mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
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:
@@ -236,13 +236,17 @@ class AchievementPage extends GenericPage
|
||||
['id', $this->typeId, '!']
|
||||
);
|
||||
$saList = new AchievementList($conditions);
|
||||
$this->lvTabs[] = [AchievementList::$brickFile, array(
|
||||
'data' => array_values($saList->getListviewData()),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
$this->extendGlobalData($saList->getJSGlobals());
|
||||
if (!$saList->error)
|
||||
{
|
||||
$this->extendGlobalData($saList->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = [AchievementList::$brickFile, array(
|
||||
'data' => array_values($saList->getListviewData()),
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'visibleCols' => ['category']
|
||||
)];
|
||||
}
|
||||
|
||||
// tab: criteria of
|
||||
$refs = DB::Aowow()->SelectCol('SELECT refAchievementId FROM ?_achievementcriteria WHERE Type = ?d AND value1 = ?d',
|
||||
|
||||
@@ -74,7 +74,7 @@ class ItemPage extends genericPage
|
||||
if (!is_numeric($param))
|
||||
$this->typeId = $this->subject->id;
|
||||
|
||||
$this->name = $this->subject->getField('name', true);
|
||||
$this->name = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_HTML);
|
||||
|
||||
if ($this->mode == CACHE_TYPE_PAGE)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ class ItemPage extends genericPage
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('item')));
|
||||
array_unshift($this->title, Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW), Util::ucFirst(Lang::game('item')));
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
@@ -365,7 +365,7 @@ class ItemPage extends genericPage
|
||||
BUTTON_LINKS => array(
|
||||
'linkColor' => 'ff'.Game::$rarityColorStings[$this->subject->getField('quality')],
|
||||
'linkId' => 'item:'.$this->typeId.':0:0:0:0:0:0:0:0',
|
||||
'linkName' => $this->name,
|
||||
'linkName' => Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW),
|
||||
'type' => $this->type,
|
||||
'typeId' => $this->typeId
|
||||
)
|
||||
@@ -1030,7 +1030,7 @@ class ItemPage extends genericPage
|
||||
$power = new StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.User::$localeString} = $this->subject->getField('name', true, false, $this->enhancedTT);
|
||||
$power->{'name_'.User::$localeString} = Lang::unescapeUISequences($this->subject->getField('name', true, false, $this->enhancedTT), Lang::FMT_RAW);
|
||||
$power->quality = $this->subject->getField('quality');
|
||||
$power->icon = rawurlencode($this->subject->getField('iconString', true, true));
|
||||
$power->{'tooltip_'.User::$localeString} = $this->subject->renderTooltip(false, 0, $this->enhancedTT);
|
||||
|
||||
@@ -36,7 +36,7 @@ class ObjectPage extends GenericPage
|
||||
if ($this->subject->error)
|
||||
$this->notFound(Lang::game('object'), Lang::gameObject('notFound'));
|
||||
|
||||
$this->name = $this->subject->getField('name', true);
|
||||
$this->name = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_HTML);
|
||||
}
|
||||
|
||||
protected function generatePath()
|
||||
@@ -46,7 +46,7 @@ class ObjectPage extends GenericPage
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
array_unshift($this->title, $this->name, Util::ucFirst(Lang::game('object')));
|
||||
array_unshift($this->title, Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW), Util::ucFirst(Lang::game('object')));
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
@@ -250,14 +250,14 @@ class ObjectPage extends GenericPage
|
||||
$sai = null;
|
||||
if ($this->subject->getField('ScriptOrAI') == 'SmartGameObjectAI')
|
||||
{
|
||||
$sai = new SmartAI(SAI_SRC_TYPE_OBJECT, $this->typeId, ['name' => $this->name]);
|
||||
$sai = new SmartAI(SAI_SRC_TYPE_OBJECT, $this->typeId, ['name' => $this->subject->getField('name', true)]);
|
||||
if (!$sai->prepare()) // no smartAI found .. check per guid
|
||||
{
|
||||
// at least one of many
|
||||
$guids = DB::World()->selectCol('SELECT guid FROM gameobject WHERE id = ?d LIMIT 1', $this->typeId);
|
||||
while ($_ = array_pop($guids))
|
||||
{
|
||||
$sai = new SmartAI(SAI_SRC_TYPE_OBJECT, -$_, ['name' => $this->name, 'title' => ' [small](for GUID: '.$_.')[/small]']);
|
||||
$sai = new SmartAI(SAI_SRC_TYPE_OBJECT, -$_, ['name' => $this->subject->getField('name', true), 'title' => ' [small](for GUID: '.$_.')[/small]']);
|
||||
if ($sai->prepare())
|
||||
break;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ class ObjectPage extends GenericPage
|
||||
$power = new StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.User::$localeString} = $this->subject->getField('name', true);
|
||||
$power->{'name_'.User::$localeString} = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW);
|
||||
$power->{'tooltip_'.User::$localeString} = $this->subject->renderTooltip();
|
||||
$power->map = $this->subject->getSpawns(SPAWNINFO_SHORT);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class QuestPage extends GenericPage
|
||||
$this->notFound(Lang::game('quest'), Lang::quest('notFound'));
|
||||
|
||||
// may contain htmlesque tags
|
||||
$this->name = Util::htmlEscape($this->subject->getField('name', true));
|
||||
$this->name = Lang::unescapeUISequences(Util::htmlEscape($this->subject->getField('name', true)), Lang::FMT_HTML);
|
||||
}
|
||||
|
||||
protected function generatePath()
|
||||
@@ -57,7 +57,7 @@ class QuestPage extends GenericPage
|
||||
protected function generateTitle()
|
||||
{
|
||||
// page title already escaped
|
||||
array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('quest')));
|
||||
array_unshift($this->title, Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW), Util::ucFirst(Lang::game('quest')));
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
@@ -265,7 +265,7 @@ class QuestPage extends GenericPage
|
||||
'side' => $_side,
|
||||
'typeStr' => Type::getFileString(Type::QUEST),
|
||||
'typeId' => $this->typeId,
|
||||
'name' => $this->name,
|
||||
'name' => Util::htmlEscape($this->subject->getField('name', true)),
|
||||
'_next' => $this->subject->getField('nextQuestIdChain')
|
||||
)
|
||||
)
|
||||
@@ -410,7 +410,7 @@ class QuestPage extends GenericPage
|
||||
$this->objectiveList[] = array(
|
||||
'typeStr' => Type::getFileString(Type::ITEM),
|
||||
'id' => $itemId,
|
||||
'name' => $olItemData->json[$itemId]['name'],
|
||||
'name' => Lang::unescapeUISequences($olItemData->json[$itemId]['name'], Lang::FMT_HTML),
|
||||
'qty' => $qty > 1 ? $qty : 0,
|
||||
'quality' => 7 - $olItemData->json[$itemId]['quality'],
|
||||
'extraText' => $provided ? ' ('.Lang::quest('provided').')' : ''
|
||||
@@ -422,7 +422,7 @@ class QuestPage extends GenericPage
|
||||
{
|
||||
$this->providedItem = array(
|
||||
'id' => $olItems[0][0],
|
||||
'name' => $olItemData->json[$olItems[0][0]]['name'],
|
||||
'name' => Lang::unescapeUISequences($olItemData->json[$olItems[0][0]]['name'], Lang::FMT_HTML),
|
||||
'qty' => $olItems[0][1] > 1 ? $olItems[0][1] : 0,
|
||||
'quality' => 7 - $olItemData->json[$olItems[0][0]]['quality']
|
||||
);
|
||||
@@ -494,7 +494,7 @@ class QuestPage extends GenericPage
|
||||
$this->objectiveList[] = array(
|
||||
'typeStr' => Type::getFileString(Type::OBJECT),
|
||||
'id' => $i,
|
||||
'name' => $pair[1] ?: Util::localizedString($olGOData->getEntry($i), 'name'),
|
||||
'name' => $pair[1] ?: Lang::unescapeUISequences(Util::localizedString($olGOData->getEntry($i), 'name'), Lang::FMT_HTML),
|
||||
'qty' => $pair[0] > 1 ? $pair[0] : 0,
|
||||
'extraText' => ''
|
||||
);
|
||||
@@ -932,7 +932,7 @@ class QuestPage extends GenericPage
|
||||
BUTTON_LINKS => array(
|
||||
'linkColor' => 'ffffff00',
|
||||
'linkId' => 'quest:'.$this->typeId.':'.$_level,
|
||||
'linkName' => $this->name,
|
||||
'linkName' => Util::htmlEscape($this->subject->getField('name', true)),
|
||||
'type' => $this->type,
|
||||
'typeId' => $this->typeId
|
||||
)
|
||||
@@ -959,7 +959,7 @@ class QuestPage extends GenericPage
|
||||
/**************/
|
||||
|
||||
// tab: see also
|
||||
$seeAlso = new QuestList(array(['name_loc'.User::$localeId, '%'.$this->name.'%'], ['id', $this->typeId, '!']));
|
||||
$seeAlso = new QuestList(array(['name_loc'.User::$localeId, '%'.Util::htmlEscape($this->subject->getField('name', true)).'%'], ['id', $this->typeId, '!']));
|
||||
if (!$seeAlso->error)
|
||||
{
|
||||
$this->extendGlobalData($seeAlso->getJSGlobals());
|
||||
@@ -1051,7 +1051,7 @@ class QuestPage extends GenericPage
|
||||
$power = new StdClass();
|
||||
if (!$this->subject->error)
|
||||
{
|
||||
$power->{'name_'.User::$localeString} = $this->subject->getField('name', true);
|
||||
$power->{'name_'.User::$localeString} = Lang::unescapeUISequences($this->subject->getField('name', true), Lang::FMT_RAW);
|
||||
$power->{'tooltip_'.User::$localeString} = $this->subject->renderTooltip();
|
||||
if ($this->subject->isDaily())
|
||||
$power->daily = 1;
|
||||
@@ -1112,7 +1112,7 @@ class QuestPage extends GenericPage
|
||||
$rewards['items'][] = array(
|
||||
'typeStr' => Type::getFileString(Type::ITEM),
|
||||
'id' => $id,
|
||||
'name' => $rewItems->getField('name', true),
|
||||
'name' => Lang::unescapeUISequences($rewItems->getField('name', true), Lang::FMT_HTML),
|
||||
'quality' => $rewItems->getField('quality'),
|
||||
'qty' => $ri[$id],
|
||||
'globalStr' => Type::getJSGlobalString(Type::ITEM)
|
||||
|
||||
Reference in New Issue
Block a user