Improving card reveal handling

This commit is contained in:
betalars 2023-08-30 11:11:55 +02:00
parent 6824a75e29
commit f314c1c1ca
2 changed files with 6 additions and 2 deletions

View File

@ -88,7 +88,8 @@ func _ready():
func _hide_buttons():
if is_inside_tree():
if not State.reduce_motion: $AnimationPlayer.play_backwards("show_buttons")
if not State.reduce_motion:
$AnimationPlayer.play_backwards("show_buttons")
func _show_buttons():
if is_inside_tree():
@ -103,7 +104,7 @@ func hide():
if visible:
_hide_buttons()
var tween = create_tween()
tween.tween_property(self, "modulate", 0, 0.4)
tween.tween_property(self, "modulate", Color(0, 0, 0), 0.4)
_hide_buttons()
await tween.finished
visible = false

View File

@ -67,12 +67,15 @@ func _ready():
func _on_ini_room():
State.take_stage(self)
get_tree().call_group("animation_player", "play_scene", Scenes.id.YOUTH_DRAEVEN, false)
State.queue_for_stage(self)
func _process(_delta):
if focus_ray.get_collider() != null:
emit_signal("ui_entered")
has_entered = true
focus_ray.get_collider().reveal()
if has_entered and has_stage:
if focus_ray.get_collider() == null: