aboutsummaryrefslogtreecommitdiff
path: root/client/menu/settings.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/menu/settings.gd')
-rw-r--r--client/menu/settings.gd30
1 files changed, 16 insertions, 14 deletions
diff --git a/client/menu/settings.gd b/client/menu/settings.gd
index 93155a93..79043564 100644
--- a/client/menu/settings.gd
+++ b/client/menu/settings.gd
@@ -33,20 +33,7 @@ func exit():
func update_rows(fix_focus = false):
for c in settings_tabs.get_children():
c.queue_free()
-
-# TODO: Re-implement presets in new system
-# for i in Global.presets:
-# var label := Label.new()
-# label.text = i.label
-# var hbox := HBoxContainer.new()
-# var spacer := Control.new()
-# spacer.size_flags_horizontal = Control.SIZE_EXPAND
-# hbox.add_child(label)
-# hbox.add_child(spacer)
-# options.add_child(hbox)
-# for b in i.buttons():
-# hbox.add_child(b)
-
+
for category: SettingsCategory in Global.default_settings:
var category_settings = category.settings
var scroll := ScrollContainerCustom.new()
@@ -56,6 +43,21 @@ func update_rows(fix_focus = false):
settings_tabs.add_child(scroll)
options.size_flags_horizontal = Control.SIZE_EXPAND_FILL
scroll.add_child(options)
+
+ var category_presets = category.presets
+ if category_presets != null:
+ for i in category_presets:
+ var label := Label.new()
+ label.text = i.label
+ var hbox := HBoxContainer.new()
+ var spacer := Control.new()
+ spacer.size_flags_horizontal = Control.SIZE_EXPAND
+ hbox.add_child(label)
+ hbox.add_child(spacer)
+ options.add_child(hbox)
+ for b in i.buttons():
+ hbox.add_child(b)
+
for k: String in category_settings.keys():
var row: SettingsRow = Global.settings[k].get_row()
options.add_child(row)