mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- GCD stops early if the player aborts the cast or is interrupted
This commit is contained in:
@ -20,6 +20,9 @@ function GlobalCoolDown.prototype:Enable(core)
|
|||||||
self:RegisterEvent("UNIT_SPELLCAST_START","CooldownStateChanged")
|
self:RegisterEvent("UNIT_SPELLCAST_START","CooldownStateChanged")
|
||||||
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED","CooldownStateChanged")
|
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED","CooldownStateChanged")
|
||||||
|
|
||||||
|
self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED","CooldownAborted")
|
||||||
|
self:RegisterEvent("UNIT_SPELLCAST_FAILED","CooldownAborted")
|
||||||
|
|
||||||
self:Show(false)
|
self:Show(false)
|
||||||
|
|
||||||
self.frame:SetFrameStrata("TOOLTIP")
|
self.frame:SetFrameStrata("TOOLTIP")
|
||||||
@ -27,6 +30,15 @@ function GlobalCoolDown.prototype:Enable(core)
|
|||||||
self.CDSpellId = self:GetSpellId()
|
self.CDSpellId = self:GetSpellId()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GlobalCoolDown.prototype:CooldownAborted(event, unit, spell)
|
||||||
|
if unit ~= "player" or not spell or not self.CurrSpell or self.CurrSpell ~= spell then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
self.CurrLerpTime = self.moduleSettings.desiredLerpTime
|
||||||
|
self.CurrSpell = nil
|
||||||
|
end
|
||||||
|
|
||||||
-- OVERRIDE
|
-- OVERRIDE
|
||||||
function GlobalCoolDown.prototype:GetDefaultSettings()
|
function GlobalCoolDown.prototype:GetDefaultSettings()
|
||||||
local settings = GlobalCoolDown.super.prototype.GetDefaultSettings(self)
|
local settings = GlobalCoolDown.super.prototype.GetDefaultSettings(self)
|
||||||
@ -78,6 +90,7 @@ function GlobalCoolDown.prototype:CooldownStateChanged(event, unit, spell)
|
|||||||
self.DesiredScale = 0
|
self.DesiredScale = 0
|
||||||
self.CurrLerpTime = 0
|
self.CurrLerpTime = 0
|
||||||
self.moduleSettings.desiredLerpTime = dur or 1
|
self.moduleSettings.desiredLerpTime = dur or 1
|
||||||
|
self.CurrSpell = spell
|
||||||
|
|
||||||
self.barFrame.bar:SetVertexColor(self:GetColor("GlobalCoolDown", 0.8))
|
self.barFrame.bar:SetVertexColor(self:GetColor("GlobalCoolDown", 0.8))
|
||||||
self:Show(true)
|
self:Show(true)
|
||||||
|
Reference in New Issue
Block a user