From 3df7a67b9bb71d79926c51dcfd41a462a0080f0b Mon Sep 17 00:00:00 2001 From: Variable <77773850+Variable-ind@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:09:38 +0500 Subject: [PATCH] fix some stuff in extension explorer, and changed (open logs folder) to (open editor data folder) (#1038) --- project.godot | 2 +- src/Autoload/Global.gd | 2 +- src/UI/ExtensionExplorer/Entry/ExtensionEntry.gd | 8 +++++--- src/UI/ExtensionExplorer/Store.gd | 1 - src/UI/TopMenuContainer/TopMenuContainer.gd | 9 ++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/project.godot b/project.godot index f24dba758..cd53d11cd 100644 --- a/project.godot +++ b/project.godot @@ -701,7 +701,7 @@ issue_tracker={ "deadzone": 0.5, "events": [] } -open_logs_folder={ +open_editor_data_folder={ "deadzone": 0.5, "events": [] } diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 8a0cdb06f..d2b8a4abe 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -73,7 +73,7 @@ enum HelpMenu { VIEW_SPLASH_SCREEN, ONLINE_DOCS, ISSUE_TRACKER, - OPEN_LOGS_FOLDER, + OPEN_EDITOR_DATA_FOLDER, CHANGELOG, ABOUT_PIXELORAMA, SUPPORT_PIXELORAMA diff --git a/src/UI/ExtensionExplorer/Entry/ExtensionEntry.gd b/src/UI/ExtensionExplorer/Entry/ExtensionEntry.gd index 1a13d4224..fa9b48ed3 100644 --- a/src/UI/ExtensionExplorer/Entry/ExtensionEntry.gd +++ b/src/UI/ExtensionExplorer/Entry/ExtensionEntry.gd @@ -28,9 +28,11 @@ func set_info(info: Dictionary, extension_path: String) -> void: ext_name.text = str(info["name"], "-v", info["version"]) # check for updates change_button_if_updatable(info["name"], info["version"]) - # Setting path extension will be "temporarily" downloaded to before install - DirAccess.make_dir_recursive_absolute(str(extension_path, "Download/")) - download_path = str(extension_path, "Download/", info["name"], ".pck") + # Setting a path extension will be "temporarily" downloaded to before install + var temp_dir = extension_path.path_join("Download") + if not DirAccess.dir_exists_absolute(temp_dir): + DirAccess.make_dir_recursive_absolute(temp_dir) + download_path = temp_dir.path_join(info["name"] + ".pck") if "sha256" in info.keys(): sha256 = info["sha256"] if "description" in info.keys(): diff --git a/src/UI/ExtensionExplorer/Store.gd b/src/UI/ExtensionExplorer/Store.gd index 6e02d0cf7..3f1860f94 100644 --- a/src/UI/ExtensionExplorer/Store.gd +++ b/src/UI/ExtensionExplorer/Store.gd @@ -184,7 +184,6 @@ func process_line(line: String) -> void: func parse_extension_data(raw_data: Array) -> Dictionary: - DirAccess.make_dir_recursive_absolute(str(extension_path, "Download/")) var result := {} # Check for non-compulsory things if they exist for item in raw_data: diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index 036011ef3..ee037cecf 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -426,7 +426,7 @@ func _setup_help_menu() -> void: "View Splash Screen": "view_splash_screen", "Online Docs": "open_docs", "Issue Tracker": "issue_tracker", - "Open Logs Folder": "open_logs_folder", + "Open Editor Data Folder": "open_editor_data_folder", "Changelog": "changelog", "About Pixelorama": "about_pixelorama", "Support Pixelorama's Development": &"", @@ -836,10 +836,9 @@ func help_menu_id_pressed(id: int) -> void: OS.shell_open(DOCS_URL) Global.HelpMenu.ISSUE_TRACKER: OS.shell_open(ISSUES_URL) - Global.HelpMenu.OPEN_LOGS_FOLDER: - var dir := DirAccess.open("user://logs") - dir.make_dir_recursive("user://logs") # In case someone deleted it - OS.shell_open(ProjectSettings.globalize_path("user://logs")) + Global.HelpMenu.OPEN_EDITOR_DATA_FOLDER: + var dir := DirAccess.open("user://") + OS.shell_open(ProjectSettings.globalize_path("user://")) Global.HelpMenu.CHANGELOG: OS.shell_open(CHANGELOG_URL) Global.HelpMenu.ABOUT_PIXELORAMA: