refactor: update skin options UI layout and add font styling to action buttons and headers

This commit is contained in:
Bluewhale1337
2026-10-10 12:51:07 +02:00
parent 2baf535aa2
commit eed71fa070
5 changed files with 175 additions and 57 deletions
+6
View File
@@ -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();
+24 -9
View File
@@ -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()
+90 -37
View File
@@ -240,6 +240,29 @@
<OnLoad>HealBot_Options_FontDD_OnLoad(this)</OnLoad>
</Scripts>
</Frame>
<Button name="HealBot_Options_TestBarsButton" inherits="UIPanelButtonTemplate" text="HEALBOT_OPTIONS_TESTBARS">
<Size><AbsDimension x="123" y="22"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_Font_Dropdown" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="15" y="-12"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>HealBot_Options_TestBarsButton_OnClick(this)</OnClick>
</Scripts>
</Button>
<Slider name="HealBot_Options_NumTestBarsS" inherits="HealBot_Options_SliderTemplate">
<Size><AbsDimension x="123" y="17"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_TestBarsButton" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="0" y="-18"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>HealBot_Options_val_OnLoad(this,HEALBOT_OPTIONS_TESTBARS,1,40)</OnLoad>
<OnValueChanged>HealBot_Options_NumTestBars_OnValueChanged(this)</OnValueChanged>
</Scripts>
</Slider>
<!-- COLUMN 3: Visuals & Opacity -->
<CheckButton name="HealBot_Options_BarColorMode" inherits="SendMailRadioButtonTemplate">
@@ -332,8 +355,15 @@
</StatusBar>
<Button name="HealBot_MaxHPColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_MaxHPColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("MaxHP")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_MaxHPColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("MaxHP")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_MinHPColorpick" inherits="TextStatusBar">
@@ -363,8 +393,15 @@
</StatusBar>
<Button name="HealBot_MinHPColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_MinHPColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("MinHP")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_MinHPColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("MinHP")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_EnTextColorpick" inherits="TextStatusBar">
@@ -401,8 +438,15 @@
</StatusBar>
<Button name="HealBot_EnTextColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_EnTextColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("En")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_EnTextColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("En")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_DisTextColorpick" inherits="TextStatusBar">
@@ -432,8 +476,15 @@
</StatusBar>
<Button name="HealBot_DisTextColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_DisTextColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("Dis")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_DisTextColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("Dis")</OnClick>
</Scripts>
</Button>
<!-- BOTTOM ROW 2: Font Debuff, Background, Border, Abort Bar -->
@@ -464,8 +515,15 @@
</StatusBar>
<Button name="HealBot_DebTextColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_DebTextColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("Debuff")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_DebTextColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("Debuff")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_BackgroundColorpick" inherits="TextStatusBar">
@@ -495,8 +553,15 @@
</StatusBar>
<Button name="HealBot_BackgroundColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_BackgroundColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("Back")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_BackgroundColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("Back")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_BorderColorpick" inherits="TextStatusBar">
@@ -526,8 +591,15 @@
</StatusBar>
<Button name="HealBot_BorderColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_BorderColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("Bor")</OnClick></Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_BorderColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("Bor")</OnClick>
</Scripts>
</Button>
<StatusBar name="HealBot_AbortColorpick" inherits="TextStatusBar">
@@ -557,35 +629,16 @@
</StatusBar>
<Button name="HealBot_AbortColorpickb">
<Size><AbsDimension x="87" y="18"/></Size>
<Anchors><Anchor point="TOPLEFT" relativeTo="HealBot_AbortColorpick"/></Anchors>
<Scripts><OnClick>HealBot_SkinColorpick_OnClick("Abort")</OnClick></Scripts>
</Button>
<!-- BOTTOM ROW 3: Test Bars -->
<Button name="HealBot_Options_TestBarsButton" inherits="UIPanelButtonTemplate" text="HEALBOT_OPTIONS_TESTBARS">
<Size><AbsDimension x="110" y="22"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_DebTextColorpick" relativePoint="BOTTOMLEFT">
<Offset><AbsDimension x="80" y="-12"/></Offset>
<Anchor point="TOPLEFT" relativeTo="HealBot_AbortColorpick" relativePoint="TOPLEFT">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>HealBot_Options_TestBarsButton_OnClick(this)</OnClick>
<OnLoad>this:SetFrameLevel(this:GetParent():GetFrameLevel() + 2)</OnLoad>
<OnClick>HealBot_SkinColorpick_OnClick("Abort")</OnClick>
</Scripts>
</Button>
<Slider name="HealBot_Options_NumTestBarsS" inherits="HealBot_Options_SliderTemplate">
<Size><AbsDimension x="110" y="18"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_TestBarsButton" relativePoint="TOPRIGHT">
<Offset><AbsDimension x="15" y="-2"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>HealBot_Options_val_OnLoad(this,HEALBOT_OPTIONS_TESTBARS,1,40)</OnLoad>
<OnValueChanged>HealBot_Options_NumTestBars_OnValueChanged(this)</OnValueChanged>
</Scripts>
</Slider>
</Frames>
</Frame>
+54 -11
View File
@@ -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);
+1
View File
@@ -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.