Quantcast
WoWInterface - View Single Post - A little script help for kgpanels
View Single Post
07-09-09, 11:07 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,765
Originally Posted by Katae View Post
If that were done, it wouldn't hide PANEL1 when showing PANEL2, which is desired. Could be written other ways, but the Hide()/Show() happens so fast you shouldn't notice at all anyway.
Ah, yes, you are right. I guess I only skimmed the code. But you want to hide them in OnLoad, or else they'll both be shown when you log in, until the event fires.

Put

PANEL1:Hide()
PANEL2:Hide()

in OnLoad and the OnEvent should be:

Code:
local party, mode = GetNumPartyMembers(), GetCurrentDungeonDifficulty()

-- 10 man normal mode
if party > 5 and mode == 1 then
    PANEL1:Show()
    PANEL2:Hide()

-- 25 man heroic mode
elseif party > 10 and mode >= 2 then
    PANEL2:Show()
    PANEL1:Hide()
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