Created
October 27, 2016 01:54
-
-
Save sparkprime/c9d639a707c0d057613543bdf7d71da0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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