mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
sort generators in ui
This commit is contained in:
parent
07169761cd
commit
c0c0104b5e
1 changed files with 9 additions and 4 deletions
|
|
@ -2,13 +2,18 @@ settings = session.get_entry('new_world')
|
|||
|
||||
function on_open()
|
||||
local names = generation.get_generators()
|
||||
table.sort(names)
|
||||
local keys = {}
|
||||
for key in pairs(names) do
|
||||
table.insert(keys, key)
|
||||
end
|
||||
table.sort(keys)
|
||||
|
||||
local panel = document.root
|
||||
for k, caption in pairs(names) do
|
||||
for _, key in ipairs(keys) do
|
||||
local caption = names[key]
|
||||
panel:add(gui.template("generator", {
|
||||
callback=string.format("settings.generator=%q menu:back()", k),
|
||||
id=k,
|
||||
callback=string.format("settings.generator=%q menu:back()", key),
|
||||
id=key,
|
||||
name=settings.generator_name(caption)
|
||||
}))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue