Advanced settings: Fix noise parameter flags (#7819)

Populate the 'checkboxes' table with bools when creating the editing formspec.
This commit is contained in:
paramat 2018-10-28 20:53:08 +00:00 committed by Nils Dagsson Moskopp
parent 622db08246
commit b72c46443f
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 5 additions and 0 deletions

View File

@ -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.
flags[name] = true
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
formspec = table.concat(fields)
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;defaults;" -- defaults