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

Rename config file from cache.ini to config.ini

This commit is contained in:
Emmanouil Papadeas 2024-05-16 00:07:38 +03:00
parent 3a4517abf4
commit a8440b80cc
9 changed files with 15 additions and 13 deletions

View file

@ -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

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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:

View file

@ -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)

View file

@ -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()

View file

@ -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: