From 0b9eb2bbed429f4201a2f16cf15a2edef3f75eef Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 11 May 2021 14:51:14 +0300 Subject: [PATCH] Change the project's name before saving the pxo file --- src/Autoload/OpenSave.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index a073c3649..ce36236f0 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -271,6 +271,8 @@ func open_old_pxo_file(file : File, new_project : Project, first_line : String) func save_pxo_file(path : String, autosave : bool, use_zstd_compression := true, project : Project = Global.current_project) -> void: + if !autosave: + project.name = path.get_file() var serialized_data = project.serialize() if !serialized_data: Global.error_dialog.set_text(tr("File failed to save. Converting project data to dictionary failed.")) @@ -299,7 +301,6 @@ func save_pxo_file(path : String, autosave : bool, use_zstd_compression := true, return if !autosave: - project.name = path.get_file() current_save_paths[Global.current_project_index] = path file.store_line(to_save)