- 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:
Parnic
2010-10-25 02:05:58 +00:00
parent d0be3b42a7
commit e003fab854
20 changed files with 324 additions and 187 deletions

View File

@ -174,20 +174,24 @@ function TargetInvuln.prototype:GetMaxbuffDuration(unitName, buffNames)
return unpack(result)
end
function TargetInvuln.prototype:MyOnUpdate()
TargetInvuln.super.prototype.MyOnUpdate(self)
self:UpdateTargetBuffs(nil, self.unit, true)
end
function TargetInvuln.prototype:UpdateTargetBuffs(event, unit, isUpdate)
local name, duration, remaining
if not isUpdate then
self.frame:SetScript("OnUpdate", function() self:UpdateTargetBuffs(nil, self.unit, true) end)
self.buffName, self.buffDuration, self.buffRemaining = self:GetMaxbuffDuration(self.unit, self.buffList)
if not isUpdate then
self.buffName, self.buffDuration, self.buffRemaining = self:GetMaxbuffDuration(self.unit, self.buffList)
else
self.buffRemaining = math.max(0, self.buffRemaining - (1.0 / GetFramerate()))
self.buffRemaining = math.max(0, self.buffRemaining - (GetTime() - self.lastUpdateTime))
if self.buffRemaining <= 0 then
self.buffName = nil
self.frame:SetScript("OnUpdate", nil)
end
end
self.lastUpdateTime = GetTime()
name = self.buffName
duration = self.buffDuration