fix #136 for good: fixing animation player skip handling

This commit is contained in:
betalars 2025-05-09 17:36:11 +02:00
parent b7258e858b
commit 6fe6834541
2 changed files with 30 additions and 8 deletions

View File

@ -127,6 +127,7 @@ func _input(event):
if event.is_action_pressed("ui_accept"): if event.is_action_pressed("ui_accept"):
pick(curr_selection_id) pick(curr_selection_id)
elif event.is_action_pressed("skip"): elif event.is_action_pressed("skip"):
$Meaning.stop()
if selection_state == CARDS_SELECTED: if selection_state == CARDS_SELECTED:
picked_player.play("skip_pick", .1) picked_player.play("skip_pick", .1)
random_player.play("skip_shuffle", .1) random_player.play("skip_shuffle", .1)
@ -135,9 +136,11 @@ func _input(event):
transition() transition()
show_posts() show_posts()
elif selection_state == POSTS_SELECTED: elif selection_state == POSTS_SELECTED:
for player:AnimationPlayer in anim_players + [picked_player, random_player]:
player.play("ini")
# I do not know, why process_frame won't work here, but this is workaround seems to prevent the notes from flashing the next selection.
await(get_tree().create_timer(0.1).timeout)
transition() transition()
for player in anim_players + [picked_player, random_player]:
player.advance(10.0)
elif selection_state == TRANSITION: elif selection_state == TRANSITION:
show_posts() show_posts()
@ -240,6 +243,8 @@ func pick_cards(id: int, repeat: bool):
fill_card_slots(id) fill_card_slots(id)
#State.transition_stage_to(self, true) #State.transition_stage_to(self, true)
selection_state = CARDS selection_state = CARDS
if id == Scenes.id.YOUTH_DRAEVEN and not repeat:
$Meaning.play()
else: else:
Scenes.end_current_sequence() Scenes.end_current_sequence()

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=70 format=3 uid="uid://brk4hjdf2x81a"] [gd_scene load_steps=72 format=3 uid="uid://brk4hjdf2x81a"]
[ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"] [ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"] [ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"]
[ext_resource type="Script" uid="uid://r12efqgk6t4n" path="res://logic-scenes/board/sticky-note.gd" id="3_f4sp4"] [ext_resource type="Script" uid="uid://r12efqgk6t4n" path="res://logic-scenes/board/sticky-note.gd" id="3_f4sp4"]
[ext_resource type="AudioStream" uid="uid://bakwypwhs7a5n" path="res://base-environments/youth_room/audio/why-does-it-mean.wav" id="4_ujc5a"]
[ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="5_et74x"]
[sub_resource type="Animation" id="Animation_dinvx"] [sub_resource type="Animation" id="Animation_dinvx"]
length = 0.001 length = 0.001
@ -1888,9 +1890,24 @@ metadata/_custom_type_script = "uid://r12efqgk6t4n"
layout_mode = 2 layout_mode = 2
[node name="Label" type="Label" parent="thought_prompt"] [node name="Label" type="Label" parent="thought_prompt"]
layout_mode = 2 layout_mode = 1
offset_left = -225.0 anchors_preset = 8
offset_top = -196.0 anchor_left = 0.5
offset_right = 225.0 anchor_top = 0.5
offset_bottom = -158.0 anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -282.5
offset_top = -288.0
offset_right = 282.5
offset_bottom = -239.0
grow_horizontal = 2
grow_vertical = 2
theme_type_variation = &"HeaderMedium"
text = "Why does that story mean so much to me?" text = "Why does that story mean so much to me?"
horizontal_alignment = 1
[node name="Meaning" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_ujc5a")
mix_target = 2
bus = &"text"
script = ExtResource("5_et74x")