From c82d24b4bcd351385d7b9c26651f42dc73480017 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 8 Dec 2023 13:08:06 +0000 Subject: [PATCH] Music starts after Sound Options completed Currently plays _OCEAN for testing, but will be changed to play _GONER when Journey In Modulating Time's short loop is ready. Explicitly restricts the basic title screen's music from playing, too. --- src/f_finale.c | 2 +- src/k_menufunc.c | 3 --- src/menus/main-goner.cpp | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 4df44d2d5..2db2dd90c 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1770,7 +1770,7 @@ void F_TitleScreenTicker(boolean run) { if (finalecount == 0) { - if (!Music_Playing("title")) + if (cache_gametrulystarted && !Music_Playing("title")) { // Now start the music Music_Loop("title", looptitle); diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 5b5374b23..2f315b2bd 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -582,9 +582,6 @@ void M_StartControlPanel(void) // Are you ready for the First Boot Experience? M_ResetOptions(); currentMenu = &MAIN_GonerDef; - currentMenu->lastOn = 0; - Music_Remap("menu_nocred", "_GONER"); - Music_Play("menu_nocred"); } else if (cv_currprofile.value == -1) // Only ask once per session. { diff --git a/src/menus/main-goner.cpp b/src/menus/main-goner.cpp index 2e5a3851e..2cec80c2e 100644 --- a/src/menus/main-goner.cpp +++ b/src/menus/main-goner.cpp @@ -5,6 +5,7 @@ #include "../m_cond.h" #include "../r_skins.h" #include "../s_sound.h" +#include "../music.h" #include "../p_local.h" // P_AutoPause #include "../st_stuff.h" // faceprefix #include "../v_draw.hpp" @@ -391,6 +392,15 @@ void M_GonerRailroad(bool set) S_StartSound(NULL, sfx_s3k63); } +void M_GonerPlayMusic(void) +{ + if (gamedata->gonerlevel <= GDGONER_SOUND || Music_Playing("menu")) + return; + + Music_Remap("menu", "_OCEAN"); //"_GONER"); + Music_Play("menu"); +} + void M_GonerHidePassword(void) { if (currentMenu->menuitems[0].mvar2) @@ -402,6 +412,8 @@ void M_GonerHidePassword(void) {.routine = M_QuitSRB2}, 0, 1}; S_StartSound(NULL, sfx_s3k5b); + + M_GonerPlayMusic(); } void M_GonerResetText(void) @@ -488,6 +500,8 @@ void M_GonerTick(void) goner_levelworking--; } + M_GonerPlayMusic(); + lastseenlevel = gamedata->gonerlevel; }