mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Advanced settings: Fix noise parameter flags (#7819)
Populate the 'checkboxes' table with bools when creating the editing formspec.
This commit is contained in:
parent
2322078fe4
commit
0d54399be2
@ -625,6 +625,11 @@ local function create_change_setting_formspec(dialogdata)
|
|||||||
-- Index by name, to avoid iterating over all enabled_flags for every possible flag.
|
-- Index by name, to avoid iterating over all enabled_flags for every possible flag.
|
||||||
flags[name] = true
|
flags[name] = true
|
||||||
end
|
end
|
||||||
|
for _, name in ipairs(setting.flags) do
|
||||||
|
local checkbox_name = "cb_" .. name
|
||||||
|
local is_enabled = flags[name] == true -- to get false if nil
|
||||||
|
checkboxes[checkbox_name] = is_enabled
|
||||||
|
end
|
||||||
-- Flags
|
-- Flags
|
||||||
formspec = table.concat(fields)
|
formspec = table.concat(fields)
|
||||||
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;defaults;" -- defaults
|
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;defaults;" -- defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user