comparison ReAction.lua @ 47:e12b736c23c3

Added Layout Editor
author Flick <flickerstreak@gmail.com>
date Fri, 11 Apr 2008 22:21:28 +0000
parents aa0b7fd68462
children 7b7d178dec52
comparison
equal deleted inserted replaced
46:aa0b7fd68462 47:e12b736c23c3
114 end 114 end
115 115
116 SlashHandler = function(option) 116 SlashHandler = function(option)
117 if option == "config" then 117 if option == "config" then
118 ReAction:ShowConfig() 118 ReAction:ShowConfig()
119 elseif option == "unlock" then 119 elseif option == "layout" then
120 ReAction:SetConfigMode(true) 120 ReAction:ShowLayout()
121 elseif option == "lock" then
122 ReAction:SetConfigMode(false)
123 else 121 else
124 ReAction:Print(("%3.1f.%d"):format(ReAction.version,ReAction.revision)) 122 ReAction:Print(("%3.1f.%d"):format(ReAction.version,ReAction.revision))
125 ReAction:Print("/reaction config") 123 ReAction:Print("/reaction config")
126 ReAction:Print("/reaction unlock") 124 ReAction:Print("/reaction layout")
127 ReAction:Print("/reaction lock")
128 end 125 end
129 end 126 end
130 end 127 end
131 128
132 129
287 284
288 function ReAction:RenameBar(x, newname) 285 function ReAction:RenameBar(x, newname)
289 local bar, name = SelectBar(x) 286 local bar, name = SelectBar(x)
290 if bar and name and newname then 287 if bar and name and newname then
291 if self.bars[newname] then 288 if self.bars[newname] then
292 error(L["ReAction: name already in use"]) 289 UIErrorsFrame:AddMessage(("%s ('%s')"):format(L["ReAction: name already in use"],newname))
293 end 290 else
294 self.bars[newname] = self.bars[name] 291 self.bars[newname] = self.bars[name]
295 self.bars[name] = nil 292 self.bars[name] = nil
296 bar:SetName(newname or "") 293 bar:SetName(newname or "")
297 local cfg = self.db.profile.bars 294 local cfg = self.db.profile.bars
298 cfg[newname], cfg[name] = cfg[name], nil 295 cfg[newname], cfg[name] = cfg[name], nil
299 self:CallMethodOnAllModules("RenameBarConfig", name, newname) 296 self:CallMethodOnAllModules("RenameBarConfig", name, newname)
300 self.callbacks:Fire("OnRenameBar", name, newname) 297 self.callbacks:Fire("OnRenameBar", name, newname)
298 end
301 end 299 end
302 end 300 end
303 301
304 -- See modules/ReAction_ConfigUI for valid options contexts. 302 -- See modules/ReAction_ConfigUI for valid options contexts.
305 function ReAction:RegisterOptions(context, module, opts) 303 function ReAction:RegisterOptions(context, module, opts)
342 340
343 function ReAction:ShowConfig() 341 function ReAction:ShowConfig()
344 self:CallModuleMethod("ConfigUI","OpenConfig") 342 self:CallModuleMethod("ConfigUI","OpenConfig")
345 end 343 end
346 344
345 function ReAction:ShowLayout()
346 self:CallModuleMethod("ConfigUI","LaunchLayoutEditor")
347 end