X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=builtin%2Fmainmenu%2Fdlg_create_world.lua;h=477b8bcb9e2cab597f79422621845e718e721686;hb=d767f025cb0d5cca29c1f2147d2a0931a088b717;hp=9e04048cd0f5d0c66c33d892fd152aa875b5ec40;hpb=7df83c2c6785a1aef440e7c586b1ee0b3ff06f53;p=oweals%2Fminetest.git diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua index 9e04048cd..477b8bcb9 100644 --- a/builtin/mainmenu/dlg_create_world.lua +++ b/builtin/mainmenu/dlg_create_world.lua @@ -16,7 +16,7 @@ --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. local function create_world_formspec(dialogdata) - local mapgens = {"v6", "v7", "indev", "singlenode"} + local mapgens = core.get_mapgen_names() local current_seed = core.setting_get("fixed_map_seed") or "" local current_mg = core.setting_get("mg_name") @@ -44,8 +44,9 @@ local function create_world_formspec(dialogdata) end end + current_seed = core.formspec_escape(current_seed) local retval = - "size[12,6,true]" .. + "size[11.5,6.5,true]" .. "label[2,0;" .. fgettext("World name") .. "]".. "field[4.5,0.4;6,0.5;te_world_name;;]" .. @@ -59,8 +60,18 @@ local function create_world_formspec(dialogdata) "textlist[4.2,3;5.8,2.3;games;" .. gamemgr.gamelist() .. ";" .. gameidx .. ";true]" .. - "button[5,5.5;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" .. - "button[7.5,5.5;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]" + "button[3.25,6;2.5,0.5;world_create_confirm;" .. fgettext("Create") .. "]" .. + "button[5.75,6;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]" + + if #gamemgr.games == 0 then + retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" .. + fgettext("You have no subgames installed.") .. "]label[2.25,4.4;" .. + fgettext("Download one from minetest.net") .. "]" + elseif #gamemgr.games == 1 and gamemgr.games[1].id == "minimal" then + retval = retval .. "box[1.75,4;8.7,1;#ff8800]label[2,4;" .. + fgettext("Warning: The minimal development test is meant for developers.") .. "]label[2,4.4;" .. + fgettext("Download a subgame, such as minetest_game, from minetest.net") .. "]" + end return retval @@ -79,6 +90,8 @@ local function create_world_buttonhandler(this, fields) local message = nil + core.setting_set("fixed_map_seed", fields["te_seed"]) + if not menudata.worldlist:uid_exists_raw(worldname) then core.setting_set("mg_name",fields["dd_mapgen"]) message = core.create_world(worldname,gameindex) @@ -86,8 +99,6 @@ local function create_world_buttonhandler(this, fields) message = fgettext("A world named \"$1\" already exists", worldname) end - core.setting_set("fixed_map_seed", fields["te_seed"]) - if message ~= nil then gamedata.errormessage = message else