1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Use error dialog for 2 more cases

NoProjectEditedOrCreatedAlertDialog and OpenLastProjectAlertDialog
This commit is contained in:
OverloadedOrama 2020-05-20 01:37:36 +03:00
parent 2ebdf51047
commit 8e6516a4d4
4 changed files with 5 additions and 28 deletions

View file

@ -267,7 +267,8 @@ func file_menu_id_pressed(id : int) -> void:
else:
load_last_project()
else: # if not then warn user that he didn't edit any project yet
$NoProjectEditedOrCreatedAlertDialog.popup_centered()
Global.error_dialog.set_text("You haven't saved or opened any project in Pixelorama yet!")
Global.error_dialog.popup_centered()
Global.dialog_open(true)
3: # Save
is_quitting_on_save = false
@ -474,7 +475,8 @@ func load_last_project() -> void:
_on_OpenSprite_file_selected(file_path)
else:
# If file doesn't exist on disk then warn user about this
$OpenLastProjectAlertDialog.popup_centered()
Global.error_dialog.set_text("Cannot find last project file.")
Global.error_dialog.popup_centered()
Global.dialog_open(true)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=47 format=2]
[gd_scene load_steps=45 format=2]
[ext_resource path="res://assets/themes/dark/theme.tres" type="Theme" id=1]
[ext_resource path="res://src/Main.gd" type="Script" id=2]
@ -39,8 +39,6 @@
[ext_resource path="res://src/Shaders/TransparentChecker.shader" type="Shader" id=42]
[ext_resource path="res://src/UI/Dialogs/HSVDialog.tscn" type="PackedScene" id=44]
[ext_resource path="res://src/UI/TransparentChecker.gd" type="Script" id=45]
[ext_resource path="res://src/UI/Dialogs/OpenLastProjectAlertDialog.tscn" type="PackedScene" id=46]
[ext_resource path="res://src/UI/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn" type="PackedScene" id=47]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 42 )
@ -860,14 +858,6 @@ filters = PoolStringArray( "*.json ; JavaScript Object Notation", "*.gpl ; Gimp
[node name="HSVDialog" parent="." instance=ExtResource( 44 )]
[node name="OpenLastProjectAlertDialog" parent="." instance=ExtResource( 46 )]
margin_right = 179.0
margin_bottom = 62.0
[node name="NoProjectEditedOrCreatedAlertDialog" parent="." instance=ExtResource( 47 )]
margin_bottom = 62.0
window_title = "Alarm!"
[node name="LeftCursor" type="Sprite" parent="."]
visible = false
@ -923,7 +913,6 @@ Do you want to reload it?"
[connection signal="file_selected" from="PaletteImportFileDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PanelContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="on_palette_import_file_selected"]
[connection signal="popup_hide" from="PaletteImportFileDialog" to="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PanelContainer/PaletteVBoxContainer/ScrollPalette/CenterPalette/PaletteContainer" method="_on_NewPaletteDialog_popup_hide"]
[connection signal="popup_hide" from="HSVDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="NoProjectEditedOrCreatedAlertDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="BackupConfirmation" to="." method="_can_draw_true"]
[editable path="BrushesPopup/TabContainer/File/FileBrushContainer/CircleBrushButton"]

View file

@ -1,7 +0,0 @@
[gd_scene format=2]
[node name="NoProjectEditedOrCreatedAlertDialog" type="AcceptDialog"]
dialog_text = "You haven't saved or opened any project in Pixelorama yet!"
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -1,7 +0,0 @@
[gd_scene format=2]
[node name="OpenLastProjectAlertDialog" type="AcceptDialog"]
margin_right = 209.0
margin_bottom = 58.0
window_title = "Alarm!"
dialog_text = "Cannot find last project file."