Download
(1Kb)
Download
Updated: 06-30-12 08:03 AM
Pictures
File Info
Updated:06-30-12 08:03 AM
Created:07-21-10 05:34 AM
Downloads:3,531
Favorites:11
MD5:

BuffTimers (for the default UI)

Version: 1.4
by: Vladinator [More]

HD preview of the countdown on Youtube:
http://www.youtube.com/watch?v=p9wXLLirGak

Got the idea from Telo's old BuffTimers and made my own based on the new code for 3.3.5. Tested and works fine, if bugs you can submit a comment and describe it in details (perhaps printscreen too?)

Enjoy!

1.4: Updated for MoP, mostly TOC bump update.

1.3: Updated for patch 4.1. Also using hooksecurefunc to avoid serious taint (may cost performance, do post if experiencing issues so I can revert this). In addition the timers will fade out to 50% when greater than 15 minutes duration, if you don't like it speak up on the comment section.

1.2: Checked and working fine with Cataclysm.

1.1: Updated time formatting function to use local variables rather than a hash table (performance).

1.0: Initial release.
Optional Files (0)


Post A Reply Comment Options
Unread 02-28-15, 01:48 PM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Re: Translucent change.

Originally Posted by Antaras
I'm glad that someone has been keeping this up! I do have a question tough, what line do I need to change so that all the numbers are not translucent at all? I find that when I look over the buffs I look harder to make sure the time is correct on the more translucent buffs.
You can open the BuffTimers.lua file and look at line 49, it says "d:SetAlpha(s > 900 and .5 or 1)" simply remove that line and it won't be opaque.
__________________
Profile: Curse | Wowhead
Report comment to moderator  
Reply With Quote
Unread 02-28-15, 01:32 PM  
Antaras
A Kobold Labourer
 
Antaras's Avatar

Forum posts: 0
File comments: 19
Uploads: 0
Translucent change.

I'm glad that someone has been keeping this up! I do have a question tough, what line do I need to change so that all the numbers are not translucent at all? I find that when I look over the buffs I look harder to make sure the time is correct on the more translucent buffs.
Report comment to moderator  
Reply With Quote
Unread 04-07-12, 02:51 PM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Totally fine, don't worry.
Report comment to moderator  
Reply With Quote
Unread 04-07-12, 10:49 AM  
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view AddOns

Forum posts: 583
File comments: 438
Uploads: 22
Don't mind if I use the code from this addon in my UI pack do ya?
__________________
Tweets YouTube Website
Report comment to moderator  
Reply With Quote
Unread 01-13-12, 08:06 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
fixed it even better

LUA Code:
  1. llocal TimeLeft
  2. do
  3.     local d, h, m
  4.     TimeLeft = function(s)
  5.         d, h, m = 0, 0, 0
  6.         if s >= 86400 then
  7.             d = s/86400
  8.             s = s%86400
  9.         end
  10.         if s >= 3600 then
  11.             h = s/3600
  12.             s = s%3600
  13.         end
  14.         if s >= 60 then
  15.             m = s/60
  16.             s = s%60
  17.         end
  18.         if d > 0 then
  19.             return format("%.2d:%.2d", d, h)
  20.         elseif h > 0 then
  21.             return format("%.2d:%.2d", h, m)
  22.         elseif m > 0 then
  23.             return format("%.2d:%.2d", m, s)
  24.         else
  25.             if s < 8 then
  26.                 return format("%.1f", s)
  27.             else
  28.                 return format("%d", s)
  29.             end
  30.         end
  31.         return ""
  32.     end
  33. end
  34.  
  35. hooksecurefunc("AuraButton_UpdateDuration", function(f, s)
  36.     local d = f.duration
  37.     if d then
  38.         d:SetText(TimeLeft(s))
  39.         if ( 8 > s ) then
  40.             d:SetVertexColor(1, 0, 0)
  41.         elseif ( 60 > s) then
  42.             d:SetVertexColor(1, 0.82, 0)
  43.         else
  44.             d:SetVertexColor(1, 1, 1)
  45.         end
  46.     end
  47. end)



