mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-20 15:02:37 +00:00
Menus/Sound Options: add Continuous Attack Music option
- On by default (current behavior) - Off - Restart music in Attack modes - Also plays POSITION music
This commit is contained in:
parent
74a04f0ab0
commit
d3034bba54
5 changed files with 42 additions and 5 deletions
|
|
@ -316,6 +316,7 @@ consvar_t cv_apng_downscale = Player("apng_downscale", "On").on_off();
|
||||||
void Captioning_OnChange(void);
|
void Captioning_OnChange(void);
|
||||||
consvar_t cv_closedcaptioning = Player("closedcaptioning", "Off").on_off().onchange(Captioning_OnChange);
|
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"}});
|
consvar_t cv_controlperkey = Player("controlperkey", "One").values({{1, "One"}, {2, "Several"}});
|
||||||
|
|
||||||
// actual general (maximum) sound & music volume, saved into the config
|
// actual general (maximum) sound & music volume, saved into the config
|
||||||
|
|
|
||||||
16
src/k_menu.h
16
src/k_menu.h
|
|
@ -379,6 +379,22 @@ typedef enum
|
||||||
daopt_replaycons,
|
daopt_replaycons,
|
||||||
} daopt_e;
|
} 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 menuitem_t OPTIONS_Profiles[];
|
||||||
extern menu_t OPTIONS_ProfilesDef;
|
extern menu_t OPTIONS_ProfilesDef;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#include "../s_sound.h" // sounds consvars
|
#include "../s_sound.h" // sounds consvars
|
||||||
#include "../g_game.h" // cv_chatnotifications
|
#include "../g_game.h" // cv_chatnotifications
|
||||||
|
|
||||||
extern "C" consvar_t cv_mastervolume;
|
extern "C" consvar_t cv_mastervolume, cv_continuousmusic;
|
||||||
|
|
||||||
using srb2::Draw;
|
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)
|
boolean input_routine(INT32)
|
||||||
{
|
{
|
||||||
UINT8 pid = 0; // todo: Add ability for any splitscreen player to bring up the menu.
|
UINT8 pid = 0; // todo: Add ability for any splitscreen player to bring up the menu.
|
||||||
|
|
@ -238,6 +250,9 @@ menuitem_t OPTIONS_Sound[] =
|
||||||
{IT_STRING | IT_CVAR, "Character Voices", "How often to play character voices in a race.",
|
{IT_STRING | IT_CVAR, "Character Voices", "How often to play character voices in a race.",
|
||||||
NULL, {.cvar = &cv_kartvoices}, 0, 0},
|
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,
|
{IT_SPACE | IT_NOTHING, NULL, NULL,
|
||||||
NULL, {NULL}, 0, 0},
|
NULL, {NULL}, 0, 0},
|
||||||
|
|
||||||
|
|
@ -267,7 +282,7 @@ menu_t OPTIONS_SoundDef = {
|
||||||
draw_routine,
|
draw_routine,
|
||||||
M_DrawOptionsCogs,
|
M_DrawOptionsCogs,
|
||||||
tick_routine,
|
tick_routine,
|
||||||
NULL,
|
init_routine,
|
||||||
NULL,
|
NULL,
|
||||||
input_routine,
|
input_routine,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,8 @@
|
||||||
|
|
||||||
#include <tracy/tracy/TracyC.h>
|
#include <tracy/tracy/TracyC.h>
|
||||||
|
|
||||||
|
extern "C" consvar_t cv_continuousmusic;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Map MD5, calculated on level load.
|
// Map MD5, calculated on level load.
|
||||||
// Sent to clients in PT_SERVERINFO.
|
// Sent to clients in PT_SERVERINFO.
|
||||||
|
|
@ -8257,7 +8259,10 @@ boolean P_UseContinuousLevelMusic(void)
|
||||||
if (gametyperules & GTR_BOSS)
|
if (gametyperules & GTR_BOSS)
|
||||||
return false;
|
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)
|
void P_LoadLevelMusic(void)
|
||||||
|
|
|
||||||
|
|
@ -1061,14 +1061,14 @@ void P_Ticker(boolean run)
|
||||||
}
|
}
|
||||||
|
|
||||||
// POSITION!! music
|
// POSITION!! music
|
||||||
if (modeattacking == ATTACKING_NONE)
|
if (modeattacking == ATTACKING_NONE || !P_UseContinuousLevelMusic())
|
||||||
{
|
{
|
||||||
P_StartPositionMusic(true); // exact times only
|
P_StartPositionMusic(true); // exact times only
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modeattacking != ATTACKING_NONE)
|
if (modeattacking != ATTACKING_NONE && P_UseContinuousLevelMusic())
|
||||||
{
|
{
|
||||||
if (leveltime == 4)
|
if (leveltime == 4)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue