From c290f845d6108271bfa417bae1eee3610e377272 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 28 May 2020 11:58:20 +0200 Subject: [PATCH] Quest/DetailPage * added tab and note with quests from the same pool if available * fixed announcements poping up after being dismissed previously * fixed double escaping of quest tooltips --- includes/types/quest.class.php | 10 +++++----- localization/locale_dede.php | 1 + localization/locale_enus.php | 1 + localization/locale_eses.php | 1 + localization/locale_frfr.php | 1 + localization/locale_ruru.php | 1 + localization/locale_zhcn.php | 1 + pages/quest.php | 17 +++++++++++++++++ static/js/global.js | 2 +- 9 files changed, 29 insertions(+), 6 deletions(-) diff --git a/includes/types/quest.class.php b/includes/types/quest.class.php index 532e5aad..70defc62 100644 --- a/includes/types/quest.class.php +++ b/includes/types/quest.class.php @@ -313,7 +313,7 @@ class QuestList extends BaseType if (!$this->curTpl) return null; - $title = Util::jsEscape(htmlentities($this->getField('name', true))); + $title = htmlentities($this->getField('name', true)); $level = $this->curTpl['level']; if ($level < 0) $level = 0; @@ -332,7 +332,7 @@ class QuestList extends BaseType $x .= '
'.$title.'
'; - $x .= '

'.$this->parseText('objectives'); + $x .= '

