mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
test worlds panel with XML + lua
This commit is contained in:
parent
71f4dff32f
commit
9a817a86ff
10 changed files with 93 additions and 49 deletions
15
res/layouts/pages/main.xml.lua
Normal file
15
res/layouts/pages/main.xml.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
function on_open()
|
||||
local worlds = core.get_worlds_list()
|
||||
for _, name in ipairs(worlds) do
|
||||
document.worlds:add(
|
||||
"<container "..
|
||||
"size='380,46' "..
|
||||
"color='#0F1E2DB2' "..
|
||||
"hover-color='#162B3399' "..
|
||||
"onclick='core.open_world(\""..name.."\")'"..
|
||||
">"..
|
||||
"<label pos='8,8'>"..name.."</label>"..
|
||||
"</container>"
|
||||
)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue