mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
feat: ui sub-nodes access
This commit is contained in:
parent
38e0753382
commit
559f946a66
2 changed files with 53 additions and 13 deletions
|
|
@ -60,6 +60,17 @@ function Element.new(docname, name)
|
|||
end,
|
||||
__newindex=function(self, k, v)
|
||||
gui.setattr(self.docname, self.name, k, v)
|
||||
end,
|
||||
__ipairs=function(self)
|
||||
local i = 0
|
||||
return function()
|
||||
i = i + 1
|
||||
local elem = gui.getattr(self.docname, self.name, i)
|
||||
if elem == nil then
|
||||
return
|
||||
end
|
||||
return i, elem
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue