View Single Post
07-17-12, 05:25 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by kaels View Post
At a minimum, you will have to create the aura frames using a secure template. If you're not using a secure template, you can't execute protected functions like targeting. Making each of them with SecureUnitButtonTemplate would be simplest for targeting if you're just doing a few static indicators, but I think you need to use SecureAuraHeaderTemplate if you want the whole collection of auras to show/hide/sort properly. You then lose filtering capability.
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? :/

Originally Posted by kaels View Post
And I haven't gotten around to my auras in oUF yet, so i don't know if it's even possible to do them with secure frames. You might need to write your own module.
You would need to write it yourself.

Originally Posted by kaels View Post
There's an alternative approach, where you layer your auras under an array of (transparent) mouse-interactive secure unit frames, and you code each of the unit frames to display the tooltip for the aura underneath it. That would be horribly messy but you'd be able to retain sorting/filtering/etc.
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.
__________________
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