Mercurial > wow > reaction
changeset 217:9c0691e91488
Don't autogenerate bar names
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Fri, 19 Nov 2010 15:27:23 -0800 |
parents | 376c424900f0 |
children | e63aefb8a555 |
files | ReAction.lua |
diffstat | 1 files changed, 6 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ReAction.lua Fri Nov 19 14:33:45 2010 -0800 +++ b/ReAction.lua Fri Nov 19 15:27:23 2010 -0800 @@ -135,18 +135,12 @@ function ReAction:CreateBar(name, config, ...) local profile = self.db.profile - if name then - if self.bars[name] then - self:UserError(format(L["ReAction: name '%s' already in use"],name)) - return nil - end - else - local prefix = L["Bar "] - local i = 1 - repeat - name = prefix..i - i = i + 1 - until self.bars[name] == nil + name = tostring(name) + if not name or name == "" then + error("ReAction:CreateBar() - bar name string required") + elseif self.bars[name] then + self:UserError(format(L["ReAction: name '%s' already in use"],name)) + return nil end if type(config) == "string" then