diff Options.lua @ 257:920d17851a93 stable

Merge 1.1 beta 4 to stable
author Flick
date Tue, 12 Apr 2011 16:06:31 -0700
parents 741c4f9b251e
children 36a29870bf34
line wrap: on
line diff
--- a/Options.lua	Thu Nov 18 13:11:08 2010 -0800
+++ b/Options.lua	Tue Apr 12 16:06:31 2011 -0700
@@ -40,10 +40,9 @@
             type     = "toggle",
             name     = L["Hide Blizzard Action Bars"],
             desc     = L["Hide the default main bar and extra action bars"],
-            handler  = self:GetModule("HideBlizzard"),
-            get      = "IsHidden",
-            set      = "SetHidden",
-            disabled = "OptionDisabled",
+            get      = "OptionGetHideBlizzardBars",
+            set      = "OptionSetHideBlizzardBars",
+            disabled = InCombatLockdown,
             width    = "full",
             order    = 3,
           },
@@ -51,10 +50,9 @@
             type     = "toggle",
             name     = L["Hide Blizzard Vehicle Bar"],
             desc     = L["Hide the default vechicle action bar"],
-            handler  = self:GetModule("HideBlizzard"),
-            get      = "IsHidden",
-            set      = "SetHidden",
-            disabled = "OptionDisabled",
+            get      = "OptionGetHideBlizzardVehicleBar",
+            set      = "OptionSetHideBlizzardVehicleBar",
+            disabled = function() return InCombatLockdown() or ReAction:OptionGetHideBlizzardBars() == false end,
             width    = "full",
             order    = 4,
           },
@@ -101,10 +99,6 @@
 
   AceConfigDialog:AddToBlizOptions(configID, options.args.profiles.name, configID, "profiles")
 
-  self.db.RegisterCallback(self,"OnProfileChanged")
-  self.db.RegisterCallback(self,"OnProfileReset", "OnProfileChanged")
-  self.db.RegisterCallback(self,"OnProfileCopied","OnProfileChanged")
-
   SlashCmdList["REACTION"] = function(option)
     option = string.match(option or "", "^%s*(%S+)")
     if option == "config" or option == "options" then
@@ -139,6 +133,14 @@
     showAlert = true,
     whileDead = true,
   }
+
+  -- reroute blizzard action bar config to ReAction config window
+  InterfaceOptionsActionBarsPanel:HookScript("OnShow", 
+    function() 
+      if ReAction:OptionGetHideBlizzardBars() then
+        ReAction:ShowOptions()
+      end
+    end )
 end
 
 
@@ -147,14 +149,6 @@
 end
 
 
-function ReAction:OnProfileChanged()
-  self:RebuildAll()
-  if not self.db.global.skipKeybindWarning then
-    StaticPopup_Show("REACTION_KB_WARN")
-  end
-end
-
-
 function ReAction:OptionSetConfigMode(info, value)
   self:SetConfigMode(value) 
 end
@@ -181,6 +175,25 @@
 end
 
 
+function ReAction:OptionSetHideBlizzardBars( info, hide )
+  self.db.profile.options.hideBlizzardBars = hide
+  self:ManageBlizzardBars()
+end
+
+function ReAction:OptionGetHideBlizzardBars()
+  return self.db.profile.options.hideBlizzardBars
+end
+
+function ReAction:OptionSetHideBlizzardVehicleBar( info, hide )
+  self.db.profile.options.hideBlizzardVehicleBar = hide
+  self:ManageBlizzardBars()
+end
+
+function ReAction:OptionGetHideBlizzardVehicleBar()
+  return self.db.profile.options.hideBlizzardVehicleBar
+end
+
+
 -- export to LDB
 local LDB = LibStub:GetLibrary("LibDataBroker-1.1")
 if LDB then