* reworked how an dwhen locks on GameObjects and Items are displayed
 * added structure for LockType.dbc
This commit is contained in:
Sarjuuk
2022-02-14 23:17:51 +01:00
parent 53e2af2116
commit 01a9744ba7
7 changed files with 83 additions and 50 deletions

View File

@@ -101,20 +101,22 @@ class ObjectPage extends GenericPage
break;
default: // requires key .. maybe
{
$locks = Lang::getLocks($this->subject->getField('lockId'));
$l = '';
foreach ($locks as $idx => $_)
{
if ($idx < 0)
continue;
$locks = Lang::getLocks($this->subject->getField('lockId'), $ids, true);
$l = [];
$this->extendGlobalIds(TYPE_ITEM, $idx);
$l = Lang::gameObject('key').Lang::main('colon').'[item='.$idx.']';
foreach ($ids as $type => $typeIds)
$this->extendGlobalIds($type, ...$typeIds);
foreach ($locks as $idx => $str)
{
if ($idx > 0)
$l[] = Lang::gameObject('key').Lang::main('colon').$str;
else if ($idx < 0)
$l[] = sprintf(Lang::game('requires'), $str);
}
// if no propper item is found use a skill
if ($locks)
$infobox[] = $l ?: array_pop($locks);
if ($l)
$infobox[] = implode('[br]', $l);
}
}