View Single Post
07-09-09, 11:20 PM   #7
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
Just to experiment i did it both ways and they hide in both versions. What i did change however is in each panel i only had it hide itself

simply
self:Hide() and that worked just fine. having a panel name or number was causing issues. the numbers changed each time i did a /reloadui so that wasnt going to work. and the names kept throwing errors.

What i ended up with after much fussing and trying to learn what the hell was going on ( as well as learing a little bit anout the local tyhingy at the beginning) i have this:

Code:
local inRaid = UnitInRaid("player")
local inParty = UnitInParty("player")

if inRaid and GetNumRaidMembers() < 11 then
      self:Show()
   -- in 10 man raid
elseif inRaid and GetNumRaidMembers() > 10 then
      self:Hide()
   -- in 20 man raid
elseif inParty and GetNumPartyMembers() > 1 then
      self:Hide()
   -- in a 5 man party
end
and reversed the self:Hide() parameters for the first 2 bits and left them both hidden for party in the 25 man panel. Had the Mrs. join a raid with me and the 10 man panel showed up perfectly and disappeared when we left the raid. Havent tested it with 25 man yet.

For the OnLoad bit i just slapped in there what was on the wowace page with examples. No idea if its necessary ot not but here it is (be gentle im still learning hehe):
Code:
 self:RegisterEvent("PLAYER_ENTERING_WORLD")
 self:RegisterEvent("PARTY_MEMBERS_CHANGED")
 self:RegisterEvent("RAID_ROSTER_UPDATE")

-- Hide panel
self:Hide()
This is in the OnLoad for both panels and so far no errors. Though if anything i have is unnecessary or likely to be a potential source of problems im always up for learning more.

As always thanks for the help. =)
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote