1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +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

@ -0,0 +1,3 @@
source_md5="b8fcdd3fcd8e6af7810b21a25fbbfce8"
dest_md5="2a8113abc3da9686cb5813edf48afc5b"

View File

@ -0,0 +1,3 @@
source_md5="f3327d109e31f66117e71347bf5d23a6"
dest_md5="aeb44b0dd8e5c6c535635c258781f974"

View File

@ -1,15 +0,0 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr"
[deps]
source_file="res://BGM - Captain Scurvy.ogg"
dest_files=[ "res://.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr" ]
[params]
loop=true
loop_offset=0

View File

@ -1,15 +0,0 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr"
[deps]
source_file="res://ButtonSFX.ogg"
dest_files=[ "res://.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr" ]
[params]
loop=false
loop_offset=0

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/BGM - Captain Scurvy.ogg-e6a4c7b7e6bf2999f35a2157c007b514.oggstr"
[deps]
source_file="res://assets/audio/BGM - Captain Scurvy.ogg"
dest_files=[ "res://.import/BGM - Captain Scurvy.ogg-e6a4c7b7e6bf2999f35a2157c007b514.oggstr" ]
[params]
loop=true
loop_offset=0

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/ButtonSFX.ogg-473913894e173ed0b5a935d3831ff9b6.oggstr"
[deps]
source_file="res://assets/audio/ButtonSFX.ogg"
dest_files=[ "res://.import/ButtonSFX.ogg-473913894e173ed0b5a935d3831ff9b6.oggstr" ]
[params]
loop=false
loop_offset=0

View File

@ -0,0 +1,9 @@
[gd_resource type="AudioBusLayout" format=2]
[resource]
bus/1/name = "BGM"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/send = "Master"

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://BGM - Captain Scurvy.ogg" type="AudioStream" id=1]
[ext_resource path="res://assets/audio/BGM - Captain Scurvy.ogg" type="AudioStream" id=1]
[node name="Control" type="Control"]
anchor_right = 1.0
@ -12,3 +12,4 @@ __meta__ = {
[node name="BGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 1 )
autoplay = true
bus = "BGM"

View File

@ -2,7 +2,7 @@
[ext_resource path="res://script/options/Option-Background.png" type="Texture" id=1]
[ext_resource path="res://script/options/Options.gd" type="Script" id=2]
[ext_resource path="res://ButtonSFX.ogg" type="AudioStream" id=3]
[ext_resource path="res://assets/audio/ButtonSFX.ogg" type="AudioStream" id=3]
[node name="Options" type="Control"]
anchor_right = 1.0

View File

@ -2,7 +2,7 @@
[ext_resource path="res://script/title screen/Title-Screen-Background.png" type="Texture" id=1]
[ext_resource path="res://script/title screen/Title Screen.gd" type="Script" id=2]
[ext_resource path="res://ButtonSFX.ogg" type="AudioStream" id=3]
[ext_resource path="res://assets/audio/ButtonSFX.ogg" type="AudioStream" id=3]
[node name="Title Node" type="Control"]
anchor_right = 1.0

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():