WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   KgPanels Script Help (https://www.wowinterface.com/forums/showthread.php?t=44569)

Epiphany17 09-30-12 09:34 PM

KgPanels Script Help
 
Hullo there! I've finally found time to play again and I've begun my UI building project :P

I'm not sure if it's possible to do with a script, but I want a frame to hide when a unitframe is present. For instance, I want a frame that I have parented to the player frame to hide when there is a pet frame present.

I'm working with gradients and this would help immensely. I just have no idea how to do this :o

suicidalkatt 09-30-12 11:57 PM

Quote:

Originally Posted by Epiphany17 (Post 265471)
Hullo there! I've finally found time to play again and I've begun my UI building project :P

I'm not sure if it's possible to do with a script, but I want a frame to hide when a unitframe is present. For instance, I want a frame that I have parented to the player frame to hide when there is a pet frame present.

I'm working with gradients and this would help immensely. I just have no idea how to do this :o

An easy way to do this is just to make a function on the frame that's showing or hiding in its own "OnShow" and "OnHide".

For example:

"OnShow" --
Lua Code:
  1. local f = kgPanels:FetchFrame("framename") -- framename in this instance, would be the name of the kgpanel you want hiding
  2. if f then f:Hide() end

"OnHide" --
Lua Code:
  1. local f = kgPanels:FetchFrame("framename")
  2. if f then f:Show() end

Resike 01-06-13 03:38 PM

Pet Battle
 
If you want to hide a Texture while in a pet battle then this is gonna work.

OnLoad

self:RegisterEvent("PET_BATTLE_OPENING_START")
self:RegisterEvent("PET_BATTLE_CLOSE")

OnEvent

if event == "PET_BATTLE_OPENING_START" then
self:Hide()
elseif event == "PET_BATTLE_CLOSE" then
self:Show()
end


All times are GMT -6. The time now is 07:18 AM.

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