Added UI sound effects
This commit is contained in:
10
client/ui/button/Button.gd
Normal file
10
client/ui/button/Button.gd
Normal file
@ -0,0 +1,10 @@
|
||||
extends Button
|
||||
|
||||
@export var hover: AudioStream
|
||||
@export var click: AudioStream
|
||||
|
||||
func _ready():
|
||||
assert(hover)
|
||||
assert(click)
|
||||
mouse_entered.connect(Audio.play_ui.bind(hover))
|
||||
button_down.connect(Audio.play_ui.bind(click))
|
15
client/ui/button/Button.tscn
Normal file
15
client/ui/button/Button.tscn
Normal file
@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bul4bacam6s78"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/button/Button.gd" id="1_75erh"]
|
||||
[ext_resource type="AudioStream" uid="uid://bxg5jpc7glw8s" path="res://assets/audio/ui/hover.wav" id="2_7ak8k"]
|
||||
[ext_resource type="AudioStream" uid="uid://bfa480mk0nwj" path="res://assets/audio/ui/click.wav" id="3_o67x3"]
|
||||
|
||||
[node name="Button" type="Button"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_75erh")
|
||||
hover = ExtResource("2_7ak8k")
|
||||
click = ExtResource("3_o67x3")
|
@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://bqpbrju7mc7d5"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://bqpbrju7mc7d5"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
|
||||
[ext_resource type="Script" path="res://ui/label/ParentNameLabel.gd" id="2_72a3s"]
|
||||
[ext_resource type="PackedScene" uid="uid://bul4bacam6s78" path="res://ui/button/Button.tscn" id="3_42una"]
|
||||
[ext_resource type="Script" path="res://ui/settings/video/Preset.gd" id="3_il1yi"]
|
||||
[ext_resource type="Script" path="res://ui/settings/video/RenderScale.gd" id="4_owrjf"]
|
||||
[ext_resource type="Script" path="res://ui/settings/video/ScaleMode.gd" id="5_monk2"]
|
||||
@ -55,17 +56,17 @@ script = ExtResource("2_72a3s")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Low" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
||||
[node name="Low" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Low"
|
||||
|
||||
[node name="Medium" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
||||
[node name="Medium" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Medium"
|
||||
|
||||
[node name="High" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
||||
[node name="High" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "High"
|
||||
@ -272,6 +273,9 @@ layout_mode = 2
|
||||
[node name="Ambience" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UI" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Skills" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||
layout_mode = 2
|
||||
|
||||
|
Reference in New Issue
Block a user