Skip to content

Commit

Permalink
Merge pull request #6 from wlsnmrk/double-music-fix-no-editor-settings
Browse files Browse the repository at this point in the history
fix: prevent doubled music
  • Loading branch information
jolexxa authored Dec 29, 2023
2 parents f52efbe + 93b2d97 commit 288ded9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/in_game_audio/InGameAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ public void OnExitTree() {

public void StartMainMenuMusic() {
GameMusic.FadeOut();
MainMenuMusic.Stop();
MainMenuMusic.FadeIn();
}

public void StartGameMusic() {
MainMenuMusic.FadeOut();
GameMusic.Stop();
GameMusic.FadeIn();
}
}
2 changes: 2 additions & 0 deletions test/src/in_game_audio/InGameAudioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void OnExitTree() {
public void PlaysMainMenuMusic() {
_logic.Setup(logic => logic.Start());
_gameMusic.Setup(music => music.FadeOut());
_mainMenuMusic.Setup(music => music.Stop());
_mainMenuMusic.Setup(music => music.FadeIn());

_audio.OnResolved();
Expand All @@ -84,6 +85,7 @@ public void PlaysMainMenuMusic() {
[Test]
public void PlaysGameMusic() {
_logic.Setup(logic => logic.Start());
_gameMusic.Setup(music => music.Stop());
_gameMusic.Setup(music => music.FadeIn());
_mainMenuMusic.Setup(music => music.FadeOut());

Expand Down

0 comments on commit 288ded9

Please sign in to comment.