comparison 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
comparison
equal deleted inserted replaced
210:b2b105747466 257:920d17851a93
38 }, 38 },
39 hide = { 39 hide = {
40 type = "toggle", 40 type = "toggle",
41 name = L["Hide Blizzard Action Bars"], 41 name = L["Hide Blizzard Action Bars"],
42 desc = L["Hide the default main bar and extra action bars"], 42 desc = L["Hide the default main bar and extra action bars"],
43 handler = self:GetModule("HideBlizzard"), 43 get = "OptionGetHideBlizzardBars",
44 get = "IsHidden", 44 set = "OptionSetHideBlizzardBars",
45 set = "SetHidden", 45 disabled = InCombatLockdown,
46 disabled = "OptionDisabled",
47 width = "full", 46 width = "full",
48 order = 3, 47 order = 3,
49 }, 48 },
50 hideVehicle = { 49 hideVehicle = {
51 type = "toggle", 50 type = "toggle",
52 name = L["Hide Blizzard Vehicle Bar"], 51 name = L["Hide Blizzard Vehicle Bar"],
53 desc = L["Hide the default vechicle action bar"], 52 desc = L["Hide the default vechicle action bar"],
54 handler = self:GetModule("HideBlizzard"), 53 get = "OptionGetHideBlizzardVehicleBar",
55 get = "IsHidden", 54 set = "OptionSetHideBlizzardVehicleBar",
56 set = "SetHidden", 55 disabled = function() return InCombatLockdown() or ReAction:OptionGetHideBlizzardBars() == false end,
57 disabled = "OptionDisabled",
58 width = "full", 56 width = "full",
59 order = 4, 57 order = 4,
60 }, 58 },
61 edit = { 59 edit = {
62 type = "execute", 60 type = "execute",
98 AceConfigReg:NotifyChange(configID) 96 AceConfigReg:NotifyChange(configID)
99 end ) 97 end )
100 end 98 end
101 99
102 AceConfigDialog:AddToBlizOptions(configID, options.args.profiles.name, configID, "profiles") 100 AceConfigDialog:AddToBlizOptions(configID, options.args.profiles.name, configID, "profiles")
103
104 self.db.RegisterCallback(self,"OnProfileChanged")
105 self.db.RegisterCallback(self,"OnProfileReset", "OnProfileChanged")
106 self.db.RegisterCallback(self,"OnProfileCopied","OnProfileChanged")
107 101
108 SlashCmdList["REACTION"] = function(option) 102 SlashCmdList["REACTION"] = function(option)
109 option = string.match(option or "", "^%s*(%S+)") 103 option = string.match(option or "", "^%s*(%S+)")
110 if option == "config" or option == "options" then 104 if option == "config" or option == "options" then
111 ReAction:ShowOptions() 105 ReAction:ShowOptions()
137 enterClicksFirstButton = true, 131 enterClicksFirstButton = true,
138 timeout = 0, 132 timeout = 0,
139 showAlert = true, 133 showAlert = true,
140 whileDead = true, 134 whileDead = true,
141 } 135 }
136
137 -- reroute blizzard action bar config to ReAction config window
138 InterfaceOptionsActionBarsPanel:HookScript("OnShow",
139 function()
140 if ReAction:OptionGetHideBlizzardBars() then
141 ReAction:ShowOptions()
142 end
143 end )
142 end 144 end
143 145
144 146
145 function ReAction:ShowOptions() 147 function ReAction:ShowOptions()
146 InterfaceOptionsFrame_OpenToCategory(configID) 148 InterfaceOptionsFrame_OpenToCategory(configID)
147 end
148
149
150 function ReAction:OnProfileChanged()
151 self:RebuildAll()
152 if not self.db.global.skipKeybindWarning then
153 StaticPopup_Show("REACTION_KB_WARN")
154 end
155 end 149 end
156 150
157 151
158 function ReAction:OptionSetConfigMode(info, value) 152 function ReAction:OptionSetConfigMode(info, value)
159 self:SetConfigMode(value) 153 self:SetConfigMode(value)
176 end 170 end
177 171
178 172
179 function ReAction:OptionSetSkipKeybindWarning(info, value) 173 function ReAction:OptionSetSkipKeybindWarning(info, value)
180 self.db.global.skipKeybindWarning = value 174 self.db.global.skipKeybindWarning = value
175 end
176
177
178 function ReAction:OptionSetHideBlizzardBars( info, hide )
179 self.db.profile.options.hideBlizzardBars = hide
180 self:ManageBlizzardBars()
181 end
182
183 function ReAction:OptionGetHideBlizzardBars()
184 return self.db.profile.options.hideBlizzardBars
185 end
186
187 function ReAction:OptionSetHideBlizzardVehicleBar( info, hide )
188 self.db.profile.options.hideBlizzardVehicleBar = hide
189 self:ManageBlizzardBars()
190 end
191
192 function ReAction:OptionGetHideBlizzardVehicleBar()
193 return self.db.profile.options.hideBlizzardVehicleBar
181 end 194 end
182 195
183 196
184 -- export to LDB 197 -- export to LDB
185 local LDB = LibStub:GetLibrary("LibDataBroker-1.1") 198 local LDB = LibStub:GetLibrary("LibDataBroker-1.1")