function PlayerXPBarCalc() |
local currXP = UnitXP("player"); |
local needXP = UnitXPMax("player"); |
PlayerXPBarExpBar:SetMinMaxValues(min(0, currXP), needXP); |
PlayerXPBarExpBar:SetValue(currXP); |
|
local exhaustionStateID = GetRestState(); |
|
if(exhaustionStateID ~= nil) then |
if (exhaustionStateID == 1) then |
PlayerXPBarExpBar:SetStatusBarColor(0.0, 0.39, 0.88, 1.0); |
elseif (exhaustionStateID == 2) then |
PlayerXPBarExpBar:SetStatusBarColor(0.58, 0.0, 0.55, 1.0); |
if (UnitLevel("player") == PlayerXPBar_MaxLevel) then |
PlayerXPBarExpBar:SetMinMaxValues(0,1); |
PlayerXPBarExpBar:SetValue(1); |
PlayerXPBarExpBar:SetStatusBarColor(0.85, 0.65, 0.0); |
PlayerXPBar_Amount:SetText(PXPBAR_DONE); |
PlayerXPBar:Hide(); |
return; |
else |
PlayerXPBarExpBar:SetMinMaxValues(min(0, currXP), needXP); |
PlayerXPBarExpBar:SetValue(currXP); |
|
local exhaustionStateID = GetRestState(); |
|
if(exhaustionStateID ~= nil) then |
if (exhaustionStateID == 1) then |
PlayerXPBarExpBar:SetStatusBarColor(0.0, 0.39, 0.88, 1.0); |
elseif (exhaustionStateID == 2) then |
PlayerXPBarExpBar:SetStatusBarColor(0.58, 0.0, 0.55, 1.0); |
end |
end |
PlayerXPBarShow(); |
end |
PlayerXPBarShow(); |
end |
|
|
function PlayerXPBarShow() |
|
if (PlayerXPBar_Player ~= nil) and (PlayerXPBar_Player["XPBAR"] == 0) then |
PlayerXPBar:Hide(); |
return; |
else |
PlayerXPBar:Show(); |
end |
if (PlayerXPBar_Player ~= nil) and (PlayerXPBar_Player["XPBAR"] == 0) then |
PlayerXPBar:Hide(); |
return; |
else |
PlayerXPBar:Show(); |
end |
|
if (UnitLevel("player") > 84) then |
PlayerXPBarExpBar:SetMinMaxValues(0,1); |
PlayerXPBarExpBar:SetValue(1); |
PlayerXPBarExpBar:SetStatusBarColor(0.85, 0.65, 0.0); |
if (UnitLevel("player") == PlayerXPBar_MaxLevel) then |
PlayerXPBar_Amount:SetText(PXPBAR_DONE); |
return; |
end |
|
return; |
end |
|
local currXP = UnitXP("player"); |
local needXP = UnitXPMax("player"); |
local restXP = GetXPExhaustion(); |