From be64b56da6a7d09b29f05be44c0598a71773ffce Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 18 Jul 2018 01:19:22 -0500 Subject: [PATCH] Fixed 8.0 error when playing as a Monk Fixed 8.0 castbar sometimes showing gibberish text and sometimes disappearing when the cast wasn't complete yet --- IceCastBar.lua | 40 ++++++++++++++++++++-------------------- IceHUD.toc | 1 - changelog.txt | 4 ++++ modules/CastBar.lua | 12 ++++++------ 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/IceCastBar.lua b/IceCastBar.lua index 3339918..1fb2f00 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -412,7 +412,7 @@ function IceCastBar.prototype:StopBar() end function IceCastBar.prototype:GetShortRank(rank) - if (rank) then + if IceHUD.WowVer < 80000 and rank then local _, _, sRank = string.find(rank, "(%d+)") if (sRank) then return " (" .. sRank .. ")" @@ -427,30 +427,30 @@ end -- NORMAL SPELLS -- ------------------------------------------------------------------------------- -function IceCastBar.prototype:SpellCastSent(event, unit, spell, rank, target, lineId) +function IceCastBar.prototype:SpellCastSent(event, unit, target, castGuid, spellId) if (unit ~= self.unit) then return end - IceHUD:Debug("SpellCastSent", unit, spell, rank, target, lineId) + IceHUD:Debug("SpellCastSent", unit, target, castGuid, spellId) end -function IceCastBar.prototype:SpellCastChanged(event, arg1) - IceHUD:Debug("SpellCastChanged", arg1) +function IceCastBar.prototype:SpellCastChanged(event, cancelled) + IceHUD:Debug("SpellCastChanged", cancelled) end -function IceCastBar.prototype:SpellCastStart(event, unit, spell, rank, lineId, spellId) +function IceCastBar.prototype:SpellCastStart(event, unit, castGuid, spellId) if (unit ~= self.unit) then return end - IceHUD:Debug("SpellCastStart", unit, spell, rank, lineId, spellId) + IceHUD:Debug("SpellCastStart", unit, castGuid, spellId) --UnitCastingInfo(unit) self:StartBar(IceCastBar.Actions.Cast) - self.current = lineId + self.current = castGuid end -function IceCastBar.prototype:SpellCastStop(event, unit, spell, rank, lineId, spellId) +function IceCastBar.prototype:SpellCastStop(event, unit, castGuid, spellId) if (unit ~= self.unit) then return end - IceHUD:Debug("SpellCastStop", unit, spell, self.current, rank, lineId, spellId) + IceHUD:Debug("SpellCastStop", unit, castGuid, spellId) -- ignore if not coming from current spell - if (self.current and lineId and self.current ~= lineId) then + if (self.current and castGuid and self.current ~= castGuid) then return end @@ -464,12 +464,12 @@ function IceCastBar.prototype:SpellCastStop(event, unit, spell, rank, lineId, sp end -function IceCastBar.prototype:SpellCastFailed(event, unit, spell, rank, lineId, spellId) +function IceCastBar.prototype:SpellCastFailed(event, castGuid, spellId) if (unit ~= self.unit) then return end - IceHUD:Debug("SpellCastFailed", unit, self.current, lineId, spellId) + IceHUD:Debug("SpellCastFailed", unit, castGuid, spellId) -- ignore if not coming from current spell - if (self.current and lineId and self.current ~= lineId) then + if (self.current and castGuid and self.current ~= castGuid) then return end @@ -492,12 +492,12 @@ function IceCastBar.prototype:SpellCastFailed(event, unit, spell, rank, lineId, self:StartBar(IceCastBar.Actions.Failure, "Failed") end -function IceCastBar.prototype:SpellCastInterrupted(event, unit, spell, rank, lineId, spellId) +function IceCastBar.prototype:SpellCastInterrupted(event, unit, castGuid, spellId) if (unit ~= self.unit) then return end - IceHUD:Debug("SpellCastInterrupted", unit, self.current, lineId, spellId) + IceHUD:Debug("SpellCastInterrupted", unit, castGuid, spellId) -- ignore if not coming from current spell - if (self.current and lineId and self.current ~= lineId) then + if (self.current and castGuid and self.current ~= castGuid) then return end @@ -506,7 +506,7 @@ function IceCastBar.prototype:SpellCastInterrupted(event, unit, spell, rank, lin self:StartBar(IceCastBar.Actions.Failure, "Interrupted") end -function IceCastBar.prototype:SpellCastDelayed(event, unit, delay) +function IceCastBar.prototype:SpellCastDelayed(event, unit, castGuid, spellId) if (unit ~= self.unit) then return end --IceHUD:Debug("SpellCastDelayed", unit, UnitCastingInfo(unit)) @@ -519,7 +519,7 @@ function IceCastBar.prototype:SpellCastDelayed(event, unit, delay) end -function IceCastBar.prototype:SpellCastSucceeded(event, unit, spell, rank, lineId, spellId) +function IceCastBar.prototype:SpellCastSucceeded(event, castGuid, spellId) if (unit ~= self.unit) then return end --IceHUD:Debug("SpellCastSucceeded", unit, spell, rank) @@ -529,7 +529,7 @@ function IceCastBar.prototype:SpellCastSucceeded(event, unit, spell, rank, lineI end -- ignore if not coming from current spell - if (self.current and self.current ~= lineId) then + if (self.current and self.current ~= castGuid) then return end diff --git a/IceHUD.toc b/IceHUD.toc index 3d70fb4..c3b59db 100644 --- a/IceHUD.toc +++ b/IceHUD.toc @@ -6,7 +6,6 @@ ## Version: @project-version@ ## SavedVariables: IceCoreDB ## OptionalDeps: Ace3, LibSharedMedia-3.0, LibDogTag-3.0, LibDogTag-Unit-3.0, LibRangeCheck-2.0, LibDualSpec-1.0, LibDBIcon-1.0, AceGUI-3.0-SharedMediaWidgets -## X-Compatible-With: 70300 ## X-Category: HUDs ## X-Website: https://www.wowace.com/projects/ice-hud ## X-WoWI-ID: 8149 diff --git a/changelog.txt b/changelog.txt index 96d7a8b..a5c17ee 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +v1.11.1: +- Fixed error when playing as a Monk +- Fixed castbar sometimes showing gibberish text and sometimes disappearing when the cast wasn't complete yet + v1.11.0: - Updated TOC for 8.0 diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 690dd74..2af0f1f 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -407,14 +407,14 @@ end -- OVERRIDE -function CastBar.prototype:SpellCastSent(event, unit, spell, rank, target, lineId) - CastBar.super.prototype.SpellCastSent(self, event, unit, spell, rank, target, lineId) +function CastBar.prototype:SpellCastSent(event, unit, castGuid, spellId) + CastBar.super.prototype.SpellCastSent(self, event, unit, castGuid, spellId) if (unit ~= self.unit) then return end if IceHUD.WowVer < 70000 then self.spellCastSent = GetTime() end - self.sentSpell = lineId + self.sentSpell = castGuid end -- OVERRIDE @@ -426,15 +426,15 @@ function CastBar.prototype:SpellCastChanged(event, arg1) end -- OVERRIDE -function CastBar.prototype:SpellCastStart(event, unit, spell, rank, lineId, spellId) - CastBar.super.prototype.SpellCastStart(self, event, unit, spell, rank, lineId, spellId) +function CastBar.prototype:SpellCastStart(event, unit, castGuid, spellId) + CastBar.super.prototype.SpellCastStart(self, event, unit, castGuid, spellId) if (unit ~= self.unit) then return end if not self:IsVisible() or not self.actionDuration then return end - if self.sentSpell ~= lineId then + if self.sentSpell ~= castGuid then self.spellCastSent = nil end