aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Menu/OptionMenu/OptionsMenu.gd
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-07-21 01:26:31 +0200
committer Hop311 <hop3114@gmail.com>2023-07-21 01:26:31 +0200
commit62d001b0fa209f259440e160503dc5ffe5bcaa8f (patch)
treea0b28dffaba50d351cab1619f54516be23d2aa6f /game/src/Game/Menu/OptionMenu/OptionsMenu.gd
parentf3f240853b15a9f9b7cb561dc6626e7f342c5c74 (diff)
Tidying: missing req comments, submodules, hotkeys
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/OptionsMenu.gd')
-rw-r--r--game/src/Game/Menu/OptionMenu/OptionsMenu.gd9
1 files changed, 5 insertions, 4 deletions
diff --git a/game/src/Game/Menu/OptionMenu/OptionsMenu.gd b/game/src/Game/Menu/OptionMenu/OptionsMenu.gd
index c74c458..93ef3e4 100644
--- a/game/src/Game/Menu/OptionMenu/OptionsMenu.gd
+++ b/game/src/Game/Menu/OptionMenu/OptionsMenu.gd
@@ -66,11 +66,12 @@ func _save_overrides() -> void:
if override_path.is_empty():
override_path = ProjectSettings.get_setting(Events.Options.settings_file_path_setting, Events.Options.settings_file_path_default)
var file := ConfigFile.new()
- var err_ret := file.load(override_path)
- if err_ret != OK: push_error("Failed to load overrides from %s" % override_path)
+ if FileAccess.file_exists(override_path):
+ if file.load(override_path) != OK:
+ push_error("Failed to load overrides from %s" % override_path)
file.set_value("display", "window/size/mode", Resolution.get_current_window_mode())
var resolution : Vector2i = Resolution.get_current_resolution()
file.set_value("display", "window/size/viewport_width", resolution.x)
file.set_value("display", "window/size/viewport_height", resolution.y)
- err_ret = file.save(override_path)
- if err_ret != OK: push_error("Failed to save overrides to %s" % override_path)
+ if file.save(override_path) != OK:
+ push_error("Failed to save overrides to %s" % override_path)