From 1cde435d1a1383a756238145cacfa5c806be0c1c Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Tue, 14 Jan 2020 00:44:16 -0300 Subject: [PATCH] Delay the splash screen popup so it shows properly centered --- Scripts/Main.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/Main.gd b/Scripts/Main.gd index eaae74d..f304758 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -156,7 +156,6 @@ func _ready() -> void: Import.import_brushes("Brushes") - $SplashDialog.popup_centered() # Splash screen if not Global.config_cache.has_section_key("preferences", "startup"): Global.config_cache.set_value("preferences", "startup", true) if not Global.config_cache.get_value("preferences", "startup"): @@ -167,6 +166,10 @@ func _ready() -> void: Global.canvas.layers[0][2] = tr("Layer") + " 0" Global.canvas.generate_layer_panels() + # 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 + func _input(event : InputEvent) -> void: Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32) Global.left_cursor.texture = Global.left_cursor_tool_texture