mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-07-27 09:44:44 +00:00
feat: add customizable frame padding and border thickness settings to UI and optimize equipment change scanning
This commit is contained in:
+13
-32
@@ -6,10 +6,7 @@
|
||||
|
||||
local _scale=0;
|
||||
local CalcEquipBonus=false;
|
||||
local InitCalcEquipBonus=false;
|
||||
local FlagEquipUpdate1=1;
|
||||
local FlagEquipUpdate2=1;
|
||||
local NeedEquipUpdate=0;
|
||||
local HealBot_EquipChangeTimer = 0;
|
||||
local HealValue=0;
|
||||
local InitSpells=1;
|
||||
local DebugDebuff=false;
|
||||
@@ -734,39 +731,23 @@ function HealBot_OnUpdate(this,arg1)
|
||||
HealBot_HealsIn={};
|
||||
HealBot_Healers={};
|
||||
HealsIn_Timer=0;
|
||||
InitCalcEquipBonus=true
|
||||
end
|
||||
if FlagEquipUpdate1>0 and FlagEquipUpdate2>0 then
|
||||
FlagEquipUpdate1=0;
|
||||
FlagEquipUpdate2=0;
|
||||
NeedEquipUpdate=1;
|
||||
elseif FlagEquipUpdate1>0 then
|
||||
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
|
||||
|
||||
if HealBot_EquipChangeTimer > 0 then
|
||||
HealBot_EquipChangeTimer = HealBot_EquipChangeTimer - arg1
|
||||
if HealBot_EquipChangeTimer <= 0 then
|
||||
HealBot_EquipChangeTimer = 0
|
||||
HealBot_BonusScanner:ScanEquipment()
|
||||
CalcEquipBonus=true;
|
||||
InitCalcEquipBonus=false;
|
||||
NeedEquipUpdate=0;
|
||||
HealBot_RecalcSpells();
|
||||
end
|
||||
HealBot_RecalcSpells();
|
||||
end
|
||||
end
|
||||
|
||||
if InitSpells>1 then
|
||||
InitSpells=InitSpells+1;
|
||||
if InitSpells>2 then
|
||||
local cnt=HealBot_InitSpells();
|
||||
InitSpells=0;
|
||||
InitCalcEquipBonus=true;
|
||||
end
|
||||
end
|
||||
if Delay_RecalcParty>0 then
|
||||
@@ -1233,12 +1214,12 @@ function HealBot_OnEvent_PartyMemberEnable(this,unit)
|
||||
end
|
||||
|
||||
function HealBot_OnEvent_PlayerEquipmentChanged(this)
|
||||
FlagEquipUpdate1=1;
|
||||
HealBot_EquipChangeTimer = 1;
|
||||
end
|
||||
|
||||
function HealBot_OnEvent_PlayerEquipmentChanged2(this,unit)
|
||||
if unit=="player" then
|
||||
FlagEquipUpdate2=1;
|
||||
HealBot_EquipChangeTimer = 1;
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1253,7 +1234,7 @@ function HealBot_OnEvent_TalentsChanged(this, arg1)
|
||||
end
|
||||
|
||||
function HealBot_OnEvent_BagUpdate(this,bag)
|
||||
if FlagEquipUpdate1==0 and FlagEquipUpdate2==0 then
|
||||
if HealBot_EquipChangeTimer==0 then
|
||||
HealBot_RecalcSpells();
|
||||
end
|
||||
end
|
||||
@@ -1261,7 +1242,7 @@ end
|
||||
function HealBot_OnEvent_BagUpdateCooldown(this,bag)
|
||||
if not bag then
|
||||
bag = "undef"
|
||||
elseif FlagEquipUpdate1==0 and FlagEquipUpdate2==0 then
|
||||
elseif HealBot_EquipChangeTimer==0 then
|
||||
HealBot_RecalcSpells();
|
||||
end
|
||||
end
|
||||
|
||||
+7
-5
@@ -3,7 +3,7 @@ function HealBot_Action_SetTexture(bar, btexture)
|
||||
if btexture == 10 then
|
||||
bar:SetStatusBarTexture("Interface\\Buttons\\WHITE8X8");
|
||||
else
|
||||
HealBot_Action_SetTexture(bar, btexture);
|
||||
bar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar");
|
||||
end
|
||||
end
|
||||
local headerno=0;
|
||||
@@ -205,6 +205,7 @@ function HealBot_Action_EnableButton(button)
|
||||
bar3:SetMinMaxValues(0, state.maxMana)
|
||||
bar3:SetValue(state.mana)
|
||||
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:SetHeight(bheight * 0.2)
|
||||
end
|
||||
@@ -714,8 +715,9 @@ if not HealBot_IsFighting then
|
||||
numBars=numBars-1;
|
||||
end
|
||||
|
||||
OffsetY = 10;
|
||||
OffsetX = 10;
|
||||
local bpadding = (HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10
|
||||
OffsetY = bpadding;
|
||||
OffsetX = bpadding;
|
||||
MaxOffsetY=0;
|
||||
|
||||
if cols>(numBars-numHeaders) then
|
||||
@@ -738,7 +740,7 @@ if not HealBot_IsFighting then
|
||||
if h==ceil((numBars)/cols) and z<numBars then
|
||||
h=0;
|
||||
if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end
|
||||
OffsetY = 10;
|
||||
OffsetY = bpadding;
|
||||
OffsetX = OffsetX + bwidth+bcspace;
|
||||
-- z=z+1;
|
||||
end
|
||||
@@ -751,7 +753,7 @@ if not HealBot_IsFighting then
|
||||
if h==ceil((numBars)/cols) and z<numBars then
|
||||
h=0;
|
||||
if MaxOffsetY<OffsetY then MaxOffsetY = OffsetY; end
|
||||
OffsetY = 10;
|
||||
OffsetY = bpadding;
|
||||
OffsetX = OffsetX + bwidth+bcspace;
|
||||
end
|
||||
z=z+1;
|
||||
|
||||
+9
-3
@@ -10,6 +10,7 @@ HealBot_ConfigDefaults = {
|
||||
TargetHeals = 1,
|
||||
EmergencyHeals = 1,
|
||||
ActionLocked = 0,
|
||||
ActionVisible = 1,
|
||||
OverHeal = 0.25,
|
||||
CastNotify = 1,
|
||||
ChatMessages = {
|
||||
@@ -172,15 +173,15 @@ HealBot_ConfigDefaults = {
|
||||
ActionVisible = 0,
|
||||
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",},
|
||||
Current_Skin = HEALBOT_SKINS_STD,
|
||||
Current_Skin = "Modern Flat",
|
||||
Skin_ID = 1,
|
||||
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},
|
||||
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},
|
||||
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},
|
||||
bheight = {[HEALBOT_SKINS_STD] = 19, ["HealBot Party"] = 18, ["HealBot Raid"] = 14, ["Alteric Valley"] = 16, ["Modern Flat"] = 20},
|
||||
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"] = 40},
|
||||
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},
|
||||
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},
|
||||
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},
|
||||
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},
|
||||
ShowTooltip = 1,
|
||||
ShowManaBars = 0,
|
||||
ManaBarsHealersOnly = 0,
|
||||
Tooltip_ShowSpellDetail = 0,
|
||||
Tooltip_ShowTarget = 1,
|
||||
Tooltip_Recommend = 1,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
HEALBOT_VERSION = "1.1";
|
||||
HEALBOT_VERSION = "1.2";
|
||||
|
||||
-------------
|
||||
-- ENGLISH --
|
||||
|
||||
+22
-3
@@ -298,11 +298,13 @@ function HealBot_SetSkinColours()
|
||||
if borderStyle == 0 then
|
||||
HealBot_Action:SetBackdropBorderColor(0,0,0,0);
|
||||
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({
|
||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||
edgeFile = "Interface\\Buttons\\WHITE8X8",
|
||||
tile = true, tileSize = 8, edgeSize = 1,
|
||||
insets = { left = 1, right = 1, top = 1, bottom = 1 }
|
||||
tile = true, tileSize = 8, edgeSize = bboffset,
|
||||
insets = { left = bpadding, right = bpadding, top = bpadding, bottom = bpadding }
|
||||
})
|
||||
HealBot_Action:SetBackdropColor(
|
||||
HealBot_Config.backcolr[HealBot_Config.Current_Skin],
|
||||
@@ -1480,7 +1482,9 @@ function HealBot_Options_SetSkins()
|
||||
HealBot_Options_BarWidthS:SetValue(HealBot_Config.bwidth[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_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_BarAlphaDis:SetValue(HealBot_Config.bardisa[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
|
||||
|
||||
|
||||
@@ -238,6 +238,29 @@
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</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">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_ActionLocked" relativePoint="TOPLEFT">
|
||||
@@ -1710,6 +1733,38 @@
|
||||
<OnLoad>HealBot_Options_val_OnLoad(this,HEALBOT_OPTIONS_SKINBCSPACE,0,25)</OnLoad>
|
||||
<OnValueChanged>HealBot_Options_BarBCSpaceS_OnValueChanged(this)</OnValueChanged>
|
||||
</Scripts>
|
||||
</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">
|
||||
<Anchors>
|
||||
|
||||
Reference in New Issue
Block a user