diff modules/PetAction.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/PetAction.lua	Sun Nov 21 12:51:24 2010 -0800
+++ b/modules/PetAction.lua	Sun Nov 21 14:42:38 2010 -0800
@@ -35,13 +35,6 @@
 
 -- module methods
 function module:OnInitialize()
-  self.db = ReAction.db:RegisterNamespace( moduleID,
-    { 
-      profile = {
-        buttons = { }
-      }
-    }
-  )
   self.buttons = { }
 
   ReAction:RegisterBarOptionGenerator(self, "GetBarOptions")
@@ -49,8 +42,6 @@
   ReAction.RegisterCallback(self, "OnCreateBar")
   ReAction.RegisterCallback(self, "OnDestroyBar")
   ReAction.RegisterCallback(self, "OnRefreshBar")
-  ReAction.RegisterCallback(self, "OnEraseBar")
-  ReAction.RegisterCallback(self, "OnRenameBar")
 end
 
 function module:OnEnable()
@@ -70,16 +61,16 @@
 end
 
 function module:OnRefreshBar(event, bar, name)
-  if bar.config.type == moduleID then
+  local config = bar:GetConfig()
+  if config.type == moduleID then
     if self.buttons[bar] == nil then
       self.buttons[bar] = { }
     end
     local btns = self.buttons[bar]
-    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 = r*c
@@ -125,14 +116,6 @@
   end
 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
 
 
 ---- Options ----