Originally Posted by Katae
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