- added the ability to duplicate an existing custom bar

This commit is contained in:
Parnic
2010-09-26 00:31:12 +00:00
parent 056fdd6d22
commit 4bf79adda5
7 changed files with 85 additions and 27 deletions

View File

@ -195,11 +195,13 @@ end
function IceCore.prototype:AddNewDynamicModule(module, hasSettings)
if not hasSettings then
self.settings.modules[module.elementName] = module:GetDefaultSettings()
elseif type(hasSettings) == "table" then
self.settings.modules[module.elementName] = IceHUD.deepcopy(hasSettings)
end
module:SetDatabase(self.settings)
if not hasSettings then
if not hasSettings or type(hasSettings) == "table" then
local numExisting = self:GetNumCustomModules(module, module:GetDefaultSettings().customBarType)
self:RenameDynamicModule(module, "MyCustom"..module:GetDefaultSettings().customBarType..(numExisting+1))
end