aboutsummaryrefslogtreecommitdiff
path: root/game/src/Autoload/Events/Options.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-02-26 17:12:07 +0100
committer GitHub <noreply@github.com>2023-02-26 17:12:07 +0100
commit93c6b207c11fdaba484410eb53fc11b35fbbb3bd (patch)
tree911753c663adb3955ab15cc8b5ac37498c2fda6e /game/src/Autoload/Events/Options.gd
parenta37c5085c3b7ee515789d681c8c18d71071fb771 (diff)
Add Setting Sanatization (#21)
Diffstat (limited to 'game/src/Autoload/Events/Options.gd')
-rw-r--r--game/src/Autoload/Events/Options.gd7
1 files changed, 5 insertions, 2 deletions
diff --git a/game/src/Autoload/Events/Options.gd b/game/src/Autoload/Events/Options.gd
index 0acaa63..8af620d 100644
--- a/game/src/Autoload/Events/Options.gd
+++ b/game/src/Autoload/Events/Options.gd
@@ -7,14 +7,17 @@ signal reset_settings()
func load_settings_from_file() -> void:
load_settings.emit(_settings_file)
-func save_settings_from_file() -> void:
+func save_settings_to_file() -> void:
save_settings.emit(_settings_file)
_settings_file.save(_settings_file_path)
func try_reset_settings() -> void:
reset_settings.emit()
-var _settings_file_path := ProjectSettings.get_setting("openvic2/settings/settings_file_path", "user://settings.cfg") as String
+const settings_file_path_setting : String = "openvic2/settings/settings_file_path"
+const settings_file_path_default : String = "user://settings.cfg"
+
+var _settings_file_path : String = ProjectSettings.get_setting(settings_file_path_setting, settings_file_path_default)
var _settings_file := ConfigFile.new()
func _init():