Mercurial > wow > reaction
comparison ReAction.lua @ 217:9c0691e91488
Don't autogenerate bar names
| author | Flick <flickerstreak@gmail.com> |
|---|---|
| date | Fri, 19 Nov 2010 15:27:23 -0800 |
| parents | 8ba8ab8bf6dd |
| children | e63aefb8a555 |
comparison
equal
deleted
inserted
replaced
| 216:376c424900f0 | 217:9c0691e91488 |
|---|---|
| 133 -- (1) ReAction:CreateBar(name, [cfgTable]) | 133 -- (1) ReAction:CreateBar(name, [cfgTable]) |
| 134 -- (2) ReAction:CreateBar(name, "barType", [nRows], [nCols], [btnSize], [btnSpacing]) | 134 -- (2) ReAction:CreateBar(name, "barType", [nRows], [nCols], [btnSize], [btnSpacing]) |
| 135 function ReAction:CreateBar(name, config, ...) | 135 function ReAction:CreateBar(name, config, ...) |
| 136 local profile = self.db.profile | 136 local profile = self.db.profile |
| 137 | 137 |
| 138 if name then | 138 name = tostring(name) |
| 139 if self.bars[name] then | 139 if not name or name == "" then |
| 140 self:UserError(format(L["ReAction: name '%s' already in use"],name)) | 140 error("ReAction:CreateBar() - bar name string required") |
| 141 return nil | 141 elseif self.bars[name] then |
| 142 end | 142 self:UserError(format(L["ReAction: name '%s' already in use"],name)) |
| 143 else | 143 return nil |
| 144 local prefix = L["Bar "] | |
| 145 local i = 1 | |
| 146 repeat | |
| 147 name = prefix..i | |
| 148 i = i + 1 | |
| 149 until self.bars[name] == nil | |
| 150 end | 144 end |
| 151 | 145 |
| 152 if type(config) == "string" then | 146 if type(config) == "string" then |
| 153 config = self.defaultBarConfig[config] | 147 config = self.defaultBarConfig[config] |
| 154 if not config then | 148 if not config then |
