diff ReAction.lua @ 38:00f08528faaf

HideBlizzard now reroutes InterfaceOptions->ActionBars to InterfaceOptions->AddOns->ReAction if hide-blizzard-bars is checked
author Flick <flickerstreak@gmail.com>
date Thu, 03 Apr 2008 21:08:52 +0000
parents 52ac6db0c8ca
children e0d8074a5bc7
line wrap: on
line diff
--- a/ReAction.lua	Thu Apr 03 21:07:05 2008 +0000
+++ b/ReAction.lua	Thu Apr 03 21:08:52 2008 +0000
@@ -113,26 +113,9 @@
     end
   end
 
-  local function CallOptsModule(method,...)
-    local m = ReAction:GetModule("ConfigUI",true)
-    if not m then
-      LoadAddOn("ReAction_ConfigUI")
-      m = ReAction:GetModule("ConfigUI")
-    end
-    if m then
-      if type(m) == "table" and type(m[method]) == "function" then
-        m[method](m,...)
-      else
-        dbprint(("Bad call '%s' to options module"):format(tostring(method)));
-      end
-    else
-      ReAction:Print("Options module not found")
-    end
-  end
-
   SlashHandler = function(option)
     if option == "config" then
-      CallOptsModule("OpenConfig",true)
+      ReAction:ShowConfig()
     elseif option == "unlock" then
       ReAction:SetConfigMode(true)
     elseif option == "lock" then
@@ -228,6 +211,24 @@
   end
 end
 
+function ReAction:CallModuleMethod(modulename, method, ...)
+  local m = self:GetModule(modulename,true)
+  if not m then
+    LoadAddOn(("ReAction_%s"):format(modulename))
+    m = self:GetModule(modulename,true)
+  end
+  if m then
+    if type(m) == "table" and type(m[method]) == "function" then
+      m[method](m,...)
+    else
+      dbprint(("Bad call '%s' to %s module"):format(tostring(method),modulename));
+    end
+  else
+    self:Print(("Module '%s' not found"):format(tostring(modulename)))
+  end
+end
+
+
 function ReAction:CreateBar(name, defaultConfig, prefix)
   local profile = self.db.profile
   defaultConfig = defaultConfig or profile.defaultBar
@@ -320,3 +321,8 @@
   self:CallMethodOnAllModules("ApplyConfigMode",mode,self.bars)
   self.configMode = mode
 end
+
+function ReAction:ShowConfig()
+  self:CallModuleMethod("ConfigUI","OpenConfig")
+end
+