mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Fixed lag indicator for GCD bar
This commit is contained in:
@ -20,7 +20,7 @@ function GlobalCoolDown.prototype:Enable(core)
|
|||||||
self.moduleSettings.inverse = "NORMAL"
|
self.moduleSettings.inverse = "NORMAL"
|
||||||
end
|
end
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_SPELLCAST_SENT","SpellCastSent")
|
self:RegisterEvent("CURRENT_SPELL_CAST_CHANGED", "SpellCastChanged")
|
||||||
|
|
||||||
--self:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN", "CooldownStateChanged")
|
--self:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN", "CooldownStateChanged")
|
||||||
self:RegisterEvent("UNIT_SPELLCAST_START","CooldownStateChanged")
|
self:RegisterEvent("UNIT_SPELLCAST_START","CooldownStateChanged")
|
||||||
@ -143,28 +143,16 @@ function GlobalCoolDown.prototype:IsFull(scale)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function GlobalCoolDown.prototype:SpellCastSent(event, unit, spell, bfaCastGUID, bfaSpellId)
|
function GlobalCoolDown.prototype:SpellCastChanged(event, cancelled)
|
||||||
if IceHUD.WowVer >= 80000 then
|
|
||||||
spell = bfaSpellId
|
|
||||||
end
|
|
||||||
|
|
||||||
if unit ~= "player" or not spell then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
self.spellCastSent = GetTime()
|
self.spellCastSent = GetTime()
|
||||||
end
|
end
|
||||||
|
|
||||||
function GlobalCoolDown.prototype:SpellCastStop(event, unit, spell, one, two, spellId)
|
function GlobalCoolDown.prototype:SpellCastStop(event, unit, castGuid, spellId)
|
||||||
if IceHUD.WowVer >= 80000 then
|
if unit ~= "player" or not spellId or not self.CurrSpellGuid or self.CurrSpellGuid ~= castGuid then
|
||||||
spellId = one
|
|
||||||
end
|
|
||||||
|
|
||||||
if unit ~= "player" or not spellId or not self.CurrSpellId or self.CurrSpellId ~= spellId then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self.CurrSpellId = nil
|
self.CurrSpellGuid = nil
|
||||||
|
|
||||||
if event == "UNIT_SPELLCAST_INTERRUPTED" or event == "UNIT_SPELLCAST_FAILED" then
|
if event == "UNIT_SPELLCAST_INTERRUPTED" or event == "UNIT_SPELLCAST_FAILED" then
|
||||||
self.CurrLerpTime = self.moduleSettings.desiredLerpTime
|
self.CurrLerpTime = self.moduleSettings.desiredLerpTime
|
||||||
@ -190,23 +178,19 @@ function GlobalCoolDown.prototype:GetSpellCastTime(spell)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function GlobalCoolDown.prototype:CooldownStateChanged(event, unit, spell, one, two, spellId)
|
function GlobalCoolDown.prototype:CooldownStateChanged(event, unit, castGuid, spellId)
|
||||||
if IceHUD.WowVer >= 80000 then
|
|
||||||
spellId = one
|
|
||||||
end
|
|
||||||
|
|
||||||
if unit ~= "player" or not spellId then
|
if unit ~= "player" or not spellId then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Ignore all events unrelated to the spell currently being cast
|
-- Ignore all events unrelated to the spell currently being cast
|
||||||
if self.CurrSpellId and self.CurrSpellId ~= spellId then
|
if self.CurrSpellGuid and self.CurrSpellGuid ~= castGuid then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Update the current spell ID for all events indicating a spellcast is starting
|
-- Update the current spell ID for all events indicating a spellcast is starting
|
||||||
if event ~= "UNIT_SPELLCAST_SUCCEEDED" then
|
if event ~= "UNIT_SPELLCAST_SUCCEEDED" then
|
||||||
self.CurrSpellId = spellId
|
self.CurrSpellGuid = castGuid
|
||||||
end
|
end
|
||||||
|
|
||||||
local start, dur = GetSpellCooldown(self.CDSpellId)
|
local start, dur = GetSpellCooldown(self.CDSpellId)
|
||||||
|
Reference in New Issue
Block a user