Skip to content
Permalink
Browse files

Advanced settings: Fix noise parameter flags (#7819)

Populate the 'checkboxes' table with bools when creating the editing formspec.
  • Loading branch information...
paramat committed Oct 28, 2018
1 parent 2322078 commit 0d54399be2af37e334f3506bd09da85ad932b92f
Showing with 5 additions and 0 deletions.
  1. +5 −0 builtin/mainmenu/dlg_settings_advanced.lua
@@ -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

0 comments on commit 0d54399

Please sign in to comment.
You can’t perform that action at this time.