Deathmatch setup start button plays SFX & transitions to load screen

This commit is contained in:
Rob Kelly 2024-12-18 10:01:48 -07:00
parent 5cce252627
commit 2583f39252
3 changed files with 78 additions and 3 deletions

View File

@ -24,6 +24,10 @@ const MIN_PLAYERS := 2
@onready var game: Game = get_tree().get_first_node_in_group(Game.group) @onready var game: Game = get_tree().get_first_node_in_group(Game.group)
func play_chime() -> void:
game.sfx.chime.play()
func _ready() -> void: func _ready() -> void:
# Populate map selection # Populate map selection
for level: Level in Level.catalog.levels: for level: Level in Level.catalog.levels:

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://ccx2u5oli6men"] [gd_scene load_steps=10 format=3 uid="uid://ccx2u5oli6men"]
[ext_resource type="Script" path="res://src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd" id="1_bchix"] [ext_resource type="Script" path="res://src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd" id="1_bchix"]
[ext_resource type="PackedScene" uid="uid://cr13d4p235b5y" path="res://src/ui/menus/title_screen/deathmatch_setup/player_setup/player_setup.tscn" id="2_on4ab"] [ext_resource type="PackedScene" uid="uid://cr13d4p235b5y" path="res://src/ui/menus/title_screen/deathmatch_setup/player_setup/player_setup.tscn" id="2_on4ab"]
@ -66,6 +66,72 @@ _data = {
"rotate": SubResource("Animation_c3p73") "rotate": SubResource("Animation_c3p73")
} }
[sub_resource type="Animation" id="Animation_560ro"]
resource_name = "fade_out"
length = 0.6
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0666667, 0.133333, 0.2, 0.266667, 0.333333, 0.4, 0.466667, 0.533333, 0.6),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 0.5), Color(1, 1, 1, 0), Color(1, 1, 1, 0.25), Color(1, 1, 1, 0), Color(1, 1, 1, 0.125), Color(1, 1, 1, 0)]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.6),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"play_chime"
}, {
"args": [],
"method": &"start"
}]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_x4wqc"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s1eyj"]
_data = {
"RESET": SubResource("Animation_x4wqc"),
"fade_out": SubResource("Animation_560ro")
}
[node name="DeathmatchSetup" type="PanelContainer"] [node name="DeathmatchSetup" type="PanelContainer"]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -258,7 +324,12 @@ layout_mode = 2
theme_type_variation = &"AlertButton" theme_type_variation = &"AlertButton"
text = "UI_START" text = "UI_START"
[node name="AnimationPlayer" type="AnimationPlayer" parent="SouthEast/HBoxContainer/Start"]
libraries = {
"": SubResource("AnimationLibrary_s1eyj")
}
[connection signal="item_selected" from="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/MapSelect" to="." method="check_start_conditions" unbinds=1] [connection signal="item_selected" from="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/MapSelect" to="." method="check_start_conditions" unbinds=1]
[connection signal="pressed" from="MarginContainer/VBoxContainer/PlayersContainer/MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/HBoxContainer/AddPlayerButton" to="." method="_on_add_player_button_pressed"] [connection signal="pressed" from="MarginContainer/VBoxContainer/PlayersContainer/MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/HBoxContainer/AddPlayerButton" to="." method="_on_add_player_button_pressed"]
[connection signal="pressed" from="SouthEast/HBoxContainer/Cancel" to="." method="cancel"] [connection signal="pressed" from="SouthEast/HBoxContainer/Cancel" to="." method="cancel"]
[connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="." method="start"] [connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="SouthEast/HBoxContainer/Start/AnimationPlayer" method="play" binds= ["fade_out"]]

View File

@ -1480,7 +1480,7 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
[node name="PressStart" type="Label" parent="Menu"] [node name="PressStart" type="Label" parent="Menu"]
modulate = Color(1, 1, 1, 0.0024811) modulate = Color(1, 1, 1, 0.997997)
layout_mode = 1 layout_mode = 1
anchors_preset = 8 anchors_preset = 8
anchor_left = 0.5 anchor_left = 0.5