Thread Tools Display Modes
07-09-09, 02:26 PM   #1
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
A little script help for kgpanels

Ok so heres the deal. For my raid healing ui i have 2 panels created for kgpanels. one for 10 and one for 25. The thing is i want the proper panels to show up based on the number of people i have in the raid.

I tired to work out the sample scripts on the page containing them over at wowace but im having the hardest time getting it to work. (translation i suck at anything pertaining to code)

In short:

In a 10 man raid id like panel 1 to show and panel 2 to hide. And the reverse to happen when in a 25 (1 to hide and 2 to show) and both hidden if im in a 5 man.

Any assistance would be appreciated.
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote
07-09-09, 03:16 PM   #2
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Code:
local party, mode = GetNumPartyMembers(), GetCurrentDungeonDifficulty()

-- hide both
PANEL1:Hide()
PANEL2:Hide()

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

-- 25 man heroic mode
elseif party > 10 and mode >= 2 then
    PANEL2:Show()
end
Drycoded, but hope it helps

Last edited by Katae : 07-09-09 at 03:46 PM.
  Reply With Quote
07-09-09, 04:57 PM   #3
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
Thanks for the help. ill give it a test run and let you know =)
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote
07-09-09, 09:06 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Take those two Hide() lines and move them into the OnLoad section of your scripts (where you register for the events).
__________________
"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
07-09-09, 10:14 PM   #5
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Seerah View Post
Take those two Hide() lines and move them into the OnLoad section of your scripts (where you register for the events).
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.
  Reply With Quote
07-09-09, 11:07 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » A little script help for kgpanels

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off