Music credits show up in more contexts

- Drawn over the top of basically everything when enabled.
- Update song credit on
    - Menu music update (can sometimes clear it)
    - Intermission begin
    - Vote begin
    - Return to title (by clearing it)
This commit is contained in:
toaster 2023-02-25 22:54:36 +00:00
parent afbea1ccc4
commit e0ac6b6044
8 changed files with 35 additions and 12 deletions

View file

@ -967,6 +967,8 @@ void D_ClearState(void)
// The title screen is obviously not a tutorial! (Unless I'm mistaken) // The title screen is obviously not a tutorial! (Unless I'm mistaken)
tutorialmode = false; tutorialmode = false;
cursongcredit.def = NULL;
G_SetGamestate(GS_NULL); G_SetGamestate(GS_NULL);
wipegamestate = GS_NULL; wipegamestate = GS_NULL;
} }

View file

@ -924,9 +924,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
#endif #endif
} }
// void HU_TickSongCredits(void)
//
static void HU_TickSongCredits(void)
{ {
if (cursongcredit.def == NULL) // No def if (cursongcredit.def == NULL) // No def
{ {
@ -1042,8 +1040,6 @@ void HU_Ticker(void)
} }
resynch_ticker++; resynch_ticker++;
HU_TickSongCredits();
} }
static boolean teamtalk = false; static boolean teamtalk = false;
@ -2129,10 +2125,6 @@ void HU_Drawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text);
} }
// draw song credits
if (cv_songcredits.value && !( hu_showscores && (netgame || multiplayer) ))
HU_DrawSongCredits();
drawontop: drawontop:
// Opened chat // Opened chat
if (chat_on) if (chat_on)

View file

@ -137,8 +137,9 @@ void HU_Start(void);
boolean HU_Responder(event_t *ev); boolean HU_Responder(event_t *ev);
void HU_Ticker(void); void HU_Ticker(void);
void HU_DrawSongCredits(void);
void HU_Drawer(void); void HU_Drawer(void);
void HU_DrawSongCredits(void);
void HU_TickSongCredits(void);
char HU_dequeueChatChar(void); char HU_dequeueChatChar(void);
void HU_Erase(void); void HU_Erase(void);
void HU_clearChatChars(void); void HU_clearChatChars(void);

View file

@ -94,6 +94,9 @@ static void temp_legacy_finishupdate_draws()
SCR_CalculateFPS(); SCR_CalculateFPS();
if (st_overlay) if (st_overlay)
{ {
if (cv_songcredits.value)
HU_DrawSongCredits();
if (cv_ticrate.value) if (cv_ticrate.value)
SCR_DisplayTicRate(); SCR_DisplayTicRate();

View file

@ -42,6 +42,9 @@ static void finish_legacy_ogl_update()
if (st_overlay) if (st_overlay)
{ {
if (cv_songcredits.value)
HU_DrawSongCredits();
if (cv_ticrate.value) if (cv_ticrate.value)
SCR_DisplayTicRate(); SCR_DisplayTicRate();

View file

@ -63,7 +63,7 @@ consvar_t cv_showfocuslost = CVAR_INIT ("showfocuslost", "Yes", CV_SAVE, CV_YesN
consvar_t cv_menujam_update = CVAR_INIT ("menujam_update", "Off", CV_SAVE, CV_OnOff, NULL); consvar_t cv_menujam_update = CVAR_INIT ("menujam_update", "Off", CV_SAVE, CV_OnOff, NULL);
static CV_PossibleValue_t menujam_cons_t[] = {{0, "menu"}, {1, "menu2"}, {2, "menu3"}, {0, NULL}}; static CV_PossibleValue_t menujam_cons_t[] = {{0, "menu"}, {1, "menu2"}, {2, "menu3"}, {0, NULL}};
static consvar_t cv_menujam = CVAR_INIT ("menujam", "0", CV_SAVE, menujam_cons_t, NULL); static consvar_t cv_menujam = CVAR_INIT ("menujam", "menu", CV_SAVE, menujam_cons_t, NULL);
// first time memory // first time memory
consvar_t cv_tutorialprompt = CVAR_INIT ("tutorialprompt", "On", CV_SAVE, CV_OnOff, NULL); consvar_t cv_tutorialprompt = CVAR_INIT ("tutorialprompt", "On", CV_SAVE, CV_OnOff, NULL);
@ -333,6 +333,8 @@ boolean M_Responder(event_t *ev)
return true; return true;
} }
#define NotCurrentlyPlaying(desiredname) (!S_MusicPlaying() || strcmp(desiredname, S_MusicName()))
void M_PlayMenuJam(void) void M_PlayMenuJam(void)
{ {
menu_t *refMenu = (menuactive ? currentMenu : restoreMenu); menu_t *refMenu = (menuactive ? currentMenu : restoreMenu);
@ -348,10 +350,15 @@ void M_PlayMenuJam(void)
if (refMenu->music[0] == '.' && refMenu->music[1] == '\0') if (refMenu->music[0] == '.' && refMenu->music[1] == '\0')
{ {
S_StopMusic(); S_StopMusic();
cursongcredit.def = NULL;
} }
else else
{ {
S_ChangeMusicInternal(refMenu->music, true); if (NotCurrentlyPlaying(refMenu->music))
{
S_ChangeMusicInternal(refMenu->music, true);
S_ShowMusicCredit();
}
} }
return; return;
} }
@ -362,9 +369,15 @@ void M_PlayMenuJam(void)
CV_SetValue(&cv_menujam_update, 0); CV_SetValue(&cv_menujam_update, 0);
} }
if (!NotCurrentlyPlaying(cv_menujam.string))
return;
S_ChangeMusicInternal(cv_menujam.string, true); S_ChangeMusicInternal(cv_menujam.string, true);
S_ShowMusicCredit();
} }
#undef IsCurrentlyPlaying
// //
// M_SpecificMenuRestore // M_SpecificMenuRestore
// //
@ -982,6 +995,8 @@ void M_Ticker(void)
{ {
INT32 i; INT32 i;
HU_TickSongCredits();
if (!menuactive) if (!menuactive)
{ {
noFurtherInput = false; noFurtherInput = false;

View file

@ -41,6 +41,8 @@ cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma,
cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation, cv_msaturation, cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation, cv_msaturation,
cv_palette, cv_palettenum; cv_palette, cv_palettenum;
extern consvar_t cv_songcredits;
// Allocates buffer screens, call before R_Init. // Allocates buffer screens, call before R_Init.
void V_Init(void); void V_Init(void);

View file

@ -834,6 +834,8 @@ void Y_StartIntermission(void)
if (!(gametyperules & GTR_CIRCUIT) && (timer > 1)) if (!(gametyperules & GTR_CIRCUIT) && (timer > 1))
S_ChangeMusicInternal("racent", true); // loop it S_ChangeMusicInternal("racent", true); // loop it
S_ShowMusicCredit(); // Always call
switch (intertype) switch (intertype)
{ {
case int_score: case int_score:
@ -1281,7 +1283,10 @@ void Y_VoteTicker(void)
D_PickVote(); D_PickVote();
if (!votetic) if (!votetic)
{
S_ChangeMusicInternal("vote", true); S_ChangeMusicInternal("vote", true);
S_ShowMusicCredit();
}
if (timer) if (timer)
timer--; timer--;