diff options
Diffstat (limited to 'client/audio/sound.gd')
| -rw-r--r-- | client/audio/sound.gd | 16 | 
1 files changed, 16 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()  |