mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
content menu moved to xml (no icons yet)
This commit is contained in:
parent
49d57b307b
commit
64820020f8
14 changed files with 91 additions and 172 deletions
14
res/layouts/pages/add_packs.xml.lua
Normal file
14
res/layouts/pages/add_packs.xml.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function add_pack(packid, packinfo)
|
||||
local callback = string.format('core.add_packs({%q})', packid)
|
||||
packinfo.id = packid
|
||||
packinfo.callback = callback
|
||||
packinfo.icon = "gui/no_icon"
|
||||
document.packs_panel:add(gui.template("pack", packinfo))
|
||||
end
|
||||
|
||||
function on_open()
|
||||
local packs = pack.get_available()
|
||||
for i,id in ipairs(packs) do
|
||||
add_pack(id, pack.get_info(id))
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue