Save backups for all opened projects

current_save_paths and backup_save_paths in OpenSave.gd are arrays now, have paths for every project
This commit is contained in:
OverloadedOrama 2020-06-06 02:16:53 +03:00
parent 2c409ab025
commit 709a401373
8 changed files with 81 additions and 66 deletions

View file

@ -3,7 +3,7 @@ class_name Project extends Reference
var name := "" setget name_changed
var size : Vector2
var size := Vector2(64, 64)
var undo_redo : UndoRedo
var undos := 0 # The number of times we added undo properties
var has_changed := false setget has_changed_changed
@ -27,15 +27,16 @@ var cameras_zoom := [Vector2(0.15, 0.15), Vector2(0.15, 0.15), Vector2(0.15, 0.1
var cameras_offset := [Vector2.ZERO, Vector2.ZERO, Vector2.ZERO] # Array of Vector2
func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
func _init(_frames := [], _name := tr("untitled")) -> void:
frames = _frames
name = _name
size = _size
x_max = size.x
y_max = size.y
undo_redo = UndoRedo.new()
Global.tabs.add_tab(name)
OpenSave.current_save_paths.append("")
OpenSave.backup_save_paths.append("")
func change_project() -> void:
@ -128,6 +129,8 @@ func change_project() -> void:
Global.zoom_level_label.text = str(round(100 / Global.camera.zoom.x)) + " %"
Global.canvas.update()
Global.transparent_checker._ready()
Global.horizontal_ruler.update()
Global.vertical_ruler.update()
Global.window_title = "%s - Pixelorama %s" % [name, Global.current_version]
if has_changed:
Global.window_title = Global.window_title + "(*)"