feat: split Raid and Pet toggles and simplify raid bars filter options

This commit is contained in:
Bluewhale1337
2026-08-05 22:02:53 +02:00
parent 2ab7a93a6e
commit 45ce2a024f
6 changed files with 94 additions and 103 deletions
+61 -65
View File
@@ -602,7 +602,7 @@ function HealBot_Action_PartyChanged()
numBars = numBars + 1;
numHeaders = numHeaders + 1;
end
if HealBot_Config.EmergIncMonitor == 2 then
if HealBot_Config.EmergIncMonitor == 1 then
if GetNumRaidMembers() > 0 then
for j = 1, 40 do
local PossibleEmerg = 1;
@@ -653,50 +653,7 @@ function HealBot_Action_PartyChanged()
end
end
end
elseif HealBot_Config.EmergIncMonitor == 12 then
if GetNumRaidMembers() > 0 then
for j = 1, 40 do
local unit = "raidpet" .. j;
if not HealBot_Action_UnitButtons[unit] and HealBot_MayHeal(unit) then
local ownerIndex = j;
local name = UnitName(unit) or "Pet";
local _, _, subgroup = GetRaidRosterInfo(ownerIndex);
subgroup = subgroup or 1;
if HealBot_Config.ExtraOrder == 1 then
order[unit] = name;
elseif HealBot_Config.ExtraOrder == 2 then
order[unit] = HEALBOT_OPTIONS_PETS;
elseif HealBot_Config.ExtraOrder == 3 then
order[unit] = subgroup;
else
order[unit] = 0 - UnitHealthMax(unit);
if UnitHealthMax(unit) > TempMaxH then TempMaxH = UnitHealthMax(unit); end
end
table.insert(units, unit);
numBars = numBars + 1;
end
end
else
local petUnits = { "pet", "partypet1", "partypet2", "partypet3", "partypet4" };
for _, unit in ipairs(petUnits) do
if not HealBot_Action_UnitButtons[unit] and HealBot_MayHeal(unit) then
local name = UnitName(unit) or "Pet";
if HealBot_Config.ExtraOrder == 1 then
order[unit] = name;
elseif HealBot_Config.ExtraOrder == 2 then
order[unit] = HEALBOT_OPTIONS_PETS;
elseif HealBot_Config.ExtraOrder == 3 then
order[unit] = 1;
else
order[unit] = 0 - UnitHealthMax(unit);
if UnitHealthMax(unit) > TempMaxH then TempMaxH = UnitHealthMax(unit); end
end
table.insert(units, unit);
numBars = numBars + 1;
end
end
end
else
if GetNumRaidMembers() > 0 then
for j = 1, 40 do
@@ -763,25 +720,29 @@ function HealBot_Action_PartyChanged()
local TempSort = "init"
TempMaxH = math.ceil(TempMaxH / 1000) * 1000;
if GetNumRaidMembers() > 0 or HealBot_Config.EmergIncMonitor == 12 then
for j = 1, 40 do
if not units[j] then break end
local name, rank, subgroup, level, class, fileName, zone, online, isDead;
local ownerIndex = nil;
if string.sub(units[j], 1, 7) == "raidpet" then
ownerIndex = tonumber(string.sub(units[j], 8));
elseif string.sub(units[j], 1, 4) == "raid" then
ownerIndex = tonumber(string.sub(units[j], 5));
end
if ownerIndex then
name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(ownerIndex);
end
if string.sub(units[j], 1, 7) == "raidpet" or string.sub(units[j], 1, 8) == "partypet" or units[j] == "pet" then
name = UnitName(units[j]) or "Pet";
class = HEALBOT_OPTIONS_PETS;
subgroup = subgroup or 1;
end
for j = 1, 40 do
if not units[j] then break end
local name, rank, subgroup, level, class, fileName, zone, online, isDead;
local ownerIndex = nil;
if string.sub(units[j], 1, 7) == "raidpet" then
ownerIndex = tonumber(string.sub(units[j], 8));
elseif string.sub(units[j], 1, 4) == "raid" then
ownerIndex = tonumber(string.sub(units[j], 5));
end
if ownerIndex then
name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(ownerIndex);
else
name = UnitName(units[j]) or "not known";
class = UnitClass(units[j]) or "not known";
subgroup = 1;
end
if string.sub(units[j], 1, 7) == "raidpet" or string.sub(units[j], 1, 8) == "partypet" or units[j] == "pet" then
name = UnitName(units[j]) or "Pet";
class = HEALBOT_OPTIONS_PETS;
subgroup = subgroup or 1;
end
if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 and HealBot_Config.ExtraOrder == 2 and TempSort ~= class then
TempSort = class
@@ -805,12 +766,47 @@ function HealBot_Action_PartyChanged()
HealBot_Action_SetHealButton(i, units[j]);
if i == last then break end
end
end
end
if numBars == ExtraValid + 1 and HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
HeaderPos[i + 1] = nil;
numBars = numBars - 1;
end
last = last + 40
local PetsValid = numBars;
if HealBot_Config.PetHeals == 1 then
if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
HeaderPos[i + 1] = HEALBOT_OPTIONS_PETHEALS
numBars = numBars + 1;
numHeaders = numHeaders + 1;
end
if GetNumRaidMembers() > 0 then
for j = 1, 40 do
local unit = "raidpet" .. j;
if not HealBot_Action_UnitButtons[unit] and HealBot_MayHeal(unit) then
i = i + 1;
HealBot_Action_SetHealButton(i, unit);
numBars = numBars + 1;
end
if i == last then break end
end
else
local petUnits = { "pet", "partypet1", "partypet2", "partypet3", "partypet4" };
for _, unit in ipairs(petUnits) do
if not HealBot_Action_UnitButtons[unit] and HealBot_MayHeal(unit) then
i = i + 1;
HealBot_Action_SetHealButton(i, unit);
numBars = numBars + 1;
end
if i == last then break end
end
end
end
if numBars == PetsValid + 1 and HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 then
HeaderPos[PetsValid + 1] = nil;
numBars = numBars - 1;
numHeaders = numHeaders - 1;
end
local bpadding = (HealBot_Config.bpadding and HealBot_Config.bpadding[HealBot_Config.Current_Skin]) or 10
local OffsetY = bpadding;