Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(1 Kb)
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:2,467
Favorites:13
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)


Archived Files (3)
File Name
Version
Size
Author
Date
1.3
1kB
Vladinator
04-27-11 02:44 PM
1.2
1kB
Vladinator
10-16-10 08:16 AM
1.1
1kB
Vladinator
07-23-10 01:42 AM


Post A Reply Comment Options
Unread 01-08-12, 10:05 AM  
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view AddOns

Forum posts: 765
File comments: 393
Uploads: 39
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.
Vlad is offline Report comment to moderator  
Reply With Quote
Unread 01-08-12, 10:09 AM  
Game92
A Molten Giant
 
Game92's Avatar
AddOn Author - Click to view AddOns

Forum posts: 653
File comments: 705
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 Game92 : 01-08-12 at 10:27 AM.
Game92 is offline Report comment to moderator  
Reply With Quote
Unread 01-11-12, 08:55 AM  
Game92
A Molten Giant
 
Game92's Avatar
AddOn Author - Click to view AddOns

Forum posts: 653
File comments: 705
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 Game92 : 01-11-12 at 08:55 AM.
Game92 is offline 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: 765
File comments: 393
Uploads: 39
Sorry for leaving you hanging, glad you found a way to work it out.
Vlad is offline Report comment to moderator  
Reply With Quote
Unread 01-11-12, 10:00 AM  
Game92
A Molten Giant
 
Game92's Avatar
AddOn Author - Click to view AddOns

Forum posts: 653
File comments: 705
Uploads: 14
Originally Posted by Vladinator
Sorry for leaving you hanging, glad you found a way to work it out.
Np man.
Game92 is offline Report comment to moderator  
Reply With Quote
Unread 01-13-12, 08:06 AM  
Game92
A Molten Giant
 
Game92's Avatar
AddOn Author - Click to view AddOns

Forum posts: 653
File comments: 705
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 Game92 : 01-13-12 at 08:20 AM.
Game92 is offline Report comment to moderator  
Reply With Quote
Unread 04-07-12, 10:49 AM  
10leej
A Firelord
 
10leej's Avatar
AddOn Author - Click to view AddOns

Forum posts: 463
File comments: 354
Uploads: 20
Don't mind if I use the code from this addon in my UI pack do ya?
10leej is offline 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: 765
File comments: 393
Uploads: 39
Totally fine, don't worry.
Vlad is offline 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.