mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 12:33:14 +00:00
Fixed issues with saving and backups
This commit is contained in:
parent
709a401373
commit
5fda35c2d8
4 changed files with 8 additions and 25 deletions
|
@ -462,24 +462,6 @@ func project_changed(value : int) -> void:
|
|||
current_project.change_project()
|
||||
|
||||
|
||||
func clear_frames() -> void:
|
||||
current_project.frames.clear()
|
||||
current_project.animation_tags.clear()
|
||||
current_project.animation_tags = current_project.animation_tags # To execute animation_tags_changed()
|
||||
|
||||
# Stop playing the animation
|
||||
play_backwards.pressed = false
|
||||
play_forward.pressed = false
|
||||
animation_timer.stop()
|
||||
|
||||
self.window_title = tr("untitled") + " - Pixelorama " + Global.current_version
|
||||
OpenSave.current_save_path = ""
|
||||
control.get_node("ExportDialog").was_exported = false
|
||||
control.file_menu.set_item_text(3, tr("Save..."))
|
||||
control.file_menu.set_item_text(6, tr("Export..."))
|
||||
current_project.undo_redo.clear_history(false)
|
||||
|
||||
|
||||
func dialog_open(open : bool) -> void:
|
||||
if open:
|
||||
can_draw = false
|
||||
|
|
|
@ -336,10 +336,13 @@ func reload_backup_file(project_paths : Array, backup_paths : Array) -> void:
|
|||
for i in range(project_paths.size()):
|
||||
# If project path is the same as backup save path -> the backup was untitled
|
||||
open_pxo_file(backup_paths[i], project_paths[i] == backup_paths[i])
|
||||
backup_save_paths[i] = backup_paths[i]
|
||||
# We need "i + 1" because the paths must be stored in
|
||||
# the new array slots, created from the Project class which was
|
||||
# created in the above open_pxo_file() method
|
||||
backup_save_paths[i + 1] = backup_paths[i]
|
||||
|
||||
if project_paths[i] != backup_paths[i]:
|
||||
current_save_paths[i] = project_paths[i]
|
||||
if project_paths[i] != backup_paths[i]: # If the user has saved
|
||||
current_save_paths[i + 1] = project_paths[i]
|
||||
Global.window_title = project_paths[i].get_file() + " - Pixelorama(*) " + Global.current_version
|
||||
Global.current_project.has_changed = true
|
||||
|
||||
|
|
|
@ -207,7 +207,6 @@ func handle_backup() -> void:
|
|||
backup_paths.append(Global.config_cache.get_value("backups", p_path))
|
||||
# Temporatily stop autosave until user confirms backup
|
||||
OpenSave.autosave_timer.stop()
|
||||
# For it's only possible to reload the first found backup
|
||||
$BackupConfirmation.dialog_text = tr($BackupConfirmation.dialog_text) % project_paths
|
||||
$BackupConfirmation.connect("confirmed", self, "_on_BackupConfirmation_confirmed", [project_paths, backup_paths])
|
||||
$BackupConfirmation.get_cancel().connect("pressed", self, "_on_BackupConfirmation_delete", [project_paths, backup_paths])
|
||||
|
@ -262,11 +261,11 @@ func on_open_last_project_file_menu_option_pressed() -> void:
|
|||
|
||||
func save_project_file() -> void:
|
||||
is_quitting_on_save = false
|
||||
if OpenSave.current_save_path == "":
|
||||
if OpenSave.current_save_paths[Global.current_project_index] == "":
|
||||
$SaveSprite.popup_centered()
|
||||
Global.dialog_open(true)
|
||||
else:
|
||||
_on_SaveSprite_file_selected(OpenSave.current_save_path)
|
||||
_on_SaveSprite_file_selected(OpenSave.current_save_paths[Global.current_project_index])
|
||||
|
||||
|
||||
func save_project_file_as() -> void:
|
||||
|
|
|
@ -11,7 +11,6 @@ var tag_scroll_container : ScrollContainer
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
last_frame = Global.current_project.frames.size() - 1
|
||||
timeline_scroll = Global.find_node_by_name(self, "TimelineScroll")
|
||||
tag_scroll_container = Global.find_node_by_name(self, "TagScroll")
|
||||
timeline_scroll.get_h_scrollbar().connect("value_changed", self, "_h_scroll_changed")
|
||||
|
|
Loading…
Add table
Reference in a new issue