fix fear ward cooldown tracking
This commit is contained in:
parent
6954fb05d0
commit
55860fc157
@ -82,6 +82,7 @@ function Gladdy:SpotEnemy(unit, auraScan)
|
|||||||
for arenaUnit,v in pairs(self.buttons) do
|
for arenaUnit,v in pairs(self.buttons) do
|
||||||
if (UnitIsUnit(arenaUnit, unitCaster)) then
|
if (UnitIsUnit(arenaUnit, unitCaster)) then
|
||||||
Cooldowns:CooldownUsed(arenaUnit, v.class, Gladdy.cooldownBuffs[spellName].spellId, expirationTime - GetTime())
|
Cooldowns:CooldownUsed(arenaUnit, v.class, Gladdy.cooldownBuffs[spellName].spellId, expirationTime - GetTime())
|
||||||
|
-- /run LibStub("Gladdy").modules["Cooldowns"]:CooldownUsed("arena5", "PRIEST", 6346, 10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -258,7 +258,7 @@ function Cooldowns:SPEC_DETECTED(unit, spec)
|
|||||||
self:DetectSpec(unit, spec)
|
self:DetectSpec(unit, spec)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Cooldowns:CooldownStart(button, spellId, duration)
|
function Cooldowns:CooldownStart(button, spellId, duration, start)
|
||||||
-- starts timer frame
|
-- starts timer frame
|
||||||
if not duration or duration == nil or type(duration) ~= "number" then
|
if not duration or duration == nil or type(duration) ~= "number" then
|
||||||
return
|
return
|
||||||
@ -267,8 +267,8 @@ function Cooldowns:CooldownStart(button, spellId, duration)
|
|||||||
if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then
|
if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then
|
||||||
local frame = button.spellCooldownFrame["icon" .. i]
|
local frame = button.spellCooldownFrame["icon" .. i]
|
||||||
frame.active = true
|
frame.active = true
|
||||||
frame.timeLeft = duration
|
frame.timeLeft = start and start - GetTime() + duration or duration
|
||||||
if (not Gladdy.db.cooldownDisableCircle) then frame.cooldown:SetCooldown(GetTime(), duration) end
|
if (not Gladdy.db.cooldownDisableCircle) then frame.cooldown:SetCooldown(start or GetTime(), duration) end
|
||||||
frame:SetScript("OnUpdate", function(self, elapsed)
|
frame:SetScript("OnUpdate", function(self, elapsed)
|
||||||
self.timeLeft = self.timeLeft - elapsed
|
self.timeLeft = self.timeLeft - elapsed
|
||||||
local timeLeft = ceil(self.timeLeft)
|
local timeLeft = ceil(self.timeLeft)
|
||||||
@ -519,7 +519,7 @@ function Cooldowns:CooldownUsed(unit, unitClass, spellId, expirationTimeInSecond
|
|||||||
|
|
||||||
if (Gladdy.db.cooldown) then
|
if (Gladdy.db.cooldown) then
|
||||||
-- start cooldown
|
-- start cooldown
|
||||||
self:CooldownStart(button, spellId, expirationTimeInSeconds or cd)
|
self:CooldownStart(button, spellId, cd, expirationTimeInSeconds and (GetTime() + expirationTimeInSeconds - cd) or nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ announcement
|
--[[ announcement
|
||||||
|
Loading…
Reference in New Issue
Block a user