diff modules/Totem.lua @ 222:d08a74e86c96

un-namespace totem, pet, stance, vehicle exit
author Flick <flickerstreak@gmail.com>
date Sun, 21 Nov 2010 14:42:38 -0800
parents e63aefb8a555
children c4b134512c50
line wrap: on
line diff
--- a/modules/Totem.lua	Sun Nov 21 12:51:24 2010 -0800
+++ b/modules/Totem.lua	Sun Nov 21 14:42:38 2010 -0800
@@ -21,21 +21,11 @@
 
 -- handlers
 function module:OnInitialize()
-  self.db = ReAction.db:RegisterNamespace( moduleID,
-    {
-      profile = { 
-        buttons = { }
-      }
-    }
-  )
-
   self.buttons = { }
 
   ReAction.RegisterCallback(self, "OnCreateBar", "OnRefreshBar")
   ReAction.RegisterCallback(self, "OnDestroyBar")
   ReAction.RegisterCallback(self, "OnRefreshBar")
-  ReAction.RegisterCallback(self, "OnEraseBar")
-  ReAction.RegisterCallback(self, "OnRenameBar")
 
   self:RegisterEvent("UPDATE_MULTI_CAST_ACTIONBAR","PLAYER_ENTERING_WORLD")
 end
@@ -61,17 +51,17 @@
 end
 
 function module:OnRefreshBar(event, bar, name)
-  if bar.config.type == moduleID then
+  local config = bar:GetConfig()
+  if config.type == moduleID then
     local btns = self.buttons[bar]
     if btns == nil then
       btns = { }
       self.buttons[bar] = btns
     end
-    local profile = self.db.profile
-    if profile.buttons[name] == nil then
-      profile.buttons[name] = {}
+    if not config.buttons then
+      config.buttons = { }
     end
-    local btnCfg = profile.buttons[name]
+    local btnCfg = config.buttons
 
     local r, c = bar:GetButtonGrid()
     local n = min(r*c,6)
@@ -111,21 +101,6 @@
 
 end
 
-function module:OnEraseBar(event, bar, name)
-  self.db.profile.buttons[name] = nil
-end
-
-function module:OnRenameBar(event, bar, oldName, newName)
-  local b = self.db.profile.buttons
-  b[newname], b[oldname] = b[oldname], nil
-end
-
-function module:RefreshAll()
-  for bar in pairs(self.buttons) do
-    self:OnRefreshBar(nil,bar,bar:GetName())
-  end
-end
-
 function module:UPDATE_MULTI_CAST_ACTIONBAR()
   if not InCombatLockdown() then
     for bar in pairs(self.buttons) do