diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index 760d780..e4fb0e3 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -63,8 +63,6 @@ end function IceCustomBar.prototype:Disable(core) IceCustomBar.super.prototype.Disable(self, core) - - self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 6f9f7f0..e497ae2 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -58,8 +58,6 @@ end function IceCustomCDBar.prototype:Disable(core) IceCustomCDBar.super.prototype.Disable(self, core) - - self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/CustomHealth.lua b/modules/CustomHealth.lua index f308ab4..ed4588c 100644 --- a/modules/CustomHealth.lua +++ b/modules/CustomHealth.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") IceCustomHealth = AceOO.Class(IceTargetHealth) +IceCustomHealth.prototype.scheduledEvent = nil -- Constructor -- function IceCustomHealth.prototype:init() @@ -103,13 +104,13 @@ function IceCustomHealth.prototype:Enable(core) self:SetUnit(self.moduleSettings.unitToTrack) self:CreateFrame() - self:ScheduleRepeatingTimer(function() self:Update() end, IceHUD.IceCore:UpdatePeriod()) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", IceHUD.IceCore:UpdatePeriod()) end function IceCustomHealth.prototype:Disable(core) IceCustomHealth.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end function IceCustomHealth.prototype:Update(unit) diff --git a/modules/CustomMana.lua b/modules/CustomMana.lua index 933a1d7..7b27754 100644 --- a/modules/CustomMana.lua +++ b/modules/CustomMana.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") IceCustomMana = AceOO.Class(IceTargetMana) +IceCustomMana.prototype.scheduledEvent = nil -- Constructor -- function IceCustomMana.prototype:init() @@ -104,13 +105,13 @@ function IceCustomMana.prototype:Enable(core) self:CreateFrame() - self:ScheduleRepeatingTimer(function() self:Update() end, IceHUD.IceCore:UpdatePeriod()) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", IceHUD.IceCore:UpdatePeriod()) end function IceCustomMana.prototype:Disable(core) IceCustomMana.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end function IceCustomMana.prototype:SetUnit(unit) diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index e9e19e8..5d82455 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") local GlobalCoolDown = AceOO.Class(IceBarElement) +GlobalCoolDown.prototype.scheduledEvent = nil -- Constructor -- function GlobalCoolDown.prototype:init() @@ -26,7 +27,7 @@ function GlobalCoolDown.prototype:Enable(core) self:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN", "CooldownStateChanged") - self:ScheduleRepeatingTimer(function() self:UpdateGlobalCoolDown() end, 0.05) + self.scheduledEvent = self:ScheduleRepeatingTimer("UpdateGlobalCoolDown", 0.05) self:Show(false) end @@ -34,7 +35,7 @@ end function GlobalCoolDown.prototype:Disable(core) GlobalCoolDown.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end function GlobalCoolDown.prototype:GetSpellId() diff --git a/modules/HungerForBlood.lua b/modules/HungerForBlood.lua index 5b1f44a..8dcb83a 100644 --- a/modules/HungerForBlood.lua +++ b/modules/HungerForBlood.lua @@ -44,8 +44,6 @@ end function HungerForBlood.prototype:Disable(core) HungerForBlood.super.prototype.Disable(self, core) - - self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/PlayerInfo.lua b/modules/PlayerInfo.lua index e1cc6f1..e8d2c42 100644 --- a/modules/PlayerInfo.lua +++ b/modules/PlayerInfo.lua @@ -7,6 +7,7 @@ PlayerInfo.prototype.mainHandEnchantTimeSet = 0 PlayerInfo.prototype.mainHandEnchantEndTime = 0 PlayerInfo.prototype.offHandEnchantTimeSet = 0 PlayerInfo.prototype.offHandEnchantEndTime = 0 +PlayerInfo.prototype.scheduledEvent = nil -- Constructor -- function PlayerInfo.prototype:init() @@ -102,7 +103,13 @@ function PlayerInfo.prototype:Enable(core) self:HideBlizz() end - self:ScheduleRepeatingTimer(function() self:RepeatingUpdateBuffs() end, 1) + self.scheduledEvent = self:ScheduleRepeatingTimer("RepeatingUpdateBuffs", 1) +end + +function PlayerInfo.prototype:Disable(core) + PlayerInfo.super.prototype.Disable(self, core) + + self:CancelTimer(self.scheduledEvent, true) end function PlayerInfo.prototype:ShowBlizz() diff --git a/modules/RangeCheck.lua b/modules/RangeCheck.lua index 14d233d..84c0302 100644 --- a/modules/RangeCheck.lua +++ b/modules/RangeCheck.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") local RangeCheck = AceOO.Class(IceElement) +RangeCheck.prototype.scheduledEvent = nil local LibRange = nil local DogTag = nil @@ -23,7 +24,7 @@ function RangeCheck.prototype:Enable(core) DogTag = AceLibrary("LibDogTag-3.0") self:RegisterFontStrings() else - self:ScheduleRepeatingTimer(function() self:UpdateRange() end, 0.1) + self.scheduledEvent = self:ScheduleRepeatingTimer("UpdateRange", 0.1) end end @@ -33,7 +34,7 @@ function RangeCheck.prototype:Disable(core) if DogTag then self:UnregisterFontStrings() else - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end end diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index b1c0062..d935f26 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -60,8 +60,6 @@ end function SliceAndDice.prototype:Disable(core) SliceAndDice.super.prototype.Disable(self, core) - - self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/TargetCC.lua b/modules/TargetCC.lua index fc0dea2..4bb3819 100644 --- a/modules/TargetCC.lua +++ b/modules/TargetCC.lua @@ -236,15 +236,11 @@ function TargetCC.prototype:Enable(core) self:RegisterEvent("UNIT_AURA", "UpdateTargetDebuffs") self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateTargetDebuffs") --- self:ScheduleRepeatingTimer(function() self:UpdateTargetDebuffs() end, 0.1) - self:Show(false) end function TargetCC.prototype:Disable(core) TargetCC.super.prototype.Disable(self, core) - --- self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/TargetInvuln.lua b/modules/TargetInvuln.lua index 74490ae..83de41b 100644 --- a/modules/TargetInvuln.lua +++ b/modules/TargetInvuln.lua @@ -88,15 +88,11 @@ function TargetInvuln.prototype:Enable(core) self:RegisterEvent("UNIT_AURA", "UpdateTargetBuffs") self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateTargetBuffs") --- self:ScheduleRepeatingTimer(function() self:UpdateTargetBuffs() end, 0.1) - self:Show(false) end function TargetInvuln.prototype:Disable(core) TargetInvuln.super.prototype.Disable(self, core) - --- self:CancelScheduledEvent(self.elementName) end -- OVERRIDE diff --git a/modules/TargetOfTarget.lua b/modules/TargetOfTarget.lua index e6e3376..7e23399 100644 --- a/modules/TargetOfTarget.lua +++ b/modules/TargetOfTarget.lua @@ -8,6 +8,7 @@ TargetOfTarget.prototype.buffSize = nil TargetOfTarget.prototype.height = nil TargetOfTarget.prototype.unit = nil TargetOfTarget.prototype.hadTarget = nil +TargetOfTarget.prototype.scheduledEvent = nil -- Constructor -- @@ -210,7 +211,7 @@ end function TargetOfTarget.prototype:Enable(core) TargetOfTarget.super.prototype.Enable(self, core) - self:ScheduleRepeatingTimer(function() self:Update() end, 0.2) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.2) RegisterUnitWatch(self.frame) self:Update() @@ -220,7 +221,7 @@ end function TargetOfTarget.prototype:Disable(core) TargetOfTarget.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) UnregisterUnitWatch(self.frame) end diff --git a/modules/TargetOfTargetCast.lua b/modules/TargetOfTargetCast.lua index 616ff62..2c2b2cf 100644 --- a/modules/TargetOfTargetCast.lua +++ b/modules/TargetOfTargetCast.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") local TargetTargetCast = AceOO.Class(IceCastBar) +TargetTargetCast.prototype.scheduledEvent = nil local SelfDisplayModeOptions = {"Hide", "Normal"} @@ -37,9 +38,14 @@ end function TargetTargetCast.prototype:Enable(core) TargetTargetCast.super.prototype.Enable(self, core) - self:ScheduleRepeatingTimer(function() self:UpdateTargetTarget() end, 0.1) + self.scheduledEvent = self:ScheduleRepeatingTimer("UpdateTargetTarget", 0.1) end +function TargetTargetCast.prototype:Disable(core) + TargetTargetCast.super.prototype.Disable(self, core) + + self:CancelTimer(self.scheduledEvent, true) +end function TargetTargetCast.prototype:UpdateTargetTarget() if not (UnitExists(self.unit)) then diff --git a/modules/TargetOfTargetHealth.lua b/modules/TargetOfTargetHealth.lua index 2ed0f25..fdf1e8a 100644 --- a/modules/TargetOfTargetHealth.lua +++ b/modules/TargetOfTargetHealth.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") local TargetTargetHealth = AceOO.Class(IceTargetHealth) +TargetTargetHealth.prototype.scheduledEvent = nil local SelfDisplayModeOptions = {"Color as SelfColor", "Hide", "Normal"} @@ -110,13 +111,13 @@ function TargetTargetHealth.prototype:Enable(core) self.moduleSettings.useSelfColor = nil end - self:ScheduleRepeatingTimer(function() self:Update("targettarget") end, 0.1) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.1, "targettarget") end function TargetTargetHealth.prototype:Disable(core) TargetTargetHealth.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end function TargetTargetHealth.prototype:Update(unit) diff --git a/modules/TargetOfTargetMana.lua b/modules/TargetOfTargetMana.lua index abf3958..3fedecf 100644 --- a/modules/TargetOfTargetMana.lua +++ b/modules/TargetOfTargetMana.lua @@ -1,6 +1,7 @@ local AceOO = AceLibrary("AceOO-2.0") local TargetTargetMana = AceOO.Class(IceTargetMana) +TargetTargetMana.prototype.scheduledEvent = nil local SelfDisplayModeOptions = {"Hide", "Normal"} @@ -60,13 +61,13 @@ function TargetTargetMana.prototype:Enable(core) self.determineColor = false TargetTargetMana.super.prototype.Enable(self, core) - self:ScheduleRepeatingTimer(function() self:Update("targettarget") end, 0.1) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.1, "targettarget") end function TargetTargetMana.prototype:Disable(core) TargetTargetMana.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end function TargetTargetMana.prototype:Update(unit) diff --git a/modules/Threat.lua b/modules/Threat.lua index 4229310..4c04c21 100644 --- a/modules/Threat.lua +++ b/modules/Threat.lua @@ -1,6 +1,5 @@ --[[ Name: IceThreat -Version: 1.2 Author: Caryna/Turalyon EU (Alliance) (updated for Threat-2.0 by 'acapela' of WoWI and merged into IceHUD by Parnic) Description: adds a threat bar to IceHUD ]] @@ -12,6 +11,7 @@ IceThreat = AceOO.Class(IceUnitBar) IceThreat.prototype.color = nil IceThreat.aggroBar = nil IceThreat.aggroBarMulti = nil +IceThreat.prototype.scheduledEvent = nil local MAX_NUM_RAID_MEMBERS = 40 local MAX_NUM_PARTY_MEMBERS = 5 @@ -169,7 +169,7 @@ end function IceThreat.prototype:Enable(core) IceThreat.super.prototype.Enable(self, core) - self:ScheduleRepeatingTimer(function() self:Update() end, 0.2) + self.scheduledEvent = self:ScheduleRepeatingTimer("Update", 0.2) self:Update(self.unit) end @@ -178,7 +178,7 @@ end function IceThreat.prototype:Disable(core) IceThreat.super.prototype.Disable(self, core) - self:CancelScheduledEvent(self.elementName) + self:CancelTimer(self.scheduledEvent, true) end -- OVERRIDE