Quantcast What's merit of using "CooldownFrameTemplate" over "AuraButtonTemplate" for auras? - WoWInterface
Thread Tools Display Modes
08-10-16, 08:53 AM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 356
What's merit of using "CooldownFrameTemplate" over "AuraButtonTemplate" for auras?

Hi all,

So, this question would be an extension from my previous thread here.

If there's such issue (well... can't be said as an issue if that's what "CooldownFrameTemplate" is meant to be doing as lightspark says, but I mean in this case), why does oUF utilizes "CooldownFrameTemplate" for auras element rather than "AuraButtonTemplate" or "BuffButtonTemplate"/"DebuffButtonTemplate"?

To be honest, it is not just oUF. Raven also utilizes "CooldownFrameTemplate", as well as the custom buff frame tutorial that I have seen.

Why would all these addons/libraries utilize "CooldownFrameTemplate" with Cooldown frame over "AuraButtonTemplate"?

Last edited by Layback_ : 08-10-16 at 08:56 AM.
  Reply With Quote
08-10-16, 09:44 AM   #2
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 328
Cuz it's used for cooldown frames, duh...

Cooldown spiral is a frame, it doesn't magically appear out of nowhere, you have to create it via CreateFrame("Cooldown"), and it has to inherit CooldownFrameTemplate to work properly.

AuraButtonTemplate is a virtual Button that has Icon, Count and Duration regions, it has no cooldown spiral. Why would anyone want to use it? O_o Even if one used it, one would have to reset all points, sizes, etc. That's a waste of time and resources.
__________________

Last edited by lightspark : 08-10-16 at 09:49 AM.
  Reply With Quote
08-10-16, 12:39 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
To add to that, oUF doesn't just use CooldownFrameTemplate -- each aura icon is a button object with a texture region (for the icon image), a font string (for the count text), etc. in addition to a cooldown child object (which is what inherits from the CooldownFrameTemplate).

Auras (table) -- oUF element
    [1] (object: Frame > Button) -- an individual aura icon
        cd (object: Frame > Cooldown) -- the cooldown spiral
        icon (object: Region > Texture) -- the (de)buff's icon image
        count (object: Region > FontString) -- text showing the number of stacks
        overlay (object: Region > Texture) -- a border image colored by dispel type, if enabled
        stealable (object: Region > Texture) -- a border image shown if the buff can be stolen
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
08-10-16, 06:53 PM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
Originally Posted by lightspark View Post
...and it has to inherit CooldownFrameTemplate to work properly.
AFAIK that is not true, it's only required to use the swipe, edge and bling textures (or rather to simplify the creation), none of which oUF uses by default (and shouldn't as all those features are normally used for action cooldowns on something like an action bar).

Last edited by p3lim : 08-10-16 at 06:56 PM.
  Reply With Quote
08-10-16, 07:53 PM   #5
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 328
Originally Posted by p3lim View Post
AFAIK that is not true, it's only required to use the swipe, edge and bling textures (or rather to simplify the creation), none of which oUF uses by default (and shouldn't as all those features are normally used for action cooldowns on something like an action bar).
Well, it's sorta required, cuz you either use it, or create those regions manually. At least swipe has to be there, otherwise you'll see no CD spiral.

But yeah, it probably was a poor choice of words, was too lazy to go into detail.
__________________

Last edited by lightspark : 08-10-16 at 07:56 PM.
  Reply With Quote
08-10-16, 08:03 PM   #6
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 356
Originally Posted by lightspark View Post
Cuz it's used for cooldown frames, duh...

Cooldown spiral is a frame, it doesn't magically appear out of nowhere, you have to create it via CreateFrame("Cooldown"), and it has to inherit CooldownFrameTemplate to work properly.

AuraButtonTemplate is a virtual Button that has Icon, Count and Duration regions, it has no cooldown spiral. Why would anyone want to use it? O_o Even if one used it, one would have to reset all points, sizes, etc. That's a waste of time and resources.
I'm aware of that Cooldown frame needs to inherit CooldownFrameTemplate to function properly and was slightly guessing that they would use it because of spiral thing, but thank you for confirmation.

Additionally, I tried to deal with the concern that I had as you advised, but after I found that the raven resolves that matter I'm still eager to fix this. Thus I had a close look at raven's code as well as its saved variables, but with my lack of skills, can't figure out where it actually does a trick...
(I only found that it; 1. calls SetCooldown function on every update 2. saves duration of aura inside its saved variable)

I might have to ask the author of Raven for an idea if he is not fussed with helping me

Originally Posted by Phanx View Post
To add to that, oUF doesn't just use CooldownFrameTemplate -- each aura icon is a button object with a texture region (for the icon image), a font string (for the count text), etc. in addition to a cooldown child object (which is what inherits from the CooldownFrameTemplate).

Auras (table) -- oUF element
    [1] (object: Frame > Button) -- an individual aura icon
        cd (object: Frame > Cooldown) -- the cooldown spiral
        icon (object: Region > Texture) -- the (de)buff's icon image
        count (object: Region > FontString) -- text showing the number of stacks
        overlay (object: Region > Texture) -- a border image colored by dispel type, if enabled
        stealable (object: Region > Texture) -- a border image shown if the buff can be stolen
Ah... yeah you are totally right.

I was so tired when I posted this thread and forgot that Cooldown frame is just a part of Button frame

Thank you for reminding me!
  Reply With Quote
08-10-16, 08:07 PM   #7
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 328
Originally Posted by Layback_ View Post
I only found that it; 1. calls SetCooldown function on every update 2. saves duration of aura inside its saved variable
Does it really bother you that much? O_o

I mean, I understand why Raven does it, cuz it's dedicated aura tracking addon, it's often used in PvP, so having precise timers even after UI reload might be important.

TBH, I think it's no biggie. But that's just my opinion on this matter, it's your time and you decide how to use it.
__________________

Last edited by lightspark : 08-10-16 at 08:22 PM.
  Reply With Quote
08-10-16, 08:27 PM   #8
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
Originally Posted by lightspark View Post
Well, it's sorta required, cuz you either use it, or create those regions manually. At least swipe has to be there, otherwise you'll see no CD spiral.

But yeah, it probably was a poor choice of words, was too lazy to go into detail.
Edit: True, but if you use CooldownFrame_Set as opposed to :SetCooldown it still works, hrm..

Last edited by p3lim : 08-10-16 at 08:31 PM.
  Reply With Quote
08-11-16, 08:43 PM   #9
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 356
Originally Posted by lightspark View Post
Does it really bother you that much? O_o

I mean, I understand why Raven does it, cuz it's dedicated aura tracking addon, it's often used in PvP, so having precise timers even after UI reload might be important.

TBH, I think it's no biggie. But that's just my opinion on this matter, it's your time and you decide how to use it.
Like I said, I tried to deal with it as you are more professional(?) than I am in this area, but to be honest, it annoys me super hard

Last edited by Layback_ : 08-11-16 at 08:50 PM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » What's merit of using "CooldownFrameTemplate" over "AuraButtonTemplate" for auras?

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