From 7dd9b36cdcf374655dcaa5adf88c935204edcfb2 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 29 Oct 2020 22:33:15 +0200 Subject: [PATCH] Move "Recent projects" up, just below "Open last project" in the File menu --- src/Autoload/Export.gd | 2 +- src/Autoload/OpenSave.gd | 6 +++--- src/Classes/Project.gd | 8 ++++---- src/Main.gd | 4 ++-- src/UI/TopMenuContainer.gd | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Autoload/Export.gd b/src/Autoload/Export.gd index 5ea9bd088..fbdeae9b5 100644 --- a/src/Autoload/Export.gd +++ b/src/Autoload/Export.gd @@ -196,7 +196,7 @@ func export_processed_images(ignore_overwrites: bool, export_dialog: AcceptDialo # Store settings for quick export and when the dialog is opened again 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(6, tr("Export") + " %s" % (file_name + file_format_string(file_format))) # Only show when not exporting gif - gif export finishes in thread if not (current_tab == ExportTab.ANIMATION and animation_type == AnimationType.ANIMATED): diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index e759914c9..3742cef94 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -117,8 +117,8 @@ func open_pxo_file(path : String, untitled_backup : bool = false) -> void: Export.file_name = path.get_file().trim_suffix(".pxo") Export.directory_path = path.get_base_dir() Export.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(5, tr("Export")) + Global.file_menu.get_popup().set_item_text(4, tr("Save") + " %s" % path.get_file()) + Global.file_menu.get_popup().set_item_text(6, tr("Export")) Global.save_project_to_recent_list(path) @@ -337,7 +337,7 @@ func save_pxo_file(path : String, autosave : bool, use_zstd_compression := true, Export.directory_path = path.get_base_dir() 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(4, tr("Save") + " %s" % path.get_file()) Global.save_project_to_recent_list(path) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 01e46225c..cfc617bc8 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -191,9 +191,9 @@ func change_project() -> void: if save_path != "": Global.open_sprites_dialog.current_path = save_path Global.save_sprites_dialog.current_path = save_path - Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % save_path.get_file()) + Global.file_menu.get_popup().set_item_text(4, tr("Save") + " %s" % save_path.get_file()) else: - Global.file_menu.get_popup().set_item_text(3, tr("Save")) + Global.file_menu.get_popup().set_item_text(4, tr("Save")) Export.directory_path = directory_path Export.file_name = file_name @@ -201,9 +201,9 @@ func change_project() -> void: Export.was_exported = was_exported if !was_exported: - Global.file_menu.get_popup().set_item_text(5, tr("Export")) + Global.file_menu.get_popup().set_item_text(6, tr("Export")) 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(6, tr("Export") + " %s" % (file_name + Export.file_format_string(file_format))) func serialize() -> Dictionary: diff --git a/src/Main.gd b/src/Main.gd index dd17b9104..dd4598d5c 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -217,8 +217,8 @@ func _on_BackupConfirmation_confirmed(project_paths : Array, backup_paths : Arra Export.file_name = OpenSave.current_save_paths[0].get_file().trim_suffix(".pxo") Export.directory_path = OpenSave.current_save_paths[0].get_base_dir() Export.was_exported = false - Global.file_menu.get_popup().set_item_text(3, tr("Save") + " %s" % OpenSave.current_save_paths[0].get_file()) - Global.file_menu.get_popup().set_item_text(5, tr("Export")) + Global.file_menu.get_popup().set_item_text(4, tr("Save") + " %s" % OpenSave.current_save_paths[0].get_file()) + Global.file_menu.get_popup().set_item_text(6, tr("Export")) func _on_BackupConfirmation_delete(project_paths : Array, backup_paths : Array) -> void: diff --git a/src/UI/TopMenuContainer.gd b/src/UI/TopMenuContainer.gd index 89c79d2fe..980a4960e 100644 --- a/src/UI/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer.gd @@ -19,11 +19,11 @@ func setup_file_menu() -> void: "New..." : InputMap.get_action_list("new_file")[0].get_scancode_with_modifiers(), "Open..." : InputMap.get_action_list("open_file")[0].get_scancode_with_modifiers(), 'Open last project...' : 0, + "Recent projects": 0, "Save..." : InputMap.get_action_list("save_file")[0].get_scancode_with_modifiers(), "Save as..." : InputMap.get_action_list("save_file_as")[0].get_scancode_with_modifiers(), "Export..." : InputMap.get_action_list("export_file")[0].get_scancode_with_modifiers(), "Export as..." : InputMap.get_action_list("export_file_as")[0].get_scancode_with_modifiers(), - "Recent projects": 0, "Quit" : InputMap.get_action_list("quit")[0].get_scancode_with_modifiers(), } file_menu = Global.file_menu.get_popup()