generated from krampus/template-godot4
Avoid extraneous settings writes from tutorial activation
This commit is contained in:
parent
7c63077312
commit
12fbc28f66
@ -7,6 +7,7 @@ const TUTORIAL_KEY_PREFIX := "game/tutorial/progress/"
|
|||||||
|
|
||||||
|
|
||||||
func activate(key: String) -> void:
|
func activate(key: String) -> void:
|
||||||
|
if not is_active(key):
|
||||||
ProjectSettings.set_setting(key, true)
|
ProjectSettings.set_setting(key, true)
|
||||||
Game.settings.write()
|
Game.settings.write()
|
||||||
|
|
||||||
@ -45,6 +46,6 @@ func reset_tutorial() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func disable_tutorial() -> void:
|
func disable_tutorial() -> void:
|
||||||
disable_all.emit()
|
for key: String in get_tutorial_keys():
|
||||||
# XXX does this ensure the call to write will happen after all signals resolve?
|
ProjectSettings.set_setting(key, true)
|
||||||
Game.settings.write.call_deferred()
|
Game.settings.write()
|
||||||
|
@ -56,5 +56,5 @@ func deserialize(state: Dictionary) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> 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()
|
interactive.enabled = enabled and _has_item()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user