local UnitXP, UnitXPMax, GetXPExhaustion = UnitXP, UnitXPMax, GetXPExhaustion;
local UnitXP, UnitXPMax, GetXPExhaustion = UnitXP, UnitXPMax, GetXPExhaustion;
local function updateXP()
local xp, xpmax = UnitXP("player"), UnitXPMax("player");
local rested = GetXPExhaustion();
local function updateXP()
local xp, xpmax = UnitXP("player"), UnitXPMax("player");
local rested = GetXPExhaustion();
frame.rest:SetWidth(min(space, restw));
frame.rest:Show();
frame.text:SetFormattedText("%d / %d (+%d)", xp, xpmax, rested/2);
frame.rest:SetWidth(min(space, restw));
frame.rest:Show();
frame.text:SetFormattedText("%d / %d (+%d)", xp, xpmax, rested/2);
frame.bar:SetVertexColor(0.6, 0.2, 1, 0.9);
end
end
frame.bar:SetVertexColor(0.6, 0.2, 1, 0.9);
end
end
updateXP();
frame:SetScript("OnEvent", function(self, event)
if event == "PLAYER_XP_UPDATE" or event == "PLAYER_LEVEL_UP" then
updateXP();
updateXP();
frame:SetScript("OnEvent", function(self, event)
if event == "PLAYER_XP_UPDATE" or event == "PLAYER_LEVEL_UP" then
updateXP();
-- from FrameXML/MainMenuBar.lua
frame:SetScript("OnEnter", function(frame) frame.text:Show(); ExhaustionToolTipText(); end);
frame:SetScript("OnLeave", function(frame) frame.text:Hide(); GameTooltip:Hide(); end);
-- from FrameXML/MainMenuBar.lua
frame:SetScript("OnEnter", function(frame) frame.text:Show(); ExhaustionToolTipText(); end);
frame:SetScript("OnLeave", function(frame) frame.text:Hide(); GameTooltip:Hide(); end);