mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-07-27 01:34:44 +00:00
feat: expand unit capacity to 100 buttons and add RAID_ROSTER_UPDATE event handling
This commit is contained in:
@@ -232,6 +232,15 @@
|
||||
<Button name="HealBot_Action_HealUnit39" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit40" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit41" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit42" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit43" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit44" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit45" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit46" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit47" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit48" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit49" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit50" inherits="HealingButtonTemplate" text="Unit not set"/>
|
||||
|
||||
<Button name="HealBot_Action_HealUnit51" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit52" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
@@ -243,6 +252,46 @@
|
||||
<Button name="HealBot_Action_HealUnit58" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit59" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit60" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit61" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit62" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit63" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit64" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit65" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit66" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit67" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit68" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit69" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit70" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit71" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit72" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit73" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit74" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit75" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit76" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit77" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit78" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit79" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit80" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit81" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit82" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit83" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit84" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit85" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit86" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit87" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit88" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit89" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit90" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit91" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit92" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit93" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit94" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit95" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit96" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit97" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit98" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit99" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_HealUnit100" inherits="HealingButtonTemplate2" text="Unit not set"/>
|
||||
|
||||
<Button name="HealBot_Action_Header1" inherits="HealingButtonTemplate4" text="Unit not set"/>
|
||||
<Button name="HealBot_Action_Header2" inherits="HealingButtonTemplate4" text="Unit not set"/>
|
||||
|
||||
@@ -181,6 +181,16 @@ local HealBot_EventHandlers = {
|
||||
HealBot_Model:NotifyObservers("ROSTER_CHANGED")
|
||||
HealBot_OnEvent_PartyMembersChanged(this)
|
||||
end,
|
||||
["RAID_ROSTER_UPDATE"] = function(this)
|
||||
for _, unit in ipairs(HealBot_Model.partyMembers) do
|
||||
HealBot_Model:RefreshUnit(unit)
|
||||
end
|
||||
for _, unit in ipairs(HealBot_Model.raidMembers) do
|
||||
HealBot_Model:RefreshUnit(unit)
|
||||
end
|
||||
HealBot_Model:NotifyObservers("ROSTER_CHANGED")
|
||||
HealBot_OnEvent_PartyMembersChanged(this)
|
||||
end,
|
||||
["PLAYER_ENTERING_WORLD"] = function(this)
|
||||
HealBot_Model:RefreshUnit("player")
|
||||
HealBot_Model:RefreshUnit("pet")
|
||||
@@ -282,6 +292,7 @@ function HealBot_OnEvent_VariablesLoaded(this)
|
||||
this:RegisterEvent("PLAYER_REGEN_ENABLED");
|
||||
this:RegisterEvent("PLAYER_TARGET_CHANGED");
|
||||
this:RegisterEvent("PARTY_MEMBERS_CHANGED");
|
||||
this:RegisterEvent("RAID_ROSTER_UPDATE");
|
||||
this:RegisterEvent("PARTY_MEMBER_DISABLE");
|
||||
this:RegisterEvent("PARTY_MEMBER_ENABLE");
|
||||
this:RegisterEvent("UNIT_PET");
|
||||
|
||||
@@ -402,6 +402,7 @@ function HealBot_Action_SetHealButton(index, unit)
|
||||
return nil
|
||||
end
|
||||
local button = getglobal("HealBot_Action_HealUnit" .. index);
|
||||
if not button then return nil end
|
||||
button.unit = unit;
|
||||
if unit then
|
||||
table.insert(HealBot_Action_HealButtons, button);
|
||||
@@ -466,10 +467,7 @@ function HealBot_Action_PartyChanged()
|
||||
local checked_end = 0;
|
||||
headerno = 0;
|
||||
|
||||
for j = 1, 41 do
|
||||
HealBot_Action_SetHealButton(j, nil);
|
||||
end
|
||||
for j = 51, 60 do
|
||||
for j = 1, 100 do
|
||||
HealBot_Action_SetHealButton(j, nil);
|
||||
end
|
||||
HealBot_Action_SetHealButton();
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
import re
|
||||
|
||||
with open('HealBot_Action.xml', 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
buttons_42_50 = '\n'.join([f' <Button name=\"HealBot_Action_HealUnit{i}\" inherits=\"HealingButtonTemplate\" text=\"Unit not set\"/>' for i in range(42, 51)])
|
||||
buttons_61_100 = '\n'.join([f' <Button name=\"HealBot_Action_HealUnit{i}\" inherits=\"HealingButtonTemplate2\" text=\"Unit not set\"/>' for i in range(61, 101)])
|
||||
|
||||
content = re.sub(
|
||||
r'(<Button name=\"HealBot_Action_HealUnit41\" [^\>]+>\n)',
|
||||
r'\g<1>' + buttons_42_50 + '\n',
|
||||
content
|
||||
)
|
||||
|
||||
content = re.sub(
|
||||
r'(<Button name=\"HealBot_Action_HealUnit60\" [^\>]+>\n)',
|
||||
r'\g<1>' + buttons_61_100 + '\n',
|
||||
content
|
||||
)
|
||||
|
||||
with open('HealBot_Action.xml', 'w') as f:
|
||||
f.write(content)
|
||||
print('Updated HealBot_Action.xml')
|
||||
Reference in New Issue
Block a user