Help

Cooldowns

Action Bars Login to Add Favorites
  • 5 Likes
  • World of Warcraft
  • 557,982 Downloads
  • Supports: 4.0.3a
  • 340 Average Daily Downloads
  • Comments
  • Created 12/12/2008 9:49:32 AM
  • Updated 1/7/2011 3:35:13 AM
  • 942 Favorites
  • Project Site
  • License: All Rights Reserved
  • Release Type: Release
  • Newest File: 1.3.6
or

About Cooldowns

A World of Warcraft add-on that displays numeric cooldown counters on all buttons that are 28 pixels or wider.

Configure colors, fonts, and other options through the Cooldowns interface options panel.

Please see the readme.txt file for a tutorial on how to configure fonts in Cooldowns.

- Fixed missing string in german localization

Comments

First Previous Page 1 of 13 Next Last
  • #505

    hola tenes ese addon pero ara la vercion 4.0.6 gracias

  • #504

    go cccc_guy, we're waiting for pet cooldowns update :D

  • #502

    After i use an ability once i cant see the cd the second time. It gets back to the default shade ring. I would like this addon to be updated. I really want to use it again.

  • #501

    thanks ccc_guy! its great it works again. but my pet abillities CD wont show anymore...can you fix that too ?pls :)

  • #500

    thanks a lot ccc_guy, for those who dont understand what ccc_guy meant . He posted an update to the cooldowns.lua found on your wow addon folder you just need to open it using wordpad copy paste what he posted and it will work out fine :D

     

    Last edited by izeley on 12/27/2011 2:44:50 AM
  • #499

    I really loved this addon. I waited as long as I could to see if updated.  Cooldown Count seems to do the same thing, and I ahve had no complaints with it. 

    I hope this gets updated one day, I prefer this addon....  BRING IT BACK!

  • #498

    Uninstalled. Now using CooldownCount which works just fine and has been updated by the developer.

  • #497

    I can't update it, but for those who read the comments, here is the entire cooldowns.lua that I use now, 80% of the code is the same, I just created 2 special functions that does what Blizzard use to do CooldownSetSlotTimers() and  ResetCooldownTimer(), and updated the other functions to call/handle it I put changes in bold:

    YarkoCooldowns = {}

    YarkoCooldowns.DefaultMainColor = NORMAL_FONT_COLOR;
    YarkoCooldowns.DefaultFlashColor = { r = 1.0, g = 0, b = 0 };
    YarkoCooldowns.DefaultFontLocation = "Fonts";
    YarkoCooldowns.DefaultFontFile = "FRIZQT__.TTF";
    YarkoCooldowns.DefaultFontHeight = 18;
    YarkoCooldowns.DefaultShadow = "Y";
    YarkoCooldowns.DefaultOutline = 1;
    YarkoCooldowns.DefaultTenths = "N";
    YarkoCooldowns.DefaultBelowTwo = "N";
    YarkoCooldowns.DefaultSeconds = 60;
    YarkoCooldowns.CounterFrames = {};


    local Counters = {};

    local Scales = {
        [1] = 1.3,
        [2] = 1.2,
        [3] = .8,
        [4] = .6
    };

    local TimeSinceLastUpdate = 1;    
    local UpdateInterval = 1;        -- update every .1 second
    local MinInterval = .05;        -- used to slowdown the usage when no cooldowns active

    local ButtonWidth = 28;
    local OutlineList = {nil, "OUTLINE", "THICKOUTLINE"};


    function YarkoCooldowns.OnLoad(self)
        self:RegisterEvent("PLAYER_LOGIN");
    end


    function YarkoCooldowns.OnEvent(self, event, ...)
        if (event == "PLAYER_LOGIN") then
            print("Cooldowns for 4.3 Loaded");
                YarkoCooldowns.OptionsSetup();
              YarkoCooldowns.ResetCooldownTimers(self)

            hooksecurefunc("CooldownFrame_SetTimer",   YarkoCooldowns.ResetCooldownTimers);
              --hooksecurefunc('ACTIONBAR_UPDATE_COOLDOWN',   YarkoCooldowns.ResetCooldownTimers);
              --hooksecurefunc('ACTIONBAR_PAGE_CHANGED',    YarkoCooldowns.ResetCooldownTimers);
              hooksecurefunc("SetActiveTalentGroup", YarkoCooldowns.ResetCooldownTimers);
              hooksecurefunc("LearnTalent", YarkoCooldowns.ResetCooldownTimers);
        end
    end


    function YarkoCooldowns.OnUpdate(self, elapsed)
        TimeSinceLastUpdate = TimeSinceLastUpdate + elapsed;
        
        if (TimeSinceLastUpdate > UpdateInterval) then
            --print("Cooldown: Updating timer: " .. TimeSinceLastUpdate .. " " .. UpdateInterval);
            YarkoCooldowns.CooldownSetSlotTimers(self)

            for k, v in pairs(Counters) do
                local timeleft = v.start + v.duration - GetTime();
                local countertext = _G["YarkoCooldowns_"..k.."CounterText"];
                local counter = _G["YarkoCooldowns_"..k.."Counter"];
                counter.timeleft = timeleft;
                
                -- if there is time remaining on cooldown

                if (timeleft > 0 and v.enable > 0) then
                    if (_G[k]:IsVisible()) then
                        local timeleftstr;
                        timeleftstr, counter.length = YarkoCooldowns.GetTimeFormat(timeleft);
                        counter.timeleftstr = timeleftstr;
                        
                        if (timeleft <= 3) then
                            if (not v.flash) then
                                v.flash = true;
                                v.flag = false;
                                v.accum = 0;
                            end
                        else
                            if (v.flash) then
                                v.flash = false;
                            end
                        end
                        
                        if (timeleftstr ~= countertext:GetText() or v.flash) then
                            countertext:SetTextColor(YarkoCooldowns_SavedVars.MainColor.r,
                                YarkoCooldowns_SavedVars.MainColor.g, YarkoCooldowns_SavedVars.MainColor.b);
                            YarkoCooldowns.DrawCooldown(counter);
                            
                            if (v.flash) then
                                if (v.accum <= 0) then
                                    if (not v.flag) then
                                        v.flag = true;
                                    else
                                        v.flag = false;
                                    end
                                    
                                    v.accum = 3;
                                else
                                    v.accum = v.accum - 1;
                                end
                            end
                            
                            if (v.flag) then
                                countertext:SetTextColor(YarkoCooldowns_SavedVars.FlashColor.r,
                                    YarkoCooldowns_SavedVars.FlashColor.g, YarkoCooldowns_SavedVars.FlashColor.b);
                            end
                        end
                    else
                        countertext:SetText("");
                    end
                else
                    Counters[k] = nil;
                    countertext:SetText("");
                end
            end

            TimeSinceLastUpdate = 0;
        end
    end

    function YarkoCooldowns.CooldownSetSlotTimers(self)
        --print("CD slot timers");
        UpdateInterval = 1;

            for i, frame in pairs(ActionBarButtonEventsFrame.frames) do
            --print("CD frame: " .. i );
            local cooldown = frame.cooldown;
            local button = cooldown:GetParent();
                
            local start, duration, enable = GetActionCooldown( button.action );
            if ((start > 0 or duration > 1.5) and enable > 0) then
                --print("Found: " .. start .. " - " .. duration .. " - " .. enable);
                  YarkoCooldowns.CooldownSetTimer(button, start-0.1, duration, enable)
                UpdateInterval = MinInterval;
            end
        end
    end

    function YarkoCooldowns.ResetCooldownTimers(self)
        --print( "Cooldown: ResetTimers");
            for i, frame in pairs(ActionBarButtonEventsFrame.frames) do
            --print("CD frame: " .. i );
            local cooldown = frame.cooldown;
            local button = cooldown:GetParent();
                
            local start, duration, enable = GetActionCooldown( button.action );
              YarkoCooldowns.CooldownSetTimer(button, start, duration, enable)
        end
    end


    function YarkoCooldowns.CooldownSetTimer(self, start, duration, enable)
        if (self.mark == 0 or not start) then
            return;
        end

        local name = self:GetName();
        if (not self.mark) then
            if (not name) then
                self.mark = 0;
                return;
            end
            
            self.mark = (((self:GetParent():GetWidth() >= ButtonWidth
                or self:GetParent():GetParent():GetName() == "WatchFrameLines")
                and 1) or 0);
        end
        
        if (self.mark == 0 or enable == 0) then
            return;
        end
        
        local countername = "YarkoCooldowns_"..name.."Counter";
        --print("Cooldowns Tracking: " .. countername .. " - " .. " - " .. start .. " - " .. duration .. " - " .. enable);

        -- track spells with a cooldown (more than 1.5s)
        if (start > 0 and duration > 1.5 and enable > 0) then
            if (not _G[countername]) then
                local specialaddon = (ButtonFacade or Bartender4);
                
                -- create a Frame with the found cooldown name
                local frame = CreateFrame("Frame", countername, ((not specialaddon) and self) or nil, "YarkoCooldowns_CounterTemplate");
                frame:SetPoint("CENTER", self, "CENTER", 0, 0);
                --frame:SetPoint("CENTER", self:GetParent(), "CENTER", 0, 0);
                
                if (specialaddon) then
                    frame:SetFrameStrata(self:GetParent():GetFrameStrata());
                end
                    
                -- set this frame to be a higher view level
                frame:SetFrameLevel(self:GetFrameLevel() + 5);
                frame:SetToplevel(true);
                frame.cooldown = self;
                self.yarkocounter = frame;
                    
                self:HookScript("OnShow", function(self) self.yarkocounter:Show(); end);
                self:HookScript("OnHide", function(self) self.yarkocounter:Hide(); end);
                    
                tinsert(YarkoCooldowns.CounterFrames, countername);
                YarkoCooldowns.UpdateFont(countername);
                frame:Show();
            end
                
            Counters[name] = {};
            Counters[name].start = start;
            Counters[name].duration = duration;
            Counters[name].enable = enable;
            Counters[name].flash = false;
            Counters[name].flag = false;
            Counters[name].accum = 0;
        else
            if (_G[countername]) then
                _G[countername.."Text"]:SetText("");
            end
            
            Counters[name] = nil;
        end
    end


    function YarkoCooldowns.GetTimeFormat(timeleft)
        local str1;
        local str2;
        
        if (timeleft > 3600) then
            str1 = ((YarkoCooldowns_SavedVars.Tenths == "Y"
                and YarkoCooldowns.TrimZeros(format("%.1f", (timeleft + 180) / 3600)))
                or format("%d", ceil(timeleft / 3600)));
            str2 = str1..((strlen(str1) > 2 and "\n") or "").."h";
        elseif (timeleft > YarkoCooldowns_SavedVars.Seconds) then
            str1 = ((YarkoCooldowns_SavedVars.Tenths == "Y"
                and YarkoCooldowns.TrimZeros(format("%.1f", (timeleft + 3) / 60)))
                or format("%d", ceil(timeleft / 60)));
            str2 = str1..((strlen(str1) > 2 and "\n") or "").."m";
        else
            str1 = ((timeleft <= 2 and YarkoCooldowns_SavedVars.BelowTwo == "Y"
                and format("%.1f", timeleft + 0.05))
                or format("%d", ceil(timeleft)));
            str2 = str1;
        end
        
        return str2, strlen(str1);
    end


    function YarkoCooldowns.TrimZeros(instr)
        local outstr = "";
        local str = "";
        local i;
        
        for i = 1, strlen(instr) do
            if (strsub(instr, i, i) ~= "0") then
                str = strsub(instr, i);
                break;
            end
        end
        
        for i = strlen(str), 1, -1 do
            if (strsub(str, i, i) == ".") then
                outstr = strsub(str, 1, i - 1);
                break;
            end
            
            if (strsub(str, i, i) ~= "0") then
                outstr = strsub(str, 1, i);
                break;
            end
        end
        
        return outstr;
    end


    function YarkoCooldowns.UpdateFont(cooldownframename)
        local cooldownframe = _G[cooldownframename];
        local cooldowntext = _G[cooldownframename.."Text"];
        
        if (YarkoCooldowns_SavedVars.Shadow == "Y") then
            cooldowntext:SetShadowOffset(1, -1);
        else
            cooldowntext:SetShadowOffset(0, 0);
        end
        
        cooldowntext:SetFont(YarkoCooldowns_SavedVars.FontLocation.."\\"..YarkoCooldowns_SavedVars.FontFile,
            YarkoCooldowns_SavedVars.FontHeight, OutlineList[YarkoCooldowns_SavedVars.Outline]);
        cooldowntext:SetTextColor(YarkoCooldowns_SavedVars.MainColor.r, YarkoCooldowns_SavedVars.MainColor.g,
            YarkoCooldowns_SavedVars.MainColor.b);
        
        if (cooldownframe:IsVisible() and cooldownframe.timeleft) then
            cooldownframe.timeleftstr, cooldownframe.length = YarkoCooldowns.GetTimeFormat(cooldownframe.timeleft);
            YarkoCooldowns.DrawCooldown(cooldownframe);
        end
    end


    function YarkoCooldowns.DrawCooldown(cooldownframe)
        local str = cooldownframe.timeleftstr;
        local len = cooldownframe.length;
        
        if (len > 4) then
            len = 4;
        end
        
        cooldownframe:SetScale(Scales[len] * (cooldownframe.cooldown:GetWidth() / ActionButton1:GetWidth()));
        _G[cooldownframe:GetName().."Text"]:SetText(cooldownframe.timeleftstr);
    end

     

    Last edited by cccc_guy on 12/17/2011 8:16:37 AM
  • #496

    I have a fix for this, I just need to upload it.  It tracks all the cooldowns the same way, I'm just trying to find all the ways cooldowns can be reset.

    Who can tell me how to upload a version?

  • #495

    Update already :D i feel weird in raids without this :D

  • #494

    When comes the update? ;'(

  • #493
    Quote from Kratfrotz »

    http://www.curse.com/addons/wow/cooldowncount works

    Works for me, too.

  • #491

    UPDATE IT OMG OMG OMG i feel blind without this lol

  • #492

    Me too! :(

  • #490

    worked in 4.2 update for 4.3 plz wont work anymore

     

  • To post a comment, please login or register a new account.
Learn how to disable ads
Learn how to disable ads
Login to Curse

Don't have an account? Create One.

Get an epic experience with Curse Premium
  • Faster Addon Downloads
  • Premium-Only Beta Giveaways
  • Ad-Free Curse.com Experience
  • Premium Curse Client
  • and many More Features
  • Learn More »