Mercurial > wow > reaction
diff modules/PetAction.lua @ 148:de1da46dadb3
moved unitwatch handling into bar
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Fri, 08 May 2009 00:06:53 +0000 |
parents | 901c91dc1bf2 |
children | 8cc187143acd |
line wrap: on
line diff
--- a/modules/PetAction.lua Thu May 07 23:55:00 2009 +0000 +++ b/modules/PetAction.lua Fri May 08 00:06:53 2009 +0000 @@ -52,7 +52,6 @@ ReAction.RegisterCallback(self, "OnRefreshBar") ReAction.RegisterCallback(self, "OnEraseBar") ReAction.RegisterCallback(self, "OnRenameBar") - ReAction.RegisterCallback(self, "OnConfigModeChanged") end function module:OnEnable() @@ -73,10 +72,7 @@ function module:OnCreateBar(event, bar, name) if bar.config.type == moduleID then -- auto show/hide when pet exists - bar:GetFrame():SetAttribute("unit","pet") - if not ReAction:GetConfigMode() then - RegisterUnitWatch(bar:GetFrame()) - end + bar:RegisterUnitWatch("pet",true) self:OnRefreshBar(event, bar, name) end end @@ -147,23 +143,6 @@ end -function module:OnConfigModeChanged(event, mode) - for _, bar in ReAction:IterateBars() do - if bar and self.buttons[bar] then - for b in bar:IterateButtons() do - b:UpdateActionIDLabel(mode) - end - local f = bar:GetFrame() - if mode then - UnregisterUnitWatch(f) - f:Show() - else - RegisterUnitWatch(f) - end - end - end -end - ---- Options ---- local Handler = { } local meta = { __index = Handler }