I found a bug in X-Perl. I e-mailed Zeksie about it 3 weeks ago, but he must be busy with other stuff. So I decided to dig in and try to fix it myself.
So, the bug... I have X-Perl set to keep the party frame up if I'm in a raid with only one group, such as arenas. I also have it set to show a separate raid group for pets when in a raid. Unfortunately, when playing an arena game with a hunter (with his pet out), I found that the raid interface would correctly stay hidden, but the extra group for pets would still show up.
From what I found, the setting to hide the raid interface if there's only one group in the raid is not taken into account when displaying the extra pet group. So I modified a couple of functions in XPerl_RaidPets\XPerl_RaidPets.lua by simply copying what Zeksie did for the rest of the raid interface.
I modified
-- XPerl_RaidPets_HideShow
function XPerl_RaidPets_HideShow()
local on = (GetNumRaidMembers() > 0 and rconf.enable)
local events = {"UNIT_HEALTH", "UNIT_MAXHEALTH", "UNIT_NAME_UPDATE", "UNIT_AURA"}
for i,event in pairs(events) do
if (on) then
XPerl_RaidPets_Frame:RegisterEvent(event)
else
XPerl_RaidPets_Frame:UnregisterEvent(event)
end
end
if (rconf.enable and GetNumRaidMembers() > 0) then
XPerl_RaidPets_Frame:Show()
XPerl_Raid_TitlePets:Show()
XPerl_Raid_GrpPets:Show()
else
XPerl_RaidPets_Frame:Hide()
XPerl_Raid_TitlePets:Hide()
XPerl_Raid_GrpPets:Hide()
end
end
with
-- XPerl_RaidPets_HideShow
function XPerl_RaidPets_HideShow()
local singleGroup
if (XPerl_Party_SingleGroup) then
if (conf.party.smallRaid) then
singleGroup = XPerl_Party_SingleGroup()
end
end
local on = (GetNumRaidMembers() > 0 and rconf.enable)
local events = {"UNIT_HEALTH", "UNIT_MAXHEALTH", "UNIT_NAME_UPDATE", "UNIT_AURA"}
for i,event in pairs(events) do
if (on) then
XPerl_RaidPets_Frame:RegisterEvent(event)
else
XPerl_RaidPets_Frame:UnregisterEvent(event)
end
end
if (rconf.enable and GetNumRaidMembers() > 0 and not singleGroup) then
XPerl_RaidPets_Frame:Show()
XPerl_Raid_TitlePets:Show()
XPerl_Raid_GrpPets:Show()
else
XPerl_RaidPets_Frame:Hide()
XPerl_Raid_TitlePets:Hide()
XPerl_Raid_GrpPets:Hide()
end
end
I also modified
-- XPerl_RaidPets_Titles
function XPerl_RaidPets_Titles()
if (rconf.hunter) then
if (rconf.warlock) then
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETS)
else
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETSHUNTER)
end
elseif (rconf.warlock) then
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETSWARLOCK)
end
local show
for i = 1,GetNumRaidMembers() do
local unitName, rank, group, level, _, unitClass = GetRaidRosterInfo(i)
if (unitClass == "HUNTER" or unitClass == "WARLOCK") then
show = true
break
end
end
if (XPerlLocked == 0 or (rconf.enable and show and conf.raid.titles)) then
XPerl_Raid_TitlePets.text:Show()
else
XPerl_Raid_TitlePets.text:Hide()
end
XPerl_ProtectedCall(XPerl_RaidPets_HideShow)
end
with
-- XPerl_RaidPets_Titles
function XPerl_RaidPets_Titles()
local singleGroup
if (XPerl_Party_SingleGroup) then
if (conf.party.smallRaid) then
singleGroup = XPerl_Party_SingleGroup()
end
end
if (rconf.hunter) then
if (rconf.warlock) then
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETS)
else
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETSHUNTER)
end
elseif (rconf.warlock) then
XPerl_Raid_TitlePets.text:SetText(XPERL_LOC_CLASS_PETSWARLOCK)
end
local show
for i = 1,GetNumRaidMembers() do
local unitName, rank, group, level, _, unitClass = GetRaidRosterInfo(i)
if (unitClass == "HUNTER" or unitClass == "WARLOCK") then
show = true
break
end
end
if (XPerlLocked == 0 or (rconf.enable and show and conf.raid.titles and not singleGroup)) then
XPerl_Raid_TitlePets.text:Show()
else
XPerl_Raid_TitlePets.text:Hide()
end
XPerl_ProtectedCall(XPerl_RaidPets_HideShow)
end
I grouped with a hunter who had his pet out, converted to raid and the pet group stayed hidden. I moved him to group 2, the raid interface appeared, with the extra pet group. I moved him back to group 1, the raid interface disappeared, including the extra pet group.
So as far as I can tell, it works. However, I haven't programmed anything in years, let alone anything to do with WoW/Lua. So I would very much appreciate it if someone more knowledgeable than I am could quickly check all that to make sure I didn't break anything.
Thanks in advance.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I found a bug in X-Perl. I e-mailed Zeksie about it 3 weeks ago, but he must be busy with other stuff. So I decided to dig in and try to fix it myself.
So, the bug... I have X-Perl set to keep the party frame up if I'm in a raid with only one group, such as arenas. I also have it set to show a separate raid group for pets when in a raid. Unfortunately, when playing an arena game with a hunter (with his pet out), I found that the raid interface would correctly stay hidden, but the extra group for pets would still show up.
From what I found, the setting to hide the raid interface if there's only one group in the raid is not taken into account when displaying the extra pet group. So I modified a couple of functions in XPerl_RaidPets\XPerl_RaidPets.lua by simply copying what Zeksie did for the rest of the raid interface.
I modified
with
I also modified
with
I grouped with a hunter who had his pet out, converted to raid and the pet group stayed hidden. I moved him to group 2, the raid interface appeared, with the extra pet group. I moved him back to group 1, the raid interface disappeared, including the extra pet group.
So as far as I can tell, it works. However, I haven't programmed anything in years, let alone anything to do with WoW/Lua. So I would very much appreciate it if someone more knowledgeable than I am could quickly check all that to make sure I didn't break anything.
Thanks in advance.