Replace noise params
This commit is contained in:
parent
f766463b3c
commit
30951070a0
@ -430,8 +430,22 @@ local function make_noise_params(setting)
|
||||
}
|
||||
end
|
||||
|
||||
make.noise_params_2d = make_noise_params
|
||||
make.noise_params_3d = make_noise_params
|
||||
if INIT == "pause_menu" then
|
||||
-- Making the noise parameter dialog work in the pause menu settings would
|
||||
-- require porting "FSTK" (at least the dialog API) from the mainmenu formspec
|
||||
-- API to the in-game formspec API.
|
||||
-- There's no reason you'd want to adjust mapgen noise parameter settings
|
||||
-- in-game (they only apply to new worlds), so there's no reason to implement
|
||||
-- this.
|
||||
local empty = function()
|
||||
return { get_formspec = function() return "", 0 end }
|
||||
end
|
||||
make.noise_params_2d = empty
|
||||
make.noise_params_3d = empty
|
||||
else
|
||||
make.noise_params_2d = make_noise_params
|
||||
make.noise_params_3d = make_noise_params
|
||||
end
|
||||
|
||||
|
||||
return make
|
||||
|
@ -765,16 +765,19 @@ local function eventhandler(event)
|
||||
end
|
||||
|
||||
|
||||
function create_settings_dlg()
|
||||
load()
|
||||
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
|
||||
if INIT == "mainmenu" then
|
||||
function create_settings_dlg()
|
||||
load()
|
||||
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
|
||||
|
||||
dlg.data.page_id = update_filtered_pages("")
|
||||
dlg.data.page_id = update_filtered_pages("")
|
||||
|
||||
return dlg
|
||||
end
|
||||
return dlg
|
||||
end
|
||||
|
||||
else
|
||||
assert(INIT == "pause_menu")
|
||||
|
||||
if INIT == "pause_menu" then
|
||||
local dialog
|
||||
|
||||
core.register_on_formspec_input(function(formname, fields)
|
||||
@ -790,7 +793,7 @@ if INIT == "pause_menu" then
|
||||
load()
|
||||
dialog = {}
|
||||
dialog.data = {}
|
||||
dialog.page_id = update_filtered_pages("")
|
||||
dialog.data.page_id = update_filtered_pages("")
|
||||
dialog.delete = function()
|
||||
dialog = nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user