From babd5759f88f765b7c150a6d1aa3b9a5600d3c98 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 2 May 2020 18:10:01 +0300 Subject: [PATCH] Makes sure that BackupConfirmation dialog is properly centered Moved yield(get_tree().create_timer(0.01), "timeout") in _ready() of Main.gd outside of the if, to affect the BackupConfirmation dialog too. --- src/Main.gd | 5 +++-- src/UI/Dialogs/SplashDialog.gd | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Main.gd b/src/Main.gd index b6f6b76b5..3a785eb3b 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -184,9 +184,10 @@ func _ready() -> void: if not Global.config_cache.has_section_key("preferences", "startup"): Global.config_cache.set_value("preferences", "startup", true) + + # Wait for the window to adjust itself, so the popup is correctly centered + yield(get_tree().create_timer(0.01), "timeout") if Global.config_cache.get_value("preferences", "startup"): - # Wait for the window to adjust itself, so the popup is correctly centered - yield(get_tree().create_timer(0.01), "timeout") $SplashDialog.popup_centered() # Splash screen else: Global.can_draw = true diff --git a/src/UI/Dialogs/SplashDialog.gd b/src/UI/Dialogs/SplashDialog.gd index 8c21df1d7..41f99efe6 100644 --- a/src/UI/Dialogs/SplashDialog.gd +++ b/src/UI/Dialogs/SplashDialog.gd @@ -37,6 +37,7 @@ func _on_ShowOnStartup_toggled(pressed : bool) -> void: Global.config_cache.set_value("preferences", "startup", false) else: Global.config_cache.set_value("preferences", "startup", true) + Global.config_cache.save("user://cache.ini") func _on_PatreonButton_pressed() -> void: