Reply
Thread Tools Display Modes
Unread 10-22-10, 01:29 AM   #1
lurelure
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 12
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
lurelure is offline   Reply With Quote
Unread 10-22-10, 01:53 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
You can call objectisable(), 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)
__________________
「貴方は1人じゃないよ」
haste is online now   Reply With Quote
Unread 10-22-10, 06:54 AM   #3
Zilver
Premium Member
 
Zilver's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 29
Originally Posted by haste View Post
You can call objectisable(), 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()
Zilver is offline   Reply With Quote
Unread 10-22-10, 07:04 AM   #4
lurelure
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 12
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.
lurelure is offline   Reply With Quote
Unread 10-22-10, 07:10 AM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 982
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)
__________________
「貴方は1人じゃないよ」
haste is online now   Reply With Quote
Reply

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Show/hide frames on the fly (no reload)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off