mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 10:26:02 +00:00
xpbar: fix nil error for non rested players
This commit is contained in:
+5
-2
@@ -47,9 +47,12 @@ pfUI:RegisterModule("xpbar", function ()
|
||||
pfUI.xp:SetAlpha(1)
|
||||
local xp, xpmax, exh = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion()
|
||||
local xp_perc = round(xp / xpmax * 100)
|
||||
local exh_perc = round(GetXPExhaustion() / xpmax * 100)
|
||||
local remaining = xpmax - xp
|
||||
local remaining_perc = round(remaining / xpmax * 100)
|
||||
local exh_perc = 0
|
||||
if GetXPExhaustion() then
|
||||
exh_perc = round(GetXPExhaustion() / xpmax * 100)
|
||||
end
|
||||
|
||||
GameTooltip:ClearLines()
|
||||
GameTooltip_SetDefaultAnchor(GameTooltip, this)
|
||||
@@ -60,7 +63,7 @@ pfUI:RegisterModule("xpbar", function ()
|
||||
if IsResting() then
|
||||
GameTooltip:AddDoubleLine("Status", "|cffffffffResting")
|
||||
end
|
||||
if GetXPExhaustion() > 0 then
|
||||
if GetXPExhaustion() then
|
||||
GameTooltip:AddDoubleLine("Rested", "|cff5555ff+" .. exh .. " (" .. exh_perc .. "%)")
|
||||
end
|
||||
GameTooltip:Show()
|
||||
|
||||
Reference in New Issue
Block a user