WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   KG Panels script help (https://www.wowinterface.com/forums/showthread.php?t=56090)

Mikaile676 03-12-18 03:20 PM

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

Seerah 03-12-18 03:21 PM

Add a self:Hide() to your OnLoad script.

Mikaile676 03-12-18 03:48 PM

Thanks, you put me on the right track, I had to put in "self:SetAlpha(0)" in the OnLoad script.

Seerah 03-13-18 12:48 PM

Ah, yes. Since you're merely changing the alpha and not actually hiding/showing the panel.


All times are GMT -6. The time now is 10:31 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI