- removed a few old CancelScheduledEvent calls on bars that weren't actually scheduling any repeating timers any more and added a few CancelTimers to modules that weren't previously canceling their scheduled timers

- converted CancelScheduledEvent to CancelTimer for modules that are still scheduling repeating timers...not sure why CancelScheduledEvent didn't throw any errors (since i don't see how it exists) but whatever
- removed a bunch of "function() self:Thing() end" closures in ScheduleRepeatingTimer calls that didn't need to be there
This commit is contained in:
Parnic
2010-09-11 01:42:29 +00:00
parent 907bee2104
commit 9d40348b80
16 changed files with 39 additions and 35 deletions

View File

@ -63,8 +63,6 @@ end
function IceCustomBar.prototype:Disable(core)
IceCustomBar.super.prototype.Disable(self, core)
self:CancelScheduledEvent(self.elementName)
end
-- OVERRIDE

View File

@ -58,8 +58,6 @@ end
function IceCustomCDBar.prototype:Disable(core)
IceCustomCDBar.super.prototype.Disable(self, core)
self:CancelScheduledEvent(self.elementName)
end
-- OVERRIDE

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -44,8 +44,6 @@ end
function HungerForBlood.prototype:Disable(core)
HungerForBlood.super.prototype.Disable(self, core)
self:CancelScheduledEvent(self.elementName)
end
-- OVERRIDE

View File

@ -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()

View File

@ -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

View File

@ -60,8 +60,6 @@ end
function SliceAndDice.prototype:Disable(core)
SliceAndDice.super.prototype.Disable(self, core)
self:CancelScheduledEvent(self.elementName)
end
-- OVERRIDE

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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