Thread Tools Display Modes
01-21-14, 09:45 AM   #1
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Hide frame on escape but not on control lost

I use UISpecialFrames to make my frames hide on escape. (and some other actions) I like this feature. What I don't like is how these frames also gets hidden on PLAYER_CONTROL_LOST. Normally this is annoying. When it closes my whisper frame while I'm in the middle of typing a message, which then gets lost, it's completely retarded. Is there some neat way to fix this?

Looking at the code, I could probably do without it closing on any of the non hardware driven events, such as player dead, entering world.

Actually I might just unregister the event on the UIParent. That won't cause taint, will it? All it does apart from closing all windows is setting UIParent.isOutOfControl = 1, which doesn't seem to be used anywhere.

Would still like to work around the other events if possible. Entering world I could probably do something with leaving world. Not sure about player dead. There's no such thing as getCurrentEvent() is there? How about get current hardware event? I know about GetMouseButtonClicked, but that won't cover escape, obviously.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
01-21-14, 10:18 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Unregistering the event won't cause taint. As far as I know registering an event won't either, so if you only want to temporarily disable it while the edit box is shown you should be able to do that.
  Reply With Quote
01-21-14, 10:38 AM   #3
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Code:
<Frame name="UIParent" setAllPoints="true" protected="true" frameStrata="MEDIUM">
I'm not very familar with this, but doesn't protected="true" basically mean that calling UIParent:UnregisterEvent() out of tainted code will cause taint?
  Reply With Quote
01-21-14, 07:22 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Duugu View Post
I'm not very familar with this, but doesn't protected="true" basically mean that calling UIParent:UnregisterEvent() out of tainted code will cause taint?
No; unregistering an event on a secure frame does not taint the frame. Every unitframe addon in existence unregistered UNIT_NAME_UPDATE on their secure group headers before Blizzard broke automated title-swapping, and they still unregister events and do other stuff to the Blizzard uniframes to hide them, all of which can be un-done by re-registering the events and the Blizzard frames will return to working normally without any taint complaints.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Hide frame on escape but not on control lost

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