Navigation Menu

Skip to content

Commit

Permalink
Mainmenu game-related changes (#11887)
Browse files Browse the repository at this point in the history
fixes:
* Switching between games does not immediately hide creative mode / damage buttons if so specified
* World creation menu has a game selection list even though the menu already provides a gamebar
* Showing gameid in world list is unnecessary
* Choice of mapgen parameters in menu persists between games (and was half-broken)
  • Loading branch information
sfan5 committed Jan 9, 2022
1 parent b164e16 commit 4c8c649
Show file tree
Hide file tree
Showing 9 changed files with 259 additions and 207 deletions.
16 changes: 10 additions & 6 deletions builtin/mainmenu/common.lua
Expand Up @@ -125,17 +125,21 @@ os.tmpname = function()
end
--------------------------------------------------------------------------------

function menu_render_worldlist()
local retval = ""
function menu_render_worldlist(show_gameid)
local retval = {}
local current_worldlist = menudata.worldlist:get_list()

local row
for i, v in ipairs(current_worldlist) do
if retval ~= "" then retval = retval .. "," end
retval = retval .. core.formspec_escape(v.name) ..
" \\[" .. core.formspec_escape(v.gameid) .. "\\]"
row = v.name
if show_gameid == nil or show_gameid == true then
row = row .. " [" .. v.gameid .. "]"
end
retval[#retval+1] = core.formspec_escape(row)

end

return retval
return table.concat(retval, ",")
end

function menu_handle_key_up_down(fields, textlist, settingname)
Expand Down

0 comments on commit 4c8c649

Please sign in to comment.