diff modules/FuBar_ReActionFu/FuBar_ReActionFu.lua @ 28:21bcaf8215ff

- converted to Ace3 - rearranged file layout - configGUI menus not working right now
author Flick <flickerstreak@gmail.com>
date Mon, 17 Mar 2008 18:24:53 +0000
parents dba04d85c799
children 0d95ce7a9ec2
line wrap: on
line diff
--- a/modules/FuBar_ReActionFu/FuBar_ReActionFu.lua	Tue Mar 11 21:39:34 2008 +0000
+++ b/modules/FuBar_ReActionFu/FuBar_ReActionFu.lua	Mon Mar 17 18:24:53 2008 +0000
@@ -12,9 +12,9 @@
 
 -- module declaration
 local moduleID = "ReActionFu"
-local module = ReAction:NewModule( moduleID,
-  "FuBarPlugin-2.0"
-)
+local rmodule = ReAction:NewModule( moduleID )
+local module  = AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0")
+rmodule.fubar = module
 
 module.hasIcon = "Interface\\Icons\\INV_Qiraj_JewelEncased"
 module.hasNoColor = true
@@ -25,39 +25,38 @@
 module.defaultPosition = "LEFT"
 module.defaultMinimapPosition = 240 -- degrees
 
-function module:OnInitialize()
-  self.db = ReAction:AcquireDBNamespace(moduleID)
-  ReAction:RegisterDefaults(moduleID,"profile", 
+function rmodule:OnInitialize()
+  self.db = ReAction.db:RegisterNamespace(moduleID,
     {
-      requireFuBar = false
+      profile = {
+        requireFuBar = false
+      }
     }
   )
+  self.db.RegisterCallback(self,"OnProfileChanged")
 
   if self.db.profile.requireFuBar == true then
     self:Hide()
   end
-end
-
-function module:OnEnable()
 
 end
 
-function module:OnDisable()
+function rmodule:OnEnable()
 
 end
 
-function module:OnProfileEnable()
+function rmodule:OnDisable()
+
+end
+
+function rmodule:OnProfileChanged()
   if self.db.profile.requireFuBar == true then
-    self:Hide()
+    module:Hide()
   else
     self:Show()
   end
 end
 
-function module:OnProfileDisable()
-
-end
-
 function module:OnTooltipUpdate()
 
 end
@@ -77,9 +76,11 @@
     Dewdrop:InjectAceOptionsTable(ReAction,opts)
     self.aceOptionsTable = opts
   end
-  for _, m in ReAction:IterateModulesWithMethod("GetGlobalOptions") do
-    for k,v in pairs(m:GetGlobalOptions()) do
-      self.aceOptionsTable.args[k] = v
+  for _, m in ReAction:IterateModules() do
+    if m and type(m.GetGlobalOptions) == "function" then
+      for k,v in pairs(m:GetGlobalOptions()) do
+        self.aceOptionsTable.args[k] = v
+      end
     end
   end
   Dewdrop:FeedAceOptionsTable(self.aceOptionsTable)