content menu moved to xml (no icons yet)

This commit is contained in:
MihailRis
2024-04-18 22:15:23 +03:00
parent 49d57b307b
commit 64820020f8
14 changed files with 91 additions and 172 deletions
+14
View 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