View Single Post
07-10-09, 09:26 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote