1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fixed "Export" option in the File menu not working properly when switching between projects

Export.was_reported was keeping its value when switching projects, instead of being project-specific. Also fixed issue where imported images were not remembering the directory_path and file_name when switching projects.
This commit is contained in:
Manolis Papadeas 2020-10-25 00:58:37 +03:00
parent e6da4d2b30
commit 4e33476a4d
4 changed files with 9 additions and 2 deletions

View file

@ -9,7 +9,7 @@ This update has been brought to you by the contributions of:
PinyaColada, Rémi Verschelde (akien-mga) PinyaColada, Rémi Verschelde (akien-mga)
### Added ### Added
- Added a "frame properties" option on the popupmenu that appears when right-clicking on a cel. This lets the user choose a custom frame delay for that specific frame. ([#357](https://github.com/Orama-Interactive/Pixelorama/pull/357)) - Added a "frame properties" option on the popup menu that appears when right-clicking on a cel. This lets the user choose a custom frame delay for that specific frame. ([#357](https://github.com/Orama-Interactive/Pixelorama/pull/357))
- You can now select if you want rotation to apply in the selection, the current cel, the entire frame, all frames or even all projects (tabs)! - You can now select if you want rotation to apply in the selection, the current cel, the entire frame, all frames or even all projects (tabs)!
### Changed ### Changed
@ -19,6 +19,7 @@ PinyaColada, Rémi Verschelde (akien-mga)
- Made .pxo saving safer. In case of a crash while parsing JSON data, the old .pxo file, if it exists, will no longer be overwritten and corrupted. - Made .pxo saving safer. In case of a crash while parsing JSON data, the old .pxo file, if it exists, will no longer be overwritten and corrupted.
- Fixed issue where the user could grab, and could not let go of, the focus of guides even when they were invisible. - Fixed issue where the user could grab, and could not let go of, the focus of guides even when they were invisible.
- Fixed issues where fully transparent color could not be picked. One of these cases was ([#364](https://github.com/Orama-Interactive/Pixelorama/issues/364)). - Fixed issues where fully transparent color could not be picked. One of these cases was ([#364](https://github.com/Orama-Interactive/Pixelorama/issues/364)).
- Fixed "Export" option in the File menu not working properly when switching between projects, and not remembering the directory path and file name, if the project is an imported image and the tabs were switched.
- Fixed crash when importing an incorrectly formatted GIMP Color Palette file. ([#363](https://github.com/Orama-Interactive/Pixelorama/issues/363)) - Fixed crash when importing an incorrectly formatted GIMP Color Palette file. ([#363](https://github.com/Orama-Interactive/Pixelorama/issues/363))
<br><br> <br><br>

View file

@ -193,6 +193,7 @@ func export_processed_images(ignore_overwrites: bool, export_dialog: AcceptDialo
# Store settings for quick export and when the dialog is opened again # Store settings for quick export and when the dialog is opened again
was_exported = true was_exported = true
Global.current_project.was_exported = true
Global.file_menu.get_popup().set_item_text(5, tr("Export") + " %s" % (file_name + file_format_string(file_format))) Global.file_menu.get_popup().set_item_text(5, tr("Export") + " %s" % (file_name + file_format_string(file_format)))
# Only show when not exporting gif - gif export finishes in thread # Only show when not exporting gif - gif export finishes in thread

View file

@ -326,6 +326,7 @@ func save_pxo_file(path : String, autosave : bool, use_zstd_compression := true,
Export.file_name = path.get_file().trim_suffix(".pxo") Export.file_name = path.get_file().trim_suffix(".pxo")
Export.directory_path = path.get_base_dir() Export.directory_path = path.get_base_dir()
Export.was_exported = false Export.was_exported = false
project.was_exported = false
Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % path.get_file()) Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % path.get_file())
@ -454,6 +455,8 @@ func set_new_tab(project : Project, path : String) -> void:
Global.window_title = Global.window_title + "(*)" Global.window_title = Global.window_title + "(*)"
var file_name := path.get_basename().get_file() var file_name := path.get_basename().get_file()
var directory_path := path.get_basename().replace(file_name, "") var directory_path := path.get_basename().replace(file_name, "")
project.directory_path = directory_path
project.file_name = file_name
Export.directory_path = directory_path Export.directory_path = directory_path
Export.file_name = file_name Export.file_name = file_name

View file

@ -33,6 +33,7 @@ var cameras_offset := [Vector2.ZERO, Vector2.ZERO, Vector2.ZERO] # Array of Vect
var directory_path := "" var directory_path := ""
var file_name := "untitled" var file_name := "untitled"
var file_format : int = Export.FileFormat.PNG var file_format : int = Export.FileFormat.PNG
var was_exported := false
func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void: func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
@ -197,8 +198,9 @@ func change_project() -> void:
Export.directory_path = directory_path Export.directory_path = directory_path
Export.file_name = file_name Export.file_name = file_name
Export.file_format = file_format Export.file_format = file_format
Export.was_exported = was_exported
if directory_path.empty(): if !was_exported:
Global.file_menu.get_popup().set_item_text(5, tr("Export")) Global.file_menu.get_popup().set_item_text(5, tr("Export"))
else: else:
Global.file_menu.get_popup().set_item_text(5, tr("Export") + " %s" % (file_name + Export.file_format_string(file_format))) Global.file_menu.get_popup().set_item_text(5, tr("Export") + " %s" % (file_name + Export.file_format_string(file_format)))