mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- very minor perf gain by not doing the per-frame update on invisible modules
- nuked the primary offender of garbage generation. there is more to get rid of but finding it is a tedious process
This commit is contained in:
@ -1229,6 +1229,9 @@ function IceBarElement.prototype:Update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceBarElement.prototype:MyOnUpdate()
|
function IceBarElement.prototype:MyOnUpdate()
|
||||||
|
if not self:IsVisible() then
|
||||||
|
return
|
||||||
|
end
|
||||||
self:SetScale(self.DesiredScale)
|
self:SetScale(self.DesiredScale)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -690,7 +690,9 @@ function IceCore.prototype:HandleUpdates()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceCore.prototype:RequestUpdates(frame, func)
|
function IceCore.prototype:RequestUpdates(frame, func)
|
||||||
|
if self.updatees[frame] ~= func then
|
||||||
self.updatees[frame] = func
|
self.updatees[frame] = func
|
||||||
|
end
|
||||||
|
|
||||||
local count = 0
|
local count = 0
|
||||||
for k,v in pairs(self.updatees) do
|
for k,v in pairs(self.updatees) do
|
||||||
|
@ -48,7 +48,9 @@ end
|
|||||||
|
|
||||||
function IceCustomBar.prototype:ConditionalSubscribe()
|
function IceCustomBar.prototype:ConditionalSubscribe()
|
||||||
if self:ShouldAlwaysSubscribe() then
|
if self:ShouldAlwaysSubscribe() then
|
||||||
|
if not IceHUD.IceCore:IsUpdateSubscribed(self.frame) then
|
||||||
IceHUD.IceCore:RequestUpdates(self.frame, function() self:UpdateCustomBar() end)
|
IceHUD.IceCore:RequestUpdates(self.frame, function() self:UpdateCustomBar() end)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
IceHUD.IceCore:RequestUpdates(self.frame, nil)
|
IceHUD.IceCore:RequestUpdates(self.frame, nil)
|
||||||
end
|
end
|
||||||
|
@ -436,7 +436,9 @@ function IceCustomCDBar.prototype:EnableUpdates(enable_update)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if enable_update then
|
if enable_update then
|
||||||
|
if not IceHUD.IceCore:IsUpdateSubscribed(self.frame) then
|
||||||
IceHUD.IceCore:RequestUpdates(self.frame, function() self:UpdateCustomBar(true) end)
|
IceHUD.IceCore:RequestUpdates(self.frame, function() self:UpdateCustomBar(true) end)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
IceHUD.IceCore:RequestUpdates(self.frame, nil)
|
IceHUD.IceCore:RequestUpdates(self.frame, nil)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user