From 123dbf254263cf53c0545f4d760b3147033a8ce9 Mon Sep 17 00:00:00 2001 From: iceroth Date: Fri, 8 Dec 2006 02:19:21 +0000 Subject: [PATCH] Fixes and patches --- IceCastBar.lua | 25 +++++-------------------- IceHUD.lua | 3 --- IceHUD.toc | 5 +++-- modules/CastBar.lua | 28 ++++++++++++++++++++++++++++ modules/TargetCast.lua | 2 ++ modules/TargetInfo.lua | 4 ++-- modules/TargetOfTarget.lua | 7 +++++-- 7 files changed, 45 insertions(+), 29 deletions(-) diff --git a/IceCastBar.lua b/IceCastBar.lua index 5c08894..733f33d 100644 --- a/IceCastBar.lua +++ b/IceCastBar.lua @@ -46,28 +46,9 @@ function IceCastBar.prototype:Enable(core) self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "SpellCastChannelStop") -- unit self.frame:Hide() - - -- remove blizz cast bar - CastingBarFrame:UnregisterAllEvents() end -function IceCastBar.prototype:Disable(core) - IceCastBar.super.prototype.Disable(self, core) - - -- restore blizz cast bar - CastingBarFrame:RegisterEvent("SPELLCAST_START"); - CastingBarFrame:RegisterEvent("SPELLCAST_STOP"); - CastingBarFrame:RegisterEvent("SPELLCAST_FAILED"); - CastingBarFrame:RegisterEvent("SPELLCAST_INTERRUPTED"); - CastingBarFrame:RegisterEvent("SPELLCAST_DELAYED"); - CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_START"); - CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_UPDATE"); - CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_STOP"); -end - - - -- 'Protected' methods -------------------------------------------------------- -- OVERRIDE @@ -275,7 +256,11 @@ function IceCastBar.prototype:SpellCastDelayed(unit, delay) --IceHUD:Debug("SpellCastDelayed", unit, UnitCastingInfo(unit)) local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo(self.unit) - self.actionDuration = endTime/1000 - self.actionStartTime + + if (endTime and self.actionStartTime) then + -- apparently this check is needed, got nils during a horrible lag spike + self.actionDuration = endTime/1000 - self.actionStartTime + end end diff --git a/IceHUD.lua b/IceHUD.lua index 277805c..f5a7bbd 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -477,7 +477,6 @@ StaticPopupDialogs["ICEHUD_RESET"] = whileDead = 1, hideOnEscape = 1, OnAccept = function() - print("hellooo") IceHUD.IceCore:ResetSettings() end } @@ -489,8 +488,6 @@ function IceHUD:OnInitialize() self:Debug("IceHUD:OnInitialize()") self.IceCore = IceCore:new() - - end diff --git a/IceHUD.toc b/IceHUD.toc index bae9793..359bc3e 100644 --- a/IceHUD.toc +++ b/IceHUD.toc @@ -3,7 +3,7 @@ ## Name: IceHUD ## Title: IceHUD |cff7fff7f -Ace2-|r ## Notes: Another HUD addon -## Version: 0.8 ($Revision$) +## Version: 0.8.1 ($Revision$) ## SavedVariables: IceCoreDB ## OptionalDeps: Ace2, DewdropLib, DruidBar, SoleManax, MobHealth ## X-Embeds: Ace2, DewdropLib @@ -22,7 +22,6 @@ libs\AceConsole-2.0\AceConsole-2.0.lua libs\AceAddon-2.0\AceAddon-2.0.lua libs\Dewdrop-2.0\Dewdrop-2.0.lua - # IceHUD core functionality IceCore.lua IceHUD.lua @@ -31,7 +30,9 @@ IceBarElement.lua IceUnitBar.lua IceCastBar.lua + # IceHUD modules +# - Feel free to comment these out if you like modules\PlayerHealth.lua modules\PlayerMana.lua modules\TargetHealth.lua diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 2d5051b..d160b12 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -63,6 +63,34 @@ function CastBar.prototype:GetOptions() return opts end + +function CastBar.prototype:Enable(core) + CastBar.super.prototype.Enable(self, core) + + -- remove blizz cast bar + CastingBarFrame:UnregisterAllEvents() +end + + +function CastBar.prototype:Disable(core) + CastBar.super.prototype.Disable(self, core) + + -- restore blizz cast bar + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SENT"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_START"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_STOP"); + + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_FAILED"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_DELAYED"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED"); + + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE"); + CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP"); +end + + ------------------------------------------------------------------------------- diff --git a/modules/TargetCast.lua b/modules/TargetCast.lua index ee56375..fc32e96 100644 --- a/modules/TargetCast.lua +++ b/modules/TargetCast.lua @@ -48,6 +48,8 @@ function TargetCast.prototype:TargetChanged(unit) self:StartBar(IceCastBar.Actions.Channel) return end + + self:StopBar() end ------------------------------------------------------------------------------- diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua index 6110673..c82d586 100644 --- a/modules/TargetInfo.lua +++ b/modules/TargetInfo.lua @@ -412,7 +412,7 @@ function TargetInfo.prototype:CreateBuffFrame(redraw) self.frame.buffFrame:SetHeight(1) self.frame.buffFrame:ClearAllPoints() - self.frame.buffFrame:SetPoint("TOPRIGHT", self.frame, "TOPLEFT", -5, 0) + self.frame.buffFrame:SetPoint("TOPRIGHT", self.frame, "TOPLEFT", -10, 0) self.frame.buffFrame:Show() self.frame.buffFrame.buffs = {} @@ -433,7 +433,7 @@ function TargetInfo.prototype:CreateDebuffFrame(redraw) self.frame.debuffFrame:SetHeight(1) self.frame.debuffFrame:ClearAllPoints() - self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, "TOPRIGHT", 5, 0) + self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, "TOPRIGHT", 10, 0) self.frame.debuffFrame:Show() self.frame.debuffFrame.buffs = {} diff --git a/modules/TargetOfTarget.lua b/modules/TargetOfTarget.lua index 729cbd5..d4b5f51 100644 --- a/modules/TargetOfTarget.lua +++ b/modules/TargetOfTarget.lua @@ -401,9 +401,12 @@ function TargetOfTarget.prototype:BuffOnEnter(type) return end - GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT") - GameTooltip:SetUnitDebuff(this.unit, this.id) + if (this.unit and this.id) then + GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT") + GameTooltip:SetUnitDebuff(this.unit, this.id) + end end + -- load us up IceHUD_Module_TargetOfTarget = TargetOfTarget:new()