WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Show/hide frames on the fly (no reload) (https://www.wowinterface.com/forums/showthread.php?t=36110)

lurelure 10-22-10 01:29 AM

Show/hide frames on the fly (no reload)
 
Is it possoble to show or hide frames without reloading the ui? I'm trying to make ingame options that work straight away, but i'm having some trouble with this. I've tried
Code:

oUF_pet:Hide()
etc, but it only hides for a split second, then appears again. I'm aware i can just avoid spawning it, but then i can't alter visibility on the fly :)

haste 10-22-10 01:53 AM

You can call object:Disable(), if you aren't in combat. This will disable events and hide the frame. This is on single frames.

headers are slightly worse to deal with however. You have to call RegisterAttributeDriver(header, 'state-visibility', nil) and probably header:Hide(). The registerattributedriver is only needed if you are using the visibility argument.

(sent from my phone)

Zilver 10-22-10 06:54 AM

Quote:

Originally Posted by haste (Post 213230)
You can call object:Disable(), if you aren't in combat. This will disable events and hide the frame. This is on single frames.

headers are slightly worse to deal with however. You have to call RegisterAttributeDriver(header, 'state-visibility', nil) and probably header:Hide(). The registerattributedriver is only needed if you are using the visibility argument.

(sent from my phone)

That ended up nice ;)
For those that don't know what the smiley means:
Code:

object:Disable()

lurelure 10-22-10 07:04 AM

Thanks!

Disable() worked like a charm.

Regarding the headers, I just used
Code:

raidgroup:SetAttribute("showParty", value)
raidgroup:SetAttribute("showRaid", value)

etc, on the individual headers.

I had no need to hide specific raid members, so that was sufficent.

haste 10-22-10 07:10 AM

Yeah, that will work fine as well :). The main difference is that registerattributedriver will continue to update the header visibility with your solution.

The difference isn't noticeable however.

(sent from my phone)


All times are GMT -6. The time now is 07:34 PM.

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