From eed71fa0700b3721466204cb50fa702f4ac510d1 Mon Sep 17 00:00:00 2001
From: Bluewhale1337 <295648290+Bluewhale1337@users.noreply.github.com>
Date: Sat, 10 Oct 2026 12:51:07 +0200
Subject: [PATCH] refactor: update skin options UI layout and add font styling
to action buttons and headers
---
HealBot_Options.lua | 6 ++
HealBot_Options_General.lua | 33 +++++++---
HealBot_Options_Skins.xml | 127 +++++++++++++++++++++++++-----------
HealBot_View_Layout.lua | 65 ++++++++++++++----
README.md | 1 +
5 files changed, 175 insertions(+), 57 deletions(-)
diff --git a/HealBot_Options.lua b/HealBot_Options.lua
index 8ca3554..6cd6cb7 100644
--- a/HealBot_Options.lua
+++ b/HealBot_Options.lua
@@ -224,13 +224,18 @@ function HealBot_Returned_Colours()
HealBot_SetSkinColours()
HealBot_SetCDCBarColours()
end
+ColorPickerFrame.func = HealBot_Returned_Colours
+
-- HealBot_UseColourPick: Internal utility: HealBot_UseColourPick
function HealBot_UseColourPick(R, G, B, A)
+ ColorPickerFrame.func = HealBot_Returned_Colours;
+ ColorPickerFrame.cancelFunc = HealBot_Returned_Colours;
if ColorPickerFrame:IsVisible() then
ColorPickerFrame:Hide();
elseif A then
ColorPickerFrame.hasOpacity = true;
ColorPickerFrame.opacity = A;
+ ColorPickerFrame.opacityFunc = HealBot_Returned_Colours;
ColorPickerFrame:ClearAllPoints();
ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
ColorPickerFrame:Show();
@@ -238,6 +243,7 @@ function HealBot_UseColourPick(R, G, B, A)
ColorPickerFrame:SetColorRGB(R, G, B);
else
ColorPickerFrame.hasOpacity = false;
+ ColorPickerFrame.opacityFunc = nil;
ColorPickerFrame:ClearAllPoints();
ColorPickerFrame:SetPoint("TOPLEFT","HealBot_Options","TOPRIGHT",0,-152);
ColorPickerFrame:Show();
diff --git a/HealBot_Options_General.lua b/HealBot_Options_General.lua
index 22df00b..8971704 100644
--- a/HealBot_Options_General.lua
+++ b/HealBot_Options_General.lua
@@ -227,15 +227,30 @@ function HealBot_SetSkinColours()
end
-- 5. Update Text Labels
- HealBot_EnTextColorpickt:SetTextHeight(btextheight)
- HealBot_DisTextColorpickt:SetTextHeight(btextheight)
- HealBot_DebTextColorpickt:SetTextHeight(btextheight)
-
- HealBot_EnTextColorpickt:SetText(HEALBOT_SKIN_ENTEXT)
- HealBot_DisTextColorpickt:SetText(HEALBOT_SKIN_DISTEXT)
- HealBot_DebTextColorpickt:SetText(HEALBOT_SKIN_DEBTEXT)
- if HealBot_MaxHPColorpickt then HealBot_MaxHPColorpickt:SetText(HEALBOT_SKIN_MAXHPTEXT or "Max HP") end
- if HealBot_MinHPColorpickt then HealBot_MinHPColorpickt:SetText(HEALBOT_SKIN_MINHPTEXT or "Min HP") end
+ local bfont = (HealBot_Config.bfont and HealBot_Config.bfont[skin]) or "Fonts\\FRIZQT__.TTF"
+ local fontOutline = (HealBot_Config.bfontoutline and HealBot_Config.bfontoutline[skin]) or 0
+ local expectedFlags = fontOutline == 1 and "OUTLINE" or ""
+
+ if HealBot_EnTextColorpickt then
+ HealBot_EnTextColorpickt:SetFont(bfont, btextheight, expectedFlags)
+ HealBot_EnTextColorpickt:SetText(HEALBOT_SKIN_ENTEXT)
+ end
+ if HealBot_DisTextColorpickt then
+ HealBot_DisTextColorpickt:SetFont(bfont, btextheight, expectedFlags)
+ HealBot_DisTextColorpickt:SetText(HEALBOT_SKIN_DISTEXT)
+ end
+ if HealBot_DebTextColorpickt then
+ HealBot_DebTextColorpickt:SetFont(bfont, btextheight, expectedFlags)
+ HealBot_DebTextColorpickt:SetText(HEALBOT_SKIN_DEBTEXT)
+ end
+ if HealBot_MaxHPColorpickt then
+ HealBot_MaxHPColorpickt:SetFont(bfont, btextheight, expectedFlags)
+ HealBot_MaxHPColorpickt:SetText(HEALBOT_SKIN_MAXHPTEXT or "Max HP")
+ end
+ if HealBot_MinHPColorpickt then
+ HealBot_MinHPColorpickt:SetFont(bfont, btextheight, expectedFlags)
+ HealBot_MinHPColorpickt:SetText(HEALBOT_SKIN_MINHPTEXT or "Min HP")
+ end
-- 6. Force UI redraw (Kept the scale hack since it addresses a specific engine quirk)
local barScale = HealBot_EnTextColorpick:GetScale()
diff --git a/HealBot_Options_Skins.xml b/HealBot_Options_Skins.xml
index 9311f28..9086440 100644
--- a/HealBot_Options_Skins.xml
+++ b/HealBot_Options_Skins.xml
@@ -240,6 +240,29 @@
HealBot_Options_FontDD_OnLoad(this)
+
+
+
+
+
+
+
+
+
+ HealBot_Options_val_OnLoad(this,HEALBOT_OPTIONS_TESTBARS,1,40)
+ HealBot_Options_NumTestBars_OnValueChanged(this)
+
+
@@ -332,8 +355,15 @@
@@ -363,8 +393,15 @@
@@ -401,8 +438,15 @@
@@ -432,8 +476,15 @@
@@ -464,8 +515,15 @@
@@ -495,8 +553,15 @@
@@ -526,8 +591,15 @@
@@ -557,35 +629,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
- HealBot_Options_val_OnLoad(this,HEALBOT_OPTIONS_TESTBARS,1,40)
- HealBot_Options_NumTestBars_OnValueChanged(this)
-
-
diff --git a/HealBot_View_Layout.lua b/HealBot_View_Layout.lua
index f945f71..d6785c0 100644
--- a/HealBot_View_Layout.lua
+++ b/HealBot_View_Layout.lua
@@ -337,15 +337,34 @@ end
-- HealBot_Action_ResetSkin: Internal utility: HealBot_Action_ResetSkin
function HealBot_Action_ResetSkin()
HealBot_Action_PartyChanged()
+ local skin = HealBot_Config.Current_Skin
+ local bfont = (HealBot_Config.bfont and HealBot_Config.bfont[skin]) or "Fonts\\FRIZQT__.TTF"
+ local btextheight = (HealBot_Config.btextheight and HealBot_Config.btextheight[skin]) or 10
+ local fontOutline = (HealBot_Config.bfontoutline and HealBot_Config.bfontoutline[skin]) or 0
+ local expectedFlags = fontOutline == 1 and "OUTLINE" or ""
+
+ if HealBot_Action_OptionsButton and HealBot_Action_OptionsButton:GetFontString() then
+ HealBot_Action_OptionsButton:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
+ if HealBot_Action_AbortButton and HealBot_Action_AbortButton:GetFontString() then
+ HealBot_Action_AbortButton:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
+ for j = 1, 20 do
+ local headerobj = getglobal("HealBot_Action_Header" .. j)
+ if headerobj and headerobj:GetFontString() then
+ headerobj:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
+ end
+
if HealBot_Options:IsVisible() then
- HealBot_Action_SetTexture(HealBot_DiseaseColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_MagicColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_PoisonColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_CurseColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_EnTextColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_EnTextColorpickin, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_DisTextColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
- HealBot_Action_SetTexture(HealBot_DebTextColorpick, HealBot_Config.btexture[HealBot_Config.Current_Skin])
+ HealBot_Action_SetTexture(HealBot_DiseaseColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_MagicColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_PoisonColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_CurseColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_EnTextColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_EnTextColorpickin, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_DisTextColorpick, HealBot_Config.btexture[skin])
+ HealBot_Action_SetTexture(HealBot_DebTextColorpick, HealBot_Config.btexture[skin])
HealBot_SetSkinColours()
end
end
@@ -386,6 +405,13 @@ function HealBot_Action_PositionButton(button, OsetX, OsetY, bwidth, bheight, ch
headerno = headerno + 1;
local headerobj = getglobal("HealBot_Action_Header" .. headerno);
headerobj:SetText(header)
+ local bfont = (HealBot_Config.bfont and HealBot_Config.bfont[HealBot_Config.Current_Skin]) or "Fonts\\FRIZQT__.TTF"
+ local btextheight = (HealBot_Config.btextheight and HealBot_Config.btextheight[HealBot_Config.Current_Skin]) or 10
+ local fontOutline = (HealBot_Config.bfontoutline and HealBot_Config.bfontoutline[HealBot_Config.Current_Skin]) or 0
+ local expectedFlags = fontOutline == 1 and "OUTLINE" or ""
+ if headerobj:GetFontString() then
+ headerobj:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
headerobj:Show();
headerobj:ClearAllPoints();
headerobj:SetHeight(bheight);
@@ -422,6 +448,13 @@ function HealBot_Action_PositionButtonHorizontal(button, OsetX, OsetY, bwidth, b
headerno = headerno + 1;
local headerobj = getglobal("HealBot_Action_Header" .. headerno);
headerobj:SetText(header)
+ local bfont = (HealBot_Config.bfont and HealBot_Config.bfont[HealBot_Config.Current_Skin]) or "Fonts\\FRIZQT__.TTF"
+ local btextheight = (HealBot_Config.btextheight and HealBot_Config.btextheight[HealBot_Config.Current_Skin]) or 10
+ local fontOutline = (HealBot_Config.bfontoutline and HealBot_Config.bfontoutline[HealBot_Config.Current_Skin]) or 0
+ local expectedFlags = fontOutline == 1 and "OUTLINE" or ""
+ if headerobj:GetFontString() then
+ headerobj:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
headerobj:Show();
headerobj:ClearAllPoints();
headerobj:SetHeight(bheight);
@@ -536,10 +569,12 @@ function HealBot_Action_PartyChanged()
end
end
- for j = 1, 15 do
+ for j = 1, 20 do
local headerobj = getglobal("HealBot_Action_Header" .. j);
- headerobj:SetText(" ")
- headerobj:Hide();
+ if headerobj then
+ headerobj:SetText(" ")
+ headerobj:Hide();
+ end
end
local bwidth = HealBot_Config.bwidth[HealBot_Config.Current_Skin] or 85;
@@ -1077,10 +1112,17 @@ function HealBot_Action_PartyChanged()
HealBot_Grid_Limit = limit;
HealBot_Grid_NumBars = numBars;
+ local bfont = (HealBot_Config.bfont and HealBot_Config.bfont[HealBot_Config.Current_Skin]) or "Fonts\\FRIZQT__.TTF"
+ local fontOutline = (HealBot_Config.bfontoutline and HealBot_Config.bfontoutline[HealBot_Config.Current_Skin]) or 0
+ local expectedFlags = fontOutline == 1 and "OUTLINE" or ""
+
if HealBot_Config.HideOptions == 1 then
HealBot_Action_OptionsButton:Hide();
else
HealBot_Action_OptionsButton:SetPoint("BOTTOM", "HealBot_Action", "BOTTOM", 0, bpadding);
+ if HealBot_Action_OptionsButton:GetFontString() then
+ HealBot_Action_OptionsButton:GetFontString():SetFont(bfont, btextheight, expectedFlags)
+ end
HealBot_Action_OptionsButton:Show();
MaxOffsetY = MaxOffsetY + 30;
end
@@ -1096,6 +1138,7 @@ function HealBot_Action_PartyChanged()
bar.txt = getglobal(bar:GetName() .. "_text");
bar.txt:SetTextColor(sr, sg, sb, sa);
bar.txt:SetText(HEALBOT_ACTION_ABORT);
+ bar.txt:SetFont(bfont, btextheight, expectedFlags);
HealBot_Action_SetTexture(bar, btexture);
bar:SetMinMaxValues(0, 100);
bar:SetValue(100);
diff --git a/README.md b/README.md
index 80e8f0e..c917193 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,7 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\
**v1.7.5**
* **Feature - Test Bars** - Implemented a "Test Bars" button and slider in the Skins options tab, allowing you to spawn and adjust a dummy raid group of up to 40 members without being in a real raid. This allows for easy layout and appearance customization out of combat.
+* **UI - Skins Options & Custom Health Gradients** - Added configurable Max HP and Min HP colour pickers with descriptive labels for custom gradient support. Fixed colour picker button click interceptors and hooked ColorPickerFrame callbacks. Integrated global font selector across raid frame text, headers, Options button, and preview bars. Reorganized Skins tab layout to anchor Test Bars cleanly in Column 2.
* **UI - Cleanup** - While adding new funcionalities the way menus look was ignored, new functions were added to each tab where there was free space, so attempt was made to clean up this convoluted mess I made. Menu Tabs are now aligned and grouped in a manner that makes more sense.
* **Performance Fix - Table Pooling & GC Leaks** - Resolved critical table leaks in emergency heals where pooled tables (`order` and `units`) failed to release when pet heals were disabled, un-nested pet healing from emergency heals, eliminated high-frequency (4 Hz) anonymous closure allocations in `HealBot_Action_UpdatePlayerHoTs`, and implemented in-place key recycling for equipment scanning and grid button tables.