From 58f593947edf36cc05c21b7c3108ab7ed6350d27 Mon Sep 17 00:00:00 2001 From: Bluewhale1337 <295648290+Bluewhale1337@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:26:09 +0200 Subject: [PATCH 01/22] Features implementation - added integration support for UnitXP and nampower, expand Options UI. --- HealBotBlue.toc | 4 ++- HealBot_Controller_Aura.lua | 8 +++-- HealBot_Controller_Events.lua | 1 + HealBot_Controller_Range.lua | 5 +++ HealBot_Data.lua | 2 ++ HealBot_Integrations.lua | 23 ++++++++++++++ HealBot_Options.lua | 2 +- HealBot_Options.xml | 13 ++++++-- HealBot_Options_Buffs.lua | 2 +- HealBot_Options_Integrations.lua | 4 +++ HealBot_Options_Integrations.xml | 52 ++++++++++++++++++++++++++++++++ HealBot_View_Layout.lua | 38 +++++++++++------------ README.md | 5 +++ 13 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 HealBot_Integrations.lua create mode 100644 HealBot_Options_Integrations.lua create mode 100644 HealBot_Options_Integrations.xml diff --git a/HealBotBlue.toc b/HealBotBlue.toc index 53c95ec..6acff89 100644 --- a/HealBotBlue.toc +++ b/HealBotBlue.toc @@ -1,6 +1,6 @@ ## Interface: 11200 ## Title: HealBotBlue -## Version: 1.6.3 +## Version: 1.7.0 ## Author: Bluewhale ## Notes: Adds panel with skinable bars for healing and decursive ## SavedVariablesPerCharacter: HealBot_Config @@ -10,6 +10,7 @@ ..\..\FrameXML\UIDropDownMenu.xml HealBot_Error.xml HealBot_Model.lua +HealBot_Integrations.lua HealBot_Controller_Range.lua HealBot_Controller_Comms.lua HealBot_Controller_Aura.lua @@ -28,3 +29,4 @@ HealBot_Options_Skins.xml HealBot_Options_Buffs.xml HealBot_Options_Chat.xml HealBot_Options_Auto.xml +HealBot_Options_Integrations.xml diff --git a/HealBot_Controller_Aura.lua b/HealBot_Controller_Aura.lua index 7b85427..6e84e14 100644 --- a/HealBot_Controller_Aura.lua +++ b/HealBot_Controller_Aura.lua @@ -39,7 +39,7 @@ function HealBot_CheckShamanWeaponBuff(spellName) if not firstWord then return false end HealBot_ScanTooltip:SetOwner(UIParent, "ANCHOR_NONE") - local slots = {} + local slots = HealBot_GetTable() if hasMainHandEnchant then table.insert(slots, 16) end if hasOffHandEnchant then table.insert(slots, 17) end @@ -52,6 +52,7 @@ function HealBot_CheckShamanWeaponBuff(spellName) local text = textObj:GetText() if text and string.find(text, firstWord) then HealBot_ScanTooltip:Hide() + HealBot_ReleaseTable(slots) return true end end @@ -59,6 +60,7 @@ function HealBot_CheckShamanWeaponBuff(spellName) end HealBot_ScanTooltip:Hide() + HealBot_ReleaseTable(slots) return false end @@ -165,6 +167,7 @@ function HealBot_OnEvent_UnitAura(this, unit) end local iconCount = 0 local i = 1; + HealBot_UnitDebuff[unit] = nil; while true do local debuff, tmp, debuff_type = UnitDebuff(unit, i, 1) if debuff then @@ -172,7 +175,7 @@ function HealBot_OnEvent_UnitAura(this, unit) iconCount = iconCount + 1 HealBot_UnitIcons[unit][iconCount] = debuff end - if HealBot_CDCInc[UnitClass(unit)] == 1 and HealBot_DebuffWatch[debuff_type] then + if HealBot_CDCInc[UnitClass(unit)] == 1 and debuff_type and HealBot_DebuffWatch[debuff_type] then HealBot_UnitDebuff[unit] = debuff_type DebuffType = debuff_type; if HealBot_DebuffPriority[debuff_type] then @@ -181,7 +184,6 @@ function HealBot_OnEvent_UnitAura(this, unit) end i = i + 1; else - if i == 1 then HealBot_UnitDebuff[unit] = nil; end break end end diff --git a/HealBot_Controller_Events.lua b/HealBot_Controller_Events.lua index ab094dd..5d76946 100644 --- a/HealBot_Controller_Events.lua +++ b/HealBot_Controller_Events.lua @@ -201,6 +201,7 @@ local HealBot_EventHandlers = { end, ["VARIABLES_LOADED"] = function(this) HealBot_OnEvent_VariablesLoaded(this) + HealBot_Integrations_Toggle() end, -- Legacy pass-throughs ["CHAT_MSG_ADDON"] = function(this, arg1, arg2, arg3, arg4) HealBot_OnEvent_AddonMsg(this, arg1, arg2, arg3, arg4) end, diff --git a/HealBot_Controller_Range.lua b/HealBot_Controller_Range.lua index e34a3e3..d24a191 100644 --- a/HealBot_Controller_Range.lua +++ b/HealBot_Controller_Range.lua @@ -14,6 +14,11 @@ function HealBot_Range_Check(unit, range) end if ( unit == "player" ) then return_val = 1; + elseif HealBot_Integrations_UnitXP_Active then + local dist = UnitXP("distanceBetween", "player", unit, "Gaussian") + if dist and dist <= range then + return_val = 1; + end elseif ( UnitIsVisible(unit) == 1 ) then local tx, ty = GetPlayerMapPosition(unit) local dist diff --git a/HealBot_Data.lua b/HealBot_Data.lua index 387e68a..c5ea038 100644 --- a/HealBot_Data.lua +++ b/HealBot_Data.lua @@ -255,6 +255,8 @@ HealBot_ConfigDefaults = { Tooltip_Recommend = 1, TooltipPos = 1, HideParty = 0, + HealBot_Integrations_UnitXP = 0, + HealBot_Integrations_Nampower = 0, }; HealBot_Config = {}; diff --git a/HealBot_Integrations.lua b/HealBot_Integrations.lua new file mode 100644 index 0000000..028bcce --- /dev/null +++ b/HealBot_Integrations.lua @@ -0,0 +1,23 @@ +HealBot_Integrations_UnitXP_Active = false; +HealBot_Integrations_Nampower_Active = false; + +function HealBot_Integrations_Toggle() + -- UnitXP + if HealBot_Config.HealBot_Integrations_UnitXP == 1 and UnitXP ~= nil then + HealBot_Integrations_UnitXP_Active = true; + HealBot_AddDebug("UnitXP Integration: ENABLED"); + else + HealBot_Integrations_UnitXP_Active = false; + HealBot_AddDebug("UnitXP Integration: DISABLED"); + end + + -- nampower + if HealBot_Config.HealBot_Integrations_Nampower == 1 then + HealBot_Integrations_Nampower_Active = true; + HealBot_AddDebug("nampower Integration: ENABLED"); + -- Add Nampower specific initialization here later + else + HealBot_Integrations_Nampower_Active = false; + HealBot_AddDebug("nampower Integration: DISABLED"); + end +end diff --git a/HealBot_Options.lua b/HealBot_Options.lua index 553aab7..815af55 100644 --- a/HealBot_Options.lua +++ b/HealBot_Options.lua @@ -223,7 +223,7 @@ function HealBot_Options_OnLoad(this) table.insert(UISpecialFrames,this:GetName()); -- Tabs - PanelTemplates_SetNumTabs(this,8); + PanelTemplates_SetNumTabs(this,9); this.selectedTab = 1; PanelTemplates_UpdateTabs(this); HealBot_Options_ShowPanel(this.selectedTab); diff --git a/HealBot_Options.xml b/HealBot_Options.xml index 6380dd1..74d8814 100644 --- a/HealBot_Options.xml +++ b/HealBot_Options.xml @@ -94,7 +94,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -215,6 +215,15 @@ + diff --git a/HealBot_Options_Buffs.lua b/HealBot_Options_Buffs.lua index d849705..f86e30c 100644 --- a/HealBot_Options_Buffs.lua +++ b/HealBot_Options_Buffs.lua @@ -105,7 +105,7 @@ function HealBot_Options_SetBuffs() HealBot_UIDropDownMenu_SetSelectedID(dropDown, val + 1) end - local selfCheck = getglobal("HealBot_Options_BuffSelf" .. i) + local selfCheck = getglobal("HealBot_Options_Buff" .. i .. "Self") if selfCheck then if HealBot_Config.BuffWatchSelf and HealBot_Config.BuffWatchSelf[i] then local isSelf = (HealBot_Config.BuffWatchSelf[i] == 1) diff --git a/HealBot_Options_Integrations.lua b/HealBot_Options_Integrations.lua new file mode 100644 index 0000000..f93f5de --- /dev/null +++ b/HealBot_Options_Integrations.lua @@ -0,0 +1,4 @@ +function HealBot_Options_Integrations_OnShow(this) + HealBot_Options_Integrations_UnitXP:SetChecked(HealBot_Config.HealBot_Integrations_UnitXP); + HealBot_Options_Integrations_Nampower:SetChecked(HealBot_Config.HealBot_Integrations_Nampower); +end diff --git a/HealBot_Options_Integrations.xml b/HealBot_Options_Integrations.xml new file mode 100644 index 0000000..d4e3154 --- /dev/null +++ b/HealBot_Options_Integrations.xml @@ -0,0 +1,52 @@ + +