mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- removed most of the rest of the garbage that was being generated during combat or when changing targets
- reduced cpu usage by 33%-50% across the board (and more in some cases) by changing how updates are registered and how often they run. now the 'update period' slider actually matters. it defaults to 0.033 meaning that frames update about 30 times a second instead of every frame - fixed the "always" display mode for cooldown bars to respect alpha settings (ooc/with target/in combat/etc.)
This commit is contained in:
@ -316,18 +316,23 @@ function TargetCC.prototype:GetMaxDebuffDuration(unitName, debuffNames)
|
||||
return unpack(result)
|
||||
end
|
||||
|
||||
function TargetCC.prototype:MyOnUpdate()
|
||||
TargetCC.super.prototype.MyOnUpdate(self)
|
||||
self:UpdateTargetDebuffs(nil, self.unit, true)
|
||||
end
|
||||
|
||||
function TargetCC.prototype:UpdateTargetDebuffs(event, unit, isUpdate)
|
||||
local name, duration, remaining
|
||||
|
||||
if not isUpdate then
|
||||
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()))
|
||||
self.debuffRemaining = math.max(0, self.debuffRemaining - (GetTime() - self.lastUpdateTime))
|
||||
if self.debuffRemaining <= 0 then
|
||||
self.debuffName = nil
|
||||
self.frame:SetScript("OnUpdate", nil)
|
||||
end
|
||||
end
|
||||
self.lastUpdateTime = GetTime()
|
||||
|
||||
name = self.debuffName
|
||||
duration = self.debuffDuration
|
||||
|
Reference in New Issue
Block a user