WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Widget API for castbar (https://www.wowinterface.com/forums/showthread.php?t=49790)

MaLarsson 08-24-14 12:39 PM

Widget API for castbar
 
I want to create a bar which shows how long the remaining time of a dot is.
I was thinking that you could use the blizzard castbar and pretend that the remaning time is a channeling spell.
What widget should I use for a castbar?
The one that stood out to me was StatusBar but it didn't have a method for setting remaning time like the cooldown widget has with Cooldown:SetCooldown(start, duration).
Is there a better widget to use for the castbar or do I manually need to update the duration of the StatusBar with StatusBar:SetValue(value)?

Cybeloras 08-24-14 12:59 PM

Quote:

Originally Posted by MaLarsson (Post 295916)
Is there a better widget to use for the castbar

No, StatusBar is what you want (unless you want to create your own from scratch using a frame and some textures, which would be overkill for your use case).

Quote:

Originally Posted by MaLarsson (Post 295916)
do I manually need to update the duration of the StatusBar with StatusBar:SetValue(value)?

Yes. Use StatusBar:SetMinMaxValues(min, max) to set the duration of the effect (min should be 0, max should be the length of the DoT). And then use StatusBar:SetValue(value) in the frame's OnUpdate handler to set how many seconds have passed since the DoT was applied.

MaLarsson 08-24-14 01:13 PM

Thanks, I'll give it a try tomorrow! :)


All times are GMT -6. The time now is 02:05 AM.

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