Skip to content

Commit

Permalink
Quest/DetailPage
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
Sarjuuk committed May 28, 2020
1 parent 8741c74 commit 93bc337
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 7 deletions.
10 changes: 5 additions & 5 deletions includes/types/quest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function renderTooltip()
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;
Expand All @@ -332,7 +332,7 @@ public function renderTooltip()
$x .= '<table><tr><td><b class="q">'.$title.'</b></td></tr></table>';


$x .= '<table><tr><td><br />'.$this->parseText('objectives');
$x .= '<table><tr><td><br />'.$this->parseText('objectives', false);


$xReq = '';
Expand All @@ -350,7 +350,7 @@ public function renderTooltip()
else
$name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng);

$xReq .= '<br /> - '.Util::jsEscape($name).($rngQty > 1 ? ' x '.$rngQty : null);
$xReq .= '<br /> - '.$name.($rngQty > 1 ? ' x '.$rngQty : null);
}

for ($i = 1; $i < 7; $i++)
Expand All @@ -361,11 +361,11 @@ public function renderTooltip()
if (!$ri || $riQty < 1)
continue;

$xReq .= '<br /> - '.Util::jsEscape(ItemList::getName($ri)).($riQty > 1 ? ' x '.$riQty : null);
$xReq .= '<br /> - '.ItemList::getName($ri).($riQty > 1 ? ' x '.$riQty : null);
}

if ($et = $this->getField('end', true))
$xReq .= '<br /> - '.Util::jsEscape($et);
$xReq .= '<br /> - '.$et;

if ($_ = $this->getField('rewardOrReqMoney'))
if ($_ < 0)
Expand Down
3 changes: 2 additions & 1 deletion localization/locale_dede.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,8 @@
'spellLearn' => "Ihr erlernt",
'bonusTalents' => "%d |4Talentpunkt:Talentpunkte;",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> wird angezeigt)',
'questInfo' => array(
'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)"
),
Expand Down
1 change: 1 addition & 0 deletions localization/locale_enus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@
'spellLearn' => "You will learn", // REWARD_SPELL
'bonusTalents' => "%d talent |4point:points;", // partly LEVEL_UP_CHAR_POINTS
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> 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)"
Expand Down
1 change: 1 addition & 0 deletions localization/locale_eses.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@
'spellLearn' => "Aprenderás",
'bonusTalents' => "%d |4punto:puntos; de talento",
'spellDisplayed'=> ' (mostrando <a href="?spell=%d">%s</a>)',
'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)"
Expand Down
1 change: 1 addition & 0 deletions localization/locale_frfr.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@
'spellLearn' => "Vous apprendrez",
'bonusTalents' => "%d |4point:points; de talent",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> 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)"
Expand Down
1 change: 1 addition & 0 deletions localization/locale_ruru.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@
'spellLearn' => "Вы изучите",
'bonusTalents' => "%d |4очко талантов:очка талантов:очков талантов;",
'spellDisplayed'=> ' (показано: <a href="?spell=%d">%s</a>)',
'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)"
Expand Down
1 change: 1 addition & 0 deletions localization/locale_zhcn.php
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@
'spellLearn' => "你将学会",
'bonusTalents' => "%d天赋|4点数:点数;",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> 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)"
Expand Down
17 changes: 17 additions & 0 deletions pages/quest.php
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,23 @@ protected function generateContent()
)];
}

// 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'))
Expand Down
2 changes: 1 addition & 1 deletion static/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 93bc337

Please sign in to comment.