From b328ad0739d8f206468d1a05e31d06818655e074 Mon Sep 17 00:00:00 2001 From: Parnic Date: Thu, 26 May 2016 23:49:22 -0500 Subject: [PATCH] Changed how cooldowns are started (ticket #205) --- modules/Runes.lua | 9 +++++++-- modules/TargetInfo.lua | 7 ++++++- modules/Totems.lua | 9 +++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/Runes.lua b/modules/Runes.lua index d59c657..b53c122 100644 --- a/modules/Runes.lua +++ b/modules/Runes.lua @@ -3,6 +3,11 @@ local Runes = IceCore_CreateClass(IceElement) local IceHUD = _G.IceHUD +local CooldownFrame_SetTimer = CooldownFrame_SetTimer +if IceHUD.WowVer >= 70000 then + CooldownFrame_SetTimer = CooldownFrame_Set +end + -- blizzard cracks me up. the below block is copied verbatim from RuneFrame.lua ;) --Readability == win local RUNETYPE_BLOOD = 1; @@ -277,12 +282,12 @@ function Runes.prototype:UpdateRunePower(event, rune, dontFlash) end elseif start ~= nil and duration ~= nil then if self.moduleSettings.cooldownMode == "Cooldown" then - self.frame.graphical[rune].cd:SetCooldown(start, duration) + CooldownFrame_SetTimer(self.frame.graphical[rune].cd, start, duration, true) self.frame.graphical[rune].cd:Show() elseif self.moduleSettings.cooldownMode == "Alpha" then self.frame.graphical[rune]:SetAlpha(0.2) elseif self.moduleSettings.cooldownMode == "Both" then - self.frame.graphical[rune].cd:SetCooldown(start, duration) + CooldownFrame_SetTimer(self.frame.graphical[rune].cd, start, duration, true) self.frame.graphical[rune].cd:Show() self.frame.graphical[rune]:SetAlpha(0.2) end diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua index afbabbd..d18d53d 100644 --- a/modules/TargetInfo.lua +++ b/modules/TargetInfo.lua @@ -1,6 +1,11 @@ local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false) IceTargetInfo = IceCore_CreateClass(IceElement) +local CooldownFrame_SetTimer = CooldownFrame_SetTimer +if IceHUD.WowVer >= 70000 then + CooldownFrame_SetTimer = CooldownFrame_Set +end + local DogTag = nil local internal = "internal" @@ -1445,7 +1450,7 @@ function IceTargetInfo.prototype:SetupAura(aura, i, icon, duration, expirationTi if (duration and duration > 0 and expirationTime and expirationTime > 0) then local start = expirationTime - duration - frame.cd:SetCooldown(start, duration) + CooldownFrame_SetTimer(frame.cd, start, duration, true) frame.cd:Show() else frame.cd:Hide() diff --git a/modules/Totems.lua b/modules/Totems.lua index 222bcdc..ba365e3 100644 --- a/modules/Totems.lua +++ b/modules/Totems.lua @@ -1,6 +1,11 @@ local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false) local Totems = IceCore_CreateClass(IceElement) +local CooldownFrame_SetTimer = CooldownFrame_SetTimer +if IceHUD.WowVer >= 70000 then + CooldownFrame_SetTimer = CooldownFrame_Set +end + -- the below block is copied from TotemFrame.lua local FIRE_TOTEM_SLOT = 1; local EARTH_TOTEM_SLOT = 2; @@ -239,7 +244,7 @@ function Totems.prototype:UpdateTotem(event, totem, ...) local haveTotem, name, startTime, duration, icon = GetTotemInfo(totem); if duration > 0 then self.frame.graphical[totem].totem:SetTexture(icon) - self.frame.graphical[totem].cd:SetCooldown(startTime, duration) + CooldownFrame_SetTimer(self.frame.graphical[totem].cd, startTime, duration, true) self.frame.graphical[totem].cd:Show() self.frame.graphical[totem]:Show() else @@ -367,7 +372,7 @@ function Totems.prototype:CreateTotem(i, name) self.frame.graphical[i].cd:ClearAllPoints() self.frame.graphical[i].cd:SetAllPoints(self.frame.graphical[i]) if duration > 0 then - self.frame.graphical[i].cd:SetCooldown(startTime, duration) + CooldownFrame_SetTimer(self.frame.graphical[i].cd, startTime, duration, true) self.frame.graphical[i].cd:Show() self.frame.graphical[i]:Show() end