From a4b59d744a2f07a4ff8f49ac608765f2052cc8bb Mon Sep 17 00:00:00 2001 From: tpart Date: Sat, 29 Jun 2024 21:30:39 +0200 Subject: Fix focus breaking in main menu --- client/menu/settings_menu.gd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/menu/settings_menu.gd b/client/menu/settings_menu.gd index b433951f..68f3f2fc 100644 --- a/client/menu/settings_menu.gd +++ b/client/menu/settings_menu.gd @@ -32,7 +32,7 @@ func _ready(): func show_graphis(): menu_manager.goto("settings_graphics") -func update_rows(): +func update_rows(fix_focus = false): for c in options.get_children(): c.queue_free() @@ -43,9 +43,10 @@ func update_rows(): row.connect("apply_preset", apply_preset) options.add_child(row) settings[k] = row - await get_tree().process_frame - Global.focus_first_button(self) - + + if fix_focus: + await get_tree().process_frame + Global.focus_first_button(self) func apply_preset(preset: Dictionary): for k in settings.keys(): @@ -54,4 +55,4 @@ func apply_preset(preset: Dictionary): for k in preset.keys(): Global.settings[k]["value"] = preset[k] - update_rows() + update_rows(true) -- cgit v1.2.3-70-g09d2