From 2a06ce5b12a96926a450774197e886ea01ffb38b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 22 Aug 2024 23:16:19 +0200 Subject: [PATCH] fixed bugs with starting/stopping sound/music in main menu --- src/game.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/game.c b/src/game.c index a516155c..c5a47a9f 100644 --- a/src/game.c +++ b/src/game.c @@ -17355,6 +17355,8 @@ static void HandleGameButtonsExt(int id, int button) if (game_status == GAME_MODE_PLAYING) PlayLevelMusic(); + else + PlayMenuMusic(); } RedrawSoundButtonGadget(id); @@ -17364,12 +17366,20 @@ static void HandleGameButtonsExt(int id, int button) case SOUND_CTRL_ID_LOOPS: case SOUND_CTRL_ID_PANEL_LOOPS: if (setup.sound_loops) + { setup.sound_loops = FALSE; + + if (game_status != GAME_MODE_PLAYING) + FadeSounds(); + } else if (audio.loops_available) { setup.sound = setup.sound_loops = TRUE; SetAudioMode(setup.sound); + + if (game_status != GAME_MODE_PLAYING) + PlayMenuSound(); } RedrawSoundButtonGadget(id); @@ -17379,12 +17389,20 @@ static void HandleGameButtonsExt(int id, int button) case SOUND_CTRL_ID_SIMPLE: case SOUND_CTRL_ID_PANEL_SIMPLE: if (setup.sound_simple) + { setup.sound_simple = FALSE; + + if (game_status != GAME_MODE_PLAYING) + FadeSounds(); + } else if (audio.sound_available) { setup.sound = setup.sound_simple = TRUE; SetAudioMode(setup.sound); + + if (game_status != GAME_MODE_PLAYING) + PlayMenuSound(); } RedrawSoundButtonGadget(id); -- 2.34.1