Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/first_party/sounds/ui/Hover.wav

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two (different) Hover.wav files, which one is the correct oen?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct file is sounds/ui/Hover.wav. The duplicate in scenes/ has been removed.

Git LFS file not shown
24 changes: 24 additions & 0 deletions assets/first_party/sounds/ui/Hover.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[remap]

importer="wav"
type="AudioStreamWAV"
uid="uid://b11jqkfbthwec"
path="res://.godot/imported/Hover.wav-d00dcf75edf30b73b4333a46a1b42156.sample"

[deps]

source_file="res://assets/first_party/sounds/ui/Hover.wav"
dest_files=["res://.godot/imported/Hover.wav-d00dcf75edf30b73b4333a46a1b42156.sample"]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2
2 changes: 1 addition & 1 deletion project.godot

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert please

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ window/size/mode.web=0

[editor]

movie_writer/movie_file="user://recording.ogv"
movie_writer/movie_file="user://recording.mp4"

[editor_plugins]

Expand Down
19 changes: 14 additions & 5 deletions scenes/globals/uisfx_player/menu_ui_player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ extends Node
@onready var button_sfx_player: AudioStreamPlayer = %ButtonSFXPlayer
@onready var toggle_on_sfx_player: AudioStreamPlayer = %ToggleOnSFXPlayer
@onready var toggle_off_sfx_player: AudioStreamPlayer = %ToggleOffSFXPlayer
@onready var hover_sfx_player: AudioStreamPlayer = %HoverSFXPlayer


func _enter_tree() -> void:
get_tree().node_added.connect(_on_node_added)


func _on_node_added(node: Node) -> void:
if node is BaseButton:
_connect_once(node.mouse_entered, _on_button_hovered)
Comment on lines +24 to +25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried navigating with the keyboard or a gamepad? I wonder if we should play the same sound for the Control.focus_entered signal.

_connect_once(node.focus_entered, _on_button_hovered)

if node is CheckButton:
_connect_once(node.toggled, _on_toggle_pressed)
elif node is Button:
Expand All @@ -35,11 +40,8 @@ func _connect_once(sig: Signal, callable: Callable) -> void:
sig.connect(callable)


func _on_toggle_pressed(toggled_on: bool) -> void:
if toggled_on:
toggle_on_sfx_player.play()
else:
toggle_off_sfx_player.play()
func _on_button_hovered() -> void:
hover_sfx_player.play()


func _on_button_pressed() -> void:
Expand All @@ -52,3 +54,10 @@ func _on_slider_value_changed(_value: float) -> void:

func _on_tab_clicked(_tab: int) -> void:
button_sfx_player.play()


func _on_toggle_pressed(toggled_on: bool) -> void:
if toggled_on:
toggle_on_sfx_player.play()
else:
toggle_off_sfx_player.play()
8 changes: 8 additions & 0 deletions scenes/globals/uisfx_player/menu_ui_player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[ext_resource type="Script" uid="uid://bpti2tbv1ufco" path="res://scenes/globals/uisfx_player/menu_ui_player.gd" id="1_08877"]
[ext_resource type="AudioStream" uid="uid://pk4mvg05n0uo" path="res://assets/first_party/sounds/ui/Click_single.wav" id="2_a0vny"]
[ext_resource type="AudioStream" uid="uid://cba2ckeb3gxu1" path="res://assets/first_party/sounds/ui/Click.wav" id="3_73s60"]
[ext_resource type="AudioStream" uid="uid://b11jqkfbthwec" path="res://assets/first_party/sounds/ui/Hover.wav" id="4_empwr"]

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_7me2p"]
random_pitch = 1.122462
Expand All @@ -27,6 +28,13 @@ unique_name_in_owner = true
stream = SubResource("AudioStreamRandomizer_a0vny")
bus = &"SFX"

[node name="HoverSFXPlayer" type="AudioStreamPlayer" parent="." unique_id=335986934]
unique_name_in_owner = true
stream = ExtResource("4_empwr")
volume_db = -9.42
max_polyphony = 8
bus = &"SFX"

[node name="ToggleOnSFXPlayer" type="AudioStreamPlayer" parent="." unique_id=1221647971]
unique_name_in_owner = true
stream = ExtResource("3_73s60")
Expand Down