Custom/UiEscapes

* so, apparently the client allows ui escape sequences in the weirdest of places. Guess i have to follow suit.
 * also, the sequences can be multiline
 * also also, the file extension for icons is optional
This commit is contained in:
Sarjuuk
2024-02-28 20:14:07 +01:00
parent 611d2c40bd
commit b125e55a4a
8 changed files with 46 additions and 42 deletions

View File

@@ -73,7 +73,7 @@ class GameObjectList extends BaseType
{
$data[$this->id] = array(
'id' => $this->id,
'name' => $this->getField('name', true),
'name' => Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_RAW),
'type' => $this->curTpl['typeCat'],
'location' => $this->getSpawns(SPAWNINFO_ZONES)
);
@@ -95,7 +95,7 @@ class GameObjectList extends BaseType
return array();
$x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';
$x .= '<tr><td><b class="q">'.Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_HTML).'</b></td></tr>';
if ($this->curTpl['typeCat'])
if ($_ = Lang::gameObject('type', $this->curTpl['typeCat']))
$x .= '<tr><td>'.$_.'</td></tr>';
@@ -115,7 +115,7 @@ class GameObjectList extends BaseType
$data = [];
foreach ($this->iterate() as $__)
$data[Type::OBJECT][$this->id] = ['name' => $this->getField('name', true)];
$data[Type::OBJECT][$this->id] = ['name' => Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_RAW)];
return $data;
}

View File

@@ -301,7 +301,7 @@ class ItemList extends BaseType
$data[$this->id][$k] = $v;
// json vs listview quirk
$data[$this->id]['name'] = $data[$this->id]['quality'].$this->getField('name', true);
$data[$this->id]['name'] = $data[$this->id]['quality'].Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_RAW);
unset($data[$this->id]['quality']);
if (!empty($this->relEnchant) && $this->curTpl['randomEnchant'])
@@ -465,7 +465,7 @@ class ItemList extends BaseType
if ($addMask & GLOBALINFO_SELF)
{
$data[Type::ITEM][$id] = array(
'name' => $this->getField('name', true),
'name' => Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_RAW),
'quality' => $this->curTpl['quality'],
'icon' => $this->curTpl['iconString']
);
@@ -509,7 +509,7 @@ class ItemList extends BaseType
if ($this->error)
return;
$_name = $this->getField('name', true);
$_name = Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_HTML);
$_reqLvl = $this->curTpl['requiredLevel'];
$_quality = $this->curTpl['quality'];
$_flags = $this->curTpl['flags'];
@@ -1155,7 +1155,7 @@ class ItemList extends BaseType
// funny, yellow text at the bottom, omit if we have a recipe
if ($this->curTpl['description_loc0'] && !$this->canTeachSpell())
$xMisc[] = '<span class="q">"'.$this->getField('description', true).'"</span>';
$xMisc[] = '<span class="q">"'.Util::parseHtmlText($this->getField('description', true), false).'"</span>';
// readable
if ($this->curTpl['pageTextId'])

View File

@@ -211,7 +211,7 @@ class QuestList extends BaseType
'id' => $this->id,
'level' => $this->curTpl['level'],
'reqlevel' => $this->curTpl['minLevel'],
'name' => $this->getField('name', true),
'name' => Lang::unescapeUISequences($this->getField('name', true), Lang::FMT_RAW),
'side' => Game::sideByRaceMask($this->curTpl['reqRaceMask']),
'wflags' => 0x0,
'xp' => $this->curTpl['rewardXP']
@@ -316,7 +316,7 @@ class QuestList extends BaseType
if (!$this->curTpl)
return null;
$title = Util::htmlEscape($this->getField('name', true));
$title = Lang::unescapeUISequences(Util::htmlEscape($this->getField('name', true)), Lang::FMT_HTML);
$level = $this->curTpl['level'];
if ($level < 0)
$level = 0;
@@ -351,7 +351,7 @@ class QuestList extends BaseType
if ($ot)
$name = $ot;
else
$name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng);
$name = $rng > 0 ? CreatureList::getName($rng) : Lang::unescapeUISequences(GameObjectList::getName(-$rng), Lang::FMT_HTML);
$xReq .= '<br /> - '.$name.($rngQty > 1 ? ' x '.$rngQty : null);
}
@@ -364,7 +364,7 @@ class QuestList extends BaseType
if (!$ri || $riQty < 1)
continue;
$xReq .= '<br /> - '.ItemList::getName($ri).($riQty > 1 ? ' x '.$riQty : null);
$xReq .= '<br /> - '.Lang::unescapeUISequences(ItemList::getName($ri), Lang::FMT_HTML).($riQty > 1 ? ' x '.$riQty : null);
}
if ($et = $this->getField('end', true))