fixed sound sound test crash (fixes #192)

This commit is contained in:
pennyrigate 2023-12-26 22:24:05 -05:00
parent 8088322761
commit 90c51d8ce7
2 changed files with 6 additions and 10 deletions

View file

@ -8,11 +8,11 @@ onready var body = $SoundLabel/Label
func _gui_input(event): func _gui_input(event):
if Input.is_action_just_pressed("ui_left"): if Input.is_action_just_pressed("ui_left"):
current_selection -= 1 current_selection -= 1
if Input.is_action_just_pressed("ui_right"): elif Input.is_action_just_pressed("ui_right"):
current_selection += 1 current_selection += 1
if Input.is_action_just_pressed("ui_accept"): elif Input.is_action_just_pressed("ui_accept"):
Audio.play_sound(sounds[current_selection],Audio.ac_collectible) Audio.play_sound(sounds[current_selection],Audio.ac_collectible)
if Input.is_action_just_pressed("ui_cancel"): elif Input.is_action_just_pressed("ui_cancel"):
Audio.ac_music.stop() Audio.ac_music.stop()
current_selection = posmod(current_selection,sounds.size()) current_selection = posmod(current_selection,sounds.size())
body.text = titles[current_selection] body.text = titles[current_selection]

View file

@ -48,9 +48,9 @@ shader_param/color_1 = Color( 0.501961, 1, 0.929412, 1 )
shader_param/color_2 = Color( 0, 0.713726, 0.631373, 1 ) shader_param/color_2 = Color( 0, 0.713726, 0.631373, 1 )
shader_param/checker_size = Vector2( 32, 32 ) shader_param/checker_size = Vector2( 32, 32 )
shader_param/pan_speed = Vector2( 12, 0 ) shader_param/pan_speed = Vector2( 12, 0 )
shader_param/cycle_speed = Vector2( 8, 0 ) shader_param/cycle_speed = Vector2( 9, 0 )
shader_param/cycle_alternation = Vector2( 2, 0 ) shader_param/cycle_alternation = Vector2( 2, 1 )
shader_param/uv_transform = Transform2D( 0, 3, 2, 1, 0, 0 ) shader_param/uv_transform = Transform2D( 0, 3, 3, 1, 0, 0 )
[sub_resource type="ShaderMaterial" id=12] [sub_resource type="ShaderMaterial" id=12]
shader = ExtResource( 2 ) shader = ExtResource( 2 )
@ -107,7 +107,6 @@ material = SubResource( 12 )
position = Vector2( 72, 152 ) position = Vector2( 72, 152 )
scale = Vector2( 2, 2 ) scale = Vector2( 2, 2 )
frames = SubResource( 15 ) frames = SubResource( 15 )
frame = 1
playing = true playing = true
[node name="AnimatedSprite3" type="AnimatedSprite" parent="."] [node name="AnimatedSprite3" type="AnimatedSprite" parent="."]
@ -115,7 +114,6 @@ material = SubResource( 12 )
position = Vector2( 112, 152 ) position = Vector2( 112, 152 )
scale = Vector2( 2, 2 ) scale = Vector2( 2, 2 )
frames = SubResource( 15 ) frames = SubResource( 15 )
frame = 1
playing = true playing = true
[node name="AnimatedSprite4" type="AnimatedSprite" parent="."] [node name="AnimatedSprite4" type="AnimatedSprite" parent="."]
@ -123,7 +121,6 @@ material = SubResource( 12 )
position = Vector2( 152, 152 ) position = Vector2( 152, 152 )
scale = Vector2( 2, 2 ) scale = Vector2( 2, 2 )
frames = SubResource( 15 ) frames = SubResource( 15 )
frame = 1
playing = true playing = true
[node name="AnimatedSprite5" type="AnimatedSprite" parent="."] [node name="AnimatedSprite5" type="AnimatedSprite" parent="."]
@ -131,7 +128,6 @@ material = SubResource( 12 )
position = Vector2( 192, 152 ) position = Vector2( 192, 152 )
scale = Vector2( 2, 2 ) scale = Vector2( 2, 2 )
frames = SubResource( 15 ) frames = SubResource( 15 )
frame = 1
playing = true playing = true
[node name="Music" type="TextureButton" parent="."] [node name="Music" type="TextureButton" parent="."]