mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-26 18:21:04 +00:00
Settings GUI: Noise parameter setting fixes (#13797)
This commit is contained in:
parent
8ebaf753d3
commit
4f735fba05
4 changed files with 18 additions and 12 deletions
|
@ -49,8 +49,8 @@ local function get_formspec(dialogdata)
|
|||
-- Final formspec will be created at the end of this function
|
||||
-- Default values below, may be changed depending on setting type
|
||||
local width = 10
|
||||
local height = 3.5
|
||||
local description_height = 3
|
||||
local height = 2
|
||||
local description_height = 1.5
|
||||
|
||||
local t = get_current_np_group(setting)
|
||||
local dimension = 3
|
||||
|
@ -58,10 +58,6 @@ local function get_formspec(dialogdata)
|
|||
dimension = 2
|
||||
end
|
||||
|
||||
-- More space for 3x3 fields
|
||||
description_height = description_height - 1.5
|
||||
height = height - 1.5
|
||||
|
||||
local fields = {}
|
||||
local function add_field(x, name, label, value)
|
||||
fields[#fields + 1] = ("field[%f,%f;3.3,1;%s;%s;%s]"):format(
|
||||
|
@ -109,21 +105,21 @@ local function get_formspec(dialogdata)
|
|||
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;"
|
||||
--[[~ "defaults" is a noise parameter flag.
|
||||
It describes the default processing options
|
||||
for noise settings in main menu -> "All Settings". ]]
|
||||
for noise settings in the settings menu. ]]
|
||||
.. fgettext("defaults") .. ";" -- defaults
|
||||
.. tostring(flags["defaults"] == true) .. "]" -- to get false if nil
|
||||
.. "checkbox[5," .. height - 0.6 .. ";cb_eased;"
|
||||
--[[~ "eased" is a noise parameter flag.
|
||||
It is used to make the map smoother and
|
||||
can be enabled in noise settings in
|
||||
main menu -> "All Settings". ]]
|
||||
the settings menu. ]]
|
||||
.. fgettext("eased") .. ";" -- eased
|
||||
.. tostring(flags["eased"] == true) .. "]"
|
||||
.. "checkbox[5," .. height - 0.15 .. ";cb_absvalue;"
|
||||
--[[~ "absvalue" is a noise parameter flag.
|
||||
It is short for "absolute value".
|
||||
It can be enabled in noise settings in
|
||||
main menu -> "All Settings". ]]
|
||||
the settings menu. ]]
|
||||
.. fgettext("absvalue") .. ";" -- absvalue
|
||||
.. tostring(flags["absvalue"] == true) .. "]"
|
||||
|
||||
|
@ -204,7 +200,7 @@ local function buttonhandler(this, fields)
|
|||
checkboxes = {}
|
||||
|
||||
if setting.type == "noise_params_2d" then
|
||||
fields["te_spready"] = fields["te_spreadz"]
|
||||
fields["te_spready"] = fields["te_spreadz"]
|
||||
end
|
||||
local new_value = {
|
||||
offset = fields["te_offset"],
|
||||
|
@ -232,6 +228,13 @@ local function buttonhandler(this, fields)
|
|||
return true
|
||||
end
|
||||
|
||||
for name, value in pairs(fields) do
|
||||
if name:sub(1, 3) == "cb_" then
|
||||
checkboxes[name] = core.is_yes(value)
|
||||
return false -- Don't update the formspec!
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue