mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'continuous-music-option' into 'master'
Continous Attack Music option See merge request KartKrew/Kart!2105
This commit is contained in:
commit
bb7c00171c
6 changed files with 48 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
16
src/k_menu.h
16
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@
|
|||
|
||||
#include <tracy/tracy/TracyC.h>
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue