From 8e6516a4d453608ff7d5d66b16b2ec6a8518e127 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 20 May 2020 01:37:36 +0300 Subject: [PATCH] Use error dialog for 2 more cases NoProjectEditedOrCreatedAlertDialog and OpenLastProjectAlertDialog --- src/Main.gd | 6 ++++-- src/Main.tscn | 13 +------------ .../NoProjectEditedOrCreatedAlertDialog.tscn | 7 ------- src/UI/Dialogs/OpenLastProjectAlertDialog.tscn | 7 ------- 4 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 src/UI/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn delete mode 100644 src/UI/Dialogs/OpenLastProjectAlertDialog.tscn diff --git a/src/Main.gd b/src/Main.gd index 7c084a146..64282f6ac 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -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) diff --git a/src/Main.tscn b/src/Main.tscn index 625d60608..67331e0ca 100644 --- a/src/Main.tscn +++ b/src/Main.tscn @@ -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"] diff --git a/src/UI/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn b/src/UI/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn deleted file mode 100644 index 81fe43227..000000000 --- a/src/UI/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn +++ /dev/null @@ -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 -} diff --git a/src/UI/Dialogs/OpenLastProjectAlertDialog.tscn b/src/UI/Dialogs/OpenLastProjectAlertDialog.tscn deleted file mode 100644 index d06c75e81..000000000 --- a/src/UI/Dialogs/OpenLastProjectAlertDialog.tscn +++ /dev/null @@ -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."