Skip to content

Commit

Permalink
Advanced settings: Fix noise parameter flags (#7819)
Browse files Browse the repository at this point in the history
Populate the 'checkboxes' table with bools when creating the editing formspec.
  • Loading branch information
paramat authored Oct 28, 2018
1 parent 2322078 commit 0d54399
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/mainmenu/dlg_settings_advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d54399

Please sign in to comment.