Uploaded with ImageShack.us
Last edited by Aftermathhqt : 01-13-12 at 08:20 AM.
Report comment to moderator  
Reply With Quote
Unread 01-11-12, 10:00 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
Originally Posted by Vladinator
Sorry for leaving you hanging, glad you found a way to work it out.
Np man.
Report comment to moderator  
Reply With Quote
Unread 01-11-12, 09:01 AM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Sorry for leaving you hanging, glad you found a way to work it out.
Report comment to moderator  
Reply With Quote
Unread 01-11-12, 08:55 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
This will do for now.

LUA Code:
  1. if AftermathhUI.buffs.classcoloronbuffs == true then
  2.     if AftermathhUI.Class == "PRIEST" then
  3.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|CFF99CCFFd|r'
  4.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|CFF99CCFFh|r'
  5.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|CFF99CCFFm|r'
  6.         SECOND_ONELETTER_ABBR = '%.1f|CFF99CCFFs|r'
  7.     elseif AftermathhUI.Class == "MAGE" then
  8.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C4069CCf0d|r'
  9.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C4069CCf0h|r'
  10.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C4069CCf0m|r'
  11.         SECOND_ONELETTER_ABBR = '%.1f|C4069CCF0s|r'
  12.     elseif AftermathhUI.Class == "WARLOCK" then
  13.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C909482C9d|r'
  14.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C909482C9h|r'
  15.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C909482C9m|r'
  16.         SECOND_ONELETTER_ABBR = '%.1f|C909482C9s|r'
  17.     elseif AftermathhUI.Class == "SHAMAN" then
  18.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C802459FFd|r'
  19.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C802459FFh|r'
  20.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C802459FFm|r'
  21.         SECOND_ONELETTER_ABBR = '%.1f|C802459FFs|r'
  22.     elseif AftermathhUI.Class == "DRUID" then
  23.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C20FF7d0Ad|r'
  24.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C20FF7d0Ah|r'
  25.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C20FF7d0Am|r'
  26.         SECOND_ONELETTER_ABBR = '%.1f|C20FF7D0As|r'
  27.     elseif AftermathhUI.Class == "PALADIN" then
  28.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C50F58CBAd|r'
  29.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C50F58CBAh|r'
  30.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C50F58CBAm|r'
  31.         SECOND_ONELETTER_ABBR = '%.1f|C50F58CBAs|r'
  32.     elseif AftermathhUI.Class == "DEATHKNIGHT" then
  33.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C10C41F3Bd|r'
  34.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C10C41F3Bh|r'
  35.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C10C41F3Bm|r'
  36.         SECOND_ONELETTER_ABBR = '%.1f|C10C41F3Bs|r'
  37.     elseif AftermathhUI.Class == "ROGUE" then
  38.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C70FFF569d|r'
  39.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C70FFF569h|r'
  40.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C70FFF569m|r'
  41.         SECOND_ONELETTER_ABBR =  '%.1f|C70FFF569s|r'
  42.     elseif AftermathhUI.Class == "HUNTER" then
  43.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|C30ABD473d|r'
  44.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|C30ABD473h|r'
  45.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|C30ABD473m|r'
  46.         SECOND_ONELETTER_ABBR =  '%.1f|C30ABD473s|r'
  47.     elseif AftermathhUI.Class == "WARRIOR" then
  48.         DAY_ONELETTER_ABBR    = '|cffffffff%d|r|CA0C79C6Ed|r'
  49.         HOUR_ONELETTER_ABBR   = '|cffffffff%d|r|CA0C79C6Eh|r'
  50.         MINUTE_ONELETTER_ABBR = '|cffffffff%d|r|CA0C79C6Em|r'
  51.         SECOND_ONELETTER_ABBR =  '%.1f|CA0C79C6Es|r'
  52.     end
  53. else
  54.     DAY_ONELETTER_ABBR    = '|cffffffff%dd|r'
  55.     HOUR_ONELETTER_ABBR   = '|cffffffff%dh|r'
  56.     MINUTE_ONELETTER_ABBR = '|cffffffff%dm|r'
  57.     SECOND_ONELETTER_ABBR = "%.1f"
  58. end
  59.  
  60. hooksecurefunc('AuraButton_UpdateDuration', function(auraButton, timeLeft)
  61.     local duration = auraButton.duration;
  62.     if ( timeLeft ) then
  63.         if ( 8 > timeLeft ) then
  64.             duration:SetVertexColor(1, 0, 0)
  65.         else
  66.             duration:SetVertexColor(1, 0.82, 0)
  67.         end
  68.     end
  69. end)


