diff options
Diffstat (limited to 'builtin/mainmenu/common.lua')
-rw-r--r-- | builtin/mainmenu/common.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 8db8bb8d1..81e28f2bb 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -125,18 +125,12 @@ os.tmpname = function() end -------------------------------------------------------------------------------- -function menu_render_worldlist(show_gameid) +function menu_render_worldlist() local retval = {} local current_worldlist = menudata.worldlist:get_list() - local row for i, v in ipairs(current_worldlist) do - row = v.name - if show_gameid == nil or show_gameid == true then - row = row .. " [" .. v.gameid .. "]" - end - retval[#retval+1] = core.formspec_escape(row) - + retval[#retval+1] = core.formspec_escape(v.name) end return table.concat(retval, ",") @@ -242,3 +236,11 @@ function menu_worldmt_legacy(selected) end end end + +function confirmation_formspec(message, confirm_id, confirm_label, cancel_id, cancel_label) + return "size[10,2.5,true]" .. + "label[0.5,0.5;" .. message .. "]" .. + "style[" .. confirm_id .. ";bgcolor=red]" .. + "button[0.5,1.5;2.5,0.5;" .. confirm_id .. ";" .. confirm_label .. "]" .. + "button[7.0,1.5;2.5,0.5;" .. cancel_id .. ";" .. cancel_label .. "]" +end |