feat: add customizable frame padding and border thickness settings to UI and optimize equipment change scanning

This commit is contained in:
Bluewhale1337
2026-06-24 20:49:47 +02:00
parent f2c374db8a
commit dd9cfc301a
6 changed files with 107 additions and 44 deletions
+11 -30
View File
@@ -6,10 +6,7 @@
local _scale=0; local _scale=0;
local CalcEquipBonus=false; local CalcEquipBonus=false;
local InitCalcEquipBonus=false; local HealBot_EquipChangeTimer = 0;
local FlagEquipUpdate1=1;
local FlagEquipUpdate2=1;
local NeedEquipUpdate=0;
local HealValue=0; local HealValue=0;
local InitSpells=1; local InitSpells=1;
local DebugDebuff=false; local DebugDebuff=false;
@@ -734,39 +731,23 @@ function HealBot_OnUpdate(this,arg1)
HealBot_HealsIn={}; HealBot_HealsIn={};
HealBot_Healers={}; HealBot_Healers={};
HealsIn_Timer=0; HealsIn_Timer=0;
InitCalcEquipBonus=true
end end
if FlagEquipUpdate1>0 and FlagEquipUpdate2>0 then
FlagEquipUpdate1=0; if HealBot_EquipChangeTimer > 0 then
FlagEquipUpdate2=0; HealBot_EquipChangeTimer = HealBot_EquipChangeTimer - arg1
NeedEquipUpdate=1; if HealBot_EquipChangeTimer <= 0 then
elseif FlagEquipUpdate1>0 then HealBot_EquipChangeTimer = 0
FlagEquipUpdate1=FlagEquipUpdate1+1;
if FlagEquipUpdate1>1 then
FlagEquipUpdate1=0;
end
elseif FlagEquipUpdate2>0 then
FlagEquipUpdate2=FlagEquipUpdate2+1;
if FlagEquipUpdate2>1 then
FlagEquipUpdate2=0;
end
end
if NeedEquipUpdate>0 and InitCalcEquipBonus then
NeedEquipUpdate=NeedEquipUpdate+1;
if NeedEquipUpdate>1 then
HealBot_BonusScanner:ScanEquipment() HealBot_BonusScanner:ScanEquipment()
CalcEquipBonus=true; CalcEquipBonus=true;
InitCalcEquipBonus=false;
NeedEquipUpdate=0;
HealBot_RecalcSpells(); HealBot_RecalcSpells();
end end
end end
if InitSpells>1 then if InitSpells>1 then
InitSpells=InitSpells+1; InitSpells=InitSpells+1;
if InitSpells>2 then if InitSpells>2 then
local cnt=HealBot_InitSpells(); local cnt=HealBot_InitSpells();
InitSpells=0; InitSpells=0;
InitCalcEquipBonus=true;
end end
end end
if Delay_RecalcParty>0 then if Delay_RecalcParty>0 then
@@ -1233,12 +1214,12 @@ function HealBot_OnEvent_PartyMemberEnable(this,unit)
end end
function HealBot_OnEvent_PlayerEquipmentChanged(this) function HealBot_OnEvent_PlayerEquipmentChanged(this)
FlagEquipUpdate1=1; HealBot_EquipChangeTimer = 1;
end end
function HealBot_OnEvent_PlayerEquipmentChanged2(this,unit) function HealBot_OnEvent_PlayerEquipmentChanged2(this,unit)
if unit=="player" then if unit=="player" then
FlagEquipUpdate2=1; HealBot_EquipChangeTimer = 1;
end end
end end
@@ -1253,7 +1234,7 @@ function HealBot_OnEvent_TalentsChanged(this, arg1)
end end
function HealBot_OnEvent_BagUpdate(this,bag) function HealBot_OnEvent_BagUpdate(this,bag)
if FlagEquipUpdate1==0 and FlagEquipUpdate2==0 then if HealBot_EquipChangeTimer==0 then
HealBot_RecalcSpells(); HealBot_RecalcSpells();
end end
end end
@@ -1261,7 +1242,7 @@ end
function HealBot_OnEvent_BagUpdateCooldown(this,bag) function HealBot_OnEvent_BagUpdateCooldown(this,bag)
if not bag then if not bag then
bag = "undef" bag = "undef"
elseif FlagEquipUpdate1==0 and FlagEquipUpdate2==0 then elseif HealBot_EquipChangeTimer==0 then
HealBot_RecalcSpells(); HealBot_RecalcSpells();
end end
end end
+7 -5
View File
@@ -3,7 +3,7 @@ function HealBot_Action_SetTexture(bar, btexture)
if btexture == 10 then if btexture == 10 then
bar:SetStatusBarTexture("Interface\\Buttons\\WHITE8X8"); bar:SetStatusBarTexture("Interface\\Buttons\\WHITE8X8");
else else
HealBot_Action_SetTexture(bar, btexture); bar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar");
end end
end end
local headerno=0; local headerno=0;
@@ -205,6 +205,7 @@ function HealBot_Action_EnableButton(button)
bar3:SetMinMaxValues(0, state.maxMana) bar3:SetMinMaxValues(0, state.maxMana)
bar3:SetValue(state.mana) bar3:SetValue(state.mana)
bar3:SetStatusBarColor(pr, pg, pb, HealBot_Config.Barcola[HealBot_Config.Current_Skin]) bar3:SetStatusBarColor(pr, pg, pb, HealBot_Config.Barcola[HealBot_Config.Current_Skin])
HealBot_Action_SetTexture(bar3, HealBot_Config.btexture[HealBot_Config.Current_Skin])
bar3:Show() bar3:Show()
bar3:SetHeight(bheight * 0.2) bar3:SetHeight(bheight * 0.2)
end end
@@ -714,8 +715,9 @@ if not HealBot_IsFighting then
numBars=numBars-1; numBars=numBars-1;
end end
OffsetY = 10; local bpadding = (HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10
OffsetX = 10; OffsetY = bpadding;
OffsetX = bpadding;
MaxOffsetY=0; MaxOffsetY=0;
if cols>(numBars-numHeaders) then if cols>(numBars-numHeaders) then
@@ -738,7 +740,7 @@ if not HealBot_IsFighting then
if h==ceil((numBars)/cols) and z<numBars then if h==ceil((numBars)/cols) and z<numBars then
h=0; h=0;
if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end
OffsetY = 10; OffsetY = bpadding;
OffsetX = OffsetX + bwidth+bcspace; OffsetX = OffsetX + bwidth+bcspace;
-- z=z+1; -- z=z+1;
end end
@@ -751,7 +753,7 @@ if not HealBot_IsFighting then
if h==ceil((numBars)/cols) and z<numBars then if h==ceil((numBars)/cols) and z<numBars then
h=0; h=0;
if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end
OffsetY = 10; OffsetY = bpadding;
OffsetX = OffsetX + bwidth+bcspace; OffsetX = OffsetX + bwidth+bcspace;
end end
z=z+1; z=z+1;
+9 -3
View File
@@ -10,6 +10,7 @@ HealBot_ConfigDefaults = {
TargetHeals = 1, TargetHeals = 1,
EmergencyHeals = 1, EmergencyHeals = 1,
ActionLocked = 0, ActionLocked = 0,
ActionVisible = 1,
OverHeal = 0.25, OverHeal = 0.25,
CastNotify = 1, CastNotify = 1,
ChatMessages = { ChatMessages = {
@@ -172,15 +173,15 @@ HealBot_ConfigDefaults = {
ActionVisible = 0, ActionVisible = 0,
CDCLeftText = {[HEALBOT_PRIEST]="None", [HEALBOT_SHAMAN]="None", [HEALBOT_DRUID]="None", [HEALBOT_PALADIN]="None",}, CDCLeftText = {[HEALBOT_PRIEST]="None", [HEALBOT_SHAMAN]="None", [HEALBOT_DRUID]="None", [HEALBOT_PALADIN]="None",},
CDCRightText = {[HEALBOT_PRIEST]="None", [HEALBOT_SHAMAN]="None", [HEALBOT_DRUID]="None", [HEALBOT_PALADIN]="None",}, CDCRightText = {[HEALBOT_PRIEST]="None", [HEALBOT_SHAMAN]="None", [HEALBOT_DRUID]="None", [HEALBOT_PALADIN]="None",},
Current_Skin = HEALBOT_SKINS_STD, Current_Skin = "Modern Flat",
Skin_ID = 1, Skin_ID = 1,
Skins = {HEALBOT_SKINS_STD, "HealBot Party", "HealBot Raid", "Alteric Valley", "Modern Flat"}, Skins = {HEALBOT_SKINS_STD, "HealBot Party", "HealBot Raid", "Alteric Valley", "Modern Flat"},
numcols = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 4, ["Alteric Valley"] = 2, ["Modern Flat"] = 1}, numcols = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 4, ["Alteric Valley"] = 2, ["Modern Flat"] = 1},
btexture = {[HEALBOT_SKINS_STD] = 8,["HealBot Party"] = 6, ["HealBot Raid"] = 7, ["Alteric Valley"] = 9, ["Modern Flat"] = 10}, btexture = {[HEALBOT_SKINS_STD] = 8,["HealBot Party"] = 6, ["HealBot Raid"] = 7, ["Alteric Valley"] = 9, ["Modern Flat"] = 10},
bcspace = {[HEALBOT_SKINS_STD] = 4, ["HealBot Party"] = 4, ["HealBot Raid"] = 2, ["Alteric Valley"] = 2, ["Modern Flat"] = 4}, bcspace = {[HEALBOT_SKINS_STD] = 4, ["HealBot Party"] = 4, ["HealBot Raid"] = 2, ["Alteric Valley"] = 2, ["Modern Flat"] = 4},
brspace = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 2, ["HealBot Raid"] = 2, ["Alteric Valley"] = 1, ["Modern Flat"] = 2}, brspace = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 2, ["HealBot Raid"] = 2, ["Alteric Valley"] = 1, ["Modern Flat"] = 2},
bwidth = {[HEALBOT_SKINS_STD] = 122, ["HealBot Party"] = 115, ["HealBot Raid"] = 90, ["Alteric Valley"] = 85, ["Modern Flat"] = 122}, bwidth = {[HEALBOT_SKINS_STD] = 122, ["HealBot Party"] = 115, ["HealBot Raid"] = 90, ["Alteric Valley"] = 85, ["Modern Flat"] = 100},
bheight = {[HEALBOT_SKINS_STD] = 19, ["HealBot Party"] = 18, ["HealBot Raid"] = 14, ["Alteric Valley"] = 16, ["Modern Flat"] = 20}, bheight = {[HEALBOT_SKINS_STD] = 19, ["HealBot Party"] = 18, ["HealBot Raid"] = 14, ["Alteric Valley"] = 16, ["Modern Flat"] = 40},
btextenabledcolr = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1}, btextenabledcolr = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1},
btextenabledcolg = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1}, btextenabledcolg = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1},
btextenabledcolb = {[HEALBOT_SKINS_STD] = 0, ["HealBot Party"] = 0, ["HealBot Raid"] = 0, ["Alteric Valley"] = 0, ["Modern Flat"] = 1}, btextenabledcolb = {[HEALBOT_SKINS_STD] = 0, ["HealBot Party"] = 0, ["HealBot Raid"] = 0, ["Alteric Valley"] = 0, ["Modern Flat"] = 1},
@@ -213,7 +214,12 @@ HealBot_ConfigDefaults = {
ShowHeader = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1}, ShowHeader = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 1},
bcolormode = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 2}, bcolormode = {[HEALBOT_SKINS_STD] = 1, ["HealBot Party"] = 1, ["HealBot Raid"] = 1, ["Alteric Valley"] = 1, ["Modern Flat"] = 2},
bborder = {[HEALBOT_SKINS_STD] = 2, ["HealBot Party"] = 2, ["HealBot Raid"] = 2, ["Alteric Valley"] = 2, ["Modern Flat"] = 1}, bborder = {[HEALBOT_SKINS_STD] = 2, ["HealBot Party"] = 2, ["HealBot Raid"] = 2, ["Alteric Valley"] = 2, ["Modern Flat"] = 1},
bpadding = {[HEALBOT_SKINS_STD] = 10, ["HealBot Party"] = 10, ["HealBot Raid"] = 10, ["Alteric Valley"] = 10, ["Modern Flat"] = 10},
bboffset = {[HEALBOT_SKINS_STD] = 16, ["HealBot Party"] = 16, ["HealBot Raid"] = 16, ["Alteric Valley"] = 16, ["Modern Flat"] = 3},
bfontoutline = {[HEALBOT_SKINS_STD] = 0, ["HealBot Party"] = 0, ["HealBot Raid"] = 0, ["Alteric Valley"] = 0, ["Modern Flat"] = 1}, bfontoutline = {[HEALBOT_SKINS_STD] = 0, ["HealBot Party"] = 0, ["HealBot Raid"] = 0, ["Alteric Valley"] = 0, ["Modern Flat"] = 1},
ShowTooltip = 1,
ShowManaBars = 0,
ManaBarsHealersOnly = 0,
Tooltip_ShowSpellDetail = 0, Tooltip_ShowSpellDetail = 0,
Tooltip_ShowTarget = 1, Tooltip_ShowTarget = 1,
Tooltip_Recommend = 1, Tooltip_Recommend = 1,
+1 -1
View File
@@ -1,4 +1,4 @@
HEALBOT_VERSION = "1.1"; HEALBOT_VERSION = "1.2";
------------- -------------
-- ENGLISH -- -- ENGLISH --
+21 -2
View File
@@ -298,11 +298,13 @@ function HealBot_SetSkinColours()
if borderStyle == 0 then if borderStyle == 0 then
HealBot_Action:SetBackdropBorderColor(0,0,0,0); HealBot_Action:SetBackdropBorderColor(0,0,0,0);
elseif borderStyle == 1 then elseif borderStyle == 1 then
local bboffset = (HealBot_Config.bboffset and HealBot_Config.bboffset[HealBot_Config.Current_Skin]) or 1
local bpadding = (HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10
HealBot_Action:SetBackdrop({ HealBot_Action:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Buttons\\WHITE8X8",
tile = true, tileSize = 8, edgeSize = 1, tile = true, tileSize = 8, edgeSize = bboffset,
insets = { left = 1, right = 1, top = 1, bottom = 1 } insets = { left = bpadding, right = bpadding, top = bpadding, bottom = bpadding }
}) })
HealBot_Action:SetBackdropColor( HealBot_Action:SetBackdropColor(
HealBot_Config.backcolr[HealBot_Config.Current_Skin], HealBot_Config.backcolr[HealBot_Config.Current_Skin],
@@ -1481,6 +1483,8 @@ function HealBot_Options_SetSkins()
HealBot_Options_BarNumColsS:SetValue(HealBot_Config.numcols[HealBot_Config.Current_Skin]) HealBot_Options_BarNumColsS:SetValue(HealBot_Config.numcols[HealBot_Config.Current_Skin])
HealBot_Options_BarBRSpaceS:SetValue(HealBot_Config.brspace[HealBot_Config.Current_Skin]) HealBot_Options_BarBRSpaceS:SetValue(HealBot_Config.brspace[HealBot_Config.Current_Skin])
HealBot_Options_BarBCSpaceS:SetValue(HealBot_Config.bcspace[HealBot_Config.Current_Skin]) HealBot_Options_BarBCSpaceS:SetValue(HealBot_Config.bcspace[HealBot_Config.Current_Skin])
HealBot_Options_FramePaddingS:SetValue((HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10)
HealBot_Options_BorderThicknessS:SetValue((HealBot_Config.bboffset and HealBot_Config.bboffset[HealBot_Config.Current_Skin]) or 1)
HealBot_Options_FontHeight:SetValue(HealBot_Config.btextheight[HealBot_Config.Current_Skin]) HealBot_Options_FontHeight:SetValue(HealBot_Config.btextheight[HealBot_Config.Current_Skin])
HealBot_Options_BarAlphaDis:SetValue(HealBot_Config.bardisa[HealBot_Config.Current_Skin]) HealBot_Options_BarAlphaDis:SetValue(HealBot_Config.bardisa[HealBot_Config.Current_Skin])
HealBot_Options_AbortBarSize:SetValue(HealBot_Config.abortsize[HealBot_Config.Current_Skin]) HealBot_Options_AbortBarSize:SetValue(HealBot_Config.abortsize[HealBot_Config.Current_Skin])
@@ -1753,3 +1757,18 @@ end
function HealBot_Options_FramePaddingS_OnValueChanged(this)
if not HealBot_Config.bpadding then HealBot_Config.bpadding = {} end
HealBot_Config.bpadding[HealBot_Config.Current_Skin] = this:GetValue();
getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
HealBot_Action_ResetSkin()
end
function HealBot_Options_BorderThicknessS_OnValueChanged(this)
if not HealBot_Config.bboffset then HealBot_Config.bboffset = {} end
HealBot_Config.bboffset[HealBot_Config.Current_Skin] = this:GetValue();
getglobal(this:GetName().."Text"):SetText(this.text .. ": " .. this:GetValue());
HealBot_Action_ResetSkin()
end
+55
View File
@@ -238,6 +238,29 @@
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
<CheckButton name="HealBot_Options_ManaBarsHealersOnly" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_ShowManaBars" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="20" y="5" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("For Healers Only");
this:SetChecked(HealBot_Config.ManaBarsHealersOnly);
</OnLoad>
<OnClick>
if (this:GetChecked()) then
HealBot_Config.ManaBarsHealersOnly = 1;
else
HealBot_Config.ManaBarsHealersOnly = 0;
end
HealBot_Action_Refresh();
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="HealBot_Options_AutoShow" inherits="OptionsCheckButtonTemplate"> <CheckButton name="HealBot_Options_AutoShow" inherits="OptionsCheckButtonTemplate">
<Anchors> <Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_ActionLocked" relativePoint="TOPLEFT"> <Anchor point="TOPLEFT" relativeTo="HealBot_Options_ActionLocked" relativePoint="TOPLEFT">
@@ -1711,6 +1734,38 @@
<OnValueChanged>HealBot_Options_BarBCSpaceS_OnValueChanged(this)</OnValueChanged> <OnValueChanged>HealBot_Options_BarBCSpaceS_OnValueChanged(this)</OnValueChanged>
</Scripts> </Scripts>
</Slider> </Slider>
<Slider name="HealBot_Options_FramePaddingS" inherits="HealBot_Options_SliderTemplate">
<Size>
<AbsDimension x="123" y="17" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_FramePaddingS" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-35" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>HealBot_Options_val_OnLoad(this,"Frame Padding",0,50)</OnLoad>
<OnValueChanged>HealBot_Options_FramePaddingS_OnValueChanged(this)</OnValueChanged>
</Scripts>
</Slider>
<Slider name="HealBot_Options_BorderThicknessS" inherits="HealBot_Options_SliderTemplate">
<Size>
<AbsDimension x="123" y="17" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_FramePaddingS" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="10" y="0" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>HealBot_Options_val_OnLoad(this,"Solid Border",1,10)</OnLoad>
<OnValueChanged>HealBot_Options_BorderThicknessS_OnValueChanged(this)</OnValueChanged>
</Scripts>
</Slider>
<Slider name="HealBot_Options_BarAlpha" inherits="HealBot_Options_SliderTemplate"> <Slider name="HealBot_Options_BarAlpha" inherits="HealBot_Options_SliderTemplate">
<Anchors> <Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_BarBRSpaceS" relativePoint="TOPLEFT"> <Anchor point="TOPLEFT" relativeTo="HealBot_Options_BarBRSpaceS" relativePoint="TOPLEFT">