Quantcast WoWInterface - View Single Post - Moving the MainMenuBar
View Single Post
08-12-18, 03:52 PM   #10
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 65
Originally Posted by cokedrivers View Post
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:
  1. -- takes into account the current expansion
  2.  -- NOTE: it's not safe to cache this value as it could change in the middle of the session
  3. function GetEffectivePlayerMaxLevel()
  4.   return MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()];
  5. end
  6.  
  7. function IsLevelAtEffectiveMaxLevel(level)
  8.   return level >= GetEffectivePlayerMaxLevel();
  9. end
  10.  
  11. function IsPlayerAtEffectiveMaxLevel()
  12.   return IsLevelAtEffectiveMaxLevel(UnitLevel("player"));
  13. end
__________________
Thomas aka Urnn
  Reply With Quote