mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Items/Tooltips
* fix scaling string in item tooltips for scaling & non-interactive tooltips
This commit is contained in:
@@ -995,11 +995,11 @@ class ItemList extends BaseType
|
||||
else if (!$parsed)
|
||||
continue;
|
||||
|
||||
if ($interactive)
|
||||
{
|
||||
if ($scaling)
|
||||
$causesScaling = true;
|
||||
|
||||
if ($interactive)
|
||||
{
|
||||
$link = '<a href="?spell='.$itemSpells->id.'">%s</a>';
|
||||
$parsed = preg_replace_callback('/([^;]*)( <small>.*?<\/small>)([^&]*)/i', function($m) use($link) {
|
||||
$m[1] = $m[1] ? sprintf($link, $m[1]) : '';
|
||||
@@ -1204,24 +1204,24 @@ class ItemList extends BaseType
|
||||
// tooltip scaling
|
||||
if (!isset($xCraft))
|
||||
{
|
||||
$link = [$subOf ? $subOf : $this->id, 1]; // itemId, scaleMinLevel
|
||||
if (isset($this->ssd[$this->id])) // is heirloom
|
||||
{
|
||||
array_push($link,
|
||||
$this->ssd[$this->id]['maxLevel'], // scaleMaxLevel
|
||||
$this->ssd[$this->id]['maxLevel'], // scaleCurLevel
|
||||
$this->curTpl['scalingStatDistribution'], // scaleDist
|
||||
$this->curTpl['scalingStatValue'] // scaleFlags
|
||||
);
|
||||
}
|
||||
else // may still use level dependent ratings
|
||||
{
|
||||
array_push($link,
|
||||
$causesScaling ? MAX_LEVEL : 1, // scaleMaxLevel
|
||||
$_reqLvl > 1 ? $_reqLvl : MAX_LEVEL // scaleCurLevel
|
||||
);
|
||||
}
|
||||
$x .= '<!--?'.implode(':', $link).'-->';
|
||||
$itemId = $subOf ?: $this->id;
|
||||
|
||||
$x .= '<!--?';
|
||||
// itemId
|
||||
$x .= $itemId;
|
||||
// scaleMinLevel
|
||||
$x .= ':1';
|
||||
// scaleMaxLevel
|
||||
$x .= ':' . ($this->ssd[$itemId]['maxLevel'] ?? ($causesScaling ? MAX_LEVEL : 1));
|
||||
// scaleCurLevel
|
||||
$x .= ':' . ($this->ssd[$itemId]['maxLevel'] ?? ($_reqLvl ?: MAX_LEVEL));
|
||||
// scaleDist
|
||||
if ($this->curTpl['scalingStatDistribution'])
|
||||
$x .= ':' . $this->curTpl['scalingStatDistribution'];
|
||||
// scaleFlags
|
||||
if ($this->curTpl['scalingStatValue'])
|
||||
$x .= ':' . $this->curTpl['scalingStatValue'];
|
||||
$x .= '-->';
|
||||
}
|
||||
|
||||
return $x;
|
||||
|
||||
@@ -1517,7 +1517,7 @@ $WH.g_setTooltipLevel = function(tooltip, level) {
|
||||
// Rating to percent
|
||||
nMatch = [];
|
||||
tooltip = tooltip.replace(/(<!--rtg%(\d+)-->)([\.0-9]+)/g, function(_all, prefix, ratingId, percent) {
|
||||
/* aowow: fix tooltips with multiple occurences of the same rating
|
||||
/* aowow: fix tooltips with multiple occurences of the same rating (see item: 19948)
|
||||
_ = tooltip.match(new RegExp('<!--rtg' + ratingId + '-->(\\d+)'));
|
||||
if (!_) {
|
||||
return _all;
|
||||
|
||||
Reference in New Issue
Block a user