Originally Posted by Phanx
Yeah, secure auras are useless on a unit frame IMO... who wants to see 40 tiny icons for mostly-irrelevant buffs in the middle of the screen? :/
You would need to write it yourself.
This would entail enabling an OnUpdate when OnEnter fired for the frame, and inside the OnUpdate, check the cursor position, calculate which aura icon slot (if any) the cursor was in, figure out which aura (if any) was shown in the slot, and show the tooltip if an aura was found there.
It would also mean that if you wanted your frame to have a visible backdrop, you'd need to create a separate frame to apply SetBackdrop to, since otherwise your backdrop would extend behind the auras, too.
Finally, this would mean you'd have a sizable region that was clickable as part of the unit frame, even though it was completely invisible because you didn't currently have 40 buffs (or however many you want to show).
All in all, I wouldn't recommend it. Unit frames should be limited to only displaying auras that are acutally important, and you should be able to recognize important auras by their icon, so tooltips are not really needed. If someone wants to see all of their buffs by their unit frame, they can install a custom buff addon and place it there themselves.
|
Well, my thought was that you can create as many secure frames as you like. So you'd have a layered structure:
1) Your normal unit frame, however you want to draw it
2) Your auras
3) An array of invisible secure frames with the same size/spacing as the auras, whose entire purpose in life is:
a) Relay clicks to the actual unit frame (you could wrap their OnClick to do this, to avoid messing with Clique)
b) Figure out which aura is under them and display its tooltip on mouseover (this is cosmetic, so you don't need to use secure code, so you can get information from the aura frames about their current position).
It would involve a
lot of frames, obviously. You'd probably want to cap the number of displayed auras pretty low if you're doing this for a lot of units, but that really only applies to raidframes, and you don't want to display a whole ton of auras on raid frames anyway. But it would work acceptably well if you just wanted to show, say, up to 4 debuffs.
If you're doing it indicator-style (one aura displayed at a time per indicator, no moving/reanchoring), then it's even easier, because your clickable mini-frames can
be your indicators, and then you don't even have to go fishing around trying to find where other frames are to decide which tooltip to show.
And obviously you don't want to do this for auras that are displayed outside the normally visible/clickable area of your unit frame. I was assuming the OP wanted to relay clicks for auras displayed on top of unit frames (e.g. for raid debuffs) - it's something I want to do as well, because as a healer I like to have tooltips for debuffs I don't recognize, but I also like not having to avoid the debuff area when I'm actually trying to heal/dispel the unit.