- added code to buff/debuff watchers and cooldown watchers to prevent them from sometimes getting stuck (not updating/animating)

This commit is contained in:
Parnic
2011-12-06 03:51:22 +00:00
parent 6e4b194900
commit d7e4bfbee2
3 changed files with 11 additions and 1 deletions

View File

@ -848,7 +848,11 @@ end
function IceCore.prototype:RequestUpdates(module, func)
if self.updatees[module] ~= func then
self.updatees[module] = func
-- Parnic: this prevents modules who are handling their own updates (as opposed to relying on IceBarElement)
-- from having their update request yanked out from under them.
if func ~= nil or not module.handlesOwnUpdates then
self.updatees[module] = func
end
end
local count = 0

View File

@ -72,9 +72,11 @@ function IceCustomBar.prototype:ConditionalSubscribe()
self.CustomBarUpdateFunc = function() self:UpdateCustomBar() end
end
self.handlesOwnUpdates = true
IceHUD.IceCore:RequestUpdates(self, self.CustomBarUpdateFunc)
end
else
self.handlesOwnUpdates = false
IceHUD.IceCore:RequestUpdates(self, nil)
end
end
@ -700,6 +702,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
self.UpdateCustomBarFunc = function() self:UpdateCustomBar(self.unit, true) end
end
self.handlesOwnUpdates = true
IceHUD.IceCore:RequestUpdates(self, self.UpdateCustomBarFunc)
end
@ -718,6 +721,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
self:UpdateBar(0, "undef")
self:Show(false)
if not self:ShouldAlwaysSubscribe() then
self.handlesOwnUpdates = false
IceHUD.IceCore:RequestUpdates(self, nil)
end
end

View File

@ -521,6 +521,8 @@ function IceCustomCDBar.prototype:EnableUpdates(enable_update)
-- end
end
self.handlesOwnUpdates = enable_update
if enable_update then
if not self.CustomUpdateFunc then
self.CustomUpdateFunc = function() self:UpdateCustomBar(true) end