From 62d001b0fa209f259440e160503dc5ffe5bcaa8f Mon Sep 17 00:00:00 2001 From: Hop311 Date: Fri, 21 Jul 2023 00:26:31 +0100 Subject: Tidying: missing req comments, submodules, hotkeys --- game/src/Game/Menu/OptionMenu/OptionsMenu.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'game/src/Game/Menu/OptionMenu/OptionsMenu.gd') 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) -- cgit v1.2.3-56-ga3b1