From 3aac77303df4f5912fc8eb004893155e1df27fb5 Mon Sep 17 00:00:00 2001 From: qrrk <19731636+qrrk@users.noreply.github.com> Date: Thu, 17 Mar 2022 01:24:17 +0300 Subject: [PATCH] Make PathHelper into a singleton --- project.godot | 1 + scenes/Catapult.tscn | 10 +-------- scripts/BackupManager.gd | 17 +++++++------- scripts/Catapult.gd | 21 +++++++++--------- scripts/Debug.gd | 13 +++++------ scripts/FilesystemHelper.gd | 4 +--- scripts/FontManager.gd | 16 ++++++-------- scripts/InstallProbe.gd | 6 ++--- scripts/ModManager.gd | 27 +++++++++++------------ scripts/ReleaseInstaller.gd | 15 ++++++------- scripts/SoundpackManager.gd | 15 ++++++------- scripts/SoundpacksUI.gd | 4 +--- scripts/{PathHelper.gd => path_helper.gd} | 0 scripts/settings_manager.gd | 2 +- 14 files changed, 65 insertions(+), 86 deletions(-) rename scripts/{PathHelper.gd => path_helper.gd} (100%) diff --git a/project.godot b/project.godot index 62e873f4..67db1ccf 100644 --- a/project.godot +++ b/project.godot @@ -57,6 +57,7 @@ default_bus_layout="" Status="*res://scripts/status.gd" Settings="*res://scripts/settings_manager.gd" Geom="*res://scripts/window_geometry.gd" +Paths="*res://scripts/path_helper.gd" [display] diff --git a/scenes/Catapult.tscn b/scenes/Catapult.tscn index 64f04d3f..aa1f988e 100644 --- a/scenes/Catapult.tscn +++ b/scenes/Catapult.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=39 format=2] +[gd_scene load_steps=38 format=2] [ext_resource path="res://icons/info.svg" type="Texture" id=1] [ext_resource path="res://icons/download.svg" type="Texture" id=2] @@ -30,7 +30,6 @@ [ext_resource path="res://scripts/FontManager.gd" type="Script" id=28] [ext_resource path="res://scenes/FontSizeHelpDialog.tscn" type="PackedScene" id=29] [ext_resource path="res://icons/help.svg" type="Texture" id=30] -[ext_resource path="res://scripts/PathHelper.gd" type="Script" id=31] [ext_resource path="res://scenes/ChangelogDialog.tscn" type="PackedScene" id=32] [ext_resource path="res://scripts/BackupsUI.gd" type="Script" id=33] [ext_resource path="res://scripts/BackupManager.gd" type="Script" id=34] @@ -1259,12 +1258,6 @@ __meta__ = { "_editor_description_": "Installs fonts from launcher's internal storage to the game directory, reads, manipulates and saves font-related settings." } -[node name="PathHelper" type="Node" parent="."] -script = ExtResource( 31 ) -__meta__ = { -"_editor_description_": "The centralized location for all path resolutions in the launcher." -} - [node name="Backups" type="Node" parent="."] script = ExtResource( 34 ) __meta__ = { @@ -1363,7 +1356,6 @@ __meta__ = { [connection signal="soundpack_deletion_started" from="Sound" to="." method="_on_soundpack_operation_started"] [connection signal="soundpack_installation_finished" from="Sound" to="." method="_on_soundpack_operation_finished"] [connection signal="soundpack_installation_started" from="Sound" to="." method="_on_soundpack_operation_started"] -[connection signal="status_message" from="PathHelper" to="." method="_on_status_message"] [connection signal="backup_creation_finished" from="Backups" to="." method="_on_backup_operation_finished"] [connection signal="backup_creation_started" from="Backups" to="." method="_on_backup_operation_started"] [connection signal="backup_restoration_finished" from="Backups" to="." method="_on_backup_operation_finished"] diff --git a/scripts/BackupManager.gd b/scripts/BackupManager.gd index 5d3bdfab..5edde850 100644 --- a/scripts/BackupManager.gd +++ b/scripts/BackupManager.gd @@ -9,7 +9,6 @@ signal backup_deletion_started signal backup_deletion_finished onready var _fshelper := $"../FSHelper" -onready var _path := $"../PathHelper" var available = null setget , _get_available @@ -20,13 +19,13 @@ func backup_current(backup_name: String) -> void: Status.post(tr("msg_backing_up_saves") % backup_name) emit_signal("backup_creation_started") - var dest_dir = _path.save_backups.plus_file(backup_name) + var dest_dir = Paths.save_backups.plus_file(backup_name) var d = Directory.new() if not d.dir_exists(dest_dir): d.make_dir(dest_dir) - for world in _fshelper.list_dir(_path.savegames): - _fshelper.copy_dir(_path.savegames.plus_file(world), dest_dir) + for world in _fshelper.list_dir(Paths.savegames): + _fshelper.copy_dir(Paths.savegames.plus_file(world), dest_dir) yield(_fshelper, "copy_dir_done") Status.post(tr("msg_backup_created")) @@ -66,11 +65,11 @@ func refresh_available(): available = [] - if not Directory.new().dir_exists(_path.save_backups): + if not Directory.new().dir_exists(Paths.save_backups): return - for backup in _fshelper.list_dir(_path.save_backups): - var path = _path.save_backups.plus_file(backup) + for backup in _fshelper.list_dir(Paths.save_backups): + var path = Paths.save_backups.plus_file(backup) available.append(get_save_summary(path)) @@ -81,7 +80,7 @@ func restore(backup_index: int) -> void: Status.post(tr("msg_restoring_backup") % backup_name) var source_dir = available[backup_index]["path"] - var dest_dir = _path.savegames + var dest_dir = Paths.savegames emit_signal("backup_restoration_started") @@ -105,7 +104,7 @@ func restore(backup_index: int) -> void: func delete(backup_name: String) -> void: # Delete a backup. - var target_dir = _path.save_backups.plus_file(backup_name) + var target_dir = Paths.save_backups.plus_file(backup_name) emit_signal("backup_deletion_started") if Directory.new().dir_exists(target_dir): diff --git a/scripts/Catapult.gd b/scripts/Catapult.gd index de0646fc..6aef8d6c 100644 --- a/scripts/Catapult.gd +++ b/scripts/Catapult.gd @@ -13,7 +13,6 @@ onready var _tabs = $Main/Tabs onready var _mods = $Mods onready var _releases = $Releases onready var _fshelper = $FSHelper -onready var _path = $PathHelper onready var _installer = $ReleaseInstaller onready var _btn_install = $Main/Tabs/Game/BtnInstall onready var _btn_refresh = $Main/Tabs/Game/Builds/BtnRefresh @@ -60,10 +59,10 @@ func _ready() -> void: func _unpack_utils() -> void: var d = Directory.new() - var unzip_exe = _path.utils_dir.plus_file("unzip.exe") + var unzip_exe = Paths.utils_dir.plus_file("unzip.exe") if (OS.get_name() == "Windows") and (not d.file_exists(unzip_exe)): - if not d.dir_exists(_path.utils_dir): - d.make_dir(_path.utils_dir) + if not d.dir_exists(Paths.utils_dir): + d.make_dir(Paths.utils_dir) Status.post(tr("msg_unpacking_unzip")) d.copy("res://utils/unzip.exe", unzip_exe) @@ -247,14 +246,14 @@ func _get_release_key() -> String: func _on_GameDir_pressed() -> void: - var gamedir = _path.game_dir + var gamedir = Paths.game_dir if Directory.new().dir_exists(gamedir): OS.shell_open(gamedir) func _on_UserDir_pressed() -> void: - var userdir = _path.userdata + var userdir = Paths.userdata if Directory.new().dir_exists(userdir): OS.shell_open(userdir) @@ -323,7 +322,7 @@ func _on_BtnPlay_pressed() -> void: func _on_BtnResume_pressed() -> void: - var lastworld: String = _path.config.plus_file("lastworld.json") + var lastworld: String = Paths.config.plus_file("lastworld.json") if Directory.new().file_exists(lastworld): var f = File.new() f.open(lastworld, File.READ) @@ -336,15 +335,15 @@ func _start_game(world := "") -> void: match OS.get_name(): "X11": - var params := ["--userdir", _path.userdata + "/"] + var params := ["--userdir", Paths.userdata + "/"] if world != "": params.append_array(["--world", world]) - OS.execute(_path.game_dir.plus_file("cataclysm-launcher"), params, false) + OS.execute(Paths.game_dir.plus_file("cataclysm-launcher"), params, false) "Windows": var world_str := "" if world != "": world_str = "--world \"%s\"" % world - var command = "cd /d %s && start cataclysm-tiles.exe --userdir %s %s" % [_path.game_dir, _path.userdata, world_str] + var command = "cd /d %s && start cataclysm-tiles.exe --userdir %s %s" % [Paths.game_dir, Paths.userdata, world_str] OS.execute("cmd", ["/C", command], false) @@ -358,7 +357,7 @@ func _refresh_currently_installed() -> void: _lbl_build.text = info[game]["name"] _btn_install.text = tr("btn_update") _btn_play.disabled = false - _btn_resume.disabled = not (Directory.new().file_exists(_path.config.plus_file("lastworld.json"))) + _btn_resume.disabled = not (Directory.new().file_exists(Paths.config.plus_file("lastworld.json"))) _btn_game_dir.visible = true _btn_user_dir.visible = true if (_lst_builds.selected != -1) and (_lst_builds.selected < len(releases)): diff --git a/scripts/Debug.gd b/scripts/Debug.gd index 5f0891e5..3b9da1e9 100644 --- a/scripts/Debug.gd +++ b/scripts/Debug.gd @@ -2,7 +2,6 @@ extends VBoxContainer onready var _fshelper = $"/root/Catapult/FSHelper" -onready var _path = $"/root/Catapult/PathHelper" onready var _mods = $"../../../Mods" onready var _sound = $"../../../Sound" onready var _totd = $"/root/Catapult/TOTD" @@ -13,7 +12,7 @@ func _on_Button_pressed() -> void: # Test modinfo parsing. var message = "Found mods:" - var mods_dir = _path.mods_stock + var mods_dir = Paths.mods_stock Status.post("Looking for mods in %s" % mods_dir) @@ -29,7 +28,7 @@ func _on_Button2_pressed() -> void: # Test soundpack parsing. var message = "Found soundpacks:" - var sound_dir = _path.sound_user + var sound_dir = Paths.sound_user Status.post("Looking for soundpacks in %s" % sound_dir) @@ -44,7 +43,7 @@ func _on_Button2_pressed() -> void: func _on_Button3_pressed(): var d = Directory.new() - var dir = _path.own_dir.plus_file("testdir") + var dir = Paths.own_dir.plus_file("testdir") d.make_dir(dir) var command_linux = { @@ -88,7 +87,7 @@ func _on_Button4_pressed() -> void: func _on_Button5_pressed() -> void: - var path = _path.own_dir + var path = Paths.own_dir Status.post("Listing directory %s..." % path, Enums.MSG_DEBUG) yield(get_tree().create_timer(0.1), "timeout") @@ -108,10 +107,10 @@ func _on_Button7_pressed() -> void: var msg = "PathHelper properties:" - for prop in _path.get_property_list(): + for prop in Paths.get_property_list(): var name = prop["name"] if (prop["type"] == 4): - msg += "\n%s: %s" % [name, _path.get(name)] + msg += "\n%s: %s" % [name, Paths.get(name)] Status.post(msg, Enums.MSG_DEBUG) diff --git a/scripts/FilesystemHelper.gd b/scripts/FilesystemHelper.gd index 8ec779f4..58df3b27 100644 --- a/scripts/FilesystemHelper.gd +++ b/scripts/FilesystemHelper.gd @@ -12,8 +12,6 @@ var _platform: String = "" var last_extract_result: int = 0 setget , _get_last_extract_result # Stores the exit code of the last extract operation (0 if successful). -onready var _path = $"../PathHelper" - func _enter_tree() -> void: @@ -159,7 +157,7 @@ func extract(path: String, dest_dir: String) -> void: # Extracts a .zip or .tar.gz archive using the system utilities on Linux # and bundled unzip.exe from InfoZip on Windows. - var unzip_exe = _path.utils_dir.plus_file("unzip.exe") + var unzip_exe = Paths.utils_dir.plus_file("unzip.exe") var command_linux_zip = { "name": "unzip", diff --git a/scripts/FontManager.gd b/scripts/FontManager.gd index 2f131a85..10a5ccd2 100644 --- a/scripts/FontManager.gd +++ b/scripts/FontManager.gd @@ -3,8 +3,6 @@ extends Node const _DEFAULT_FONTS = ["data/font/Terminus.ttf", "data/font/unifont.ttf"] -onready var _path := $"../PathHelper" - var _game_options: Array = [] var available_fonts: Array = [] setget , _get_available_fonts @@ -62,7 +60,7 @@ func load_available_fonts() -> void: func font_config_file_exists() -> bool: - var config_file: String = _path.config.plus_file("fonts.json") + var config_file: String = Paths.config.plus_file("fonts.json") return Directory.new().file_exists(config_file) @@ -70,7 +68,7 @@ func font_config_file_exists() -> bool: func load_font_config() -> void: var result: Dictionary = {} - var config_file: String = _path.config.plus_file("fonts.json") + var config_file: String = Paths.config.plus_file("fonts.json") if Directory.new().file_exists(config_file): var f := File.new() @@ -93,14 +91,14 @@ func load_font_config() -> void: func options_file_exists() -> bool: - var options_file: String = _path.config.plus_file("options.json") + var options_file: String = Paths.config.plus_file("options.json") return Directory.new().file_exists(options_file) func load_game_options() -> void: - var options_file: String = _path.config.plus_file("options.json") + var options_file: String = Paths.config.plus_file("options.json") if Directory.new().file_exists(options_file): var f := File.new() @@ -121,7 +119,7 @@ func load_game_options() -> void: func _write_font_config() -> void: - var config_file: String = _path.config.plus_file("fonts.json") + var config_file: String = Paths.config.plus_file("fonts.json") var f = File.new() var err = f.open(config_file, File.WRITE) @@ -135,7 +133,7 @@ func _write_font_config() -> void: func write_game_options() -> void: - var options_file: String = _path.config.plus_file("options.json") + var options_file: String = Paths.config.plus_file("options.json") var f = File.new() var err = f.open(options_file, File.WRITE) @@ -153,7 +151,7 @@ func _install_font(font_index: int) -> bool: var d := Directory.new() var font_file = available_fonts[font_index]["file"] var source := "res://fonts/ingame".plus_file(font_file) - var dest: String = _path.font_user.plus_file(font_file) + var dest: String = Paths.font_user.plus_file(font_file) var err = d.copy(source, dest) if err: diff --git a/scripts/InstallProbe.gd b/scripts/InstallProbe.gd index f5f39f35..9b8d6e58 100644 --- a/scripts/InstallProbe.gd +++ b/scripts/InstallProbe.gd @@ -3,8 +3,6 @@ extends Node const _INFO_FILENAME = "catapult_install_info.json" -onready var _path := $"../PathHelper" - func create_info_file(location: String, name: String) -> void: @@ -40,11 +38,11 @@ func probe_installed_games() -> Dictionary: var result = {} var d = Directory.new() - var path_dda = _path.own_dir + "/dda/current/" + _INFO_FILENAME + var path_dda = Paths.own_dir + "/dda/current/" + _INFO_FILENAME if d.file_exists(path_dda): result["dda"] = _load_json(path_dda) - var path_bn = _path.own_dir + "/bn/current/" + _INFO_FILENAME + var path_bn = Paths.own_dir + "/bn/current/" + _INFO_FILENAME if d.file_exists(path_bn): result["bn"] = _load_json(path_bn) diff --git a/scripts/ModManager.gd b/scripts/ModManager.gd index addf9b68..d8a474dc 100644 --- a/scripts/ModManager.gd +++ b/scripts/ModManager.gd @@ -36,7 +36,6 @@ const _MODPACKS = { onready var _fshelper := $"../FSHelper" onready var _downloader := $"../Downloader" -onready var _path := $"../PathHelper" var installed: Dictionary = {} setget , _get_installed @@ -148,12 +147,12 @@ func refresh_installed(): installed = {} var non_stock := {} - if Directory.new().dir_exists(_path.mods_user): - non_stock = parse_mods_dir(_path.mods_user) + if Directory.new().dir_exists(Paths.mods_user): + non_stock = parse_mods_dir(Paths.mods_user) for id in non_stock: non_stock[id]["is_stock"] = false - var stock := parse_mods_dir(_path.mods_stock) + var stock := parse_mods_dir(Paths.mods_stock) for id in stock: stock[id]["is_stock"] = true if ("obsolete" in stock[id]["modinfo"]) and (stock[id]["modinfo"]["obsolete"] == true): @@ -172,7 +171,7 @@ func refresh_installed(): func refresh_available(): - available = parse_mods_dir(_path.mod_repo) + available = parse_mods_dir(Paths.mod_repo) func _delete_mod(mod_id: String) -> void: @@ -218,7 +217,7 @@ func _install_mod(mod_id: String) -> void: yield(get_tree().create_timer(0.05), "timeout") # For stability; see above. - var mods_dir = _path.mods_user + var mods_dir = Paths.mods_user if mod_id in available: var mod = available[mod_id] @@ -268,32 +267,32 @@ func retrieve_kenan_pack() -> void: emit_signal("modpack_retrieval_started") Status.post(tr("msg_getting_kenan_pack") % game.to_upper()) - _downloader.download_file(pack["url"], _path.own_dir, pack["filename"]) + _downloader.download_file(pack["url"], Paths.own_dir, pack["filename"]) yield(_downloader, "download_finished") - var archive = _path.own_dir.plus_file(pack["filename"]) + var archive = Paths.own_dir.plus_file(pack["filename"]) if Directory.new().file_exists(archive): - _fshelper.extract(archive, _path.tmp_dir) + _fshelper.extract(archive, Paths.tmp_dir) yield(_fshelper, "extract_done") Directory.new().remove(archive) Status.post(tr("msg_wiping_mod_repo")) - if (Directory.new().dir_exists(_path.mod_repo)): - _fshelper.rm_dir(_path.mod_repo) + if (Directory.new().dir_exists(Paths.mod_repo)): + _fshelper.rm_dir(Paths.mod_repo) yield(_fshelper, "rm_dir_done") Status.post(tr("msg_unpacking_kenan_mods")) for int_path in pack["internal_paths"]: - _fshelper.move_dir(_path.tmp_dir.plus_file(int_path), _path.mod_repo) + _fshelper.move_dir(Paths.tmp_dir.plus_file(int_path), Paths.mod_repo) yield(_fshelper, "move_dir_done") if Settings.read("install_archived_mods"): Status.post(tr("msg_unpacking_archived_mods")) - _fshelper.move_dir(_path.tmp_dir.plus_file(pack["archived_path"]), _path.mod_repo) + _fshelper.move_dir(Paths.tmp_dir.plus_file(pack["archived_path"]), Paths.mod_repo) yield(_fshelper, "move_dir_done") Status.post(tr("msg_kenan_install_cleanup")) - _fshelper.rm_dir(_path.tmp_dir.plus_file(pack["internal_paths"][0].split("/")[0])) + _fshelper.rm_dir(Paths.tmp_dir.plus_file(pack["internal_paths"][0].split("/")[0])) yield(_fshelper, "rm_dir_done") Status.post(tr("msg_kenan_install_done")) diff --git a/scripts/ReleaseInstaller.gd b/scripts/ReleaseInstaller.gd index b473a3a6..34038714 100644 --- a/scripts/ReleaseInstaller.gd +++ b/scripts/ReleaseInstaller.gd @@ -7,7 +7,6 @@ signal installation_finished onready var _downloader := $"../Downloader" onready var _fshelper := $"../FSHelper" onready var _probe := $"../InstallProbe" -onready var _path := $"../PathHelper" func install_release(release_info: Dictionary, game: String, update: bool = false) -> void: @@ -19,13 +18,13 @@ func install_release(release_info: Dictionary, game: String, update: bool = fals else: Status.post(tr("msg_installing_game") % release_info["name"]) - _downloader.download_file(release_info["url"], _path.own_dir, release_info["filename"]) + _downloader.download_file(release_info["url"], Paths.own_dir, release_info["filename"]) yield(_downloader, "download_finished") - var archive: String = _path.own_dir.plus_file(release_info["filename"]) + var archive: String = Paths.own_dir.plus_file(release_info["filename"]) if Directory.new().file_exists(archive): - _fshelper.extract(archive, _path.tmp_dir) + _fshelper.extract(archive, Paths.tmp_dir) yield(_fshelper, "extract_done") Directory.new().remove(archive) @@ -34,17 +33,17 @@ func install_release(release_info: Dictionary, game: String, update: bool = fals var extracted_root match OS.get_name(): "X11": - extracted_root = _path.tmp_dir.plus_file(_fshelper.list_dir(_path.tmp_dir)[0]) + extracted_root = Paths.tmp_dir.plus_file(_fshelper.list_dir(Paths.tmp_dir)[0]) "Windows": - extracted_root = _path.tmp_dir + extracted_root = Paths.tmp_dir _probe.create_info_file(extracted_root, release_info["name"]) if update: - _fshelper.rm_dir(_path.game_dir) + _fshelper.rm_dir(Paths.game_dir) yield(_fshelper, "rm_dir_done") - _fshelper.move_dir(extracted_root, _path.game_dir) + _fshelper.move_dir(extracted_root, Paths.game_dir) yield(_fshelper, "move_dir_done") if update: diff --git a/scripts/SoundpackManager.gd b/scripts/SoundpackManager.gd index aa870857..ca935d5c 100644 --- a/scripts/SoundpackManager.gd +++ b/scripts/SoundpackManager.gd @@ -56,7 +56,6 @@ const SOUNDPACKS = [ onready var _fshelper := $"../FSHelper" onready var _downloader := $"../Downloader" -onready var _path := $"../PathHelper" func parse_sound_dir(sound_dir: String) -> Array: @@ -94,13 +93,13 @@ func get_installed(include_stock = false) -> Array: var packs = [] - if Directory.new().dir_exists(_path.sound_user): - packs.append_array(parse_sound_dir(_path.sound_user)) + if Directory.new().dir_exists(Paths.sound_user): + packs.append_array(parse_sound_dir(Paths.sound_user)) for pack in packs: pack["is_stock"] = false if include_stock: - var stock = parse_sound_dir(_path.sound_stock) + var stock = parse_sound_dir(Paths.sound_stock) for pack in stock: pack["is_stock"] = true packs.append_array(stock) @@ -126,8 +125,8 @@ func install_pack(soundpack_index: int, from_file = null, reinstall = false, kee var pack = SOUNDPACKS[soundpack_index] var game = Settings.read("game") - var sound_dir = _path.sound_user - var tmp_dir = _path.tmp_dir.plus_file(pack["name"]) + var sound_dir = Paths.sound_user + var tmp_dir = Paths.tmp_dir.plus_file(pack["name"]) var archive = "" emit_signal("soundpack_installation_started") @@ -140,9 +139,9 @@ func install_pack(soundpack_index: int, from_file = null, reinstall = false, kee if from_file: archive = from_file else: - _downloader.download_file(pack["url"], _path.own_dir, pack["filename"]) + _downloader.download_file(pack["url"], Paths.own_dir, pack["filename"]) yield(_downloader, "download_finished") - archive = _path.own_dir.plus_file(pack["filename"]) + archive = Paths.own_dir.plus_file(pack["filename"]) if not Directory.new().file_exists(archive): Status.post(tr("msg_sound_download_failed"), Enums.MSG_ERROR) emit_signal("soundpack_installation_finished") diff --git a/scripts/SoundpacksUI.gd b/scripts/SoundpacksUI.gd index 66674029..502a48e1 100644 --- a/scripts/SoundpacksUI.gd +++ b/scripts/SoundpacksUI.gd @@ -11,8 +11,6 @@ onready var _dlg_manual_dl = $ConfirmManualDownload onready var _dlg_file = $InstallFromFileDialog onready var _cbox_stock = $HBox/Installed/ShowStock -onready var _workdir = OS.get_executable_path().get_base_dir() - var _installed_packs = [] @@ -151,7 +149,7 @@ func _on_ConfirmManualDownload_confirmed() -> void: var pack = _sound.SOUNDPACKS[_available_list.get_selected_items()[0]] OS.shell_open(pack["url"]) - _dlg_file.current_dir = _workdir + _dlg_file.current_dir = Paths.own_dir _dlg_file.popup_centered_ratio(0.9) diff --git a/scripts/PathHelper.gd b/scripts/path_helper.gd similarity index 100% rename from scripts/PathHelper.gd rename to scripts/path_helper.gd diff --git a/scripts/settings_manager.gd b/scripts/settings_manager.gd index 2fab82d9..dd049950 100644 --- a/scripts/settings_manager.gd +++ b/scripts/settings_manager.gd @@ -35,7 +35,7 @@ func _exit_tree() -> void: func _load() -> void: - _settings_file = OS.get_executable_path().get_base_dir() + "/" + _SETTINGS_FILENAME + _settings_file = Paths.own_dir.plus_file(_SETTINGS_FILENAME) if File.new().file_exists(_settings_file): _current = _read_from_file(_settings_file)