diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-09 23:16:10 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-09 23:16:10 +0200 |
| commit | 35763c27e0dc829e89696b500ac7f0a92bbcf013 (patch) | |
| tree | 9542b4553ca787e5e52472a72b2d2036e3ea8954 /client/gui | |
| parent | 62e04ff78fcacab4ab3087aff986428d9b155d3d (diff) | |
| download | hurrycurry-35763c27e0dc829e89696b500ac7f0a92bbcf013.tar hurrycurry-35763c27e0dc829e89696b500ac7f0a92bbcf013.tar.bz2 hurrycurry-35763c27e0dc829e89696b500ac7f0a92bbcf013.tar.zst | |
Music fading and filtering interpolation
Diffstat (limited to 'client/gui')
| -rw-r--r-- | client/gui/menus/character.gd | 4 | ||||
| -rw-r--r-- | client/gui/menus/main/main.gd | 3 | ||||
| -rw-r--r-- | client/gui/menus/main/play.gd | 1 | ||||
| -rw-r--r-- | client/gui/menus/menu.gd | 4 | ||||
| -rw-r--r-- | client/gui/overlays/lobby/lobby.gd | 6 |
5 files changed, 11 insertions, 7 deletions
diff --git a/client/gui/menus/character.gd b/client/gui/menus/character.gd index 217edaf9..15efe969 100644 --- a/client/gui/menus/character.gd +++ b/client/gui/menus/character.gd @@ -23,7 +23,8 @@ func _ready(): super() $VBoxContainer/top_panel/a/username.text = Profile.read("username") character.set_style(Profile.read("character_style"), "chef") - Sound.dampen_music = true + +func _menu_music(): Sound.set_music("reflets-dans-leau", 0, true) func exit(): if username_edit.text == "": @@ -35,7 +36,6 @@ func exit(): await submenu("res://gui/menus/popup.tscn", popup_data) return Profile.write("username", username_edit.text) - Sound.dampen_music = false super() func _on_character_back_pressed(): diff --git a/client/gui/menus/main/main.gd b/client/gui/menus/main/main.gd index 754eddd7..4a55b761 100644 --- a/client/gui/menus/main/main.gd +++ b/client/gui/menus/main/main.gd @@ -24,7 +24,8 @@ func _ready(): quit_button.hide() ServerList.one_shot() await get_tree().create_timer(0.7).timeout - Sound.play_music("MainMenu") + +func _menu_music(): Sound.set_music("reflets-dans-leau", 3, false) func _menu_cover(state): $side.visible = not state diff --git a/client/gui/menus/main/play.gd b/client/gui/menus/main/play.gd index 206b4d9f..4ae19f2f 100644 --- a/client/gui/menus/main/play.gd +++ b/client/gui/menus/main/play.gd @@ -35,7 +35,6 @@ func _ready(): if OS.has_feature("web"): server.hide() connect_uri.text = Profile.read("last_server_url") - Sound.play_music("MainMenu") ServerList.update_server_list.connect(update_server_list) ServerList.update_loading.connect(update_server_list_loading) diff --git a/client/gui/menus/menu.gd b/client/gui/menus/menu.gd index e0d5472a..bdc64be0 100644 --- a/client/gui/menus/menu.gd +++ b/client/gui/menus/menu.gd @@ -41,6 +41,7 @@ func _ready(): update_parent_menu(self.get_parent()) if support_anim: anim_setup() if auto_anim: _menu_open() + _menu_music() get_tree().get_root().go_back_requested.connect(exit_maybe) func anim_setup(): @@ -52,6 +53,8 @@ func _menu_exit(): if transition != null: await transition.fade_out() func _menu_cover(_state: bool): pass +func _menu_music(): + pass var popup: Menu = null var covered := false @@ -70,6 +73,7 @@ func submenu(path: String, data_ = null): covered = false await _menu_cover(false) Global.focused_menu = self + _menu_music() _disable_recursive(self, false) if prev_focus != null: prev_focus.grab_focus() diff --git a/client/gui/overlays/lobby/lobby.gd b/client/gui/overlays/lobby/lobby.gd index 8f7adc49..23d6036f 100644 --- a/client/gui/overlays/lobby/lobby.gd +++ b/client/gui/overlays/lobby/lobby.gd @@ -164,16 +164,16 @@ func _on_start_pressed(): start_msg += "\ncreate-bot %s" % k game.mp.send_chat(game.my_player_id, start_msg) - Sound.play_music("stop") # TODO: Game music enter + Sound.set_music(null) # TODO: Game music enter func _update_visible(_state: bool): visible = game.in_lobby and game.join_state == Game.JoinState.JOINED func check_for_music(): if visible: - Sound.play_music("Lobby") + Sound.set_music(null) # TODO: lobby music else: - Sound.play_music(null) + Sound.set_music(null) func _on_enable_bots_toggled(toggled_on): bots_enabled = toggled_on |