diff options
| author | tpart <tpart120@proton.me> | 2024-06-29 22:08:39 +0200 | 
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2024-06-29 22:08:41 +0200 | 
| commit | 9a76089edbae93c874b24c53a9b79f1fe10ebe2f (patch) | |
| tree | 76f003962c2f1c1219c88e6ab02bf7c53a389afb /client/audio/sound.gd | |
| parent | 424b4ef3716e74bcc54c3eefffe6ba7994d79270 (diff) | |
| download | hurrycurry-9a76089edbae93c874b24c53a9b79f1fe10ebe2f.tar hurrycurry-9a76089edbae93c874b24c53a9b79f1fe10ebe2f.tar.bz2 hurrycurry-9a76089edbae93c874b24c53a9b79f1fe10ebe2f.tar.zst | |
Add Sound singleton; Restructure sound system; Add button sounds to ingame menu
Diffstat (limited to 'client/audio/sound.gd')
| -rw-r--r-- | client/audio/sound.gd | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/client/audio/sound.gd b/client/audio/sound.gd new file mode 100644 index 00000000..ddb610c5 --- /dev/null +++ b/client/audio/sound.gd @@ -0,0 +1,19 @@ +extends Node + +@onready var click_sound = $UI/Click +@onready var hover_sound = $UI/Hover + +func play_click(): +	click_sound.play() + +func play_hover(): +	hover_sound.play() + +func play_hover_maybe(element): +	if Global.focus_auto_changed: +		Global.focus_auto_changed = false +		return +	if element is Button: +		if element.is_hovered(): +			return +	play_hover() | 
