diff --git a/.pkgmeta b/.pkgmeta
index 4d110cf..a8692bc 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -5,7 +5,12 @@ externals:
libs/CallbackHandler-1.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/CallbackHandler-1.0
tag: latest
- libs/AceEvent-2.0: svn://svn.wowace.com/wow/ace2/mainline/trunk/AceEvent-2.0
+ libs/AceEvent-3.0:
+ url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0
+ tag: latest
+ libs/AceTimer-3.0:
+ url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTimer-3.0
+ tag: latest
libs/AceDB-3.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0
tag: latest
diff --git a/IceCastBar.lua b/IceCastBar.lua
index 39ef0e3..c2f340a 100644
--- a/IceCastBar.lua
+++ b/IceCastBar.lua
@@ -415,13 +415,13 @@ end
-- NORMAL SPELLS --
-------------------------------------------------------------------------------
-function IceCastBar.prototype:SpellCastSent(unit, spell, rank, target)
+function IceCastBar.prototype:SpellCastSent(event, unit, spell, rank, target)
if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastSent", unit, spell, rank, target)
end
-function IceCastBar.prototype:SpellCastStart(unit, spell, rank)
+function IceCastBar.prototype:SpellCastStart(event, unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastStart", unit, spell, rank)
--UnitCastingInfo(unit)
@@ -430,7 +430,7 @@ function IceCastBar.prototype:SpellCastStart(unit, spell, rank)
self.current = spell
end
-function IceCastBar.prototype:SpellCastStop(unit, spell, rank)
+function IceCastBar.prototype:SpellCastStop(event, unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastStop", unit, spell, self.current)
@@ -449,7 +449,7 @@ function IceCastBar.prototype:SpellCastStop(unit, spell, rank)
end
-function IceCastBar.prototype:SpellCastFailed(unit, spell, rank)
+function IceCastBar.prototype:SpellCastFailed(event, unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastFailed", unit, self.current)
@@ -477,7 +477,7 @@ function IceCastBar.prototype:SpellCastFailed(unit, spell, rank)
self:StartBar(IceCastBar.Actions.Failure, "Failed")
end
-function IceCastBar.prototype:CheckChatInterrupt(msg)
+function IceCastBar.prototype:CheckChatInterrupt(event, msg)
local player, spell = deformat(msg, SPELLINTERRUPTOTHERSELF)
IceHUD:Debug("CheckChatInterrupt", msg, self.current)
@@ -491,7 +491,7 @@ function IceCastBar.prototype:CheckChatInterrupt(msg)
end
end
-function IceCastBar.prototype:SpellCastInterrupted(unit, spell, rank)
+function IceCastBar.prototype:SpellCastInterrupted(event, unit, spell, rank)
if (unit ~= self.unit) then return end
IceHUD:Debug("SpellCastInterrupted", unit, self.current)
@@ -505,7 +505,7 @@ function IceCastBar.prototype:SpellCastInterrupted(unit, spell, rank)
self:StartBar(IceCastBar.Actions.Failure, "Interrupted")
end
-function IceCastBar.prototype:SpellCastDelayed(unit, delay)
+function IceCastBar.prototype:SpellCastDelayed(event, unit, delay)
if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastDelayed", unit, UnitCastingInfo(unit))
@@ -518,7 +518,7 @@ function IceCastBar.prototype:SpellCastDelayed(unit, delay)
end
-function IceCastBar.prototype:SpellCastSucceeded(unit, spell, rank)
+function IceCastBar.prototype:SpellCastSucceeded(event, unit, spell, rank)
if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastSucceeded", unit, spell, rank)
@@ -556,14 +556,14 @@ end
-- CHANNELING SPELLS --
-------------------------------------------------------------------------------
-function IceCastBar.prototype:SpellCastChannelStart(unit)
+function IceCastBar.prototype:SpellCastChannelStart(event, unit)
if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastChannelStart", unit)
self:StartBar(IceCastBar.Actions.Channel)
end
-function IceCastBar.prototype:SpellCastChannelUpdate(unit)
+function IceCastBar.prototype:SpellCastChannelUpdate(event, unit)
if (unit ~= self.unit or not self.actionStartTime) then return end
--IceHUD:Debug("SpellCastChannelUpdate", unit, UnitChannelInfo(unit))
@@ -571,7 +571,7 @@ function IceCastBar.prototype:SpellCastChannelUpdate(unit)
self.actionDuration = endTime/1000 - self.actionStartTime
end
-function IceCastBar.prototype:SpellCastChannelStop(unit)
+function IceCastBar.prototype:SpellCastChannelStop(event, unit)
if (unit ~= self.unit) then return end
--IceHUD:Debug("SpellCastChannelStop", unit)
diff --git a/IceCore.lua b/IceCore.lua
index 7031fdc..5596cc0 100644
--- a/IceCore.lua
+++ b/IceCore.lua
@@ -1,6 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
-IceCore = AceOO.Class("AceEvent-2.0")
+IceCore = AceOO.Class()
IceCore.Side = { Left = "LEFT", Right = "RIGHT" }
@@ -31,13 +31,6 @@ function IceCore.prototype:init()
IceHUD:Debug("IceCore.prototype:init()")
self.IceHUDFrame = CreateFrame("Frame","IceHUDFrame", UIParent)
-
- -- We are ready to load modules
- self:RegisterEvent(IceCore.RegisterModule, "Register")
- self:TriggerEvent(IceCore.Loaded)
-
-
- self:SetupDefaults()
end
@@ -50,7 +43,7 @@ function IceCore.prototype:SetupDefaults()
verticalPos = -110,
horizontalPos = 0,
scale = 0.9,
-
+
alphaooc = 0.3,
alphaic = 0.6,
alphaTarget = 0.4,
@@ -60,7 +53,7 @@ function IceCore.prototype:SetupDefaults()
alphaicbg = 0.3,
alphaTargetbg = 0.25,
alphaNotFullbg = 0.25,
-
+
backgroundToggle = false,
backgroundColor = {r = 0.5, g = 0.5, b = 0.5},
barTexture = "Bar",
@@ -85,14 +78,14 @@ function IceCore.prototype:SetupDefaults()
for k, v in pairs(self.presets[defaultPreset]) do
self.defaults.profile[k] = v
end
-
+
-- get default settings from the modules
self.defaults.profile.modules = {}
for i = 1, table.getn(self.elements) do
local name = self.elements[i]:GetElementName()
- self.defaults.profile.modules[name] = self.elements[i]:GetDefaultSettings()
+ self.defaults.profile.modules[name] = self.elements[i]:GetDefaultSettings()
end
-
+
if (table.getn(self.elements) > 0) then
self.defaults.profile.colors = self.elements[1].defaultColors
end
@@ -284,7 +277,7 @@ function IceCore.prototype:Disable()
self.elements[i]:Disable(true)
end
end
-
+
self.IceHUDFrame:Hide()
self:EmptyUpdates()
self.enabled = false
@@ -299,9 +292,9 @@ function IceCore.prototype:DrawFrame()
self.IceHUDFrame:SetFrameStrata("BACKGROUND")
self.IceHUDFrame:SetWidth(self.settings.gap)
self.IceHUDFrame:SetHeight(20)
-
+
self:SetScale(self.settings.scale)
-
+
self.IceHUDFrame:SetPoint("CENTER", self.settings.horizontalPos, self.settings.verticalPos)
self.IceHUDFrame:Show()
end
@@ -316,7 +309,7 @@ end
function IceCore.prototype:GetModuleOptions()
local options = {}
-
+
options["aaaClickPlus"] = {
type = 'description',
fontSize = 'large',
@@ -334,16 +327,16 @@ function IceCore.prototype:GetModuleOptions()
args = opt
}
end
-
+
return options
end
function IceCore.prototype:GetColorOptions()
assert(table.getn(IceHUD.IceCore.elements) > 0, "Unable to get color options, no elements found!")
-
+
local options = {}
-
+
for k, v in pairs(self.elements[1]:GetColors()) do
local kk, vv = k, v
options[k] = {
@@ -359,7 +352,7 @@ function IceCore.prototype:GetColorOptions()
end
}
end
-
+
return options
end
@@ -411,7 +404,7 @@ function IceCore.prototype:GetScale()
end
function IceCore.prototype:SetScale(value)
self.settings.scale = value
-
+
self.IceHUDFrame:SetScale(value)
end
@@ -572,7 +565,7 @@ end
function IceCore.prototype:GetFontFamily()
- return self.settings.fontFamily
+ return self.settings.fontFamily
end
function IceCore.prototype:SetFontFamily(value)
self.settings.fontFamily = value
@@ -598,7 +591,7 @@ function IceCore.prototype:SetColor(color, r, g, b)
self.settings.colors[color].r = r
self.settings.colors[color].g = g
self.settings.colors[color].b = b
-
+
self:Redraw()
end
@@ -713,7 +706,7 @@ function IceCore.prototype:LoadPresets()
barBlendMode = "BLEND",
barBgBlendMode = "BLEND",
}
-
+
self.presets["HiBar"] = {
barTexture = "HiBar",
barWidth = 63,
@@ -723,7 +716,7 @@ function IceCore.prototype:LoadPresets()
barBlendMode = "BLEND",
barBgBlendMode = "BLEND",
}
-
+
self.presets["RoundBar"] = {
barTexture = "RoundBar",
barWidth = 155,
diff --git a/IceElement.lua b/IceElement.lua
index b2a1e85..f27daad 100644
--- a/IceElement.lua
+++ b/IceElement.lua
@@ -1,7 +1,7 @@
local AceOO = AceLibrary("AceOO-2.0")
local SML = AceLibrary("LibSharedMedia-3.0")
-IceElement = AceOO.Class("AceEvent-2.0")
+IceElement = AceOO.Class()
IceElement.virtual = true
IceElement.TexturePath = IceHUD.Location .. "\\textures\\"
@@ -42,7 +42,10 @@ function IceElement.prototype:init(name)
self:SetDefaultColor("Text", 1, 1, 1)
self:SetDefaultColor("undef", 0.7, 0.7, 0.7)
- self:RegisterEvent(IceCore.Loaded, "OnCoreLoad")
+ LibStub("AceEvent-3.0"):Embed(self)
+ LibStub("AceTimer-3.0"):Embed(self)
+
+ IceHUD:Register(self)
end
@@ -60,7 +63,7 @@ end
function IceElement.prototype:Create(parent)
assert(parent, "IceElement 'parent' can't be nil")
-
+
self.parent = parent
self:CreateFrame()
self:Show(false)
@@ -105,7 +108,7 @@ end
-- inherting classes should override this and provide
-- make sure they refresh any changes made to them
function IceElement.prototype:Redraw()
-
+
end
@@ -167,12 +170,12 @@ function IceElement.prototype:GetOptions()
self.moduleSettings.alwaysFullAlpha = value
self:Update(self.unit)
self:Redraw()
- end,
+ end,
disabled = function()
return not self.moduleSettings.enabled
end,
order = 27.5
- }
+ }
return opts
end
@@ -253,7 +256,7 @@ function IceElement.prototype:GetColor(color, alpha)
if not (alpha) then
alpha = self.alpha
end
-
+
if not (self.settings.colors[color]) then
local r, g, b = self:GetClassColor(color)
return r, g, b, alpha
@@ -293,7 +296,7 @@ function IceElement.prototype:SetDefaultColor(color, red, green, blue)
if (blue > 1) then
blue = blue / 255
end
-
+
self.defaultColors[color] = {r = red, g = green, b = blue}
end
@@ -331,20 +334,20 @@ function IceElement.prototype:FontFactory(size, frame, font, flags)
if not (frame) then
frame = self.frame
end
-
+
local fontString = nil
if not (font) then
fontString = frame:CreateFontString()
else
fontString = font
end
-
+
fontString:SetFont(SML:Fetch('font', self.settings.fontFamily), size, flags)
if not (flags) then
fontString:SetShadowColor(0, 0, 0, 1)
fontString:SetShadowOffset(1, -1)
end
-
+
return fontString
end
@@ -378,15 +381,6 @@ function IceElement.prototype:Show(bShouldShow)
end
-
--- Event Handlers -------------------------------------------------------------
-
--- Register ourself to the core
-function IceElement.prototype:OnCoreLoad()
- self:TriggerEvent(IceCore.RegisterModule, self)
-end
-
-
-- Combat event handlers ------------------------------------------------------
function IceElement.prototype:InCombat()
diff --git a/IceHUD.lua b/IceHUD.lua
index 905c94f..29bd69f 100644
--- a/IceHUD.lua
+++ b/IceHUD.lua
@@ -5,6 +5,9 @@ local ACR = LibStub("AceConfigRegistry-3.0")
local ConfigDialog = LibStub("AceConfigDialog-3.0")
local icon = LibStub("LibDBIcon-1.0")
+local pendingModuleLoads = {}
+local bReadyToRegisterModules = false
+
IceHUD.CurrTagVersion = 3
IceHUD.debugging = false
@@ -19,14 +22,14 @@ IceHUD.options =
name = "IceHUD",
desc = "IceHUD",
icon = "Interface\\Icons\\Spell_Frost_Frost",
- args =
+ args =
{
headerGeneral = {
type = 'header',
name = "General Settings",
order = 10
},
-
+
faq = {
type = 'group',
name = 'FAQs',
@@ -351,7 +354,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
set = function(info, value)
IceHUD.IceCore:SetFontFamily(info.option.values[value])
end,
- values = SML:List('font'),
+ values = SML:List('font'),
},
barSettings = {
@@ -470,7 +473,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
set = function(info, value)
IceHUD.IceCore:SetBarBgBlendMode(value)
end,
- values = { BLEND = "Blend", ADD = "Additive" }, --"Disable", "Alphakey", "Mod" },
+ values = { BLEND = "Blend", ADD = "Additive" }, --"Disable", "Alphakey", "Mod" },
order = 16
},
@@ -484,7 +487,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
set = function(info, value)
IceHUD.IceCore:SetBarBlendMode(value)
end,
- values = { BLEND = "Blend", ADD = "Additive" }, --"Disable", "Alphakey", "Mod" },
+ values = { BLEND = "Blend", ADD = "Additive" }, --"Disable", "Alphakey", "Mod" },
order = 17
},
}
@@ -498,7 +501,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
args = {},
order = 41
},
-
+
colors = {
type='group',
desc = 'Module color configuration options',
@@ -542,7 +545,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
end,
order = 92
},
-
+
reset = {
type = 'execute',
name = '|cffff0000Reset|r',
@@ -693,7 +696,7 @@ Expand Module Settings, expand PlayerInfo (or TargetInfo for targets), and set t
}
-StaticPopupDialogs["ICEHUD_RESET"] =
+StaticPopupDialogs["ICEHUD_RESET"] =
{
text = "Are you sure you want to reset IceHUD settings?",
button1 = OKAY,
@@ -770,6 +773,9 @@ function IceHUD:OnInitialize()
self:Debug("IceHUD:OnInitialize()")
self.IceCore = IceCore:new()
+ self:RegisterPendingModules()
+ self.IceCore:SetupDefaults()
+ bReadyToRegisterModules = true
self.db = LibStub("AceDB-3.0"):New("IceCoreDB", self.IceCore.defaults, "Default")
self.db.RegisterCallback(self, "OnProfileShutdown", "PreProfileChanged")
@@ -798,7 +804,7 @@ function IceHUD:NotifyNewDb()
self.IceCore.accountSettings = self.db.global
self.IceCore.settings = self.db.profile
self.IceCore:SetModuleDatabases()
-
+
self.IceCore:CheckDisplayUpdateMessage()
end
@@ -991,3 +997,19 @@ function IceHUD:GetSelectValue(info, val)
return 1
end
+
+function IceHUD:Register(element)
+ assert(element, "Trying to register a nil module")
+ if not bReadyToRegisterModules then
+ pendingModuleLoads[#pendingModuleLoads+1] = element
+ else
+ self.IceCore:Register(element)
+ end
+end
+
+function IceHUD:RegisterPendingModules()
+ for i=1, #pendingModuleLoads do
+ self.IceCore:Register(pendingModuleLoads[i])
+ end
+ pendingModuleLoads = {}
+end
diff --git a/embeds.xml b/embeds.xml
index 79b5248..5239539 100644
--- a/embeds.xml
+++ b/embeds.xml
@@ -8,7 +8,8 @@
-
+
+
diff --git a/modules/CastBar.lua b/modules/CastBar.lua
index 711c6c8..7c23d00 100644
--- a/modules/CastBar.lua
+++ b/modules/CastBar.lua
@@ -327,7 +327,7 @@ function CastBar.prototype:Enable(core)
end
-function CastBar.prototype:EnteringVehicle(unit, arg2)
+function CastBar.prototype:EnteringVehicle(event, unit, arg2)
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
self.unit = "vehicle"
self:Update(self.unit)
@@ -335,7 +335,7 @@ function CastBar.prototype:EnteringVehicle(unit, arg2)
end
-function CastBar.prototype:ExitingVehicle(unit)
+function CastBar.prototype:ExitingVehicle(event, unit)
if (unit == "player" and self.unit == "vehicle") then
self.unit = "player"
self:Update(self.unit)
@@ -415,16 +415,16 @@ end
-- OVERRIDE
-function CastBar.prototype:SpellCastSent(unit, spell, rank, target)
- CastBar.super.prototype.SpellCastSent(self, unit, spell, rank, target)
+function CastBar.prototype:SpellCastSent(event, unit, spell, rank, target)
+ CastBar.super.prototype.SpellCastSent(self, event, unit, spell, rank, target)
if (unit ~= self.unit) then return end
self.spellCastSent = GetTime()
end
-- OVERRIDE
-function CastBar.prototype:SpellCastStart(unit, spell, rank)
- CastBar.super.prototype.SpellCastStart(self, unit, spell, rank)
+function CastBar.prototype:SpellCastStart(event, unit, spell, rank)
+ CastBar.super.prototype.SpellCastStart(self, event, unit, spell, rank)
if (unit ~= self.unit) then return end
if not self:IsVisible() or not self.actionDuration then
@@ -471,8 +471,8 @@ end
-- OVERRIDE
-function CastBar.prototype:SpellCastChannelStart(unit)
- CastBar.super.prototype.SpellCastChannelStart(self, unit)
+function CastBar.prototype:SpellCastChannelStart(event, unit)
+ CastBar.super.prototype.SpellCastChannelStart(self, event, unit)
if (unit ~= self.unit) then return end
if not self:IsVisible() or not self.actionDuration then
diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua
index ed7d006..760d780 100644
--- a/modules/CustomBar.lua
+++ b/modules/CustomBar.lua
@@ -23,10 +23,10 @@ end
function IceCustomBar.prototype:Enable(core)
IceCustomBar.super.prototype.Enable(self, core)
- self:RegisterEvent("UNIT_AURA", "UpdateCustomBar")
- self:RegisterEvent("UNIT_PET", "UpdateCustomBar")
- self:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomBar")
- self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomBar")
+ self:RegisterEvent("UNIT_AURA", "UpdateCustomBarEvent")
+ self:RegisterEvent("UNIT_PET", "UpdateCustomBarEvent")
+ self:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomBarEvent")
+ self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomBarEvent")
if self.moduleSettings.auraIconScale == nil then
self.moduleSettings.auraIconScale = 1
@@ -496,6 +496,10 @@ function IceCustomBar.prototype:GetAuraDuration(unitName, buffName)
return nil, nil, nil, nil
end
+function IceCustomBar.prototype:UpdateCustomBarEvent(event, unit)
+ self:UpdateCustomBar(unit)
+end
+
function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
if unit and unit ~= self.unit and not (self.unit == "main hand weapon" or self.unit == "off hand weapon") then
return
diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua
index 666874b..6f9f7f0 100644
--- a/modules/CustomCDBar.lua
+++ b/modules/CustomCDBar.lua
@@ -25,8 +25,8 @@ end
function IceCustomCDBar.prototype:Enable(core)
IceCustomCDBar.super.prototype.Enable(self, core)
- self:RegisterEvent("SPELL_UPDATE_COOLDOWN", "UpdateCustomBar")
- self:RegisterEvent("SPELL_UPDATE_USEABLE", "UpdateCustomBar")
+ self:RegisterEvent("SPELL_UPDATE_COOLDOWN", "UpdateCustomBarEvent")
+ self:RegisterEvent("SPELL_UPDATE_USEABLE", "UpdateCustomBarEvent")
self:Show(true)
@@ -439,6 +439,10 @@ function IceCustomCDBar.prototype:UpdateIcon()
end
end
+function IceCustomCDBar.prototype:UpdateCustomBarEvent()
+ self:UpdateCustomBar()
+end
+
function IceCustomCDBar.prototype:UpdateCustomBar(fromUpdate)
local now = GetTime()
local remaining = nil
diff --git a/modules/CustomCount.lua b/modules/CustomCount.lua
index 5769d79..5618172 100644
--- a/modules/CustomCount.lua
+++ b/modules/CustomCount.lua
@@ -536,11 +536,7 @@ function IceCustomCount.prototype:GetGradientColor(curr)
end
-function IceCustomCount.prototype:UpdateCustomCount(unit)
- if unit and unit ~= self.unit and self.unit ~= "main hand weapon" and self.unit ~= "off hand weapon" then
- return
- end
-
+function IceCustomCount.prototype:UpdateCustomCount()
local points
if IceHUD.IceCore:IsInConfigMode() then
points = tonumber(self.moduleSettings.maxCount)
diff --git a/modules/CustomHealth.lua b/modules/CustomHealth.lua
index 8d24485..f308ab4 100644
--- a/modules/CustomHealth.lua
+++ b/modules/CustomHealth.lua
@@ -103,7 +103,7 @@ function IceCustomHealth.prototype:Enable(core)
self:SetUnit(self.moduleSettings.unitToTrack)
self:CreateFrame()
- self:ScheduleRepeatingEvent(self.elementName, self.Update, IceHUD.IceCore:UpdatePeriod(), self)
+ self:ScheduleRepeatingTimer(function() self:Update() end, IceHUD.IceCore:UpdatePeriod())
end
function IceCustomHealth.prototype:Disable(core)
diff --git a/modules/CustomMana.lua b/modules/CustomMana.lua
index 22405d9..933a1d7 100644
--- a/modules/CustomMana.lua
+++ b/modules/CustomMana.lua
@@ -104,7 +104,7 @@ function IceCustomMana.prototype:Enable(core)
self:CreateFrame()
- self:ScheduleRepeatingEvent(self.elementName, self.Update, IceHUD.IceCore:UpdatePeriod(), self)
+ self:ScheduleRepeatingTimer(function() self:Update() end, IceHUD.IceCore:UpdatePeriod())
end
function IceCustomMana.prototype:Disable(core)
diff --git a/modules/FocusCast.lua b/modules/FocusCast.lua
index d4c170f..43d4e72 100644
--- a/modules/FocusCast.lua
+++ b/modules/FocusCast.lua
@@ -38,7 +38,7 @@ function FocusCast.prototype:Enable(core)
end
-function FocusCast.prototype:FocusChanged(unit)
+function FocusCast.prototype:FocusChanged(event, unit)
if not (UnitExists(self.unit)) then
self:StopBar()
return
diff --git a/modules/FocusHealth.lua b/modules/FocusHealth.lua
index 48f0d16..c2f477c 100644
--- a/modules/FocusHealth.lua
+++ b/modules/FocusHealth.lua
@@ -252,10 +252,10 @@ end
function FocusHealth.prototype:Enable(core)
FocusHealth.super.prototype.Enable(self, core)
- self:RegisterEvent("UNIT_HEALTH", "Update")
- self:RegisterEvent("UNIT_MAXHEALTH", "Update")
- self:RegisterEvent("UNIT_FLAGS", "Update")
- self:RegisterEvent("UNIT_FACTION", "Update")
+ self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_FLAGS", "UpdateEvent")
+ self:RegisterEvent("UNIT_FACTION", "UpdateEvent")
self:RegisterEvent("RAID_TARGET_UPDATE", "UpdateRaidFocusIcon")
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateFocus")
@@ -329,7 +329,9 @@ function FocusHealth.prototype:Disable(core)
FocusHealth.super.prototype.Disable(self, core)
end
-
+function FocusHealth.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
function FocusHealth.prototype:Update(unit)
FocusHealth.super.prototype.Update(self)
diff --git a/modules/FocusMana.lua b/modules/FocusMana.lua
index b45591d..16c1ed3 100644
--- a/modules/FocusMana.lua
+++ b/modules/FocusMana.lua
@@ -33,20 +33,20 @@ function FocusMana.prototype:Enable(core)
FocusMana.super.prototype.Enable(self, core)
if IceHUD.WowVer >= 40000 then
- self:RegisterEvent("UNIT_POWER", "Update")
- self:RegisterEvent("UNIT_MAXPOWER", "Update")
+ self:RegisterEvent("UNIT_POWER", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXPOWER", "UpdateEvent")
else
- self:RegisterEvent("UNIT_MANA", "Update")
- self:RegisterEvent("UNIT_MAXMANA", "Update")
- self:RegisterEvent("UNIT_RAGE", "Update")
- self:RegisterEvent("UNIT_MAXRAGE", "Update")
- self:RegisterEvent("UNIT_ENERGY", "Update")
- self:RegisterEvent("UNIT_MAXENERGY", "Update")
- self:RegisterEvent("UNIT_FOCUS", "Update")
- self:RegisterEvent("UNIT_MAXFOCUS", "Update")
+ self:RegisterEvent("UNIT_MANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXMANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_RAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_ENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_FOCUS", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXFOCUS", "UpdateEvent")
end
- self:RegisterEvent("UNIT_AURA", "Update")
- self:RegisterEvent("UNIT_FLAGS", "Update")
+ self:RegisterEvent("UNIT_AURA", "UpdateEvent")
+ self:RegisterEvent("UNIT_FLAGS", "UpdateEvent")
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateFocus")
self:Update(self.unit)
@@ -56,6 +56,10 @@ function FocusMana.prototype:UpdateFocus()
self:Update(self.unit)
end
+function FocusMana.prototype:Update(event, unit)
+ self:Update(unit)
+end
+
function FocusMana.prototype:Update(unit)
FocusMana.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua
index 35db296..e9e19e8 100644
--- a/modules/GlobalCoolDown.lua
+++ b/modules/GlobalCoolDown.lua
@@ -26,7 +26,7 @@ function GlobalCoolDown.prototype:Enable(core)
self:RegisterEvent("ACTIONBAR_UPDATE_COOLDOWN", "CooldownStateChanged")
- self:ScheduleRepeatingEvent(self.elementName, self.UpdateGlobalCoolDown, 0.05, self)
+ self:ScheduleRepeatingTimer(function() self:UpdateGlobalCoolDown() end, 0.05)
self:Show(false)
end
diff --git a/modules/HungerForBlood.lua b/modules/HungerForBlood.lua
index 9a12e52..5b1f44a 100644
--- a/modules/HungerForBlood.lua
+++ b/modules/HungerForBlood.lua
@@ -162,7 +162,7 @@ function HungerForBlood.prototype:GetBuffDuration(unitName, buffName)
return nil, nil, nil
end
-function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate)
+function HungerForBlood.prototype:UpdateHungerForBlood(event, unit, fromUpdate)
if unit and unit ~= self.unit then
return
end
@@ -183,7 +183,7 @@ function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate)
if hfbEndTime and hfbEndTime >= now then
if not fromUpdate then
- self.frame:SetScript("OnUpdate", function() self:UpdateHungerForBlood(self.unit, true) end)
+ self.frame:SetScript("OnUpdate", function() self:UpdateHungerForBlood(nil, self.unit, true) end)
end
-- self:Show(true)
diff --git a/modules/MaelstromCount.lua b/modules/MaelstromCount.lua
index 7bd4cb5..4709930 100644
--- a/modules/MaelstromCount.lua
+++ b/modules/MaelstromCount.lua
@@ -256,7 +256,7 @@ function MaelstromCount.prototype:CreateMaelstromFrame(doTextureUpdate)
end
-function MaelstromCount.prototype:UpdateMaelstromCount(unit)
+function MaelstromCount.prototype:UpdateMaelstromCount(event, unit)
if unit and unit ~= "player" then
return
end
diff --git a/modules/MirrorBar.lua b/modules/MirrorBar.lua
index 5af19d4..8095196 100644
--- a/modules/MirrorBar.lua
+++ b/modules/MirrorBar.lua
@@ -450,7 +450,7 @@ function MirrorBarHandler.prototype:Redraw()
end
-function MirrorBarHandler.prototype:MirrorStart(timer, value, maxValue, scale, paused, label)
+function MirrorBarHandler.prototype:MirrorStart(event, timer, value, maxValue, scale, paused, label)
local done = nil
-- check if we can find an already running timer to reverse it
@@ -483,7 +483,7 @@ function MirrorBarHandler.prototype:MirrorStart(timer, value, maxValue, scale, p
end
-function MirrorBarHandler.prototype:MirrorStop(timer)
+function MirrorBarHandler.prototype:MirrorStop(event, timer)
for i = 1, table.getn(self.bars) do
if (self.bars[i].timer == timer) then
self.bars[i]:MirrorStop()
@@ -492,7 +492,7 @@ function MirrorBarHandler.prototype:MirrorStop(timer)
end
-function MirrorBarHandler.prototype:MirrorPause(paused)
+function MirrorBarHandler.prototype:MirrorPause(event, paused)
for i = 1, table.getn(self.bars) do
if (self.bars[i].timer ~= nil) then
self.bars[i]:MirrorPause(paused > 0)
diff --git a/modules/PetHealth.lua b/modules/PetHealth.lua
index f167695..c043afd 100644
--- a/modules/PetHealth.lua
+++ b/modules/PetHealth.lua
@@ -59,8 +59,8 @@ function PetHealth.prototype:Enable(core)
self:RegisterEvent("PET_BAR_CHANGED", "CheckPet");
self:RegisterEvent("UNIT_PET", "CheckPet");
- self:RegisterEvent("UNIT_HEALTH", "Update")
- self:RegisterEvent("UNIT_MAXHEALTH", "Update")
+ self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
if IceHUD.WowVer >= 40000 then
self:RegisterEvent("UNIT_POWER", "PetHappiness")
@@ -79,7 +79,7 @@ function PetHealth.prototype:Disable(core)
UnregisterUnitWatch(self.frame)
end
-function PetHealth.prototype:PetHappiness(unit, powertype)
+function PetHealth.prototype:PetHappiness(event, unit, powertype)
if (unit and (unit ~= self.unit)) then
return
end
@@ -96,12 +96,16 @@ end
function PetHealth.prototype:CheckPet()
if (UnitExists(self.unit)) then
- self:PetHappiness(self.unit, "HAPPINESS")
+ self:PetHappiness(nil, self.unit, "HAPPINESS")
self:Update(self.unit)
end
end
+function PetHealth.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
+
function PetHealth.prototype:Update(unit)
PetHealth.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
diff --git a/modules/PetMana.lua b/modules/PetMana.lua
index 22a4710..b12ae2d 100644
--- a/modules/PetMana.lua
+++ b/modules/PetMana.lua
@@ -58,23 +58,23 @@ function PetMana.prototype:Enable(core)
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "CheckPet")
if IceHUD.WowVer >= 40000 then
- self:RegisterEvent("UNIT_POWER", "Update")
- self:RegisterEvent("UNIT_MAXPOWER", "Update")
+ self:RegisterEvent("UNIT_POWER", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXPOWER", "UpdateEvent")
else
- self:RegisterEvent("UNIT_MANA", "Update")
- self:RegisterEvent("UNIT_MAXMANA", "Update")
- self:RegisterEvent("UNIT_RAGE", "Update")
- self:RegisterEvent("UNIT_MAXRAGE", "Update")
- self:RegisterEvent("UNIT_ENERGY", "Update")
- self:RegisterEvent("UNIT_MAXENERGY", "Update")
- self:RegisterEvent("UNIT_FOCUS", "Update")
- self:RegisterEvent("UNIT_MAXFOCUS", "Update")
+ self:RegisterEvent("UNIT_MANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXMANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_RAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_ENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_FOCUS", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXFOCUS", "UpdateEvent")
end
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
self:CheckPet()
- self:ManaType(self.unit)
+ self:ManaType(nil, self.unit)
end
@@ -83,7 +83,7 @@ function PetMana.prototype:CheckPet()
if (UnitExists(self.unit)) then
self:Show(true)
- self:ManaType(self.unit)
+ self:ManaType(nil, self.unit)
self:Update(self.unit)
else
self:Show(false)
@@ -91,7 +91,7 @@ function PetMana.prototype:CheckPet()
end
-function PetMana.prototype:ManaType(unit)
+function PetMana.prototype:ManaType(event, unit)
if (unit ~= self.unit) then
return
end
@@ -134,11 +134,15 @@ function PetMana.prototype:CheckForVehicle()
end
if self.unit ~= lastUnit then
- self:ManaType(self.unit)
+ self:ManaType(nil, self.unit)
end
end
+function PetMana.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
+
function PetMana.prototype:Update(unit)
self:CheckForVehicle()
diff --git a/modules/PlayerHealth.lua b/modules/PlayerHealth.lua
index e0f0c79..a9c14e2 100644
--- a/modules/PlayerHealth.lua
+++ b/modules/PlayerHealth.lua
@@ -62,8 +62,8 @@ end
function PlayerHealth.prototype:Enable(core)
PlayerHealth.super.prototype.Enable(self, core)
- self:RegisterEvent("UNIT_HEALTH", "Update")
- self:RegisterEvent("UNIT_MAXHEALTH", "Update")
+ self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "EnteringWorld")
@@ -785,7 +785,7 @@ function PlayerHealth.prototype:GetOptions()
end
-function PlayerHealth.prototype:EnteringVehicle(unit, arg2)
+function PlayerHealth.prototype:EnteringVehicle(event, unit, arg2)
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
self.unit = "vehicle"
self:RegisterFontStrings()
@@ -794,7 +794,7 @@ function PlayerHealth.prototype:EnteringVehicle(unit, arg2)
end
-function PlayerHealth.prototype:ExitingVehicle(unit)
+function PlayerHealth.prototype:ExitingVehicle(event, unit)
if (unit == "player" and self.unit == "vehicle") then
self.unit = "player"
self:RegisterFontStrings()
@@ -1155,6 +1155,10 @@ function PlayerHealth.prototype:CheckPvP()
end
+function PlayerHealth.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
+
function PlayerHealth.prototype:Update(unit)
PlayerHealth.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
diff --git a/modules/PlayerInfo.lua b/modules/PlayerInfo.lua
index af9d757..e1cc6f1 100644
--- a/modules/PlayerInfo.lua
+++ b/modules/PlayerInfo.lua
@@ -102,7 +102,7 @@ function PlayerInfo.prototype:Enable(core)
self:HideBlizz()
end
- self:ScheduleRepeatingEvent(self.elementName, self.UpdateBuffs, 1, self, self.unit, true)
+ self:ScheduleRepeatingTimer(function() self:RepeatingUpdateBuffs() end, 1)
end
function PlayerInfo.prototype:ShowBlizz()
@@ -120,6 +120,10 @@ function PlayerInfo.prototype:HideBlizz()
BuffFrame:UnregisterAllEvents()
end
+function PlayerInfo.prototype:RepeatingUpdateBuffs()
+ self:UpdateBuffs(self.unit, true)
+end
+
function PlayerInfo.prototype:UpdateBuffs(unit, fromRepeated)
if unit and unit ~= self.unit then
return
diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua
index 3d55efa..59a5624 100644
--- a/modules/PlayerMana.lua
+++ b/modules/PlayerMana.lua
@@ -47,7 +47,7 @@ if self:ShouldUseTicker() then
end,
set = function(info, value)
self.moduleSettings.tickerEnabled = value
- self:ManaType(self.unit)
+ self:ManaType(nil, self.unit)
end,
disabled = function()
return not self.moduleSettings.enabled
@@ -103,18 +103,18 @@ function PlayerMana.prototype:Enable(core)
self:CreateTickerFrame()
if IceHUD.WowVer >= 40000 then
- self:RegisterEvent("UNIT_POWER", "Update")
- self:RegisterEvent("UNIT_MAXPOWER", "Update")
+ self:RegisterEvent("UNIT_POWER", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXPOWER", "UpdateEvent")
else
- self:RegisterEvent("UNIT_MAXMANA", "Update")
- self:RegisterEvent("UNIT_MAXRAGE", "Update")
- self:RegisterEvent("UNIT_MAXENERGY", "Update")
- self:RegisterEvent("UNIT_MAXRUNIC_POWER", "Update")
+ self:RegisterEvent("UNIT_MAXMANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRUNIC_POWER", "UpdateEvent")
- self:RegisterEvent("UNIT_MANA", "Update")
- self:RegisterEvent("UNIT_RAGE", "Update")
+ self:RegisterEvent("UNIT_MANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_RAGE", "UpdateEvent")
self:RegisterEvent("UNIT_ENERGY", "UpdateEnergy")
- self:RegisterEvent("UNIT_RUNIC_POWER", "Update")
+ self:RegisterEvent("UNIT_RUNIC_POWER", "UpdateEvent")
end
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
@@ -127,7 +127,7 @@ function PlayerMana.prototype:Enable(core)
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
- self:ManaType(self.unit)
+ self:ManaType(nil, self.unit)
end
function PlayerMana.prototype:ShouldUseTicker()
@@ -148,7 +148,7 @@ function PlayerMana.prototype:SetupOnUpdate(enable)
end
-function PlayerMana.prototype:EnteringVehicle(unit, arg2)
+function PlayerMana.prototype:EnteringVehicle(event, unit, arg2)
if (self.unit == "player" and IceHUD:ShouldSwapToVehicle(unit, arg2)) then
self.unit = "vehicle"
self:RegisterFontStrings()
@@ -157,7 +157,7 @@ function PlayerMana.prototype:EnteringVehicle(unit, arg2)
end
-function PlayerMana.prototype:ExitingVehicle(unit)
+function PlayerMana.prototype:ExitingVehicle(event, unit)
if (unit == "player" and self.unit == "vehicle") then
self.unit = "player"
self:RegisterFontStrings()
@@ -195,7 +195,7 @@ function PlayerMana.prototype:UseTargetAlpha(scale)
end
-function PlayerMana.prototype:ManaType(unit)
+function PlayerMana.prototype:ManaType(event, unit)
if (unit ~= self.unit) then
return
end
@@ -217,6 +217,10 @@ function PlayerMana.prototype:ManaType(unit)
end
+function PlayerMana.prototype:UpdateEvent(event, unit, powertype)
+ self:Update(unit, powertype)
+end
+
function PlayerMana.prototype:Update(unit, powertype)
PlayerMana.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
@@ -224,7 +228,7 @@ function PlayerMana.prototype:Update(unit, powertype)
end
if powertype ~= nil and powertype == "ENERGY" then
- self:UpdateEnergy(unit)
+ self:UpdateEnergy(nil, unit)
end
if self.unit == "vehicle" and ((not UnitExists(unit)) or (self.maxMana == 0)) then
@@ -311,7 +315,7 @@ end
-function PlayerMana.prototype:UpdateEnergy(unit)
+function PlayerMana.prototype:UpdateEnergy(event, unit)
if (unit and (unit ~= self.unit)) then
return
end
diff --git a/modules/RangeCheck.lua b/modules/RangeCheck.lua
index f36c7e9..14d233d 100644
--- a/modules/RangeCheck.lua
+++ b/modules/RangeCheck.lua
@@ -23,7 +23,7 @@ function RangeCheck.prototype:Enable(core)
DogTag = AceLibrary("LibDogTag-3.0")
self:RegisterFontStrings()
else
- self:ScheduleRepeatingEvent(self.elementName, self.UpdateRange, 0.1, self)
+ self:ScheduleRepeatingTimer(function() self:UpdateRange() end, 0.1)
end
end
diff --git a/modules/Runes.lua b/modules/Runes.lua
index e1b629c..21ec170 100644
--- a/modules/Runes.lua
+++ b/modules/Runes.lua
@@ -204,12 +204,12 @@ end
function Runes.prototype:ResetRuneAvailability()
for i=1, self.numRunes do
- self:UpdateRunePower(i, true)
+ self:UpdateRunePower(nil, i, true)
end
end
-- simply shows/hides the foreground rune when it becomes usable/unusable. this allows the background transparent rune to show only
-function Runes.prototype:UpdateRunePower(rune, dontFlash)
+function Runes.prototype:UpdateRunePower(event, rune, dontFlash)
if not rune or not self.frame.graphical or #self.frame.graphical < rune then
return
end
@@ -255,7 +255,7 @@ function Runes.prototype:ShineFinished(rune)
UIFrameFadeOut(self.frame.graphical[rune].shine, 0.5);
end
-function Runes.prototype:UpdateRuneType(rune)
+function Runes.prototype:UpdateRuneType(event, rune)
-- DEFAULT_CHAT_FRAME:AddMessage("Runes.prototype:UpdateRuneType: rune="..rune.." GetRuneType(rune)="..GetRuneType(rune));
if not rune or tonumber(rune) ~= rune or rune < 1 or rune > self.numRunes then
diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua
index f1506ee..b1c0062 100644
--- a/modules/SliceAndDice.lua
+++ b/modules/SliceAndDice.lua
@@ -41,18 +41,13 @@ function SliceAndDice.prototype:Enable(core)
SliceAndDice.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
- if IceHUD.WowVer >= 30000 then
- self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice")
- self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateDurationBar")
- else
- self:RegisterEvent("PLAYER_AURAS_CHANGED", "UpdateSliceAndDice")
- self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateDurationBar")
- end
+ self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice")
+ self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateDurationBar")
if not self.moduleSettings.alwaysFullAlpha then
self:Show(false)
else
- self:UpdateSliceAndDice(self.unit)
+ self:UpdateSliceAndDice(nil, self.unit)
end
self:SetBottomText1("")
@@ -204,7 +199,7 @@ function SliceAndDice.prototype:GetBuffDuration(unitName, buffName)
return nil, nil
end
-function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate)
+function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
if unit and unit ~= self.unit then
return
end
@@ -224,7 +219,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate)
if sndEndTime and sndEndTime >= now then
if not fromUpdate then
- self.frame:SetScript("OnUpdate", function() self:UpdateSliceAndDice(self.unit, true) end)
+ self.frame:SetScript("OnUpdate", function() self:UpdateSliceAndDice(nil, self.unit, true) end)
end
self:Show(true)
@@ -255,7 +250,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate)
end
end
-function SliceAndDice.prototype:UpdateDurationBar(unit)
+function SliceAndDice.prototype:UpdateDurationBar(event, unit)
if unit and unit ~= self.unit then
return
end
diff --git a/modules/TargetCC.lua b/modules/TargetCC.lua
index 0ae577f..fc0dea2 100644
--- a/modules/TargetCC.lua
+++ b/modules/TargetCC.lua
@@ -236,7 +236,7 @@ function TargetCC.prototype:Enable(core)
self:RegisterEvent("UNIT_AURA", "UpdateTargetDebuffs")
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateTargetDebuffs")
--- self:ScheduleRepeatingEvent(self.elementName, self.UpdateTargetDebuffs, 0.1, self)
+-- self:ScheduleRepeatingTimer(function() self:UpdateTargetDebuffs() end, 0.1)
self:Show(false)
end
@@ -337,10 +337,10 @@ function TargetCC.prototype:GetMaxDebuffDuration(unitName, debuffNames)
return unpack(result)
end
-function TargetCC.prototype:UpdateTargetDebuffs(unit, isUpdate)
+function TargetCC.prototype:UpdateTargetDebuffs(event, unit, isUpdate)
local name, duration, remaining
if not isUpdate then
- self.frame:SetScript("OnUpdate", function() self:UpdateTargetDebuffs(self.unit, true) end)
+ self.frame:SetScript("OnUpdate", function() self:UpdateTargetDebuffs(nil, self.unit, true) end)
self.debuffName, self.debuffDuration, self.debuffRemaining = self:GetMaxDebuffDuration(self.unit, self.debuffList)
else
self.debuffRemaining = math.max(0, self.debuffRemaining - (1.0 / GetFramerate()))
diff --git a/modules/TargetHealth.lua b/modules/TargetHealth.lua
index 5bf3278..1ff1b8c 100644
--- a/modules/TargetHealth.lua
+++ b/modules/TargetHealth.lua
@@ -523,10 +523,10 @@ function IceTargetHealth.prototype:Enable(core)
IceTargetHealth.super.prototype.Enable(self, core)
if self.registerEvents then
- self:RegisterEvent("UNIT_HEALTH", "Update")
- self:RegisterEvent("UNIT_MAXHEALTH", "Update")
- self:RegisterEvent("UNIT_FLAGS", "Update")
- self:RegisterEvent("UNIT_FACTION", "Update")
+ self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
+ self:RegisterEvent("UNIT_FLAGS", "UpdateEvent")
+ self:RegisterEvent("UNIT_FACTION", "UpdateEvent")
self:RegisterEvent("RAID_TARGET_UPDATE", "UpdateRaidTargetIcon")
self:RegisterEvent("UPDATE_FACTION", "CheckPvP")
self:RegisterEvent("PLAYER_FLAGS_CHANGED", "CheckPvP")
@@ -621,6 +621,10 @@ function IceTargetHealth.prototype:EnableClickTargeting(bEnable)
end
+function IceTargetHealth.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
+
function IceTargetHealth.prototype:Update(unit)
IceTargetHealth.super.prototype.Update(self)
diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua
index a08ab0e..7439361 100644
--- a/modules/TargetInfo.lua
+++ b/modules/TargetInfo.lua
@@ -1189,7 +1189,7 @@ end
-function IceTargetInfo.prototype:AuraChanged(unit)
+function IceTargetInfo.prototype:AuraChanged(event, unit)
if (unit == self.unit) then
self:UpdateBuffs()
end
@@ -1234,12 +1234,12 @@ function IceTargetInfo.prototype:TargetChanged()
-- pass "internal" as a paramater so event handler code doesn't execute
-- Update() unnecassarily
- self:TargetName(internal)
+ self:TargetName(nil, internal)
- self:TargetLevel(internal)
- self:TargetReaction(internal)
- self:TargetFaction(internal)
- self:TargetFlags(internal)
+ self:TargetLevel(nil, internal)
+ self:TargetReaction(nil, internal)
+ self:TargetFaction(nil, internal)
+ self:TargetFlags(nil, internal)
self:UpdateBuffs()
self:UpdateRaidTargetIcon()
@@ -1248,7 +1248,7 @@ function IceTargetInfo.prototype:TargetChanged()
end
-function IceTargetInfo.prototype:TargetName(unit)
+function IceTargetInfo.prototype:TargetName(event, unit)
if (unit == self.unit or unit == internal) then
self.name, self.realm = UnitName(self.unit)
self.classLocale, self.classEnglish = UnitClass(self.unit)
@@ -1282,7 +1282,7 @@ function IceTargetInfo.prototype:TargetName(unit)
end
-function IceTargetInfo.prototype:TargetLevel(unit)
+function IceTargetInfo.prototype:TargetLevel(event, unit)
if (unit == self.unit or unit == internal) then
self.level = UnitLevel(self.unit)
@@ -1319,7 +1319,7 @@ end
-- PVP status
-function IceTargetInfo.prototype:TargetFaction(unit)
+function IceTargetInfo.prototype:TargetFaction(event, unit)
if (unit == self.unit or unit == internal) then
if (self.isPlayer) then
if (UnitIsPVP(self.unit)) then
@@ -1341,7 +1341,7 @@ function IceTargetInfo.prototype:TargetFaction(unit)
end
-function IceTargetInfo.prototype:TargetFlags(unit)
+function IceTargetInfo.prototype:TargetFlags(event, unit)
if (unit == self.unit or unit == internal) then
self.tapped = UnitIsTapped(self.unit) and (not UnitIsTappedByPlayer(self.unit))
self.targetCombat = UnitAffectingCombat(self.unit) and " |cffee4030Combat|r" or ""
diff --git a/modules/TargetInvuln.lua b/modules/TargetInvuln.lua
index 5f92ba7..74490ae 100644
--- a/modules/TargetInvuln.lua
+++ b/modules/TargetInvuln.lua
@@ -88,7 +88,7 @@ function TargetInvuln.prototype:Enable(core)
self:RegisterEvent("UNIT_AURA", "UpdateTargetBuffs")
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateTargetBuffs")
--- self:ScheduleRepeatingEvent(self.elementName, self.UpdateTargetBuffs, 0.1, self)
+-- self:ScheduleRepeatingTimer(function() self:UpdateTargetBuffs() end, 0.1)
self:Show(false)
end
@@ -180,10 +180,10 @@ function TargetInvuln.prototype:GetMaxbuffDuration(unitName, buffNames)
return unpack(result)
end
-function TargetInvuln.prototype:UpdateTargetBuffs(unit, isUpdate)
+function TargetInvuln.prototype:UpdateTargetBuffs(event, unit, isUpdate)
local name, duration, remaining
if not isUpdate then
- self.frame:SetScript("OnUpdate", function() self:UpdateTargetBuffs(self.unit, true) end)
+ self.frame:SetScript("OnUpdate", function() self:UpdateTargetBuffs(nil, self.unit, true) end)
self.buffName, self.buffDuration, self.buffRemaining = self:GetMaxbuffDuration(self.unit, self.buffList)
else
diff --git a/modules/TargetMana.lua b/modules/TargetMana.lua
index ab8cd8b..8a56018 100644
--- a/modules/TargetMana.lua
+++ b/modules/TargetMana.lua
@@ -40,33 +40,36 @@ function IceTargetMana.prototype:Enable(core)
if self.registerEvents then
if IceHUD.WowVer >= 40000 then
- self:RegisterEvent("UNIT_POWER", "Update")
- self:RegisterEvent("UNIT_MAXPOWER", "Update")
+ self:RegisterEvent("UNIT_POWER", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXPOWER", "UpdateEvent")
else
- self:RegisterEvent("UNIT_MAXMANA", "Update")
- self:RegisterEvent("UNIT_MAXRAGE", "Update")
- self:RegisterEvent("UNIT_MAXENERGY", "Update")
- self:RegisterEvent("UNIT_MAXFOCUS", "Update")
+ self:RegisterEvent("UNIT_MAXMANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXFOCUS", "UpdateEvent")
- self:RegisterEvent("UNIT_MANA", "Update")
- self:RegisterEvent("UNIT_RAGE", "Update")
- self:RegisterEvent("UNIT_ENERGY", "Update")
- self:RegisterEvent("UNIT_FOCUS", "Update")
+ self:RegisterEvent("UNIT_MANA", "UpdateEvent")
+ self:RegisterEvent("UNIT_RAGE", "UpdateEvent")
+ self:RegisterEvent("UNIT_ENERGY", "UpdateEvent")
+ self:RegisterEvent("UNIT_FOCUS", "UpdateEvent")
-- DK rune stuff
if IceHUD.WowVer >= 30000 then
- self:RegisterEvent("UNIT_RUNIC_POWER", "Update")
- self:RegisterEvent("UNIT_MAXRUNIC_POWER", "Update")
+ self:RegisterEvent("UNIT_RUNIC_POWER", "UpdateEvent")
+ self:RegisterEvent("UNIT_MAXRUNIC_POWER", "UpdateEvent")
end
end
- self:RegisterEvent("UNIT_AURA", "Update")
- self:RegisterEvent("UNIT_FLAGS", "Update")
+ self:RegisterEvent("UNIT_AURA", "UpdateEvent")
+ self:RegisterEvent("UNIT_FLAGS", "UpdateEvent")
end
self:Update(self.unit)
end
+function IceTargetMana.prototype:UpdateEvent(event, unit)
+ self:Update(unit)
+end
function IceTargetMana.prototype:Update(unit)
IceTargetMana.super.prototype.Update(self)
diff --git a/modules/TargetOfTarget.lua b/modules/TargetOfTarget.lua
index 55397aa..e6e3376 100644
--- a/modules/TargetOfTarget.lua
+++ b/modules/TargetOfTarget.lua
@@ -210,7 +210,7 @@ end
function TargetOfTarget.prototype:Enable(core)
TargetOfTarget.super.prototype.Enable(self, core)
- self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.2, self)
+ self:ScheduleRepeatingTimer(function() self:Update() end, 0.2)
RegisterUnitWatch(self.frame)
self:Update()
diff --git a/modules/TargetOfTargetCast.lua b/modules/TargetOfTargetCast.lua
index f1eba89..616ff62 100644
--- a/modules/TargetOfTargetCast.lua
+++ b/modules/TargetOfTargetCast.lua
@@ -37,7 +37,7 @@ end
function TargetTargetCast.prototype:Enable(core)
TargetTargetCast.super.prototype.Enable(self, core)
- self:ScheduleRepeatingEvent(self.elementName, self.UpdateTargetTarget, 0.1, self)
+ self:ScheduleRepeatingTimer(function() self:UpdateTargetTarget() end, 0.1)
end
diff --git a/modules/TargetOfTargetHealth.lua b/modules/TargetOfTargetHealth.lua
index afe28f3..2ed0f25 100644
--- a/modules/TargetOfTargetHealth.lua
+++ b/modules/TargetOfTargetHealth.lua
@@ -110,7 +110,7 @@ function TargetTargetHealth.prototype:Enable(core)
self.moduleSettings.useSelfColor = nil
end
- self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.1, self, "targettarget")
+ self:ScheduleRepeatingTimer(function() self:Update("targettarget") end, 0.1)
end
function TargetTargetHealth.prototype:Disable(core)
diff --git a/modules/TargetOfTargetMana.lua b/modules/TargetOfTargetMana.lua
index 7aae8a7..abf3958 100644
--- a/modules/TargetOfTargetMana.lua
+++ b/modules/TargetOfTargetMana.lua
@@ -60,7 +60,7 @@ function TargetTargetMana.prototype:Enable(core)
self.determineColor = false
TargetTargetMana.super.prototype.Enable(self, core)
- self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.1, self, "targettarget")
+ self:ScheduleRepeatingTimer(function() self:Update("targettarget") end, 0.1)
end
function TargetTargetMana.prototype:Disable(core)
diff --git a/modules/Threat.lua b/modules/Threat.lua
index 7e4ad19..4229310 100644
--- a/modules/Threat.lua
+++ b/modules/Threat.lua
@@ -31,8 +31,6 @@ function IceThreat.prototype:init(name, unit)
self:SetDefaultColor("ThreatCustom", 255, 255, 0)
self:SetDefaultColor("ThreatPullAggro", 255, 0, 0)
self:SetDefaultColor("ThreatSecondPlace", 255, 255, 0)
-
- self:OnCoreLoad()
end
-- default settings
@@ -171,7 +169,7 @@ end
function IceThreat.prototype:Enable(core)
IceThreat.super.prototype.Enable(self, core)
- self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.2, self)
+ self:ScheduleRepeatingTimer(function() self:Update() end, 0.2)
self:Update(self.unit)
end
diff --git a/modules/Totems.lua b/modules/Totems.lua
index 7564b67..e5cefda 100644
--- a/modules/Totems.lua
+++ b/modules/Totems.lua
@@ -205,11 +205,11 @@ end
function Totems.prototype:ResetTotemAvailability()
for i=1, self.numTotems do
- self:UpdateTotem(totem)
+ self:UpdateTotem(nil, totem)
end
end
-function Totems.prototype:UpdateTotem(totem, ...)
+function Totems.prototype:UpdateTotem(event, totem, ...)
if not totem or tonumber(totem) ~= totem or totem < 1 or totem > self.numTotems then
return
end