'.$this->parseText('objectives', false); $xReq = ''; @@ -350,7 +350,7 @@ class QuestList extends BaseType else $name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng); - $xReq .= '
- '.Util::jsEscape($name).($rngQty > 1 ? ' x '.$rngQty : null); + $xReq .= '
- '.$name.($rngQty > 1 ? ' x '.$rngQty : null); } for ($i = 1; $i < 7; $i++) @@ -361,11 +361,11 @@ class QuestList extends BaseType if (!$ri || $riQty < 1) continue; - $xReq .= '
- '.Util::jsEscape(ItemList::getName($ri)).($riQty > 1 ? ' x '.$riQty : null); + $xReq .= '
- '.ItemList::getName($ri).($riQty > 1 ? ' x '.$riQty : null); } if ($et = $this->getField('end', true)) - $xReq .= '
- '.Util::jsEscape($et); + $xReq .= '
- '.$et; if ($_ = $this->getField('rewardOrReqMoney')) if ($_ < 0) diff --git a/localization/locale_dede.php b/localization/locale_dede.php index 2eb75547..a57f1dbc 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "Ihr erlernt", 'bonusTalents' => "%d |4Talentpunkt:Talentpunkte;", 'spellDisplayed'=> ' (%s wird angezeigt)', + 'questPoolDesc' => 'Nur %d |4Quest kann:Quests können; aus diesem Tab gleichzeitig aktiv sein', 'questInfo' => array( 0 => "Normal", 1 => "Gruppe", 21 => "Leben", 41 => "PvP", 62 => "Schlachtzug", 81 => "Dungeon", 82 => "Weltereignis", 83 => "Legendär", 84 => "Eskorte", 85 => "Heroisch", 88 => "Schlachtzug (10)", 89 => "Schlachtzug (25)" diff --git a/localization/locale_enus.php b/localization/locale_enus.php index 0696d2a5..aab78605 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "You will learn", // REWARD_SPELL 'bonusTalents' => "%d talent |4point:points;", // partly LEVEL_UP_CHAR_POINTS 'spellDisplayed'=> ' (%s is displayed)', + 'questPoolDesc' => 'Only %d |4Quest:Quests; from this tab will be available at a time', 'questInfo' => array( 0 => "Normal", 1 => "Group", 21 => "Life", 41 => "PvP", 62 => "Raid", 81 => "Dungeon", 82 => "World Event", 83 => "Legendary", 84 => "Escort", 85 => "Heroic", 88 => "Raid (10)", 89 => "Raid (25)" diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 25657ce4..59d20adb 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "Aprenderás", 'bonusTalents' => "%d |4punto:puntos; de talento", 'spellDisplayed'=> ' (mostrando %s)', + 'questPoolDesc' => 'Only %d |4Quest:Quests; from this tab will be available at a time', 'questInfo' => array( 0 => "Normal", 1 => "Élite", 21 => "Vida", 41 => "JcJ", 62 => "Banda", 81 => "Mazmorra", 82 => "Evento del mundo", 83 => "Legendaria", 84 => "Escolta", 85 => "Heroica", 88 => "Banda (10)", 89 => "Banda (25)" diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index 51236e19..c0a1b64e 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "Vous apprendrez", 'bonusTalents' => "%d |4point:points; de talent", 'spellDisplayed'=> ' (%s affichés)', + 'questPoolDesc' => 'Only %d |4Quest:Quests; from this tab will be available at a time', 'questInfo' => array( 0 => "Standard", 1 => "Groupe", 21 => "Vie", 41 => "JcJ", 62 => "Raid", 81 => "Donjon", 82 => "Évènement mondial", 83 => "Légendaire", 84 => "Escorte", 85 => "Héroïque", 88 => "Raid (10)", 89 => "Raid (25)" diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index c6c4a31c..d39ce759 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "Вы изучите", 'bonusTalents' => "%d |4очко талантов:очка талантов:очков талантов;", 'spellDisplayed'=> ' (показано: %s)', + 'questPoolDesc' => 'Only %d |4Quest:Quests; from this tab will be available at a time', 'questInfo' => array( 0 => "Обычный", 1 => "Группа", 21 => "Жизнь", 41 => "PvP", 62 => "Рейд", 81 => "Подземелье", 82 => "Игровое событие", 83 => "Легенда", 84 => "Сопровождение", 85 => "Героическое", 88 => "Рейд (10)", 89 => "Рейд (25)" diff --git a/localization/locale_zhcn.php b/localization/locale_zhcn.php index 7ef9c639..c0656a82 100644 --- a/localization/locale_zhcn.php +++ b/localization/locale_zhcn.php @@ -1080,6 +1080,7 @@ $lang = array( 'spellLearn' => "你将学会", 'bonusTalents' => "%d天赋|4点数:点数;", 'spellDisplayed'=> ' (%s is displayed)', + 'questPoolDesc' => 'Only %d |4Quest:Quests; from this tab will be available at a time', 'questInfo' => array( 0 => "普通", 1 => "组队", 21 => "职业", 41 => "PvP", 62 => "团队", 81 => "地下城", 82 => "世界事件", 83 => "传说", 84 => "护送", 85 => "英雄", 88 => "团队(10)", 89 => "团队(25)" diff --git a/pages/quest.php b/pages/quest.php index af83529b..61cb3eef 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -971,6 +971,23 @@ class QuestPage extends GenericPage )]; } + // tab: spawning pool (for the swarm) + if ($qp = DB::World()->selectCol('SELECT qpm2.questId FROM quest_pool_members qpm1 JOIN quest_pool_members qpm2 ON qpm1.poolId = qpm2.poolId WHERE qpm1.questId = ?d', $this->typeId)) + { + $max = DB::World()->selectCell('SELECT numActive FROM quest_pool_template qpt JOIN quest_pool_members qpm ON qpm.poolId = qpt.poolId WHERE qpm.questId = ?d', $this->typeId); + $pooledQuests = new QuestList(array(['id', $qp])); + if (!$pooledQuests->error) + { + $this->extendGlobalData($pooledQuests->getJSGlobals()); + $this->lvTabs[] = ['quest', array( + 'data' => array_values($pooledQuests->getListviewData()), + 'name' => 'Quest Pool', + 'id' => 'quest-pool', + 'note' => Lang::quest('questPoolDesc', [$max]) + )]; + } + } + // tab: conditions $cnd = []; if ($_ = $this->subject->getField('reqMinRepFaction')) diff --git a/static/js/global.js b/static/js/global.js index 29f6c2bc..67ee84dc 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -21538,7 +21538,7 @@ var Announcement = function(opt) { return; } - if (g_user.id == 0 && (!g_cookiesEnabled() || g_getWowheadCookie('announcement-' + this.id) == 'closed')) { + if (g_user.id > 0 && (!g_cookiesEnabled() || g_getWowheadCookie('announcement-' + this.id) == 'closed')) { return; }