Avoid extraneous settings writes from tutorial activation

This commit is contained in:
Rob Kelly 2025-07-10 17:56:33 -06:00
parent 7c63077312
commit 12fbc28f66
2 changed files with 7 additions and 6 deletions

View File

@ -7,8 +7,9 @@ const TUTORIAL_KEY_PREFIX := "game/tutorial/progress/"
func activate(key: String) -> void:
ProjectSettings.set_setting(key, true)
Game.settings.write()
if not is_active(key):
ProjectSettings.set_setting(key, true)
Game.settings.write()
func is_active(key: String) -> bool:
@ -45,6 +46,6 @@ func reset_tutorial() -> void:
func disable_tutorial() -> void:
disable_all.emit()
# XXX does this ensure the call to write will happen after all signals resolve?
Game.settings.write.call_deferred()
for key: String in get_tutorial_keys():
ProjectSettings.set_setting(key, true)
Game.settings.write()

View File

@ -56,5 +56,5 @@ func deserialize(state: Dictionary) -> void:
func _process(_delta: float) -> void:
# TODO don't do this in _process
# TODO donAAaaaa't do this in _process
interactive.enabled = enabled and _has_item()