generated from krampus/template-godot4
Title screen SFX
This commit is contained in:
parent
4bfa1c88a6
commit
c28c016dbd
@ -59,6 +59,7 @@ func _initial_load() -> void:
|
||||
##
|
||||
## The loading screen will be shown until the scene is loaded.
|
||||
func queue_scene(path: String) -> Promise:
|
||||
_unload_content()
|
||||
return queue_load(path, ScenePromise.new(), "PackedScene").finally(_finish_scene_load)
|
||||
|
||||
|
||||
@ -85,8 +86,6 @@ func _finish_scene_load(scene_instance: Node) -> void:
|
||||
# Reset time scale in case it's been changed.
|
||||
Engine.time_scale = 1.0
|
||||
|
||||
_unload_content()
|
||||
|
||||
content.add_child(scene_instance)
|
||||
scene_instance.reparent(content)
|
||||
|
||||
|
@ -14,6 +14,9 @@ extends Control
|
||||
@onready var continue_button: Button = %Continue
|
||||
@onready var settings_container: Control = %SettingsContainer
|
||||
|
||||
@onready var title_sfx: AudioStreamPlayer = %TitleSFX
|
||||
@onready var title_drone: AudioStreamPlayer = %TitleDrone
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
@ -36,3 +39,8 @@ func show_settings() -> void:
|
||||
|
||||
func quit() -> void:
|
||||
get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
title_sfx.stop()
|
||||
title_drone.stop()
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=18 format=3 uid="uid://bctwol681jdk0"]
|
||||
[gd_scene load_steps=20 format=3 uid="uid://bctwol681jdk0"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dj2ij1b2yjicr" path="res://src/ui/menus/title_screen/title_screen.theme" id="1_3lcvc"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6dx0ovy15g5o" path="res://src/effects/grunk_2d/grunk_2d.tscn" id="2_7vchy"]
|
||||
@ -9,6 +9,8 @@
|
||||
[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="4_cgiy0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dixpjnlaj86x2" path="res://assets/ui/corpo_logo/corpo_logo_128.png" id="5_yrys0"]
|
||||
[ext_resource type="FontFile" uid="uid://bgy7odoob7xyl" path="res://assets/fonts/Silkscreen/Silkscreen-Bold.ttf" id="6_cgiy0"]
|
||||
[ext_resource type="AudioStream" uid="uid://c838ofbu4bqrn" path="res://assets/sfx/computer_noise.wav" id="10_x67pi"]
|
||||
[ext_resource type="AudioStream" uid="uid://dx4d8a3mgpws" path="res://assets/sfx/ambient/drone_loop.wav" id="11_gdkv4"]
|
||||
|
||||
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_7v5ka"]
|
||||
width = 256
|
||||
@ -294,6 +296,30 @@ tracks/19/keys = {
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/20/type = "value"
|
||||
tracks/20/imported = false
|
||||
tracks/20/enabled = true
|
||||
tracks/20/path = NodePath("TitleDrone:playing")
|
||||
tracks/20/interp = 1
|
||||
tracks/20/loop_wrap = true
|
||||
tracks/20/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
tracks/21/type = "value"
|
||||
tracks/21/imported = false
|
||||
tracks/21/enabled = true
|
||||
tracks/21/path = NodePath("TitleDrone:volume_db")
|
||||
tracks/21/interp = 1
|
||||
tracks/21/loop_wrap = true
|
||||
tracks/21/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [-40.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_uxv0r"]
|
||||
resource_name = "display"
|
||||
@ -539,6 +565,45 @@ tracks/19/keys = {
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/20/type = "audio"
|
||||
tracks/20/imported = false
|
||||
tracks/20/enabled = true
|
||||
tracks/20/path = NodePath("TitleSFX")
|
||||
tracks/20/interp = 1
|
||||
tracks/20/loop_wrap = true
|
||||
tracks/20/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("10_x67pi")
|
||||
}],
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/20/use_blend = true
|
||||
tracks/21/type = "value"
|
||||
tracks/21/imported = false
|
||||
tracks/21/enabled = true
|
||||
tracks/21/path = NodePath("TitleDrone:playing")
|
||||
tracks/21/interp = 1
|
||||
tracks/21/loop_wrap = true
|
||||
tracks/21/keys = {
|
||||
"times": PackedFloat32Array(0, 6.15),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [false, true]
|
||||
}
|
||||
tracks/22/type = "value"
|
||||
tracks/22/imported = false
|
||||
tracks/22/enabled = true
|
||||
tracks/22/path = NodePath("TitleDrone:volume_db")
|
||||
tracks/22/interp = 1
|
||||
tracks/22/loop_wrap = true
|
||||
tracks/22/keys = {
|
||||
"times": PackedFloat32Array(6.15, 10),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [-40.0, -10.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3qdtd"]
|
||||
_data = {
|
||||
@ -553,7 +618,6 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_3lcvc")
|
||||
script = ExtResource("2_rjwhj")
|
||||
save_path = "user://ghost_ship.state.res"
|
||||
level_scene = "uid://bov4ok76woyc"
|
||||
@ -573,7 +637,7 @@ color = Color(0.0196078, 0.0431373, 0.0627451, 1)
|
||||
material = SubResource("ShaderMaterial_rjwhj")
|
||||
layout_mode = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
[node name="TitleScreenContent" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
@ -581,161 +645,173 @@ anchor_bottom = 1.0
|
||||
offset_top = -73.0
|
||||
offset_right = 440.0
|
||||
grow_vertical = 0
|
||||
theme = ExtResource("1_3lcvc")
|
||||
theme_override_constants/margin_left = 32
|
||||
theme_override_constants/margin_bottom = 32
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TitleScreenContent"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="Loader" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="Loader" type="HBoxContainer" parent="TitleScreenContent/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Prompt" type="Label" parent="MarginContainer/VBoxContainer/Loader"]
|
||||
[node name="Prompt" type="Label" parent="TitleScreenContent/VBoxContainer/Loader"]
|
||||
layout_mode = 2
|
||||
text = ">"
|
||||
|
||||
[node name="Loading" type="Label" parent="MarginContainer/VBoxContainer/Loader"]
|
||||
[node name="Loading" type="Label" parent="TitleScreenContent/VBoxContainer/Loader"]
|
||||
layout_mode = 2
|
||||
text = "UI_LOADING"
|
||||
visible_characters_behavior = 1
|
||||
|
||||
[node name="Ellipsis" type="Label" parent="MarginContainer/VBoxContainer/Loader"]
|
||||
[node name="Ellipsis" type="Label" parent="TitleScreenContent/VBoxContainer/Loader"]
|
||||
layout_mode = 2
|
||||
text = "... "
|
||||
visible_characters_behavior = 1
|
||||
|
||||
[node name="Done" type="Label" parent="MarginContainer/VBoxContainer/Loader"]
|
||||
[node name="Done" type="Label" parent="TitleScreenContent/VBoxContainer/Loader"]
|
||||
layout_mode = 2
|
||||
text = "Done!"
|
||||
visible_characters = 0
|
||||
visible_characters_behavior = 1
|
||||
visible_ratio = 0.0
|
||||
|
||||
[node name="WarningMessage" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="WarningMessage" type="HBoxContainer" parent="TitleScreenContent/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="LogoContainer" type="Control" parent="MarginContainer/VBoxContainer/WarningMessage"]
|
||||
[node name="LogoContainer" type="Control" parent="TitleScreenContent/VBoxContainer/WarningMessage"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(128, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="Logo" type="TextureRect" parent="MarginContainer/VBoxContainer/WarningMessage/LogoContainer"]
|
||||
[node name="Logo" type="TextureRect" parent="TitleScreenContent/VBoxContainer/WarningMessage/LogoContainer"]
|
||||
modulate = Color(0.137255, 0.984314, 0.34902, 1)
|
||||
layout_mode = 1
|
||||
offset_right = 128.0
|
||||
offset_bottom = 128.0
|
||||
texture = ExtResource("5_yrys0")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/WarningMessage"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TitleScreenContent/VBoxContainer/WarningMessage"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 16
|
||||
alignment = 2
|
||||
|
||||
[node name="Line1" type="HBoxContainer" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer"]
|
||||
[node name="Line1" type="HBoxContainer" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Warning" type="Label" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
[node name="Warning" type="Label" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_cgiy0")
|
||||
text = "!WARNING!"
|
||||
visible_characters = 0
|
||||
visible_ratio = 0.0
|
||||
|
||||
[node name="Warning2" type="Label" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
[node name="Warning2" type="Label" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
layout_mode = 2
|
||||
text = " This is a secure terminal system."
|
||||
visible_characters = 0
|
||||
visible_ratio = 0.0
|
||||
|
||||
[node name="Blinker" type="Label" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
[node name="Blinker" type="Label" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer/Line1"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "_"
|
||||
|
||||
[node name="Line2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer"]
|
||||
[node name="Line2" type="HBoxContainer" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Warning3" type="Label" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer/Line2"]
|
||||
[node name="Warning3" type="Label" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer/Line2"]
|
||||
layout_mode = 2
|
||||
text = "Unauthorized access is prohibited under penalty of"
|
||||
visible_characters = 0
|
||||
visible_ratio = 0.0
|
||||
|
||||
[node name="Blinker2" type="Label" parent="MarginContainer/VBoxContainer/WarningMessage/VBoxContainer/Line2"]
|
||||
[node name="Blinker2" type="Label" parent="TitleScreenContent/VBoxContainer/WarningMessage/VBoxContainer/Line2"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "_"
|
||||
|
||||
[node name="BufferSpace" type="Control" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="BufferSpace" type="Control" parent="TitleScreenContent/VBoxContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(1024, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TitleContainer" type="Control" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="TitleContainer" type="Control" parent="TitleScreenContent/VBoxContainer"]
|
||||
visible = false
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(800, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/TitleContainer"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TitleScreenContent/VBoxContainer/TitleContainer"]
|
||||
layout_mode = 1
|
||||
offset_right = 968.0
|
||||
offset_bottom = 432.0
|
||||
theme_override_constants/margin_left = 64
|
||||
|
||||
[node name="Title" type="TextureRect" parent="MarginContainer/VBoxContainer/TitleContainer/MarginContainer"]
|
||||
[node name="Title" type="TextureRect" parent="TitleScreenContent/VBoxContainer/TitleContainer/MarginContainer"]
|
||||
modulate = Color(0.137255, 0.984314, 0.34902, 1)
|
||||
texture_filter = 3
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_uxv0r")
|
||||
stretch_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TitleScreenContent/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 64
|
||||
|
||||
[node name="MenuButtons" type="VBoxContainer" parent="MarginContainer/VBoxContainer/MarginContainer"]
|
||||
[node name="MenuButtons" type="VBoxContainer" parent="TitleScreenContent/VBoxContainer/MarginContainer"]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="Continue" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
[node name="Continue" type="Button" parent="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Continue"
|
||||
|
||||
[node name="NewGame" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
[node name="NewGame" type="Button" parent="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "New Game"
|
||||
|
||||
[node name="Settings" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
[node name="Settings" type="Button" parent="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Settings"
|
||||
|
||||
[node name="Quit" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
[node name="Quit" type="Button" parent="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"DangerButton"
|
||||
text = "Quit"
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="MarginContainer"]
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="TitleScreenContent"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_3qdtd")
|
||||
}
|
||||
autoplay = "display"
|
||||
|
||||
[node name="TitleSFX" type="AudioStreamPlayer" parent="TitleScreenContent"]
|
||||
unique_name_in_owner = true
|
||||
volume_db = -20.0
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="TitleDrone" type="AudioStreamPlayer" parent="TitleScreenContent"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("11_gdkv4")
|
||||
volume_db = -40.0
|
||||
bus = &"Music"
|
||||
|
||||
[node name="SettingsContainer" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(1000, 600)
|
||||
@ -751,7 +827,7 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer/MenuButtons/Continue" to="." method="continue_game"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer/MenuButtons/NewGame" to="." method="new_game"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer/MenuButtons/Settings" to="." method="show_settings"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer/MenuButtons/Quit" to="." method="quit"]
|
||||
[connection signal="pressed" from="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons/Continue" to="." method="continue_game"]
|
||||
[connection signal="pressed" from="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons/NewGame" to="." method="new_game"]
|
||||
[connection signal="pressed" from="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons/Settings" to="." method="show_settings"]
|
||||
[connection signal="pressed" from="TitleScreenContent/VBoxContainer/MarginContainer/MenuButtons/Quit" to="." method="quit"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user