comparison modules/ReAction_ConfigUI/ReAction_ConfigUI.lua @ 76:c8c8610fd864

Bar menu now opens directly to bar config page (thanks for the AceConfigDialog update, nevcairiel!)
author Flick <flickerstreak@gmail.com>
date Thu, 19 Jun 2008 17:48:57 +0000
parents 768be7eb22a0
children da8ba8783924
comparison
equal deleted inserted replaced
75:06cd74bdc7da 76:c8c8610fd864
136 ReAction:SetConfigMode(false) 136 ReAction:SetConfigMode(false)
137 end ) 137 end )
138 AceConfigDialog:SetDefaultSize(editorName, 700, 540) 138 AceConfigDialog:SetDefaultSize(editorName, 700, 540)
139 139
140 140
141 local name = ("ReAction - %s"):format(L["Bar Editor"])
142 editor:SetTitle(name)
141 local options = { 143 local options = {
142 type = "group", 144 type = "group",
143 name = ("ReAction - %s"):format(L["Bar Editor"]), 145 name = name,
144 handler = editor, 146 handler = editor,
145 childGroups = "tree", 147 childGroups = "tree",
146 args = { 148 args = {
147 desc = { 149 desc = {
148 type = "description", 150 type = "description",
278 } 280 }
279 } 281 }
280 } 282 }
281 AceConfigReg:RegisterOptionsTable(editorName, options) 283 AceConfigReg:RegisterOptionsTable(editorName, options)
282 284
283 function editor:Open() 285 function editor:Open(bar)
286 if bar then
287 AceConfigDialog:SelectGroup(editorName, barOptMap[bar:GetName()])
288 end
284 AceConfigDialog:Open(editorName,self) 289 AceConfigDialog:Open(editorName,self)
285 end 290 end
286 291
287 function editor:Refresh() 292 function editor:Refresh()
288 AceConfigReg:NotifyChange(editorName) 293 AceConfigReg:NotifyChange(editorName)
483 ReAction:UserError(L["ReAction config mode disabled during combat."]) 488 ReAction:UserError(L["ReAction config mode disabled during combat."])
484 else 489 else
485 if not self.editor then 490 if not self.editor then
486 self.editor = NewEditor() 491 self.editor = NewEditor()
487 end 492 end
488 -- TODO: figure out how to open to a particular bar: currently AceConfigDialogue doesn't support this 493 self.editor:Open(bar)
489 self.editor:Open()
490 ReAction:SetConfigMode(true) 494 ReAction:SetConfigMode(true)
491 end 495 end
492 end 496 end
493 497