Quantcast KG Panels script help - WoWInterface
Thread Tools Display Modes
03-12-18, 03:20 PM   #1
Mikaile676
A Murloc Raider
Join Date: Sep 2014
Posts: 4
KG Panels script help

Hey, I have a panel created in KG Panels that I would like to show on combat and hide when out of combat.

So far I have:

OnLoad: self:RegisterEvent("PLAYER_REGEN_ENABLED")
self:RegisterEvent("PLAYER_REGEN_DISABLED")

OnEvent: if event == "PLAYER_REGEN_DISABLED" then
self:SetAlpha(1)
else
self:SetAlpha(0)
end


It works fine but when I first load in the panels are showing until I enter combat and then leave. Is there anyway to get these to automatically hide straight up and then show when i enter combat?

Thanks
  Reply With Quote
03-12-18, 03:21 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,527
Add a self:Hide() to your OnLoad script.
__________________
"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
03-12-18, 03:48 PM   #3
Mikaile676
A Murloc Raider
Join Date: Sep 2014
Posts: 4
Thanks, you put me on the right track, I had to put in "self:SetAlpha(0)" in the OnLoad script.
  Reply With Quote
03-13-18, 12:48 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,527
Ah, yes. Since you're merely changing the alpha and not actually hiding/showing the panel.
__________________
"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 » KG Panels script help

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