WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   What's merit of using "CooldownFrameTemplate" over "AuraButtonTemplate" for auras? (https://www.wowinterface.com/forums/showthread.php?t=54182)

Layback_ 08-10-16 08:53 AM

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"?

lightspark 08-10-16 09:44 AM

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.

Phanx 08-10-16 12:39 PM

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

p3lim 08-10-16 06:53 PM

Quote:

Originally Posted by lightspark (Post 317764)
...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).

lightspark 08-10-16 07:53 PM

Quote:

Originally Posted by p3lim (Post 317782)
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.

Layback_ 08-10-16 08:03 PM

Quote:

Originally Posted by lightspark (Post 317764)
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 :confused:

Quote:

Originally Posted by Phanx (Post 317768)
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 :p

Thank you for reminding me!

lightspark 08-10-16 08:07 PM

Quote:

Originally Posted by Layback_ (Post 317784)
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.

p3lim 08-10-16 08:27 PM

Quote:

Originally Posted by lightspark (Post 317783)
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..

Layback_ 08-11-16 08:43 PM

Quote:

Originally Posted by lightspark (Post 317785)
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 :(


All times are GMT -6. The time now is 06:52 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI