mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 23:14:48 -04:00
Make the Splash Screen popup optional
This commit is contained in:
parent
e61fea32bc
commit
6025271e29
4 changed files with 35 additions and 10 deletions
|
@ -7,9 +7,12 @@
|
||||||
|
|
||||||
[node name="SplashDialog" type="WindowDialog"]
|
[node name="SplashDialog" type="WindowDialog"]
|
||||||
margin_right = 400.0
|
margin_right = 400.0
|
||||||
margin_bottom = 380.0
|
margin_bottom = 399.0
|
||||||
rect_min_size = Vector2( 400, 380 )
|
rect_min_size = Vector2( 400, 380 )
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Contents" type="VBoxContainer" parent="."]
|
[node name="Contents" type="VBoxContainer" parent="."]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
@ -45,25 +48,32 @@ mouse_default_cursor_shape = 2
|
||||||
text = "Art by Erevoid"
|
text = "Art by Erevoid"
|
||||||
flat = true
|
flat = true
|
||||||
|
|
||||||
[node name="HSeparator2" type="HSeparator" parent="Contents"]
|
[node name="CheckBox" type="CheckBox" parent="Contents"]
|
||||||
margin_top = 330.0
|
margin_top = 330.0
|
||||||
margin_right = 400.0
|
margin_right = 400.0
|
||||||
margin_bottom = 334.0
|
margin_bottom = 354.0
|
||||||
|
text = "Don't show on the next startup"
|
||||||
|
|
||||||
|
[node name="HSeparator2" type="HSeparator" parent="Contents"]
|
||||||
|
margin_top = 358.0
|
||||||
|
margin_right = 400.0
|
||||||
|
margin_bottom = 362.0
|
||||||
|
|
||||||
[node name="DevelopedBy" type="Label" parent="Contents"]
|
[node name="DevelopedBy" type="Label" parent="Contents"]
|
||||||
margin_top = 338.0
|
margin_top = 366.0
|
||||||
margin_right = 400.0
|
margin_right = 400.0
|
||||||
margin_bottom = 351.0
|
margin_bottom = 379.0
|
||||||
custom_fonts/font = ExtResource( 4 )
|
custom_fonts/font = ExtResource( 4 )
|
||||||
text = "Pixelorama v0.6 - Developed by Orama Interactive"
|
text = "Pixelorama v0.6 - Developed by Orama Interactive"
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
[node name="Copyright" type="Label" parent="Contents"]
|
[node name="Copyright" type="Label" parent="Contents"]
|
||||||
margin_top = 355.0
|
margin_top = 383.0
|
||||||
margin_right = 400.0
|
margin_right = 400.0
|
||||||
margin_bottom = 368.0
|
margin_bottom = 396.0
|
||||||
custom_fonts/font = ExtResource( 4 )
|
custom_fonts/font = ExtResource( 4 )
|
||||||
text = "Copyright 2019-2020 Orama Interactive"
|
text = "Copyright 2019-2020 Orama Interactive"
|
||||||
align = 1
|
align = 1
|
||||||
[connection signal="about_to_show" from="." to="." method="_on_SplashDialog_about_to_show"]
|
[connection signal="about_to_show" from="." to="." method="_on_SplashDialog_about_to_show"]
|
||||||
[connection signal="pressed" from="Contents/ArtCredits" to="." method="_on_ArtCredits_pressed"]
|
[connection signal="pressed" from="Contents/ArtCredits" to="." method="_on_ArtCredits_pressed"]
|
||||||
|
[connection signal="toggled" from="Contents/CheckBox" to="." method="_on_CheckBox_toggled"]
|
||||||
|
|
|
@ -9,3 +9,9 @@ func _on_SplashDialog_about_to_show() -> void:
|
||||||
|
|
||||||
func _on_ArtCredits_pressed() -> void:
|
func _on_ArtCredits_pressed() -> void:
|
||||||
OS.shell_open("https://www.instagram.com/erevos_art")
|
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)
|
||||||
|
|
|
@ -215,6 +215,8 @@ var palette_import_file_dialog : FileDialog
|
||||||
|
|
||||||
var error_dialog : AcceptDialog
|
var error_dialog : AcceptDialog
|
||||||
|
|
||||||
|
var startup : bool
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
randomize()
|
randomize()
|
||||||
# Load settings from the config file
|
# Load settings from the config file
|
||||||
|
|
|
@ -156,8 +156,15 @@ func _ready() -> void:
|
||||||
|
|
||||||
Import.import_brushes("Brushes")
|
Import.import_brushes("Brushes")
|
||||||
|
|
||||||
$SplashDialog.popup_centered() # Splash screen
|
if Global.config_cache.has_section_key("preferences", "startup"):
|
||||||
OS.set_window_title("(" + tr("untitled") + ") - Pixelorama")
|
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:
|
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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue