mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
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:
@ -15,10 +15,7 @@ end
|
||||
|
||||
function IceCustomCounterBar.prototype:GetOptions()
|
||||
local opts = IceCustomCounterBar.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',
|
||||
@ -216,11 +213,8 @@ function IceCustomCounterBar.prototype:GetOptions()
|
||||
end
|
||||
|
||||
function IceCustomCounterBar.prototype:GetDefaultSettings()
|
||||
local defaults = IceCustomCounterBar.super.prototype.GetDefaultSettings(self)
|
||||
|
||||
for k,v in pairs(IceStackCounter_GetDefaultSettings(self)) do
|
||||
defaults[k] = v
|
||||
end
|
||||
local defaults = IceCustomCounterBar.super.prototype.GetDefaultSettings(self)
|
||||
IceStackCounter_GetDefaultSettings(defaults)
|
||||
|
||||
defaults.textVisible['lower'] = false
|
||||
defaults.offset = 9
|
||||
|
Reference in New Issue
Block a user