generated from krampus/template-godot4
Avoid extraneous settings writes from tutorial activation
This commit is contained in:
parent
7c63077312
commit
12fbc28f66
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user