NPCs/Vendors

* show restock time if available
This commit is contained in:
Sarjuuk
2022-03-25 15:24:51 +01:00
parent 32b4c451e4
commit 04e55b5498
9 changed files with 44 additions and 9 deletions

View File

@@ -621,12 +621,19 @@ class NpcPage extends GenericPage
$soldItems = new ItemList(array(['id', $sells]));
if (!$soldItems->error)
{
$colAddIn = '';
$extraCols = ["\$Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", '$Listview.extraCols.cost'];
if ($soldItems->hasSetFields(['condition']))
$extraCols[] = '$Listview.extraCols.condition';
if ($soldItems->hasSetFields(['condition']))
$extraCols[] = '$Listview.extraCols.condition';
$lvData = $soldItems->getListviewData(ITEMINFO_VENDOR, [Type::NPC => [$this->typeId]]);
if (array_filter(array_column($lvData, 'restock')))
{
$extraCols[] = '$_';
$colAddIn = 'vendorRestockCol';
}
$sc = Util::getServerConditions(CND_SRC_NPC_VENDOR, $this->typeId);
if (!empty($sc[0]))
{
@@ -645,7 +652,7 @@ class NpcPage extends GenericPage
'name' => '$LANG.tab_sells',
'id' => 'currency-for',
'extraCols' => array_unique($extraCols)
)];
), $colAddIn];
$this->extendGlobalData($soldItems->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
}