mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-07-27 01:34:44 +00:00
Added pet frames support
This commit is contained in:
+63
-3
@@ -495,7 +495,7 @@ function HealBot_Action_PartyChanged()
|
||||
numBars = numBars + 1;
|
||||
numHeaders = numHeaders + 1;
|
||||
end
|
||||
if HealBot_Config.EmergIncMonitor == 1 then
|
||||
if HealBot_Config.EmergIncMonitor == 2 then
|
||||
if GetNumRaidMembers() > 0 then
|
||||
for j = 1, 40 do
|
||||
local PossibleEmerg = 1;
|
||||
@@ -543,6 +543,50 @@ 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
|
||||
@@ -606,10 +650,26 @@ function HealBot_Action_PartyChanged()
|
||||
local TempSort = "init"
|
||||
TempMaxH = math.ceil(TempMaxH / 1000) * 1000;
|
||||
|
||||
if GetNumRaidMembers() > 0 then
|
||||
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 = GetRaidRosterInfo(string.sub(units[j], 5));
|
||||
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
|
||||
|
||||
if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin] == 1 and HealBot_Config.ExtraOrder == 2 and TempSort ~= class then
|
||||
TempSort = class
|
||||
HeaderPos[i + 1] = class
|
||||
|
||||
Reference in New Issue
Block a user