From 9f201d8ccabb5f236c0ea5a2b409976cf64750fd Mon Sep 17 00:00:00 2001 From: bdbch Date: Wed, 28 Jan 2026 15:44:52 +0000 Subject: [PATCH] Hide Blizzard XP and reputation bars when enabled --- Core.lua | 8 ++++++++ UI.lua | 33 +++++++++++++++++++++++++++++++++ 2 file(s) changed, 41 insertion(s)(+), 0 deletion(s)(-) diff --git a/Core.lua b/Core.lua --- a/Core.lua +++ b/Core.lua @@ -15,11 +15,19 @@ F.InitDB() F.State.session.startTime = time() F.State.session.lastXP = UnitXP("player") + -- Hide Blizzard XP / Reputation bars if configured + if F.UI and F.UI.HideBlizzardBars then + F.UI.HideBlizzardBars() + end end if event == "PLAYER_ENTERING_WORLD" then F.State:UpdatePlayerXP() F.State:UpdateQuestXP() + -- Ensure Blizzard bars stay hidden after entering world (in case something re-enabled them) + if F.UI and F.UI.HideBlizzardBars then + F.UI.HideBlizzardBars() + end elseif event == "PLAYER_XP_UPDATE" then local currentXP = UnitXP("player") diff --git a/UI.lua b/UI.lua --- a/UI.lua +++ b/UI.lua @@ -198,6 +198,39 @@ -- Perform an initial update to set values F.UI.Update() + + -- Hide default Blizzard bars if the option is enabled (guarded in the function) + F.UI.HideBlizzardBars() +end + +-- Utility: Hide Blizzard's default experience and reputation bars (if configured) +-- This is safe even if the global Blizzard frames don't exist (we check for them). +function F.UI.HideBlizzardBars() + if not (F and F.DB and F.DB.hideBlizzardXPBar) then return end + + -- Hide the main experience bar if present + if MainMenuExpBar then + MainMenuExpBar:UnregisterAllEvents() + MainMenuExpBar:Hide() + end + + -- Hide the reputation watch bar (classic name) + if ReputationWatchBar then + ReputationWatchBar:UnregisterAllEvents() + ReputationWatchBar:Hide() + end + + -- Hide the status-tracking manager (modern clients) + if StatusTrackingBarManager then + StatusTrackingBarManager:UnregisterAllEvents() + StatusTrackingBarManager:Hide() + end + + -- Some clients expose a performance/progress bar container; hide if present + if MainMenuBarPerformanceBar then + MainMenuBarPerformanceBar:UnregisterAllEvents() + MainMenuBarPerformanceBar:Hide() + end end --- The Main Draw Function (Called from Core.lua) -- tangled.sh