A World of Warcraft Experience Bar addon
worldofwarcraft wow addon midnight

Hide Blizzard XP and reputation bars when enabled

bdbch 9f201d8c c107e754

+41
+8
Core.lua
··· 15 15 F.InitDB() 16 16 F.State.session.startTime = time() 17 17 F.State.session.lastXP = UnitXP("player") 18 + -- Hide Blizzard XP / Reputation bars if configured 19 + if F.UI and F.UI.HideBlizzardBars then 20 + F.UI.HideBlizzardBars() 21 + end 18 22 end 19 23 20 24 if event == "PLAYER_ENTERING_WORLD" then 21 25 F.State:UpdatePlayerXP() 22 26 F.State:UpdateQuestXP() 27 + -- Ensure Blizzard bars stay hidden after entering world (in case something re-enabled them) 28 + if F.UI and F.UI.HideBlizzardBars then 29 + F.UI.HideBlizzardBars() 30 + end 23 31 24 32 elseif event == "PLAYER_XP_UPDATE" then 25 33 local currentXP = UnitXP("player")
+33
UI.lua
··· 198 198 199 199 -- Perform an initial update to set values 200 200 F.UI.Update() 201 + 202 + -- Hide default Blizzard bars if the option is enabled (guarded in the function) 203 + F.UI.HideBlizzardBars() 204 + end 205 + 206 + -- Utility: Hide Blizzard's default experience and reputation bars (if configured) 207 + -- This is safe even if the global Blizzard frames don't exist (we check for them). 208 + function F.UI.HideBlizzardBars() 209 + if not (F and F.DB and F.DB.hideBlizzardXPBar) then return end 210 + 211 + -- Hide the main experience bar if present 212 + if MainMenuExpBar then 213 + MainMenuExpBar:UnregisterAllEvents() 214 + MainMenuExpBar:Hide() 215 + end 216 + 217 + -- Hide the reputation watch bar (classic name) 218 + if ReputationWatchBar then 219 + ReputationWatchBar:UnregisterAllEvents() 220 + ReputationWatchBar:Hide() 221 + end 222 + 223 + -- Hide the status-tracking manager (modern clients) 224 + if StatusTrackingBarManager then 225 + StatusTrackingBarManager:UnregisterAllEvents() 226 + StatusTrackingBarManager:Hide() 227 + end 228 + 229 + -- Some clients expose a performance/progress bar container; hide if present 230 + if MainMenuBarPerformanceBar then 231 + MainMenuBarPerformanceBar:UnregisterAllEvents() 232 + MainMenuBarPerformanceBar:Hide() 233 + end 201 234 end 202 235 203 236 --- The Main Draw Function (Called from Core.lua)