Fixing various issues

This commit is contained in:
hz
2025-11-07 10:51:53 -06:00
parent 4c6b2f84df
commit 631928c943
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ func _load_settings() -> void:
_user_volume_linear = clamp(stored_volume, 0.0, 1.0)
var stored_muted: bool = bool(config.get_value(CONFIG_SECTION, CONFIG_KEY_MUSIC_MUTED, false))
_is_muted = stored_muted
elif err == ERR_DOES_NOT_EXIST:
elif err == ERR_DOES_NOT_EXIST or err == ERR_FILE_NOT_FOUND:
_user_volume_linear = DEFAULT_VOLUME
_is_muted = false
else:
@@ -94,7 +94,7 @@ func _load_settings() -> void:
func _save_settings() -> void:
var config: ConfigFile = ConfigFile.new()
var err: int = config.load(CONFIG_PATH)
if err != OK and err != ERR_DOES_NOT_EXIST:
if err != OK and err != ERR_DOES_NOT_EXIST and err != ERR_FILE_NOT_FOUND:
push_warning("Failed to load settings.cfg before saving: %s" % err)
config = ConfigFile.new()
elif err != OK:
+2 -2
View File
@@ -53,7 +53,7 @@ func _load_settings() -> void:
if err == OK:
_user_volume_linear = clamp(float(config.get_value(CONFIG_SECTION, CONFIG_KEY_VOLUME, DEFAULT_VOLUME)), 0.0, 1.0)
_is_muted = bool(config.get_value(CONFIG_SECTION, CONFIG_KEY_MUTED, false))
elif err == ERR_DOES_NOT_EXIST:
elif err == ERR_DOES_NOT_EXIST or err == ERR_FILE_NOT_FOUND:
_user_volume_linear = DEFAULT_VOLUME
_is_muted = false
else:
@@ -64,7 +64,7 @@ func _load_settings() -> void:
func _save_settings() -> void:
var config: ConfigFile = ConfigFile.new()
var err: int = config.load(CONFIG_PATH)
if err != OK and err != ERR_DOES_NOT_EXIST:
if err != OK and err != ERR_DOES_NOT_EXIST and err != ERR_FILE_NOT_FOUND:
push_warning("Failed to load settings.cfg before saving: %s" % err)
config = ConfigFile.new()
elif err != OK:
+1 -1
View File
@@ -14,7 +14,7 @@ func _register_focus_sounds() -> void:
button.mouse_entered.connect(_on_menu_item_focus)
func _on_start_button_pressed():
get_tree().change_scene_to_file("uid://dchj6g2i8ebph")
get_tree().change_scene_to_file("res://scenes/Grid/grid_field.tscn")
func _on_settings_button_pressed():
get_tree().change_scene_to_file("uid://d3tqrm4ry4l88")