diff --git a/addons/README.md b/addons/README.md index b2f9fa2e7..1109ab2d3 100644 --- a/addons/README.md +++ b/addons/README.md @@ -9,7 +9,7 @@ ## Keychain - Upstream: https://github.com/Orama-Interactive/Keychain -- Version: [5031af557efcff4eb1ae77550e91868ab57cb1c0](https://github.com/Orama-Interactive/Keychain/commit/5031af557efcff4eb1ae77550e91868ab57cb1c0) +- Version: [66417933f76ad6e76dd479145183acddecf4ae33](https://github.com/Orama-Interactive/Keychain/commit/66417933f76ad6e76dd479145183acddecf4ae33) - License: [MIT](https://github.com/Orama-Interactive/Keychain/blob/main/LICENSE) ## gdgifexporter diff --git a/addons/keychain/Keychain.gd b/addons/keychain/Keychain.gd index 2288107b2..fc0594180 100644 --- a/addons/keychain/Keychain.gd +++ b/addons/keychain/Keychain.gd @@ -22,7 +22,7 @@ var ignore_ui_actions := true ## and the fourth for [InputEventJoypadMotion]s. var changeable_types: PackedByteArray = [true, true, true, true] ## The file path of the [code]config_file[/code]. -var config_path := "user://cache.ini" +var config_path := "user://config.ini" ## Used to store the settings to the filesystem. var config_file: ConfigFile @@ -58,11 +58,11 @@ func _ready() -> void: DirAccess.make_dir_recursive_absolute(PROFILES_PATH) var profile_dir := DirAccess.open(PROFILES_PATH) profile_dir.list_dir_begin() - var file_name = profile_dir.get_next() + var file_name := profile_dir.get_next() while file_name != "": if !profile_dir.current_is_dir(): if file_name.get_extension() == "tres": - var file = load(PROFILES_PATH.path_join(file_name)) + var file := load(PROFILES_PATH.path_join(file_name)) if file is ShortcutProfile: profiles.append(file) file_name = profile_dir.get_next() diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 60739f71e..b02933c76 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -106,6 +106,8 @@ const LANGUAGES_DICT := { "uk_UA": ["Українська", "Ukrainian"], } +## The file path used for the [member config_cache] file. +const CONFIG_PATH := "user://config.ini" ## The file used to save preferences that use [code]ProjectSettings.save_custom()[/code]. const OVERRIDE_FILE := "override.cfg" ## The name of folder containing Pixelorama preferences. @@ -655,7 +657,7 @@ var cel_button_scene: PackedScene = load("res://src/UI/Timeline/CelButton.tscn") func _init() -> void: # Load settings from the config file - config_cache.load("user://cache.ini") + config_cache.load(CONFIG_PATH) loaded_locales.sort() # Make sure locales are always sorted if OS.has_feature("template"): root_directory = OS.get_executable_path().get_base_dir() diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index 377cd4a4b..7d3237e30 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -263,7 +263,7 @@ func open_pxo_file(path: String, is_backup := false, replace_empty := true) -> v # Set last opened project path and save Global.config_cache.set_value("data", "current_dir", path.get_base_dir()) Global.config_cache.set_value("data", "last_project_path", path) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) new_project.file_name = path.get_file().trim_suffix(".pxo") new_project.was_exported = false Global.top_menu_container.file_menu.set_item_text( @@ -425,7 +425,7 @@ func save_pxo_file( # Set last opened project path and save Global.config_cache.set_value("data", "current_dir", path.get_base_dir()) Global.config_cache.set_value("data", "last_project_path", path) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) if !project.was_exported: project.file_name = path.get_file().trim_suffix(".pxo") project.export_directory_path = path.get_base_dir() diff --git a/src/Autoload/Themes.gd b/src/Autoload/Themes.gd index a96d3756e..59ef67af9 100644 --- a/src/Autoload/Themes.gd +++ b/src/Autoload/Themes.gd @@ -52,7 +52,7 @@ func change_theme(id: int) -> void: change_clear_color() change_icon_colors() Global.config_cache.set_value("preferences", "theme", id) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) theme_switched.emit() diff --git a/src/HandleExtensions.gd b/src/HandleExtensions.gd index 05acd8b9f..4e115f751 100644 --- a/src/HandleExtensions.gd +++ b/src/HandleExtensions.gd @@ -220,7 +220,7 @@ func enable_extension(extension: Extension, save_to_config := true) -> void: if save_to_config: Global.config_cache.set_value("extensions", extension.file_name, extension.enabled) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) func uninstall_extension(file_name := "", remove_mode := UninstallMode.REMOVE_PERMANENT) -> void: diff --git a/src/Main.gd b/src/Main.gd index c93377ef3..2d3546c7d 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -574,4 +574,4 @@ func _exit_tree() -> void: Global.config_cache.set_value("view_menu", "show_rulers", Global.show_rulers) Global.config_cache.set_value("view_menu", "show_guides", Global.show_guides) Global.config_cache.set_value("view_menu", "show_mouse_guides", Global.show_mouse_guides) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index 6a8d017df..316a418aa 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -373,7 +373,7 @@ func _on_PreferencesDialog_visibility_changed() -> void: if not visible: list.clear() Global.dialog_open(false) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) func _on_List_item_selected(index: int) -> void: @@ -407,7 +407,7 @@ func _on_language_pressed(index: int) -> void: locale = Global.loaded_locales[index - 2] Global.set_locale(locale) Global.config_cache.set_value("preferences", "locale", TranslationServer.get_locale()) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) # Update some UI elements with the new translations Tools.update_hint_tooltips() diff --git a/src/UI/Dialogs/SplashDialog.gd b/src/UI/Dialogs/SplashDialog.gd index 723932d72..4da46fa8c 100644 --- a/src/UI/Dialogs/SplashDialog.gd +++ b/src/UI/Dialogs/SplashDialog.gd @@ -76,7 +76,7 @@ func _on_ShowOnStartup_toggled(pressed: bool) -> void: Global.config_cache.set_value("preferences", "startup", false) else: Global.config_cache.set_value("preferences", "startup", true) - Global.config_cache.save("user://cache.ini") + Global.config_cache.save(Global.CONFIG_PATH) func _on_PatreonButton_pressed() -> void: