mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- 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:
16
IceCore.lua
16
IceCore.lua
@ -667,19 +667,19 @@ function IceCore.prototype:SetUpdatePeriod(period)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- For elements that want to receive updates even when hidden
|
-- For elements that want to receive updates even when hidden
|
||||||
function IceCore.HandleUpdates()
|
function IceCore.prototype:HandleUpdates()
|
||||||
local update_period = IceHUD.IceCore:UpdatePeriod()
|
local update_period = self:UpdatePeriod()
|
||||||
local elapsed = 1 / GetFramerate()
|
local elapsed = 1 / GetFramerate()
|
||||||
IceCore.prototype.update_elapsed = IceCore.prototype.update_elapsed + elapsed
|
self.update_elapsed = self.update_elapsed + elapsed
|
||||||
if (IceCore.prototype.update_elapsed > update_period) then
|
if (self.update_elapsed > update_period) then
|
||||||
for frame, func in pairs(IceCore.prototype.updatees)
|
for frame, func in pairs(self.updatees)
|
||||||
do
|
do
|
||||||
func()
|
func()
|
||||||
end
|
end
|
||||||
if (elapsed > update_period) then
|
if (elapsed > update_period) then
|
||||||
IceCore.prototype.update_elapsed = 0
|
self.update_elapsed = 0
|
||||||
else
|
else
|
||||||
IceCore.prototype.update_elapsed = IceCore.prototype.update_elapsed - update_period
|
self.update_elapsed = self.update_elapsed - update_period
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -695,7 +695,7 @@ function IceCore.prototype:RequestUpdates(frame, func)
|
|||||||
if (count == 0) then
|
if (count == 0) then
|
||||||
self.IceHUDFrame:SetScript("OnUpdate", nil)
|
self.IceHUDFrame:SetScript("OnUpdate", nil)
|
||||||
else
|
else
|
||||||
self.IceHUDFrame:SetScript("OnUpdate", IceCore.HandleUpdates)
|
self.IceHUDFrame:SetScript("OnUpdate", function() self:HandleUpdates() end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,9 +32,9 @@ function IceCustomCDBar.prototype:Enable(core)
|
|||||||
self.moduleSettings.auraIconScale = 1
|
self.moduleSettings.auraIconScale = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:EnableUpdates(false)
|
||||||
self:UpdateCustomBar()
|
self:UpdateCustomBar()
|
||||||
self:UpdateIcon()
|
self:UpdateIcon()
|
||||||
self:EnableUpdates(false)
|
|
||||||
|
|
||||||
if self.moduleSettings.auraIconXOffset == nil then
|
if self.moduleSettings.auraIconXOffset == nil then
|
||||||
self.moduleSettings.auraIconXOffset = 40
|
self.moduleSettings.auraIconXOffset = 40
|
||||||
|
@ -388,6 +388,7 @@ function IceCustomCount.prototype:Enable(core)
|
|||||||
self.unit = self.moduleSettings.auraTarget
|
self.unit = self.moduleSettings.auraTarget
|
||||||
|
|
||||||
self:CreateCustomFrame(true)
|
self:CreateCustomFrame(true)
|
||||||
|
self:UpdateCustomCount()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user