mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Spells/Tooltips
* fixed text-parsing for spells with a combat rating in the tooltip, that is inside a formula (e.g. spell 24574) * fixed client tooltip updates when modifying level for affected tooltips * fixed spell-links on item tooltips with multiple combat ratings
This commit is contained in:
@@ -1458,13 +1458,25 @@ $WH.g_setTooltipLevel = function(tooltip, level) {
|
||||
});
|
||||
|
||||
// Rating to percent
|
||||
nMatch = [];
|
||||
tooltip = tooltip.replace(/(<!--rtg%(\d+)-->)([\.0-9]+)/g, function(_all, prefix, ratingId, percent) {
|
||||
/* sarjuuk: fix tooltips with multiple occurences of the same rating
|
||||
_ = tooltip.match(new RegExp('<!--rtg' + ratingId + '-->(\\d+)'));
|
||||
if (!_) {
|
||||
return _all;
|
||||
}
|
||||
|
||||
return prefix + Math.round($WH.g_convertRatingToPercent(level, ratingId, _[1]) * 100) / 100;
|
||||
*/
|
||||
if (!nMatch[ratingId])
|
||||
nMatch[ratingId] = 0;
|
||||
|
||||
_ = tooltip.match(new RegExp('<!--rtg' + ratingId + '-->(\\d+)', 'g'))[nMatch[ratingId]++];
|
||||
if (!_) {
|
||||
return _all;
|
||||
}
|
||||
|
||||
return prefix + Math.round($WH.g_convertRatingToPercent(level, ratingId, _.split('>')[1]) * 100) / 100;
|
||||
});
|
||||
|
||||
// Level
|
||||
|
||||
Reference in New Issue
Block a user