mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
tooltip: detect server sent values below 100
This commit is contained in:
+2
-2
@@ -135,7 +135,7 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
|
|||||||
local _, hpmax = GameTooltipStatusBar:GetMinMaxValues()
|
local _, hpmax = GameTooltipStatusBar:GetMinMaxValues()
|
||||||
local rhp, rhpmax, estimated
|
local rhp, rhpmax, estimated
|
||||||
|
|
||||||
if hpmax > 100 then
|
if hpmax > 100 or (round(hpmax/100*hp) ~= hp) then
|
||||||
rhp, rhpmax = hp, hpmax
|
rhp, rhpmax = hp, hpmax
|
||||||
elseif pfUI.libhealth and pfUI.libhealth.enabled then
|
elseif pfUI.libhealth and pfUI.libhealth.enabled then
|
||||||
rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(this.name, this.level, tonumber(hp), tonumber(hpmax))
|
rhp, rhpmax, estimated = pfUI.libhealth:GetUnitHealthByName(this.name, this.level, tonumber(hp), tonumber(hpmax))
|
||||||
@@ -149,7 +149,7 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 ) then
|
if C.tooltip.alwaysperc == "0" and ( estimated or hpmax > 100 or (round(hpmax/100*hp) ~= hp) ) then
|
||||||
pfUI.tooltipStatusBar.HP:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax)))
|
pfUI.tooltipStatusBar.HP:SetText(string.format("%s / %s", Abbreviate(rhp), Abbreviate(rhpmax)))
|
||||||
else
|
else
|
||||||
pfUI.tooltipStatusBar.HP:SetText(string.format("%s%%", hp))
|
pfUI.tooltipStatusBar.HP:SetText(string.format("%s%%", hp))
|
||||||
|
|||||||
Reference in New Issue
Block a user