Make the Splash Screen popup optional

This commit is contained in:
Schweini07 2020-01-01 16:00:28 +01:00 committed by GitHub
parent e61fea32bc
commit 6025271e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 10 deletions

View file

@ -9,3 +9,9 @@ func _on_SplashDialog_about_to_show() -> void:
func _on_ArtCredits_pressed() -> void:
OS.shell_open("https://www.instagram.com/erevos_art")
func _on_CheckBox_toggled(pressed) -> void:
if pressed:
Global.config_cache.set_value("preferences", "startup", false)
else:
Global.config_cache.set_value("preferences", "startup", true)

View file

@ -215,6 +215,8 @@ var palette_import_file_dialog : FileDialog
var error_dialog : AcceptDialog
var startup : bool
func _ready() -> void:
randomize()
# Load settings from the config file

View file

@ -156,8 +156,15 @@ func _ready() -> void:
Import.import_brushes("Brushes")
$SplashDialog.popup_centered() # Splash screen
OS.set_window_title("(" + tr("untitled") + ") - Pixelorama")
if Global.config_cache.has_section_key("preferences", "startup"):
Global.startup = Global.config_cache.get_value("preferences", "startup")
else:
Global.startup = true
Global.config_cache.set_value("preferences", "startup", Global.startup)
if Global.config_cache.get_value("preferences", "startup"):
$SplashDialog.popup_centered() # Splash screen
OS.set_window_title("(" + tr("untitled") + ") - Pixelorama")
func _input(event : InputEvent) -> void:
Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
@ -925,4 +932,4 @@ func _on_QuitDialog_confirmed() -> void:
# (it won't respond to user input in this state).
modulate = Color(0.5, 0.5, 0.5)
get_tree().quit()
get_tree().quit()