From 30e8522677a96b77ff0ee2fc2c1724d743f07658 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 2 Apr 2020 15:28:47 +0300 Subject: [PATCH] Set Global.saved = true when creating a new image --- Scripts/Dialogs/CreateNewImage.gd | 1 + Scripts/Main.gd | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/Dialogs/CreateNewImage.gd b/Scripts/Dialogs/CreateNewImage.gd index 20d249030..5b2f3a46b 100644 --- a/Scripts/Dialogs/CreateNewImage.gd +++ b/Scripts/Dialogs/CreateNewImage.gd @@ -22,6 +22,7 @@ func _on_CreateNewImage_confirmed() -> void: Global.canvases = Global.canvases # To trigger Global.canvases_changed() Global.current_frame = 0 Global.layers = Global.layers # To trigger Global.layers_changed() + Global.saved = true if fill_color.a > 0: Global.canvas.layers[0][0].fill(fill_color) Global.canvas.layers[0][0].lock() diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 0ac2ebe7d..7b1681187 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -395,6 +395,11 @@ func help_menu_id_pressed(id : int) -> void: $AboutDialog.popup_centered() Global.can_draw = false + +func _on_UnsavedCanvasDialog_confirmed() -> void: + $CreateNewImage.popup_centered() + + func _on_OpenSprite_file_selected(path : String) -> void: var file := File.new() var err := file.open(path, File.READ) @@ -828,5 +833,3 @@ func _on_QuitDialog_confirmed() -> void: get_tree().quit() -func _on_UnsavedCanvasDialog_confirmed() -> void : - $CreateNewImage.popup_centered() \ No newline at end of file