diff options
| author | nokoe <nokoe@mailbox.org> | 2025-10-09 17:06:23 +0200 |
|---|---|---|
| committer | nokoe <nokoe@mailbox.org> | 2025-10-09 17:07:01 +0200 |
| commit | 27919ac3e6c274f82a7b93e0941738188773020c (patch) | |
| tree | e4082ee8d46b5cd1c664ffe82a8c4449b78ce410 /client | |
| parent | 51531848f824ce5b3841ed1d96909903c090a3b0 (diff) | |
| download | hurrycurry-27919ac3e6c274f82a7b93e0941738188773020c.tar hurrycurry-27919ac3e6c274f82a7b93e0941738188773020c.tar.bz2 hurrycurry-27919ac3e6c274f82a7b93e0941738188773020c.tar.zst | |
add main menu music
Diffstat (limited to 'client')
| -rw-r--r-- | client/audio/music/reflets-dans-leau.ogg | bin | 0 -> 966492 bytes | |||
| -rw-r--r-- | client/audio/music/reflets-dans-leau.ogg.import | 19 | ||||
| -rw-r--r-- | client/audio/sound.gd | 22 | ||||
| -rw-r--r-- | client/audio/sound.tscn | 6 | ||||
| -rw-r--r-- | client/default_bus_layout.tres | 14 | ||||
| -rw-r--r-- | client/gui/menus/character.gd | 6 | ||||
| -rw-r--r-- | client/gui/menus/main/about.gd | 4 | ||||
| -rw-r--r-- | client/gui/menus/main/main.gd | 3 | ||||
| -rw-r--r-- | client/gui/overlays/lobby/lobby.gd | 2 |
9 files changed, 64 insertions, 12 deletions
diff --git a/client/audio/music/reflets-dans-leau.ogg b/client/audio/music/reflets-dans-leau.ogg Binary files differnew file mode 100644 index 00000000..13d78788 --- /dev/null +++ b/client/audio/music/reflets-dans-leau.ogg diff --git a/client/audio/music/reflets-dans-leau.ogg.import b/client/audio/music/reflets-dans-leau.ogg.import new file mode 100644 index 00000000..24e77fa2 --- /dev/null +++ b/client/audio/music/reflets-dans-leau.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dpgt5loaberoj" +path="res://.godot/imported/reflets-dans-leau.ogg-b4a7d816b71a4043429c7dc7d9411e8f.oggvorbisstr" + +[deps] + +source_file="res://audio/music/reflets-dans-leau.ogg" +dest_files=["res://.godot/imported/reflets-dans-leau.ogg-b4a7d816b71a4043429c7dc7d9411e8f.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/client/audio/sound.gd b/client/audio/sound.gd index 8c7649aa..833d0bbe 100644 --- a/client/audio/sound.gd +++ b/client/audio/sound.gd @@ -22,15 +22,23 @@ extends Node var item_sounds: Dictionary = {} var item_id: int = 0 +var current_song = null -func play_music(music : String): # If music == "stop", this stops all music - for stream in music_node.get_children(): - stream.stop() - - if music_node.get_node_or_null(music) == null: - return +func play_music(music): + if music: + var song = music_node.get_node_or_null(music) + if song: + if song != current_song: + if current_song: + current_song.stop() + song.play() + current_song = song + else: + push_error("Song %s does not exist" % music) else: - music_node.get_node(music).play() + if current_song: + current_song.stop() + current_song = null func set_volume(bus : int, value:float): AudioServer.set_bus_volume_db(bus, value) diff --git a/client/audio/sound.tscn b/client/audio/sound.tscn index b15a3263..bdd865a4 100644 --- a/client/audio/sound.tscn +++ b/client/audio/sound.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=5 format=3 uid="uid://d3h243yic44rr"] +[gd_scene load_steps=6 format=3 uid="uid://d3h243yic44rr"] [ext_resource type="Script" uid="uid://cho8r5m78a4ur" path="res://audio/sound.gd" id="1_b0qb1"] [ext_resource type="AudioStream" uid="uid://cpyn511c5mtni" path="res://gui/resources/sounds/click.ogg" id="2_mhrce"] [ext_resource type="AudioStream" uid="uid://dtr1khfyqr56o" path="res://gui/resources/sounds/hover.ogg" id="3_qft2s"] [ext_resource type="AudioStream" uid="uid://dft3m8utnxhs7" path="res://gui/resources/sounds/game_start.ogg" id="4_le874"] +[ext_resource type="AudioStream" uid="uid://dpgt5loaberoj" path="res://audio/music/reflets-dans-leau.ogg" id="5_j8h5s"] [node name="Sound" type="Node3D"] script = ExtResource("1_b0qb1") @@ -25,7 +26,8 @@ bus = &"SFX" [node name="Music" type="Node" parent="."] [node name="MainMenu" type="AudioStreamPlayer" parent="Music"] -volume_db = 1.0 +stream = ExtResource("5_j8h5s") +volume_db = -3.0 bus = &"Music" [node name="Lobby" type="AudioStreamPlayer" parent="Music"] diff --git a/client/default_bus_layout.tres b/client/default_bus_layout.tres index b578bec4..6c958883 100644 --- a/client/default_bus_layout.tres +++ b/client/default_bus_layout.tres @@ -1,4 +1,12 @@ -[gd_resource type="AudioBusLayout" format=3 uid="uid://cco0uysin1okg"] +[gd_resource type="AudioBusLayout" load_steps=3 format=3 uid="uid://cco0uysin1okg"] + +[sub_resource type="AudioEffectLowPassFilter" id="AudioEffectLowPassFilter_j3pel"] +resource_name = "LowPassFilter" +cutoff_hz = 400.0 + +[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_j3pel"] +resource_name = "Reverb" +room_size = 1.0 [resource] bus/1/name = &"Music" @@ -7,6 +15,10 @@ bus/1/mute = false bus/1/bypass_fx = false bus/1/volume_db = 0.0 bus/1/send = &"Master" +bus/1/effect/0/effect = SubResource("AudioEffectLowPassFilter_j3pel") +bus/1/effect/0/enabled = false +bus/1/effect/1/effect = SubResource("AudioEffectReverb_j3pel") +bus/1/effect/1/enabled = false bus/2/name = &"SFX" bus/2/solo = false bus/2/mute = false diff --git a/client/gui/menus/character.gd b/client/gui/menus/character.gd index fa3d213e..6216d67d 100644 --- a/client/gui/menus/character.gd +++ b/client/gui/menus/character.gd @@ -23,6 +23,9 @@ func _ready(): super() $VBoxContainer/top_panel/a/username.text = Profile.read("username") character.set_style(Profile.read("character_style"), "chef") + AudioServer.set_bus_effect_enabled(1, 0, true) + AudioServer.set_bus_effect_enabled(1, 1, true) + AudioServer.set_bus_volume_db(1, -12.) func exit(): if username_edit.text == "": @@ -34,6 +37,9 @@ func exit(): await submenu("res://gui/menus/popup.tscn", popup_data) return Profile.write("username", username_edit.text) + AudioServer.set_bus_effect_enabled(1, 0, false) + AudioServer.set_bus_effect_enabled(1, 1, false) + AudioServer.set_bus_volume_db(1, 0.) super() func _on_character_back_pressed(): diff --git a/client/gui/menus/main/about.gd b/client/gui/menus/main/about.gd index 95f98d30..6b0677ad 100644 --- a/client/gui/menus/main/about.gd +++ b/client/gui/menus/main/about.gd @@ -20,6 +20,7 @@ var authors := ["metamuffin", "nokoe", "tpart"] var contributors := ["sofviic", "BigBrotherNii", "Miner34"] const cc_by_4 := "CC-BY 4.0" const cc_by_3 := "CC-BY 3.0" +const cc_by_sa_4 := "CC-BY-SA 4.0" const cc0 := "CC0" const AGPL_NOTICE := """This program is free software: you can redistribute it and/or modify @@ -61,6 +62,9 @@ var credits := [ ["Dillon Becker", "Super Dialogue Audio Pack V1", cc_by_4], ["Ekrcoaster", "Water steaming on hot surface #2", cc0] ]], + [tr("c.credits.music"), [ + ["Giorgi Latso, Asuas", "Debussy: Images I. Reflets dans l'eau (adapted: bars 1-35)", cc_by_sa_4], + ]], [tr("c.credits.other"), [ ["Ray Trace", "Nintendo_Switch_Pro_Controller.svg", cc_by_4], ["Amousey", "Curved solid arrow.svg", cc0] diff --git a/client/gui/menus/main/main.gd b/client/gui/menus/main/main.gd index 7a389304..754eddd7 100644 --- a/client/gui/menus/main/main.gd +++ b/client/gui/menus/main/main.gd @@ -22,8 +22,9 @@ func _ready(): super() if OS.has_feature("web"): quit_button.hide() - Sound.play_music("MainMenu") ServerList.one_shot() + await get_tree().create_timer(0.7).timeout + Sound.play_music("MainMenu") func _menu_cover(state): $side.visible = not state diff --git a/client/gui/overlays/lobby/lobby.gd b/client/gui/overlays/lobby/lobby.gd index 2b40cada..8f7adc49 100644 --- a/client/gui/overlays/lobby/lobby.gd +++ b/client/gui/overlays/lobby/lobby.gd @@ -173,7 +173,7 @@ func check_for_music(): if visible: Sound.play_music("Lobby") else: - Sound.play_music("stop") # TODO: Game music enter + Sound.play_music(null) func _on_enable_bots_toggled(toggled_on): bots_enabled = toggled_on |