diff modules/Bag.lua @ 147:901c91dc1bf2

Some refactoring of configmode/keybind handlers
author Flick <flickerstreak@gmail.com>
date Thu, 07 May 2009 23:55:00 +0000
parents 86564b5cbbff
children df68b5a40490
line wrap: on
line diff
--- a/modules/Bag.lua	Thu Apr 30 16:51:43 2009 +0000
+++ b/modules/Bag.lua	Thu May 07 23:55:00 2009 +0000
@@ -17,9 +17,6 @@
   -- mixins go here
 )
 
--- libraries
-local KB = LibStub("LibKeyBound-1.0")
-
 -- handlers
 function module:OnInitialize()
   self.db = ReAction.db:RegisterNamespace( moduleID,
@@ -37,11 +34,6 @@
   ReAction.RegisterCallback(self, "OnRefreshBar")
   ReAction.RegisterCallback(self, "OnEraseBar")
   ReAction.RegisterCallback(self, "OnRenameBar")
-  ReAction.RegisterCallback(self, "OnConfigModeChanged")
-
-  KB.RegisterCallback(self, "LIBKEYBOUND_ENABLED")
-  KB.RegisterCallback(self, "LIBKEYBOUND_DISABLED")
-  KB.RegisterCallback(self, "LIBKEYBOUND_MODE_COLOR_CHANGED","LIBKEYBOUND_ENABLED")
 end
 
 function module:OnEnable()
@@ -125,36 +117,6 @@
   b[newname], b[oldname] = b[oldname], nil
 end
 
-function module:OnConfigModeChanged(event, mode)
-  for bar in pairs(self.buttons) do
-    for b in bar:IterateButtons() do
-      b:UpdateActionIDLabel(mode)
-    end
-  end
-end
-
-function module:LIBKEYBOUND_ENABLED(evt)
-  for _, buttons in pairs(self.buttons) do
-    for _, b in pairs(buttons) do
-      b:SetKeybindMode(true)
-    end
-  end
-end
-
-function module:LIBKEYBOUND_DISABLED(evt)
-  for _, buttons in pairs(self.buttons) do
-    for _, b in pairs(buttons) do
-      b:SetKeybindMode(false)
-    end
-  end
-end
-
-function module:RefreshAll()
-  for bar in pairs(self.buttons) do
-    self:OnRefreshBar(nil,bar,bar:GetName())
-  end
-end
-
 
 -- hook some functions to propagate to our bag buttons
 hooksecurefunc("Disable_BagButtons",