performance optimizations:

- only run the OnUpdate code for the player mana bar when the player's power is not full
- never run the every-frame OnUpdate for TargetMana or DruidMana bars since we don't need quite that level of granularity
This commit is contained in:
Parnic
2008-10-29 04:01:11 +00:00
parent eaa7b73b85
commit 2814ba0d20
4 changed files with 45 additions and 54 deletions

View File

@ -503,7 +503,7 @@ function IceBarElement.prototype:CreateFrame()
-- never register the OnUpdate for the mirror bar since it's handled internally
-- in addition, do not register OnUpdate if predictedPower is set and this is the player mana or target mana bar
if not string.find(self.elementName, "MirrorBar")
and ((IceHUD.WowVer < 30000 or not GetCVarBool("predictedPower")) or (not string.find(self.elementName, "PlayerMana") and not string.find(self.elementName, "TargetMana"))) then
and ((IceHUD.WowVer < 30000 or not GetCVarBool("predictedPower")) or (not string.find(self.elementName, "PlayerMana"))) then
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
end
end