1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-13 14:55:18 +00:00

Merge pull request #124 from YeldhamDev/splashscreen_yield_popup

Delay the splash screen popup so it shows properly centered
This commit is contained in:
Manolis Papadeas 2020-01-14 14:08:38 +02:00 committed by GitHub
commit 021ae469a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,7 +156,6 @@ func _ready() -> void:
Import.import_brushes("Brushes") Import.import_brushes("Brushes")
$SplashDialog.popup_centered() # Splash screen
if not Global.config_cache.has_section_key("preferences", "startup"): if not Global.config_cache.has_section_key("preferences", "startup"):
Global.config_cache.set_value("preferences", "startup", true) Global.config_cache.set_value("preferences", "startup", true)
if not Global.config_cache.get_value("preferences", "startup"): 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.layers[0][2] = tr("Layer") + " 0"
Global.canvas.generate_layer_panels() 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: func _input(event : InputEvent) -> void:
Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32) Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
Global.left_cursor.texture = Global.left_cursor_tool_texture Global.left_cursor.texture = Global.left_cursor_tool_texture