View Single Post
09-30-12, 11:57 PM   #2
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Epiphany17 View Post
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
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
  Reply With Quote