From a03d44ae676134a06b06f9b36b1a267ef44a91db Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 17 May 2024 23:21:13 +0200 Subject: [PATCH] ZoneDetailPage/Fishing * if subzone has no entry in skill_fishing_base_level, try to look up parent entry --- includes/utilities.php | 2 +- pages/zone.php | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/includes/utilities.php b/includes/utilities.php index aec7dfa2..4a39645a 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -518,8 +518,8 @@ abstract class Util public static $dateFormatInternal = "Y/m/d H:i:s"; public static $changeLevelString = '%s'; - public static $setRatingLevelString = '%s'; + public static $lvTabNoteString = '%s'; public static $filterResultString = '$$WH.sprintf(LANG.lvnote_filterresults, \'%s\')'; public static $tryFilteringString = '$$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'\', \'\')'; diff --git a/pages/zone.php b/pages/zone.php index 294af586..b0b99e99 100644 --- a/pages/zone.php +++ b/pages/zone.php @@ -36,6 +36,9 @@ class ZonePage extends GenericPage { $this->addScript([SC_JS_FILE, '?data=zones']); + $parentArea = $this->subject->getField('parentArea'); + + /***********/ /* Infobox */ /***********/ @@ -43,11 +46,11 @@ class ZonePage extends GenericPage $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); // City - if ($this->subject->getField('flags') & 0x8 && !$this->subject->getField('parentArea')) + if ($this->subject->getField('flags') & 0x8 && !$parentArea) $infobox[] = Lang::zone('city'); // Auto repop - if ($this->subject->getField('flags') & 0x1000 && !$this->subject->getField('parentArea')) + if ($this->subject->getField('flags') & 0x1000 && !$parentArea) $infobox[] = Lang::zone('autoRez'); // Level @@ -163,10 +166,10 @@ class ZonePage extends GenericPage } }; - if ($_ = $this->subject->getField('parentArea')) + if ($parentArea) { - $this->extraText = sprintf(Lang::zone('zonePartOf'), $_); - $this->extendGlobalIds(Type::ZONE, $_); + $this->extraText = sprintf(Lang::zone('zonePartOf'), $parentArea); + $this->extendGlobalIds(Type::ZONE, $parentArea); } // we cannot fetch spawns via lists. lists are grouped by entry @@ -642,7 +645,9 @@ class ZonePage extends GenericPage $note = ''; if ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $this->typeId)) - $note = ''.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML).''; + $note = sprintf(Util::$lvTabNoteString, Lang::zone('fishingSkill'), Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML)); + else if ($parentArea && ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $parentArea))) + $note = sprintf(Util::$lvTabNoteString, Lang::zone('fishingSkill'), Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML)); $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($fish->getResult()),