diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-10-28 20:53:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-28 20:53:08 +0000 |
commit | 0d54399be2af37e334f3506bd09da85ad932b92f (patch) | |
tree | 091d6a2c7334fd33eda4c6ac8d271045c23b0aa0 /builtin | |
parent | 2322078fe480a338422b35ee29fee3c0767f3e1d (diff) | |
download | minetest-0d54399be2af37e334f3506bd09da85ad932b92f.tar.gz minetest-0d54399be2af37e334f3506bd09da85ad932b92f.tar.bz2 minetest-0d54399be2af37e334f3506bd09da85ad932b92f.zip |
Advanced settings: Fix noise parameter flags (#7819)
Populate the 'checkboxes' table with bools when creating the editing formspec.
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/mainmenu/dlg_settings_advanced.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua index 6adadecbc..4a6fcfba7 100644 --- a/builtin/mainmenu/dlg_settings_advanced.lua +++ b/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 |