|
class_name AutosaveNotification
|
|
extends MarginContainer
|
|
|
|
|
|
@export var animation_player: AnimationPlayer
|
|
|
|
|
|
func _ready() -> void:
|
|
SaveGameManager.autosave_start.connect(_on_autosave_start)
|
|
SaveGameManager.autosave_complete.connect(_on_autosave_complete)
|
|
visible = false
|
|
|
|
func _on_autosave_start() -> void:
|
|
animation_player.play("spin")
|
|
visible = true
|
|
|
|
func _on_autosave_complete() -> void:
|
|
# This is for testing. Saving seems to be fast making the autosave disappear immediately.
|
|
# It's not clear the cause.
|
|
# Additionally, the displaying of UI element is inconsistent. Sometimes I need to print(visible) to force it to show up, although I have no idea why that works
|
|
# TODO: Figure out what the hell is going on here
|
|
print(visible)
|
|
await get_tree().create_timer(3).timeout
|
|
|
|
animation_player.stop()
|
|
visible = false
|