diff options
| author | BigBrotherNii <nicochr1004@gmail.com> | 2024-07-24 14:31:21 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-07-25 11:23:26 +0200 | 
| commit | e108944ffab8f69308f78a87c9c9310dff410d6e (patch) | |
| tree | 4aa039752aed73a3ac9a9ddff4ed1f92923fe28a /client/audio/sound.gd | |
| parent | 74fb8de441c68fff92680a48352f6b9b0f6e9271 (diff) | |
| download | hurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar hurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar.bz2 hurrycurry-e108944ffab8f69308f78a87c9c9310dff410d6e.tar.zst  | |
added main theme and music settings
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()  |