• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom cooldown model as UI sprite

Status
Not open for further replies.

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
So I was tinkering around with UI natives to create a custom ability bar and good quite far. But I'm having some trouble implementing a cooldown clock on top of the ability icon.

So far, I've found a way to display the cooldown clock model from UI\\Feedback\\Cooldown\\UI-Cooldown-Indicator.mdl
I then found out I can use call BlzFrameSetSpriteAnimate(model, 2, 0) to play the clock animation on the model and call BlzFrameSetSpriteAnimate(model, 1, 0) to play the shiny glow once the cooldown finishes.

But I can't figure out how to change the time scale of the animation. Something like SetUnitTimeScale() doesn't exist for the UI sprite native.

Any ideas or workarounds?
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Support for UI models isn't very good. Only certain animations work, you don't have control over timescale, you can't rotate them, they don't support attachments, etc..

I personally use the default command buttons which has cooldowns built in but you are limited to 12 buttons.
Id like more power over it so I implemented my own custom command buttons.

I did apply a workaround now by simply editing the cooldown model to provide multiple animations with different rotation speeds that i trigger via SpriteAnimate.
 
Status
Not open for further replies.
Top