ZoneDetailPage/Fishing

* if subzone has no entry in skill_fishing_base_level, try to look up parent entry
This commit is contained in:
Sarjuuk
2024-05-17 23:21:13 +02:00
parent a97cede1e0
commit a03d44ae67
2 changed files with 12 additions and 7 deletions

View File

@@ -518,8 +518,8 @@ abstract class Util
public static $dateFormatInternal = "Y/m/d H:i:s"; public static $dateFormatInternal = "Y/m/d H:i:s";
public static $changeLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_staticTooltipLevelClick(this, null, 0)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><!--lvl-->%s</a>'; public static $changeLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_staticTooltipLevelClick(this, null, 0)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><!--lvl-->%s</a>';
public static $setRatingLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_setRatingLevel(this, %s, %s, %s)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">%s</a>'; public static $setRatingLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_setRatingLevel(this, %s, %s, %s)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">%s</a>';
public static $lvTabNoteString = '<b class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, \'%s\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">%s</b>';
public static $filterResultString = '$$WH.sprintf(LANG.lvnote_filterresults, \'%s\')'; public static $filterResultString = '$$WH.sprintf(LANG.lvnote_filterresults, \'%s\')';
public static $tryFilteringString = '$$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')'; public static $tryFilteringString = '$$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')';

View File

@@ -36,6 +36,9 @@ class ZonePage extends GenericPage
{ {
$this->addScript([SC_JS_FILE, '?data=zones']); $this->addScript([SC_JS_FILE, '?data=zones']);
$parentArea = $this->subject->getField('parentArea');
/***********/ /***********/
/* Infobox */ /* Infobox */
/***********/ /***********/
@@ -43,11 +46,11 @@ class ZonePage extends GenericPage
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// City // City
if ($this->subject->getField('flags') & 0x8 && !$this->subject->getField('parentArea')) if ($this->subject->getField('flags') & 0x8 && !$parentArea)
$infobox[] = Lang::zone('city'); $infobox[] = Lang::zone('city');
// Auto repop // Auto repop
if ($this->subject->getField('flags') & 0x1000 && !$this->subject->getField('parentArea')) if ($this->subject->getField('flags') & 0x1000 && !$parentArea)
$infobox[] = Lang::zone('autoRez'); $infobox[] = Lang::zone('autoRez');
// Level // Level
@@ -163,10 +166,10 @@ class ZonePage extends GenericPage
} }
}; };
if ($_ = $this->subject->getField('parentArea')) if ($parentArea)
{ {
$this->extraText = sprintf(Lang::zone('zonePartOf'), $_); $this->extraText = sprintf(Lang::zone('zonePartOf'), $parentArea);
$this->extendGlobalIds(Type::ZONE, $_); $this->extendGlobalIds(Type::ZONE, $parentArea);
} }
// we cannot fetch spawns via lists. lists are grouped by entry // we cannot fetch spawns via lists. lists are grouped by entry
@@ -642,7 +645,9 @@ class ZonePage extends GenericPage
$note = ''; $note = '';
if ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $this->typeId)) if ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $this->typeId))
$note = '<b class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, \''.Lang::zone('fishingSkill').'\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">'.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML).'</b>'; $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( $this->lvTabs[] = [ItemList::$brickFile, array(
'data' => array_values($fish->getResult()), 'data' => array_values($fish->getResult()),