Listviews/AddIns

* AddIns must be output directly before the listview it is used by
This commit is contained in:
Sarjuuk
2025-10-26 17:24:27 +01:00
parent cf2ace805b
commit 3a25c2390f
4 changed files with 47 additions and 47 deletions

View File

@@ -164,10 +164,11 @@ class Listview implements \JsonSerializable
public function __toString() : string
{
$addIn = '';
if ($this->__addIn)
include($this->__addIn);
$addIn = file_get_contents($this->__addIn).PHP_EOL;
return "new Listview(".Util::toJSON($this).");\n";
return $addIn.'new Listview('.Util::toJSON($this).');'.PHP_EOL;
}
}

View File

@@ -19,6 +19,41 @@ if (!defined('AOWOW_REVISION'))
quest_mail_loot_template entry quest_template RewMailTemplateId
reference_loot_template entry many <- many *_loot_template reference
*/
/* 4.3 loot-example
template: 'item',
id: 'drops',
name: LANG.tab_drops,
tabs: tabsRelated,
parent: 'lkljbjkb574',
extraCols: [Listview.extraCols.count, Listview.extraCols.percent],
sort:['-percent', 'name'],
_totalCount: 448092, // total # creature killed/looted
computeDataFunc: Listview.funcBox.initLootTable,
onAfterCreate: Listview.funcBox.addModeIndicator,
data: [
{
"classs":15, // Tab Type
"commondrop":true, // loot filtered as "not noteworthy"
"id":25445,
"level":1,
"name":"7Wretched Ichor",
"slot":0,
"source":[2],
"sourcemore":[{"z":3520}],
"subclass":0, // Tab:Type
modes:{
"mode":4, // &1: heroic; &4: noteworthy(?); &8: reg10; &16: reg25; &32: hc10; &64: hc25; &128: RaidFinder
"4":{"count":363318,"outof":448092} // calculate pct chance
},
count:363318,
stack:[1,1],
pctstack:'{1: 50.0123, 2: 49.9877}'
}
]
});
*/
class Loot
{