1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2025-02-04 12:28:35 +00:00

Moved audio to folder in assets; Separated BGM from the master volume

This commit is contained in:
hpham474
2021-11-07 19:15:13 -06:00
parent 04fc9759dc
commit 9929aab354
16 changed files with 51 additions and 39 deletions

View File

@@ -20,14 +20,10 @@ func _on_Button_pressed():
func _on_SFX_Slider_value_changed(value):
OptionsController.set_sfx_vol(value)
OptionsController.save_options()
if !$ButtonSFX.is_playing():
$ButtonSFX.play()
func _on_Volume_Slider_value_changed(value):
OptionsController.set_mus_vol(value)
OptionsController.save_options()
if !$ButtonSFX.is_playing():
$ButtonSFX.play()
func _on_Light_pressed():
OptionsController.set_theme("light")

View File

@@ -24,7 +24,7 @@ func set_theme(theme_name):
emit_signal("change_theme", theme)
func set_mus_vol(volume):
mus_vol = volume
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), mus_vol)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), mus_vol)
emit_signal("change_mus_volume", mus_vol)
func set_sfx_vol(volume):
sfx_vol = volume
@@ -44,7 +44,7 @@ func load_options():
mus_vol = f.get_var()
sfx_vol = f.get_var()
f.close()
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), mus_vol)
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), mus_vol)
# Getters
func get_theme():