Skip to content

Instantly share code, notes, and snippets.

@LiQiuDGG
Created December 25, 2025 20:12
Show Gist options
  • Select an option

  • Save LiQiuDGG/dd8fd6cd01f5c4d6b18c83a8741eb06a to your computer and use it in GitHub Desktop.

Select an option

Save LiQiuDGG/dd8fd6cd01f5c4d6b18c83a8741eb06a to your computer and use it in GitHub Desktop.
QuaziiUI - Hide XP Bar at Max Level (Dominos-style)

QuaziiUI - Hide XP Bar at Max Level

Adds option to hide the Status Tracking Bar (XP/Rep bar) when at max level, following Dominos' pattern.


How Dominos Does It

From Dominos_Progress/progressBar.lua:

function ProgressBar:GetDisplayConditions()
    if self.sets.hideAtMaxLevel then
        if UnitLevel("player") == (GetMaxLevelForPlayerExpansion or GetMaxPlayerLevel)() then
            return "hide"
        end
    end
end

Simple approach:

  1. Setting: hideAtMaxLevel (boolean)
  2. Check: UnitLevel("player") == GetMaxLevelForPlayerExpansion()
  3. Action: Return "hide" to visibility system

QuaziiUI Implementation

1. Add Setting

File: utils/uihider.lua (in GetSettings default table, around line 15)

QUICore.db.profile.uiHider = {
    -- ... existing settings ...
    hideFriendlyNPCNameplates = false,
    hideXPBarAtMaxLevel = false,  -- NEW: Hide XP/status bar at max level
}

2. Add Helper Function and Hide Logic

File: utils/uihider.lua (add near top, after GetSettings function)

-- Helper: Check if player is at max level
local function IsAtMaxLevel()
    local maxLevel = GetMaxLevelForPlayerExpansion and GetMaxLevelForPlayerExpansion() 
                     or GetMaxPlayerLevel and GetMaxPlayerLevel() 
                     or 80
    return UnitLevel("player") >= maxLevel
end

File: utils/uihider.lua (in ApplyHideSettings, around line 220)

-- XP/Status Tracking Bar at Max Level
if StatusTrackingBarManager then
    local shouldHide = settings.hideXPBarAtMaxLevel and IsAtMaxLevel()
    
    if shouldHide then
        StatusTrackingBarManager:Hide()
        
        -- Hook Show() to prevent Blizzard from re-showing it
        if not StatusTrackingBarManager._QUI_ShowHooked then
            StatusTrackingBarManager._QUI_ShowHooked = true
            hooksecurefunc(StatusTrackingBarManager, "Show", function(self)
                local s = GetSettings()
                if s and s.hideXPBarAtMaxLevel and IsAtMaxLevel() then
                    self:Hide()
                end
            end)
        end
    else
        StatusTrackingBarManager:Show()
    end
end

3. Register Level Up Event

File: utils/uihider.lua (update the eventFrame, around line 230)

local eventFrame = CreateFrame("Frame")
eventFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
eventFrame:RegisterEvent("PLAYER_LEVEL_UP")  -- NEW: Check on level up
eventFrame:SetScript("OnEvent", function(self, event, ...)
    local settings = GetSettings()
    if not settings then return end
    
    -- Existing objective tracker code...
    
    -- XP bar: re-check on level up or entering world
    if event == "PLAYER_LEVEL_UP" or event == "PLAYER_ENTERING_WORLD" then
        if settings.hideXPBarAtMaxLevel and StatusTrackingBarManager then
            if IsAtMaxLevel() then
                StatusTrackingBarManager:Hide()
            else
                StatusTrackingBarManager:Show()
            end
        end
    end
end)

4. Add to Options Panel

File: utils/qui_options.lua (find UI Hider section, add checkbox)

-- Hide XP Bar at Max Level
local hideXPCheck = GUI:CreateFormCheckbox(content, "Hide XP Bar at Max Level",
    "hideXPBarAtMaxLevel", uiHider, RefreshUIHider)
hideXPCheck:SetPoint("TOPLEFT", PADDING, y)
hideXPCheck:SetPoint("RIGHT", content, "RIGHT", -PADDING, 0)
y = y - FORM_ROW

Summary

Aspect Implementation
Setting hideXPBarAtMaxLevel in uiHider table
Max Level Check GetMaxLevelForPlayerExpansion() with fallbacks
Target Frame StatusTrackingBarManager
Events PLAYER_LEVEL_UP, PLAYER_ENTERING_WORLD
Persistence Hook Show() to prevent Blizzard re-showing

When enabled:

  • Bar shows normally while leveling
  • Automatically hides when you reach max level
  • Hides immediately on ding if you're leveling to max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment