Fixed container system. (#2)

This commit is contained in:
rdococ 2018-03-25 00:37:18 +00:00 committed by luk3yx
parent e7f7a1a0ce
commit 9a9b812fe9
1 changed files with 5 additions and 6 deletions

View File

@ -248,20 +248,19 @@ end)
-- --
-- Parameters: x, y, children -- Parameters: x, y, children
-- --
-- each element inside the container is offset by the x and y -- Each element inside the container is offset by the x and y
-- --
formspeclib.register_object('container', function(obj, safe_mode) formspeclib.register_object('container', function(obj, safe_mode)
return { local t = {
{ {
type = 'formspeclib:container_start', type = 'formspeclib:container_start',
x = formspeclib.escape(obj.x or 0), x = formspeclib.escape(obj.x or 0),
y = formspeclib.escape(obj.y or 0), y = formspeclib.escape(obj.y or 0),
}, },
(table.unpack or unpack)(obj), (table.unpack or unpack)(obj)
{
type = 'formspeclib:container_end'
}
} }
table.insert(t, {type = 'formspeclib:container_end'})
return t
end) end)
formspeclib.register_object('formspeclib:container_start', function(obj, safe_mode) formspeclib.register_object('formspeclib:container_start', function(obj, safe_mode)