Features implementation - added integration support for UnitXP and nampower, expand Options UI.

This commit is contained in:
Bluewhale1337
2026-08-17 20:26:09 +02:00
parent 496013ae9c
commit 58f593947e
13 changed files with 131 additions and 28 deletions
+3 -1
View File
@@ -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
+5 -3
View File
@@ -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
+1
View File
@@ -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,
+5
View File
@@ -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
+2
View File
@@ -255,6 +255,8 @@ HealBot_ConfigDefaults = {
Tooltip_Recommend = 1,
TooltipPos = 1,
HideParty = 0,
HealBot_Integrations_UnitXP = 0,
HealBot_Integrations_Nampower = 0,
};
HealBot_Config = {};
+23
View File
@@ -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
+1 -1
View File
@@ -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);
+11 -2
View File
@@ -94,7 +94,7 @@
<Frame name="HealBot_Options" toplevel="true" frameStrata="DIALOG"
movable="true" parent="UIParent" enableMouse="true" hidden="true">
<Size>
<AbsDimension x="480" y="455"/>
<AbsDimension x="540" y="455"/>
</Size>
<Anchors>
<Anchor point="CENTER">
@@ -121,7 +121,7 @@
<Texture name="HealBot_Options_Header"
file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="400" y="64"/>
<AbsDimension x="450" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
@@ -215,6 +215,15 @@
</Anchor>
</Anchors>
</Button>
<Button name="HealBot_OptionsTab9" inherits="HealBot_Options_Tab" id="9" text="Extras">
<Anchors>
<Anchor point="LEFT" relativeTo="HealBot_OptionsTab8" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-14" y="0" />
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
<Scripts>
+1 -1
View File
@@ -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)
+4
View File
@@ -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
+52
View File
@@ -0,0 +1,52 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="HealBot_Options_Integrations.lua" />
<Frame name="HealBot_Options_Panel9" hidden="true" parent="HealBot_Options" setAllPoints="true">
<Frames>
<CheckButton name="HealBot_Options_Integrations_UnitXP" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="31" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("Enable UnitXP_SP3 Integration (Distance/LoS)");
</OnLoad>
<OnClick>
HealBot_Config.HealBot_Integrations_UnitXP = this:GetChecked() and 1 or 0;
HealBot_Integrations_Toggle();
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="HealBot_Options_Integrations_Nampower" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="HealBot_Options_Integrations_UnitXP" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("Enable nampower Integration (Buffs/Heals)");
</OnLoad>
<OnClick>
HealBot_Config.HealBot_Integrations_Nampower = this:GetChecked() and 1 or 0;
HealBot_Integrations_Toggle();
</OnClick>
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnShow>
HealBot_Options_Integrations_OnShow(this);
</OnShow>
</Scripts>
</Frame>
</Ui>
+18 -20
View File
@@ -27,24 +27,19 @@ end
function HealBot_HealthColor(unit, hlth, maxhlth)
if HealBot_UnitDebuff[unit] then
local debuff, tmp, debuff_type = UnitDebuff(unit, 1, 1)
if not debuff then
HealBot_UnitDebuff[unit] = nil;
HealBot_UnitDebuff[unit .. "_debuff_texture"] = nil
else
local dr = HealBot_Config.CDCBarColour[debuff_type].R
local dg = HealBot_Config.CDCBarColour[debuff_type].G
local db = HealBot_Config.CDCBarColour[debuff_type].B
if HealBot_Config.btexture[HealBot_Config.Current_Skin] == 10 then
dr = dr * 4
dg = dg * 4
db = db * 4
if dr > 1 then dr = 1 end
if dg > 1 then dg = 1 end
if db > 1 then db = 1 end
end
return dr, dg, db, HealBot_Config.Barcola[HealBot_Config.Current_Skin];
local debuff_type = HealBot_UnitDebuff[unit]
local dr = HealBot_Config.CDCBarColour[debuff_type].R
local dg = HealBot_Config.CDCBarColour[debuff_type].G
local db = HealBot_Config.CDCBarColour[debuff_type].B
if HealBot_Config.btexture[HealBot_Config.Current_Skin] == 10 then
dr = dr * 4
dg = dg * 4
db = db * 4
if dr > 1 then dr = 1 end
if dg > 1 then dg = 1 end
if db > 1 then db = 1 end
end
return dr, dg, db, HealBot_Config.Barcola[HealBot_Config.Current_Skin];
end
local text = UnitName(unit);
@@ -431,7 +426,7 @@ function HealBot_Action_PartyChanged()
local numBars = 0;
local numHeaders = 0;
local TempMaxH = 0;
local HeaderPos = {};
local HeaderPos = HealBot_GetTable();
if HealBot_Config.AutoSwap_Enabled == 1 then
local totalMembers = GetNumRaidMembers()
@@ -598,8 +593,8 @@ function HealBot_Action_PartyChanged()
last = last + 40
local ExtraValid = numBars;
if HealBot_Config.EmergencyHeals == 1 then
local order = {};
local units = {};
local order = HealBot_GetTable();
local units = HealBot_GetTable();
if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 and HealBot_Config.ExtraOrder == 1 then
HeaderPos[i + 1] = HEALBOT_OPTIONS_EMERGENCYHEALS
numBars = numBars + 1;
@@ -804,6 +799,8 @@ function HealBot_Action_PartyChanged()
if i == last then break end
end
end
HealBot_ReleaseTable(order);
HealBot_ReleaseTable(units);
end
if numBars == PetsValid + 1 and HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
HeaderPos[PetsValid + 1] = nil;
@@ -968,6 +965,7 @@ function HealBot_Action_PartyChanged()
HidePartyFrame();
end
HealBot_Action_RefreshButtons();
HealBot_ReleaseTable(HeaderPos);
HealBot_Action_ShowFrame();
end
+5
View File
@@ -49,11 +49,16 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\
### Change Log
**v1.7.0**
* **External Addon Integrations** - Added a new 'Extras' tab in Options to optionally enable integrations with `UnitXP_SP3` (for ultra-precise 3D range and Line of Sight checks) and `nampower` (for accurate real-time heal/buff tracking).
* **UI Layout** - Widened the Options UI and neatly centered elements to accommodate the new integrations tab.
**v1.6.3**
* **Hotfix string splitter** - added falback for string splitter if the the string is empty or nil.
* **UI Update - Icon Limit** - Increased maximum tracked buffs/debuffs per unit from 5 to 10.
* **UI Update - Customizable icon size** - Added an option to change size of HoT icons (default to 12px).
* **Cleanup** - Removed dead code `HealBot_Groups` table.
* **Bug Fix - Buff Watch Self** - Fixed an issue where the "Self Only" toggle for watched buffs failed to load visually across sessions.
**v1.6.2**
* **Hotfix - raid and party frames** - if getNumRaidMembers() > 0 wrapper around extra bars stopped from displaying all frames blocked from displaying Extras\Raid.