mirror of
https://github.com/JohnBreaux/Boat-Battle.git
synced 2025-02-04 12:28:35 +00:00
Background music volume can be adjusted
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
extends Control
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
@@ -24,6 +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)
|
||||
emit_signal("change_mus_volume", mus_vol)
|
||||
func set_sfx_vol(volume):
|
||||
sfx_vol = volume
|
||||
@@ -43,6 +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)
|
||||
|
||||
# Getters
|
||||
func get_theme():
|
||||
|
||||
Reference in New Issue
Block a user