Mercurial > wow > reaction
diff modules/ConfigUI.lua @ 182:55c2fc0c8d55
Collect options in one file
clean up ReAction.lua a bit
remove AceConsole-3.0
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Thu, 21 Oct 2010 22:07:11 +0000 |
parents | df68b5a40490 |
children | 1ee86bbb05a0 |
line wrap: on
line diff
--- a/modules/ConfigUI.lua Wed Oct 20 23:42:40 2010 +0000 +++ b/modules/ConfigUI.lua Thu Oct 21 22:07:11 2010 +0000 @@ -35,11 +35,9 @@ self:RegisterEvent("PLAYER_REGEN_DISABLED") ReAction.RegisterCallback(self,"OnOptionsRegistered","OnOptionsRefreshed") ReAction.RegisterCallback(self,"OnOptionsRefreshed") - self:InitializeOptions() end function module:OnOptionsRefreshed(evt) - AceConfigReg:NotifyChange(configName) if self.editor then self.editor:Refresh() end end @@ -49,60 +47,28 @@ end end -function module:OpenConfig() - InterfaceOptionsFrame_OpenToCategory(configName) +function module:OptionShowEditor() + self:LaunchBarEditor() + -- you can't close a dialog in response to an options click, because the end of the + -- handler for all the button events calls lib:Open() + -- So, schedule a close on the next OnUpdate + if self.db.profile.closeOnLaunch then + self.editor.closePending = true + end end -function module:InitializeOptions() - ReAction:RegisterOptions(self, { - _launchEditor = { - type = "execute", - handler = self, - name = L["Edit Bars..."], - desc = L["Show the ReAction Bar Editor dialogue"], - func = function() - self:LaunchBarEditor() - -- you can't close a dialog in response to an options click, because the end of the - -- handler for all the button events calls lib:Open() - -- So, schedule a close on the next OnUpdate - if self.db.profile.closeOnLaunch then - self.editor.closePending = true - end - end, - order = 2, - }, - _closeThis = { - type = "toggle", - name = L["Close on Launch"], - desc = L["Close the Interface Options window when launching the ReAction Bar Editor"], - get = function() return self.db.profile.closeOnLaunch end, - set = function(info, val) self.db.profile.closeOnLaunch = val end, - order = 3, - }, - _keybind = { - type = "execute", - handler = self, - name = L["Key Bindings"], - desc = L["Show the keybinding dialogue"], - func = function() - ReAction:SetKeybindMode(true) - end, - order = 4, - }, - }, true) -- global +function module:OptionGetCloseThis() + return self.db.profile.closeOnLaunch +end - AceConfigReg:RegisterOptionsTable(configName,ReAction.options) - self.frame = AceConfigDialog:AddToBlizOptions(configName, configName) - self.frame.obj:SetCallback("default", - function() - ReAction.db:ResetProfile() - ReAction:RefreshOptions() - end ) +function module:OptionSetCloseThis(info,val) + self.db.profile.closeOnLaunch = val end + -- Bar Editor -- local function NewEditor() -- private variables @@ -168,7 +134,7 @@ name = L["Global Config"], desc = L["Opens ReAction global configuration settings panel"], func = function() - module:OpenConfig() + ReAction:ShowOptions() -- you can't close a dialog in response to an options click, because the end of the -- handler for all the button events calls lib:Open() -- So, schedule a close on the next OnUpdate