Quantcast Click-through frames over SecureUnitButtons possible? - WoWInterface
 
Thread Tools Display Modes
12-29-10, 06:29 AM   #1
Iza
A Cyclonian
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 43
Click-through frames over SecureUnitButtons possible?

Hi,
I'm currently trying to provide tooltips for custom debuff icons in VuhDo and I'm having a slight issue:

In order to have "OnEnter"/"OnLeave" functionality I need to make them "Frames", not just a "Texture". So tooltips now show with no problem.
The problem is that these icon frames are overlaying my "SecureUnitButton" and they are eating mouse clicks if I click on the icons (though I have set enableMouse="false").
What I'd like to have is onenter/onleave but mouse clicks being passed to the UnitButton below.
I had a look into how Blizz does this in their raid frames (actually they set OnClick to function "PassToParent") but this is not possible for custom addons (= tainted execution path).

I could possibly make all debuff icons "SecureUnitButtons" themselves and set spells up the same regular buttons, but I think this would be overkill in terms of memory and cpu usage.

Any suggestion highly appreciated, thanks in advance,
Iza
  Reply With Quote
12-29-10, 07:21 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,257
I don't know of any way to get OnEnter|Leave for mouse disabled frames.

You might be able to fake it with checking region:IsMouseOver() for your debuff icons.
(on a generous timer or similar workaround)

Edit2:
If I tried to do something like that I would probably use a timer frame with a relatively slow refresh
(say 0.2 that seems to be a favorite with Blizzard).
Then have the OnShow() for each debuff icon add the frame to a registry and OnHide() remove it.
Every 0.2 loop my registry and check if mouse is over an icon and show/hide tooltip accordingly.
If no frames, hide my timer frame.
Not sure about processing cost but I don't think it would be too high.

Last edited by Dridzt : 12-29-10 at 07:34 AM. Reason: link added
  Reply With Quote
12-29-10, 07:39 AM   #3
Iza
A Cyclonian
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 43
Thank you very much, this really sounds promising.
  Reply With Quote
12-29-10, 06:41 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,703
I'm curious - why aren't you using OnEnter and OnLeave on your buttons?

button:SetScript("OnEnter", dostuff)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-30-10, 04:26 AM   #5
Iza
A Cyclonian
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 43
Oh, I'm actually using onenter/onleave for my buttons and for the icons as well. I just wanted to avoid making all the icons "SecureUnitButtons" themselves, but as soon as I make my icons frames they'll consume mouse clicks preventing the underlying SecureUnitButtons from reacting.
  Reply With Quote
12-30-10, 02:28 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,703
I'm still confused on what you're trying to do and why you're not just using the buttons for this.

/edit: I reread your OP. You have icons for debuffs as indicator type things over your unit frame basically? And you want tooltips for these icons so people can see what the debuffs are. What you should do is just add the debuff names to the tooltip of the unit, as a list.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Click-through frames over SecureUnitButtons possible?

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