Originally Posted by cokedrivers
I just relized WoW moved the Xp bar below the MainmenuBar so now if the player is not Max Level the bar shows and my alignment is off.
So Ive been hunting for a solution but cant seem to find one.
Will the following work.
Code:
if UnitLevel("player") == MAX_LEVEL then
SetPosition(MainMenuBar, "BOTTOM", cDataMainPanel, "TOP", 0, -4)
else
SetPosition(MainMenuBar, "BOTTOM", cDataMainPanel, "TOP", 0, 9)
end
thanks for any help with this.
Coke
|
A little off topic but you can replace the max level bit with IsPlayerAtEffectiveMaxLevel(). They just added it to the api recently. They added that one and a few others.
Lua Code:
-- takes into account the current expansion
-- NOTE: it's not safe to cache this value as it could change in the middle of the session
function GetEffectivePlayerMaxLevel()
return MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()];
end
function IsLevelAtEffectiveMaxLevel(level)
return level >= GetEffectivePlayerMaxLevel();
end
function IsPlayerAtEffectiveMaxLevel()
return IsLevelAtEffectiveMaxLevel(UnitLevel("player"));
end