Skip to content

Commit 0d54399

Browse files
authoredOct 28, 2018
Advanced settings: Fix noise parameter flags (#7819)
Populate the 'checkboxes' table with bools when creating the editing formspec.
1 parent 2322078 commit 0d54399

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎builtin/mainmenu/dlg_settings_advanced.lua

+5
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,11 @@ local function create_change_setting_formspec(dialogdata)
625625
-- Index by name, to avoid iterating over all enabled_flags for every possible flag.
626626
flags[name] = true
627627
end
628+
for _, name in ipairs(setting.flags) do
629+
local checkbox_name = "cb_" .. name
630+
local is_enabled = flags[name] == true -- to get false if nil
631+
checkboxes[checkbox_name] = is_enabled
632+
end
628633
-- Flags
629634
formspec = table.concat(fields)
630635
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;defaults;" -- defaults

0 commit comments

Comments
 (0)
Please sign in to comment.