Quest/Misc
* move honor/arena point reward to gains on detail page so it no longer looks like an item
This commit is contained in:
parent
98763c3060
commit
5f7247b292
2 changed files with 28 additions and 9 deletions
|
|
@ -890,9 +890,9 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->series = $this->createSeries($_side);
|
||||
$this->gains = $this->createGains();
|
||||
$this->rewards = $this->createRewards($_side);
|
||||
$this->series = $this->createSeries();
|
||||
$this->gains = $this->createGains($_side);
|
||||
$this->rewards = $this->createRewards();
|
||||
$this->objectives = $this->subject->parseText('objectives', false);
|
||||
$this->details = $this->subject->parseText('details', false);
|
||||
$this->offerReward = $this->subject->parseText('offerReward', false);
|
||||
|
|
@ -999,7 +999,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
parent::generate();
|
||||
}
|
||||
|
||||
private function createRewards(int $side) : ?array
|
||||
private function createRewards() : ?array
|
||||
{
|
||||
$rewards = [[], [], [], '']; // [spells, items, choice, money]
|
||||
|
||||
|
|
@ -1056,9 +1056,9 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($this->subject->rewards[$this->typeId][Type::CURRENCY]))
|
||||
if ($currency = array_filter($this->subject->rewards[$this->typeId][Type::CURRENCY] ?? [],
|
||||
fn($x) => $x != CURRENCY_ARENA_POINTS && $x != CURRENCY_HONOR_POINTS, ARRAY_FILTER_USE_KEY))
|
||||
{
|
||||
$currency = $this->subject->rewards[$this->typeId][Type::CURRENCY];
|
||||
$rewCurr = new CurrencyList(array(['id', array_keys($currency)]));
|
||||
if (!$rewCurr->error)
|
||||
{
|
||||
|
|
@ -1069,7 +1069,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
$id,
|
||||
$rewCurr->getField('name', true),
|
||||
quality: ITEM_QUALITY_NORMAL,
|
||||
num: $currency[$id] * ($side == SIDE_HORDE ? -1 : 1), // toggles the icon
|
||||
num: $currency[$id]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1187,13 +1187,19 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
return true;
|
||||
}
|
||||
|
||||
private function createGains() : ?array
|
||||
private function createGains(int $side) : ?array
|
||||
{
|
||||
$gains = [];
|
||||
|
||||
// xp
|
||||
$gains[0] = $this->subject->getField('rewardXP');
|
||||
|
||||
// arena points
|
||||
$gains[5] = $this->subject->getField('rewardArenaPoints');
|
||||
|
||||
// honor points
|
||||
$gains[4] = [$this->subject->getField('rewardHonorPoints'), $side];
|
||||
|
||||
// talent points
|
||||
$gains[3] = $this->subject->getField('rewardTalents');
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ if ([$spells, $items, $choice, $money] = $this->rewards):
|
|||
|
||||
endif;
|
||||
|
||||
if ([$xp, $rep, $title, $tp] = $this->gains):
|
||||
if ([$xp, $rep, $title, $tp, $honor, $arena] = $this->gains):
|
||||
?>
|
||||
<h3><?=Lang::main('gains'); ?></h3>
|
||||
<?=Lang::quest('gainsDesc').Lang::main('colon'); ?>
|
||||
|
|
@ -171,6 +171,19 @@ if ([$xp, $rep, $title, $tp] = $this->gains):
|
|||
echo ' <li><div>'.Lang::quest('bonusTalents', [$tp])."</div></li>\n";
|
||||
endif;
|
||||
|
||||
if ($arena || $honor[0]):
|
||||
echo ' <li><div>';
|
||||
if ($honor[0]):
|
||||
$a = '<a href="?currency=104">'.$honor[0].'</a>';
|
||||
$a = $honor[1] == SIDE_BOTH ? '<span class="moneyalliance">'.$a.'</span>' : $a;
|
||||
echo '<span class="money'.($honor[1] == SIDE_ALLIANCE ? 'alliance' : 'horde').' tip q1" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">'.$a.'</span>';
|
||||
endif;
|
||||
if ($arena):
|
||||
echo ' <span class="moneyarena tip q1" onmouseover="Listview.funcBox.moneyArenaOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><a href="?currency=103">'.$arena.'</a></span>';
|
||||
endif;
|
||||
echo "</div></li>\n";
|
||||
endif;
|
||||
|
||||
echo " </ul>\n";
|
||||
endif;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue