diff --git a/src/cvars.cpp b/src/cvars.cpp index fae790588..df290f65f 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -316,6 +316,7 @@ consvar_t cv_apng_downscale = Player("apng_downscale", "On").on_off(); void Captioning_OnChange(void); consvar_t cv_closedcaptioning = Player("closedcaptioning", "Off").on_off().onchange(Captioning_OnChange); +consvar_t cv_continuousmusic = Player("continuousmusic", "On").on_off(); consvar_t cv_controlperkey = Player("controlperkey", "One").values({{1, "One"}, {2, "Several"}}); // actual general (maximum) sound & music volume, saved into the config diff --git a/src/k_menu.h b/src/k_menu.h index 81c85eb03..dcd9aedd6 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -379,6 +379,22 @@ typedef enum daopt_replaycons, } daopt_e; +typedef enum +{ + sopt_volume, + sopt_sfxvolume, + sopt_musicvolume, + sopt_spacer1, + sopt_chatnotifs, + sopt_charvoices, + sopt_attackmusic, + sopt_spacer2, + sopt_advanced, + sopt_tabbedout, + sopt_spacer3, + sopt_restart, +} sopt_e; + extern menuitem_t OPTIONS_Profiles[]; extern menu_t OPTIONS_ProfilesDef; diff --git a/src/k_menudraw.c b/src/k_menudraw.c index ab327a9cb..f338b6075 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -1037,6 +1037,10 @@ void M_Drawer(void) // Used for the secrets menu, to hide yet-to-be-unlocked stuff. static const char *M_CreateSecretMenuOption(const char *str) { +#if 1 + (void)str; + return "???"; +#else static char qbuf[64]; int i; @@ -1055,6 +1059,7 @@ static const char *M_CreateSecretMenuOption(const char *str) qbuf[63] = '\0'; return qbuf; +#endif } // @@ -4660,7 +4665,7 @@ box_found: if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawMenuString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); + V_DrawMenuString(x + 8, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); y += SMALLLINEHEIGHT; break; case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text diff --git a/src/menus/options-sound.cpp b/src/menus/options-sound.cpp index 716ee5752..7a78aa11b 100644 --- a/src/menus/options-sound.cpp +++ b/src/menus/options-sound.cpp @@ -14,7 +14,7 @@ #include "../s_sound.h" // sounds consvars #include "../g_game.h" // cv_chatnotifications -extern "C" consvar_t cv_mastervolume; +extern "C" consvar_t cv_mastervolume, cv_continuousmusic; using srb2::Draw; @@ -200,6 +200,18 @@ void tick_routine(void) } } +void init_routine(void) +{ + OPTIONS_Sound[sopt_attackmusic].status = IT_SECRET; + + if (M_SecretUnlocked(SECRET_TIMEATTACK, true) || + M_SecretUnlocked(SECRET_PRISONBREAK, true) || + M_SecretUnlocked(SECRET_SPECIALATTACK, true)) + { + OPTIONS_Sound[sopt_attackmusic].status = IT_STRING | IT_CVAR; + } +} + boolean input_routine(INT32) { UINT8 pid = 0; // todo: Add ability for any splitscreen player to bring up the menu. @@ -238,15 +250,15 @@ menuitem_t OPTIONS_Sound[] = {IT_STRING | IT_CVAR, "Character Voices", "How often to play character voices in a race.", NULL, {.cvar = &cv_kartvoices}, 0, 0}, + {IT_STRING | IT_CVAR, "Continuous Attack Music", "Keep music playing seamlessly when retrying in Attack modes.", + NULL, {.cvar = &cv_continuousmusic}, 0, 0}, + {IT_SPACE | IT_NOTHING, NULL, NULL, NULL, {NULL}, 0, 0}, {IT_HEADER, "Advanced...", NULL, NULL, {NULL}, 0, 0}, - {IT_STRING | IT_CVAR, "Reverse L/R Channels", "Reverse left & right channels for Stereo playback.", - NULL, {.cvar = &stereoreverse}, 0, 0}, - {IT_STRING | IT_CVAR, "Hear Tabbed-out", "Keep playing game audio when the window is out of focus (FOCUS LOST).", NULL, {.cvar = &cv_bgaudio}, 0, 0}, @@ -270,7 +282,7 @@ menu_t OPTIONS_SoundDef = { draw_routine, M_DrawOptionsCogs, tick_routine, - NULL, + init_routine, NULL, input_routine, }; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index c7fef0a29..812815984 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -124,6 +124,8 @@ #include +extern "C" consvar_t cv_continuousmusic; + // // Map MD5, calculated on level load. // Sent to clients in PT_SERVERINFO. @@ -8257,7 +8259,10 @@ boolean P_UseContinuousLevelMusic(void) if (gametyperules & GTR_BOSS) return false; - return (gametyperules & GTR_NOPOSITION) || modeattacking != ATTACKING_NONE; + if (modeattacking != ATTACKING_NONE) + return cv_continuousmusic.value; + + return (gametyperules & GTR_NOPOSITION) != 0; } void P_LoadLevelMusic(void) diff --git a/src/p_tick.c b/src/p_tick.c index 55d051709..b550310f9 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -1061,14 +1061,14 @@ void P_Ticker(boolean run) } // POSITION!! music - if (modeattacking == ATTACKING_NONE) + if (modeattacking == ATTACKING_NONE || !P_UseContinuousLevelMusic()) { P_StartPositionMusic(true); // exact times only } } } - if (modeattacking != ATTACKING_NONE) + if (modeattacking != ATTACKING_NONE && P_UseContinuousLevelMusic()) { if (leveltime == 4) {