WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Hiding Frames (party in this case) (https://www.wowinterface.com/forums/showthread.php?t=56957)

candrid 01-07-19 04:48 AM

Hiding Frames (party in this case)
 
Here is what I have so far:

lua Code:
  1. SLASH_PANE1 = "/pane"; -- creates the slash command to toggle the pane on and off.
  2. SlashCmdList.PANE = function(arg)
  3.   BottomPane:SetShown(not BottomPane:IsVisible())
  4.   PlayerFrame:SetShown(not PlayerFrame:IsVisible())
  5.   MinimapCluster:SetShown(not MinimapCluster:IsVisible())
  6. end

What I am trying to figure out is how to toggle, if you will the party frame when the /pane command is used.
I also tried working with hiding the UIParent, but then the pane would not show.

Any thoughts? Am I going the wrong way with this?

- Thanks!

Fizzlemizz 01-07-19 09:04 AM

Use IsShown() rather than IsVisible()

candrid 01-07-19 02:34 PM

Quote:

Originally Posted by Fizzlemizz (Post 331312)
Use IsShown() rather than IsVisible()

Would that include things like the party frame and actionbars?

Fizzlemizz 01-07-19 03:08 PM

Toggling the show state of secure frames like unit frames and action bars can be problematic because if you do it in combat you will get errors.

Normally you would register the condition(s) you want them shown/hidden using RegisterStateDriver() and let the game look after them, like:

Code:

RegisterStateDriver(PlayerFrame, "visibility", "[petbattle] hide; default")
To hide when entering a pet battle and show again when leaving.

candrid 01-07-19 05:42 PM

Hey, thanks!


All times are GMT -6. The time now is 06:29 AM.

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