From 59fb6c1bc9ea228f3e0d39d04b9531ecfe8ed2b1 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 10 Oct 2020 10:11:02 +0200 Subject: [PATCH] DetailPage/GameObject * display related faction in infobox --- pages/object.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pages/object.php b/pages/object.php index 217f95a7..467dcd02 100644 --- a/pages/object.php +++ b/pages/object.php @@ -68,12 +68,19 @@ class ObjectPage extends GenericPage $infobox[] = Util::ucFirst(Lang::game('eventShort')).Lang::main('colon').implode(',', $ev); } + // Faction + if ($_ = DB::Aowow()->selectCell('SELECT factionId FROM ?_factiontemplate WHERE id = ?d', $this->subject->getField('faction'))) + { + $this->extendGlobalIds(TYPE_FACTION, $_); + $infobox[] = Util::ucFirst(Lang::game('faction')).Lang::main('colon').'[faction='.$_.']'; + } + // Reaction $_ = function ($r) { - if ($r == 1) return 2; - if ($r == -1) return 10; - return; + if ($r == 1) return 2; // q2 green + if ($r == -1) return 10; // q10 red + return; // q yellow }; $infobox[] = Lang::npc('react').Lang::main('colon').'[color=q'.$_($this->subject->getField('A')).']A[/color] [color=q'.$_($this->subject->getField('H')).']H[/color]';