mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-06 03:34:49 -04:00
Saved is false after any action and is true at the beginning
Also hide QuitDialog after saving
This commit is contained in:
parent
3ea3bd7b40
commit
52fa460876
2 changed files with 11 additions and 8 deletions
|
@ -9,7 +9,7 @@ var config_cache := ConfigFile.new()
|
|||
var loaded_locales : Array
|
||||
var undo_redo : UndoRedo
|
||||
var undos := 0 # The number of times we added undo properties
|
||||
var saved := false #Checks if the user has saved
|
||||
var saved := true # Checks if the user has saved
|
||||
|
||||
# Canvas related stuff
|
||||
var current_frame := 0 setget frame_changed
|
||||
|
@ -426,6 +426,7 @@ func undo(_canvases : Array, layer_index : int = -1) -> void:
|
|||
canvas_parent.move_child(_canvases[0], _canvases[0].frame)
|
||||
|
||||
canvas.update()
|
||||
saved = false
|
||||
notification_label("Undo: %s" % action_name)
|
||||
|
||||
|
||||
|
@ -466,6 +467,7 @@ func redo(_canvases : Array, layer_index : int = -1) -> void:
|
|||
canvas_parent.move_child(_canvases[0], _canvases[0].frame)
|
||||
|
||||
canvas.update()
|
||||
saved = false
|
||||
if control.redone:
|
||||
notification_label("Redo: %s" % action_name)
|
||||
|
||||
|
|
|
@ -861,11 +861,12 @@ func _on_QuitDialog_confirmed() -> void:
|
|||
|
||||
get_tree().quit()
|
||||
|
||||
func _on_QuitDialog_custom_action(action):
|
||||
func _on_QuitDialog_custom_action(action : String) -> void:
|
||||
if action == "Save":
|
||||
$SaveSprite.popup_centered()
|
||||
$QuitDialog.hide()
|
||||
Global.can_draw = false
|
||||
|
||||
func _on_QuitDialog_popup_hide():
|
||||
func _on_QuitDialog_popup_hide() -> void:
|
||||
if !Global.saved:
|
||||
SaveButton.queue_free()
|
||||
|
|
Loading…
Add table
Reference in a new issue