mirror of
https://github.com/JohnBreaux/Boat-Battle.git
synced 2024-11-14 21:15:58 +00:00
Merge branch 'main' of github.com:StatewideInk/Group12 into main
This commit is contained in:
commit
ff26e67be8
@ -21,25 +21,20 @@ func _on_Button_pressed():
|
||||
|
||||
func _on_Master_Slider_value_changed(value):
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
OptionsController.set_mas_vol(value)
|
||||
OptionsController.save_options()
|
||||
OptionsController.set_vol(value, "mas_vol")
|
||||
|
||||
func _on_Music_Slider_value_changed(value):
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
OptionsController.set_mus_vol(value)
|
||||
OptionsController.save_options()
|
||||
OptionsController.set_vol(value, "mus_vol")
|
||||
|
||||
func _on_SFX_Slider_value_changed(value):
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
OptionsController.set_sfx_vol(value)
|
||||
OptionsController.save_options()
|
||||
OptionsController.set_vol(value, "sfx_vol")
|
||||
|
||||
func _on_Light_pressed():
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
OptionsController.set_theme("light")
|
||||
OptionsController.save_options()
|
||||
|
||||
func _on_Dark_pressed():
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
OptionsController.set_theme("dark")
|
||||
OptionsController.save_options()
|
||||
|
@ -22,15 +22,28 @@ func set_theme(theme_name):
|
||||
theme = String(theme_name)
|
||||
save_options()
|
||||
emit_signal("change_theme", theme)
|
||||
func set_mas_vol(volume):
|
||||
mas_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), mas_vol)
|
||||
func set_mus_vol(volume):
|
||||
mus_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), mus_vol)
|
||||
func set_sfx_vol(volume):
|
||||
sfx_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), sfx_vol)
|
||||
save_options()
|
||||
func set_vol(volume, type):
|
||||
if type == "mas_vol":
|
||||
mas_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), mas_vol)
|
||||
elif type == "mus_vol":
|
||||
mus_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), mus_vol)
|
||||
elif type == "sfx_vol":
|
||||
sfx_vol = volume
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), sfx_vol)
|
||||
save_options()
|
||||
|
||||
#func set_mas_vol(volume):
|
||||
# mas_vol = volume
|
||||
# AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), mas_vol)
|
||||
#func set_mus_vol(volume):
|
||||
# mus_vol = volume
|
||||
# AudioServer.set_bus_volume_db(AudioServer.get_bus_index("BGM"), mus_vol)
|
||||
#func set_sfx_vol(volume):
|
||||
# sfx_vol = volume
|
||||
# AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), sfx_vol)
|
||||
|
||||
#Option Save File
|
||||
func save_options():
|
||||
|
Loading…
Reference in New Issue
Block a user