- minor fixes to enabling a module and how updates are handled that should allow custom modules to react appropriately when they are enabled while a player has the buff they're monitoring

This commit is contained in:
Parnic
2010-09-22 00:15:35 +00:00
parent 1fa11ea3dd
commit cd50276d35
3 changed files with 10 additions and 9 deletions

View File

@ -667,19 +667,19 @@ function IceCore.prototype:SetUpdatePeriod(period)
end
-- For elements that want to receive updates even when hidden
function IceCore.HandleUpdates()
local update_period = IceHUD.IceCore:UpdatePeriod()
function IceCore.prototype:HandleUpdates()
local update_period = self:UpdatePeriod()
local elapsed = 1 / GetFramerate()
IceCore.prototype.update_elapsed = IceCore.prototype.update_elapsed + elapsed
if (IceCore.prototype.update_elapsed > update_period) then
for frame, func in pairs(IceCore.prototype.updatees)
self.update_elapsed = self.update_elapsed + elapsed
if (self.update_elapsed > update_period) then
for frame, func in pairs(self.updatees)
do
func()
end
if (elapsed > update_period) then
IceCore.prototype.update_elapsed = 0
self.update_elapsed = 0
else
IceCore.prototype.update_elapsed = IceCore.prototype.update_elapsed - update_period
self.update_elapsed = self.update_elapsed - update_period
end
end
end
@ -695,7 +695,7 @@ function IceCore.prototype:RequestUpdates(frame, func)
if (count == 0) then
self.IceHUDFrame:SetScript("OnUpdate", nil)
else
self.IceHUDFrame:SetScript("OnUpdate", IceCore.HandleUpdates)
self.IceHUDFrame:SetScript("OnUpdate", function() self:HandleUpdates() end)
end
end

View File

@ -32,9 +32,9 @@ function IceCustomCDBar.prototype:Enable(core)
self.moduleSettings.auraIconScale = 1
end
self:EnableUpdates(false)
self:UpdateCustomBar()
self:UpdateIcon()
self:EnableUpdates(false)
if self.moduleSettings.auraIconXOffset == nil then
self.moduleSettings.auraIconXOffset = 40

View File

@ -388,6 +388,7 @@ function IceCustomCount.prototype:Enable(core)
self.unit = self.moduleSettings.auraTarget
self:CreateCustomFrame(true)
self:UpdateCustomCount()
end