WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Click-through frames over SecureUnitButtons possible? (https://www.wowinterface.com/forums/showthread.php?t=37984)

Iza 12-29-10 06:29 AM

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

Dridzt 12-29-10 07:21 AM

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.

Iza 12-29-10 07:39 AM

Thank you very much, this really sounds promising.

Seerah 12-29-10 06:41 PM

I'm curious - why aren't you using OnEnter and OnLeave on your buttons?

button:SetScript("OnEnter", dostuff)

Iza 12-30-10 04:26 AM

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.

Seerah 12-30-10 02:28 PM

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.


All times are GMT -6. The time now is 01:43 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI