summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2022-02-12 19:23:58 +0000
committerGitHub <noreply@github.com>2022-02-12 20:23:58 +0100
commit10cf2f3eddb9106a87721e36f0dd284ec041c4d8 (patch)
tree5286bdfd8c48cc235cfe3483253574eb390de757 /builtin
parent0cd9c5b5be47dffd433e9bad8fd2119eb9ddf0f5 (diff)
downloadminetest-10cf2f3eddb9106a87721e36f0dd284ec041c4d8.tar.gz
minetest-10cf2f3eddb9106a87721e36f0dd284ec041c4d8.tar.bz2
minetest-10cf2f3eddb9106a87721e36f0dd284ec041c4d8.zip
Add support for 'seed' in disallow_mapgen_settings (#12023)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/dlg_create_world.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua
index 8d1509f33..76ceb0f16 100644
--- a/builtin/mainmenu/dlg_create_world.lua
+++ b/builtin/mainmenu/dlg_create_world.lua
@@ -315,12 +315,17 @@ local function create_world_formspec(dialogdata)
"field[0.3,0.6;6,0.5;te_world_name;" ..
fgettext("World name") ..
";" .. core.formspec_escape(dialogdata.worldname) .. "]" ..
- "set_focus[te_world_name;false]" ..
+ "set_focus[te_world_name;false]"
- "field[0.3,1.7;6,0.5;te_seed;" ..
- fgettext("Seed") ..
- ";".. core.formspec_escape(dialogdata.seed) .. "]" ..
+ if not disallowed_mapgen_settings["seed"] then
+ retval = retval .. "field[0.3,1.7;6,0.5;te_seed;" ..
+ fgettext("Seed") ..
+ ";".. core.formspec_escape(dialogdata.seed) .. "]"
+
+ end
+
+ retval = retval ..
"label[0,2;" .. fgettext("Mapgen") .. "]"..
"dropdown[0,2.5;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]"
@@ -391,7 +396,7 @@ local function create_world_buttonhandler(this, fields)
end
if message == nil then
- this.data.seed = fields["te_seed"]
+ this.data.seed = fields["te_seed"] or ""
this.data.mg = fields["dd_mapgen"]
-- actual names as used by engine
@@ -426,7 +431,7 @@ local function create_world_buttonhandler(this, fields)
end
this.data.worldname = fields["te_world_name"]
- this.data.seed = fields["te_seed"]
+ this.data.seed = fields["te_seed"] or ""
if fields["games"] then
local gameindex = core.get_textlist_index("games")