aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorROllerozxa <temporaryemail4meh+github@gmail.com>2022-06-29 22:20:12 +0200
committerGitHub <noreply@github.com>2022-06-29 22:20:12 +0200
commit17709d7d0f8e394d2e22545e67cc39bca831c2e7 (patch)
treeae4c67e2b042887b92c944102329f1a35fdf3daa /builtin
parenta5f385917d0db5097e3cd4a1c6de794bda20c01f (diff)
downloadminetest-17709d7d0f8e394d2e22545e67cc39bca831c2e7.tar.gz
minetest-17709d7d0f8e394d2e22545e67cc39bca831c2e7.tar.bz2
minetest-17709d7d0f8e394d2e22545e67cc39bca831c2e7.zip
Improve warnings when no games or only devtest is installed (#11955)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/dlg_create_world.lua29
1 files changed, 19 insertions, 10 deletions
diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua
index 76ceb0f16..8628ed312 100644
--- a/builtin/mainmenu/dlg_create_world.lua
+++ b/builtin/mainmenu/dlg_create_world.lua
@@ -94,14 +94,14 @@ local mgv6_biomes = {
local function create_world_formspec(dialogdata)
- -- Error out when no games found
+ -- Point the player to ContentDB when no games are found
if #pkgmgr.games == 0 then
- return "size[12.25,3,true]" ..
- "box[0,0;12,2;" .. mt_color_orange .. "]" ..
- "textarea[0.3,0;11.7,2;;;"..
- fgettext("You have no games installed.") .. "\n" ..
- fgettext("Download one from minetest.net") .. "]" ..
- "button[4.75,2.5;3,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
+ return "size[8,2.5,true]" ..
+ "style[label_button;border=false]" ..
+ "button[0.5,0.5;7,0.5;label_button;" ..
+ fgettext("You have no games installed.") .. "]" ..
+ "button[0.5,1.5;2.5,0.5;world_create_open_cdb;" .. fgettext("Install a game") .. "]" ..
+ "button[5.0,1.5;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
end
local current_mg = dialogdata.mg
@@ -301,9 +301,9 @@ local function create_world_formspec(dialogdata)
local gamelist_height = 2.3
if #pkgmgr.games == 1 and pkgmgr.games[1].id == "devtest" then
devtest_only = "box[0,0;5.8,1.7;#ff8800]" ..
- "textarea[0.3,0;6,1.8;;;"..
- fgettext("Warning: The Development Test is meant for developers.") .. "\n" ..
- fgettext("Download a game, such as Minetest Game, from minetest.net") .. "]"
+ "textarea[0.4,0.1;6,1.8;;;"..
+ fgettext("Development Test is meant for developers.") .. "]" ..
+ "button[1,1;4,0.5;world_create_open_cdb;" .. fgettext("Install another game") .. "]"
gamelist_height = 0.5
end
@@ -358,6 +358,15 @@ end
local function create_world_buttonhandler(this, fields)
+ if fields["world_create_open_cdb"] then
+ local dlg = create_store_dlg("game")
+ dlg:set_parent(this.parent)
+ this:delete()
+ this.parent:hide()
+ dlg:show()
+ return true
+ end
+
if fields["world_create_confirm"] or
fields["key_enter"] then