You can't do this in each panel though. You can only register an event once. Unless that was just a restriction of eePanels (or it has changed since kgPanels was first released...) In the kgPanels in-game FAQ is a way to get a reference to a panel so you can call multiple panels from one script. I
think it's
Code:
kgPanels:Fetch("the name you gave the panel when you made it")
So, pick one panel (probably best is the one with a higher panel number) and put the code in there. It'll make it easier to change later anyway, to have it all in one spot...
OnLoad:
Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PARTY_MEMBERS_CHANGED")
self:RegisterEvent("RAID_ROSTER_UPDATE")
local tenman = kgPanels:Fetch("thatpanel'sname")
local twentyfive = kgPanels:Fetch("thatone'sname")
-- Hide panels
tenman:Hide()
twentyfive:Hide()
OnEvent:
Code:
local inRaid = UnitInRaid("player")
local inParty = UnitInParty("player")
local tenman = kgPanels:Fetch("thatpanel'sname")
local twentyfive = kgPanels:Fetch("thatone'sname")
if inRaid and GetNumRaidMembers() < 11 then
tenman:Show()
twentyfive:Hide()
-- in 10 man raid
elseif inRaid and GetNumRaidMembers() > 10 then
tenman:Hide()
twentyfive:Show()
-- in 20 man raid
elseif inParty and GetNumPartyMembers() > 1 then
tenman:Hide()
twentyfive:Hide()
-- in a 5 man party
end