From f87789d131753854fab20c044a86a53fc6023dc3 Mon Sep 17 00:00:00 2001 From: bdbch Date: Wed, 28 Jan 2026 21:23:35 +0100 Subject: [PATCH] adjust color and toggle command --- Config.lua | 40 ++++++++++++++++++++++++++++++++++++++++ UI.lua | 4 ++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Config.lua b/Config.lua index 3574aee..2a72ad9 100644 --- a/Config.lua +++ b/Config.lua @@ -4,6 +4,8 @@ F.Config = { -- Display Options showAtMaxLevel = false, showIncompleteQuestBar = true, + -- Master visibility toggle (can be flipped with /nxp toggle) + enabled = true, -- Text Toggles showLevelTimeText = true, @@ -26,4 +28,42 @@ function F.InitDB() end F.DB = NXP_DB + + -- Apply the current DB state immediately so visibility is correct on load. + if F.UpdateUI then F.UpdateUI() end +end + +-- Slash command to toggle addon visibility. Usage: /nxp toggle | /nxp show | /nxp hide +SLASH_NIXXNUXXPBAR1 = SLASH_NIXXNUXXPBAR1 or "/nxp" +SlashCmdList = SlashCmdList or {} +SlashCmdList["NIXXNUXXPBAR"] = function(msg) + msg = msg or "" + local cmd = msg:match("^(%S+)") + cmd = cmd and cmd:lower() or "" + + if cmd == "toggle" then + -- Ensure DB is initialized, then flip the flag + if F.InitDB then F.InitDB() end + F.DB.enabled = not F.DB.enabled + + if F.DB.enabled then + print("NixxnuxXPBar: Visible") + if F.UpdateUI then F.UpdateUI() end + else + print("NixxnuxXPBar: Hidden") + if F.Frame and F.Frame.Hide then F.Frame:Hide() end + end + elseif cmd == "show" then + if F.InitDB then F.InitDB() end + F.DB.enabled = true + print("NixxnuxXPBar: Visible") + if F.UpdateUI then F.UpdateUI() end + elseif cmd == "hide" then + if F.InitDB then F.InitDB() end + F.DB.enabled = false + print("NixxnuxXPBar: Hidden") + if F.Frame and F.Frame.Hide then F.Frame:Hide() end + else + print("NixxnuxXPBar: Commands: /nxp toggle | /nxp show | /nxp hide") + end end diff --git a/UI.lua b/UI.lua index 43a2eed..0dc9b86 100644 --- a/UI.lua +++ b/UI.lua @@ -16,8 +16,8 @@ local CFG = { colorMain = {0.76, 0.38, 1, 1}, -- Base Purple colorRested = {0.34, 0.61, 0.99, .5}, -- Rested Blue - colorQuest = {1, 0.64, 0.0078, 1}, -- Quest Yellow - colorQuestComplete = {0.86, 0.52, 0.01, 1}, -- Completed Quest (darker) + colorQuest = {1, 0.64, 0.0078, 0.25}, -- Quest Yellow + colorQuestComplete = {1, 0.64, 0.0078, 0.5}, -- Completed Quest } function F.UI.CreateStatusBar(parent, layer, subLevel, color) -- 2.51.2