From 2583f39252bdd91296c059bf8a6a1b80cddbe52c Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Wed, 18 Dec 2024 10:01:48 -0700 Subject: [PATCH] Deathmatch setup start button plays SFX & transitions to load screen --- .../deathmatch_setup/deathmatch_setup.gd | 4 + .../deathmatch_setup/deathmatch_setup.tscn | 75 ++++++++++++++++++- src/ui/menus/title_screen/title_screen.tscn | 2 +- 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd index 49d5040..82250b5 100644 --- a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd +++ b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.gd @@ -24,6 +24,10 @@ const MIN_PLAYERS := 2 @onready var game: Game = get_tree().get_first_node_in_group(Game.group) +func play_chime() -> void: + game.sfx.chime.play() + + func _ready() -> void: # Populate map selection for level: Level in Level.catalog.levels: diff --git a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn index 86bacc1..d1fecbc 100644 --- a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn +++ b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn @@ -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="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") } +[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"] anchors_preset = 15 anchor_right = 1.0 @@ -258,7 +324,12 @@ layout_mode = 2 theme_type_variation = &"AlertButton" 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="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/Start" to="." method="start"] +[connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="SouthEast/HBoxContainer/Start/AnimationPlayer" method="play" binds= ["fade_out"]] diff --git a/src/ui/menus/title_screen/title_screen.tscn b/src/ui/menus/title_screen/title_screen.tscn index 01f5b40..a4c0dca 100644 --- a/src/ui/menus/title_screen/title_screen.tscn +++ b/src/ui/menus/title_screen/title_screen.tscn @@ -1480,7 +1480,7 @@ grow_horizontal = 2 grow_vertical = 2 [node name="PressStart" type="Label" parent="Menu"] -modulate = Color(1, 1, 1, 0.0024811) +modulate = Color(1, 1, 1, 0.997997) layout_mode = 1 anchors_preset = 8 anchor_left = 0.5