menu sounds
This commit is contained in:
parent
098ab161de
commit
ba12787fcb
10 changed files with 63 additions and 16 deletions
Binary file not shown.
|
@ -12,4 +12,3 @@ func _process(delta):
|
|||
func _gui_input(event):
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
get_parent().set_kill_mode(!get_parent().kill_mode)
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
|
|
@ -13,4 +13,3 @@ func _process(delta):
|
|||
func _gui_input(event):
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
SceneManager.current_scene = next_scene.instance()
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
|
|
@ -27,8 +27,7 @@ func set_kill_mode(value):
|
|||
description.text = "Select your destiny"
|
||||
flavor_text.text = "Adventure awaits"
|
||||
|
||||
#func play_select_sound():
|
||||
# Audio.play_sound(Audio.a_select,Audio.ac_collectible)
|
||||
|
||||
#func play_confirm_sound():
|
||||
# Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
|
||||
func play_confirm_sound():
|
||||
pass # Replace with function body.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=17 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://menus/file_select_panel.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://menus/level_select_scholar.tscn" type="PackedScene" id=2]
|
||||
|
@ -13,6 +13,7 @@
|
|||
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=11]
|
||||
[ext_resource path="res://menus/DeleteButton.gd" type="Script" id=12]
|
||||
[ext_resource path="res://menus/main_menu.tscn" type="PackedScene" id=13]
|
||||
[ext_resource path="res://objects/hud/menu_sounds.tscn" type="PackedScene" id=14]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = ExtResource( 11 )
|
||||
|
@ -163,9 +164,21 @@ theme = ExtResource( 4 )
|
|||
text = "Adventure awaits"
|
||||
align = 1
|
||||
|
||||
[node name="MenuSounds" parent="." instance=ExtResource( 14 )]
|
||||
|
||||
[connection signal="file_loaded" from="Panel" to="." method="_on_file_loaded"]
|
||||
[connection signal="file_loaded" from="Panel2" to="." method="_on_file_loaded"]
|
||||
[connection signal="file_loaded" from="Panel3" to="." method="_on_file_loaded"]
|
||||
[connection signal="focus_entered" from="SelectFile1" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="pressed" from="SelectFile1" to="Panel" method="select"]
|
||||
[connection signal="pressed" from="SelectFile1" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="SelectFile2" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="pressed" from="SelectFile2" to="Panel2" method="select"]
|
||||
[connection signal="pressed" from="SelectFile2" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="SelectFile3" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="pressed" from="SelectFile3" to="Panel3" method="select"]
|
||||
[connection signal="pressed" from="SelectFile3" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="button_down" from="Back" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="Back" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="button_down" from="DeleteButton" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="DeleteButton" to="MenuSounds" method="play_select_sound"]
|
||||
|
|
|
@ -17,7 +17,6 @@ func _ready():
|
|||
|
||||
|
||||
func select() -> void:
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
if get_parent().kill_mode == false:
|
||||
# if a file exists, load and play it!
|
||||
if file:
|
||||
|
|
|
@ -16,32 +16,26 @@ func _ready():
|
|||
|
||||
Vector2( 0.83205, 0.5547 )
|
||||
|
||||
func play_select_sound():
|
||||
Audio.play_sound(Audio.a_select,Audio.ac_collectible)
|
||||
|
||||
func _on_Continue_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()
|
||||
|
||||
|
||||
func _on_FileSelect_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
||||
|
||||
|
||||
func _on_Exit_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_SoundTest_button_down():
|
||||
Audio.play_sound(Audio.a_confirm,Audio.ac_collectible)
|
||||
Fade.fade_out(0.4)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/sound_test.tscn").instance()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=14 format=2]
|
||||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=1]
|
||||
[ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=2]
|
||||
|
@ -8,6 +8,7 @@
|
|||
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=6]
|
||||
[ext_resource path="res://graphics/hud/sg_menu_blink.png" type="Texture" id=7]
|
||||
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=8]
|
||||
[ext_resource path="res://objects/hud/menu_sounds.tscn" type="PackedScene" id=9]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = ExtResource( 6 )
|
||||
|
@ -227,7 +228,20 @@ text = "Welcome to the future...
|
|||
2083"
|
||||
align = 1
|
||||
|
||||
[node name="MenuSounds" parent="." instance=ExtResource( 9 )]
|
||||
|
||||
[connection signal="button_down" from="Panel/Continue" to="." method="_on_Continue_button_down"]
|
||||
[connection signal="button_down" from="Panel/Continue" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="Panel/Continue" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="button_down" from="Panel/FileSelect" to="." method="_on_FileSelect_button_down"]
|
||||
[connection signal="button_down" from="Panel/FileSelect" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="Panel/FileSelect" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="focus_entered" from="Panel/MarathonMode" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="focus_entered" from="Panel/Augmentations" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="focus_entered" from="Panel/Options" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="button_down" from="Panel/SoundTest" to="." method="_on_SoundTest_button_down"]
|
||||
[connection signal="button_down" from="Panel/SoundTest" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="Panel/SoundTest" to="MenuSounds" method="play_select_sound"]
|
||||
[connection signal="button_down" from="Panel/Exit" to="." method="_on_Exit_button_down"]
|
||||
[connection signal="button_down" from="Panel/Exit" to="MenuSounds" method="play_confirm_sound"]
|
||||
[connection signal="focus_entered" from="Panel/Exit" to="MenuSounds" method="play_select_sound"]
|
||||
|
|
12
objects/hud/menu_sounds.gd
Normal file
12
objects/hud/menu_sounds.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Node
|
||||
|
||||
var can_play: bool = false
|
||||
|
||||
func play_select_sound():
|
||||
if can_play:
|
||||
$"%SelectSound".play()
|
||||
else:
|
||||
can_play = true
|
||||
|
||||
func play_confirm_sound():
|
||||
$"%ConfirmSound".play()
|
18
objects/hud/menu_sounds.tscn
Normal file
18
objects/hud/menu_sounds.tscn
Normal file
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://objects/hud/menu_sounds.gd" type="Script" id=1]
|
||||
[ext_resource path="res://audio/sounds/confirm.wav" type="AudioStream" id=2]
|
||||
[ext_resource path="res://audio/sounds/select.wav" type="AudioStream" id=3]
|
||||
|
||||
[node name="MenuSounds" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="SelectSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource( 3 )
|
||||
volume_db = -8.0
|
||||
|
||||
[node name="ConfirmSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource( 2 )
|
||||
volume_db = -8.0
|
Loading…
Add table
Add a link
Reference in a new issue