aboutsummaryrefslogtreecommitdiff
path: root/client/audio
diff options
context:
space:
mode:
authorBigBrotherNii <nicochr1004@gmail.com>2024-07-24 14:31:21 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-25 11:23:26 +0200
commite108944ffab8f69308f78a87c9c9310dff410d6e (patch)
tree4aa039752aed73a3ac9a9ddff4ed1f92923fe28a /client/audio
parent74fb8de441c68fff92680a48352f6b9b0f6e9271 (diff)
downloadhurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar
hurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar.bz2
hurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar.zst
added main theme and music settings
Diffstat (limited to 'client/audio')
-rw-r--r--client/audio/sound.gd16
-rw-r--r--client/audio/sound.tscn4
2 files changed, 20 insertions, 0 deletions
diff --git a/client/audio/sound.gd b/client/audio/sound.gd
index ac30acf8..99bf692f 100644
--- a/client/audio/sound.gd
+++ b/client/audio/sound.gd
@@ -2,6 +2,7 @@
# Copyright 2024 nokoe
# Copyright 2024 tpart
# Copyright 2024 metamuffin
+# Copyright 2024 BigBrotherNii
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -19,10 +20,25 @@ extends Node
@onready var click_sound = $UI/Click
@onready var hover_sound = $UI/Hover
+@onready var music_node : Node = $Music
var item_sounds: Dictionary = {}
var item_id: int = 0
+func play_music(music : String):
+ for stream in music_node.get_children():
+ stream.stop()
+
+ music_node.get_node(music).play()
+
+func set_volume(value:float):
+ AudioServer.set_bus_volume_db(0, value)
+
+ if value == -30:
+ AudioServer.set_bus_mute(0, true)
+ else:
+ AudioServer.set_bus_mute(0, false)
+
func play_click():
click_sound.play()
diff --git a/client/audio/sound.tscn b/client/audio/sound.tscn
index 3f2607c8..a8524e71 100644
--- a/client/audio/sound.tscn
+++ b/client/audio/sound.tscn
@@ -14,3 +14,7 @@ stream = ExtResource("2_mhrce")
[node name="Hover" type="AudioStreamPlayer" parent="UI"]
stream = ExtResource("3_qft2s")
+
+[node name="Music" type="Node" parent="."]
+
+[node name="MainMenu" type="AudioStreamPlayer" parent="Music"]