Skip to content

Instantly share code, notes, and snippets.

@sparkprime
Created October 27, 2016 01:54
Show Gist options
  • Save sparkprime/c9d639a707c0d057613543bdf7d71da0 to your computer and use it in GitHub Desktop.
Save sparkprime/c9d639a707c0d057613543bdf7d71da0 to your computer and use it in GitHub Desktop.
local function gfx_hud_object_add(name, tab)
print('gfx_hud_object_add("' .. name .. '", ' .. tostring(tab) .. ')')
end
local function thingy(path)
self = {
path = path
}
setmetatable(self, {
__index = function(self, k)
local path2 = {}
for k, v in pairs(self.path) do path2[k] = v end
path2[#path2 + 1] = k
return thingy(path2)
end;
__call = function(self, ...)
local class_name = '/' .. table.concat(self.path, '/')
gfx_hud_object_add(class_name, ...)
end
})
return self
end
gfx_hud = thingy({})
gfx_hud.common.blah.whatever.MyThing { }
local gui = gfx_hud.common.gui
gui.RadioButton { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment