Cleaner way of getting defaults and options from stack counters

Now we pass in the options or defaults table directly to the helper class's getter methods since they're passed by reference and can be modified in place. This saves us creation of yet more tables and obviates the need to merge tables together.
This commit is contained in:
Parnic
2015-09-04 22:34:07 -05:00
parent 4d20a073ae
commit ad72976b24
3 changed files with 7 additions and 25 deletions

View File

@ -17,10 +17,7 @@ end
-- OVERRIDE
function IceCustomCount.prototype:GetOptions()
local opts = IceCustomCount.super.prototype.GetOptions(self)
for k,v in pairs(IceStackCounter_GetOptions(self)) do
opts[k] = v
end
IceStackCounter_GetOptions(self, opts)
opts["deleteme"] = {
type = 'execute',
@ -261,10 +258,7 @@ end
function IceCustomCount.prototype:GetDefaultSettings()
local defaults = IceCustomCount.super.prototype.GetDefaultSettings(self)
for k,v in pairs(IceStackCounter_GetDefaultSettings(self)) do
defaults[k] = v
end
IceStackCounter_GetDefaultSettings(defaults)
defaults["vpos"] = 0
defaults["hpos"] = 0