Last edited by Aftermathhqt : 01-11-12 at 08:55 AM.
Report comment to moderator  
Reply With Quote
Unread 01-08-12, 10:09 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
Originally Posted by Vladinator
Originally Posted by Game92
Is it possible to have this feature only from 8 sec left of the buff time?

like this;

Elaborate, "this feature" meaning the timers should be visible when less than 8 seconds left, or you wish the color to be red at 8 seconds left?

If you meant that the timer should only be visible at 8 seconds left, here is how:

Open BuffTimers.lua and find:
Code:
d:SetAlpha(s > 900 and .5 or 1)
Replace with:
Code:
d:SetAlpha(s > 8 and 0 or 1)
Anything above 8 seconds has no timer, anything below has the timer.
I'm meaning like it only shows 7.8, 7.7, 7.6 instead of etc etc 29:55, 2:40,

like this



Dont worry about the color, i got it already
Last edited by Aftermathhqt : 01-08-12 at 10:27 AM.
Report comment to moderator  
Reply With Quote
Unread 01-08-12, 10:05 AM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Originally Posted by Game92
Is it possible to have this feature only from 8 sec left of the buff time?

like this;

Elaborate, "this feature" meaning the timers should be visible when less than 8 seconds left, or you wish the color to be red at 8 seconds left?

If you meant that the timer should only be visible at 8 seconds left, here is how:

Open BuffTimers.lua and find:
Code:
d:SetAlpha(s > 900 and .5 or 1)
Replace with:
Code:
d:SetAlpha(s > 8 and 0 or 1)
Anything above 8 seconds has no timer, anything below has the timer.
Report comment to moderator  
Reply With Quote
Unread 01-08-12, 09:29 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
Is it possible to have this feature only from 8 sec left of the buff time?

like this;


Last edited by Aftermathhqt : 01-08-12 at 09:42 AM.
Report comment to moderator  
Reply With Quote
Unread 04-27-11, 04:22 PM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Put up a update, tough 1.3 should in theory work as long you check "load outdated addons". In 1.4 I added some minor things, note that there is a bug in 4.1 so buffs expire quicker than the buff frames show, don't be surprised, it's not addons fault.
Report comment to moderator  
Reply With Quote
Unread 04-27-11, 12:44 PM  
eqXzeRt
A Kobold Labourer
AddOn Compiler - Click to view compilations

Forum posts: 0
File comments: 4
Uploads: 1
please update!
Report comment to moderator  
Reply With Quote
Unread 08-24-10, 11:58 AM  
Dexter74
A Kobold Labourer

Forum posts: 0
File comments: 167
Uploads: 0
As I said the error messages are part of the API just as informative as by Microsoft. Could bet if I let your addon away the error occurs anyway, only to then have otherwise caused the error.
Report comment to moderator  
Reply With Quote
Unread 08-24-10, 10:22 AM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 793
File comments: 337
Uploads: 31
Originally posted by Dexter74
The addon is not so complex that one can say "it will trigger a chain reaction".

It is probably in there in the error message, because it begins with B and so is near the top.
It says that "BuffTimers" used a function "updateFunc" in AnimationSystem, checking BuffTimers I use no such function, nor does AnimationSystem use the buff aura function, i.e. it must be something in between Blizzards code and my addon that causes this error.

I just wish I could find out what exactly, but unsure if I will fix the error, it may as well occur without my addon I suspect.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.