mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Improve warnings when no games or only devtest is installed (#11955)
This commit is contained in:
parent
a5f385917d
commit
17709d7d0f
@ -94,14 +94,14 @@ local mgv6_biomes = {
|
|||||||
|
|
||||||
local function create_world_formspec(dialogdata)
|
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
|
if #pkgmgr.games == 0 then
|
||||||
return "size[12.25,3,true]" ..
|
return "size[8,2.5,true]" ..
|
||||||
"box[0,0;12,2;" .. mt_color_orange .. "]" ..
|
"style[label_button;border=false]" ..
|
||||||
"textarea[0.3,0;11.7,2;;;"..
|
"button[0.5,0.5;7,0.5;label_button;" ..
|
||||||
fgettext("You have no games installed.") .. "\n" ..
|
fgettext("You have no games installed.") .. "]" ..
|
||||||
fgettext("Download one from minetest.net") .. "]" ..
|
"button[0.5,1.5;2.5,0.5;world_create_open_cdb;" .. fgettext("Install a game") .. "]" ..
|
||||||
"button[4.75,2.5;3,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
|
"button[5.0,1.5;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
|
||||||
end
|
end
|
||||||
|
|
||||||
local current_mg = dialogdata.mg
|
local current_mg = dialogdata.mg
|
||||||
@ -301,9 +301,9 @@ local function create_world_formspec(dialogdata)
|
|||||||
local gamelist_height = 2.3
|
local gamelist_height = 2.3
|
||||||
if #pkgmgr.games == 1 and pkgmgr.games[1].id == "devtest" then
|
if #pkgmgr.games == 1 and pkgmgr.games[1].id == "devtest" then
|
||||||
devtest_only = "box[0,0;5.8,1.7;#ff8800]" ..
|
devtest_only = "box[0,0;5.8,1.7;#ff8800]" ..
|
||||||
"textarea[0.3,0;6,1.8;;;"..
|
"textarea[0.4,0.1;6,1.8;;;"..
|
||||||
fgettext("Warning: The Development Test is meant for developers.") .. "\n" ..
|
fgettext("Development Test is meant for developers.") .. "]" ..
|
||||||
fgettext("Download a game, such as Minetest Game, from minetest.net") .. "]"
|
"button[1,1;4,0.5;world_create_open_cdb;" .. fgettext("Install another game") .. "]"
|
||||||
gamelist_height = 0.5
|
gamelist_height = 0.5
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -358,6 +358,15 @@ end
|
|||||||
|
|
||||||
local function create_world_buttonhandler(this, fields)
|
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
|
if fields["world_create_confirm"] or
|
||||||
fields["key_enter"] then
|
fields["key_enter"] then
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user