Re-add mid-game rankings

- gc_rankings, bound to TAB by default
- Now a toggle, rather than a hold behaviour
- Rearrange HU_Drawer to have chat (and cecho/music credits) render over everything else (like, say, tab rankings)
- Update PROFILEVER to 2 so we can add the new control to old profiles
This commit is contained in:
toaster 2022-11-25 17:59:18 +00:00
parent 45604a05c3
commit db95e3144d
6 changed files with 73 additions and 68 deletions

View file

@ -528,7 +528,7 @@ void G_DefineDefaultControls(void)
gamecontroldefault[gc_up ][0] = KEY_UPARROW;
gamecontroldefault[gc_down ][0] = KEY_DOWNARROW;
gamecontroldefault[gc_left ][0] = KEY_LEFTARROW;
gamecontroldefault[gc_right][0] = KEY_RIGHTARROW;
gamecontroldefault[gc_right ][0] = KEY_RIGHTARROW;
gamecontroldefault[gc_a ][0] = 'z';
gamecontroldefault[gc_b ][0] = 'x';
gamecontroldefault[gc_c ][0] = 'c';
@ -537,7 +537,8 @@ void G_DefineDefaultControls(void)
gamecontroldefault[gc_z ][0] = 'd';
gamecontroldefault[gc_l ][0] = 'q';
gamecontroldefault[gc_r ][0] = 'e';
gamecontroldefault[gc_start][0] = KEY_ESCAPE; // *
gamecontroldefault[gc_start ][0] = KEY_ESCAPE; // *
gamecontroldefault[gc_rankings][0] = KEY_TAB;
// Gamepad controls
gamecontroldefault[gc_up ][1] = KEY_HAT1+0; // D-Pad Up

View file

@ -78,6 +78,7 @@ typedef enum
gc_console,
gc_talk,
gc_teamtalk,
gc_rankings,
gc_screenshot,
gc_recordgif,

View file

@ -980,18 +980,27 @@ static void HU_TickSongCredits(void)
void HU_Ticker(void)
{
static boolean hu_holdscores = false;
if (dedicated)
return;
hu_tick++;
hu_tick &= 7; // currently only to blink chat input cursor
/*
if (PlayerInputDown(1, gc_scores))
hu_showscores = !chat_on;
// Rankings
if (G_PlayerInputDown(0, gc_rankings, 0))
{
if (!hu_holdscores)
{
hu_showscores ^= true;
}
hu_holdscores = true;
}
else
hu_showscores = false;
*/
{
hu_holdscores = false;
}
hu_keystrokes = false;
@ -2066,35 +2075,8 @@ void HU_DrawSongCredits(void)
//
void HU_Drawer(void)
{
if (cv_vhseffect.value && (paused || (demo.playback && cv_playbackspeed.value > 1)))
V_DrawVhsEffect(demo.rewinding);
// draw chat string plus cursor
if (chat_on)
{
if (!OLDCHAT)
HU_DrawChat();
else
HU_DrawChat_Old();
}
else
{
typelines = 1;
chat_scrolltime = 0;
if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
HU_drawMiniChat(); // draw messages in a cool fashion.
}
if (cechotimer)
HU_DrawCEcho();
if (!( Playing() || demo.playback )
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|| gamestate == GS_ENDING || gamestate == GS_GAMEEND
|| gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS) // SRB2kart
return;
if (gamestate != GS_LEVEL)
goto drawchat;
// draw multiplayer rankings
if (hu_showscores)
@ -2117,12 +2099,8 @@ void HU_Drawer(void)
}
}
if (gamestate != GS_LEVEL)
return;
// draw song credits
if (cv_songcredits.value && !( hu_showscores && (netgame || multiplayer) ))
HU_DrawSongCredits();
if (cv_vhseffect.value && (paused || (demo.playback && cv_playbackspeed.value > 1)))
V_DrawVhsEffect(demo.rewinding);
// draw desynch text
if (hu_redownloadinggamestate)
@ -2138,20 +2116,30 @@ void HU_Drawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text);
}
if (modeattacking && pausedelay > 0 && !pausebreakkey)
drawchat:
// draw chat string plus cursor
if (chat_on)
{
INT32 strength = ((pausedelay - 1 - NEWTICRATE/2)*10)/(NEWTICRATE/3);
INT32 x = BASEVIDWIDTH/2, y = BASEVIDHEIGHT/2; // obviously incorrect values while we scrap hudinfo
V_DrawThinString(x, y,
((leveltime & 4) ? V_SKYMAP : V_BLUEMAP),
"HOLD TO RETRY...");
if (strength > 9)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
else if (strength > 0)
V_DrawFadeScreen(0, strength);
if (!OLDCHAT)
HU_DrawChat();
else
HU_DrawChat_Old();
}
else
{
typelines = 1;
chat_scrolltime = 0;
if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
HU_drawMiniChat(); // draw messages in a cool fashion.
}
if (cechotimer)
HU_DrawCEcho();
// draw song credits
if (cv_songcredits.value && !( hu_showscores && (netgame || multiplayer) ))
HU_DrawSongCredits();
}
//======================================================================

View file

@ -653,6 +653,9 @@ menuitem_t OPTIONS_ProfileControls[] = {
{IT_CONTROL, "OPEN TEAM CHAT", "Do we even have team gamemodes?",
NULL, {.routine = M_ProfileSetControl}, gc_teamtalk, 0},
{IT_CONTROL, "SHOW RANKINGS", "Show mid-game rankings.",
NULL, {.routine = M_ProfileSetControl}, gc_rankings, 0},
{IT_CONTROL, "OPEN CONSOLE", "Opens the developer options console.",
NULL, {.routine = M_ProfileSetControl}, gc_console, 0},

View file

@ -327,8 +327,8 @@ void PR_LoadProfiles(void)
{
profilesList[i] = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL);
// Version.
profilesList[i]->version = version;
// Version. (We always update this on successful forward step)
profilesList[i]->version = PROFILEVER;
// Names.
READSTRINGN(save_p, profilesList[i]->profilename, PROFILENAMELEN);
@ -382,6 +382,18 @@ void PR_LoadProfiles(void)
// Controls.
for (j = 0; j < num_gamecontrols; j++)
{
#ifdef DEVELOP
// Profile update 1-->2: Add gc_rankings.
if (j == gc_rankings && version < 2)
{
for (k = 0; k < MAXINPUTMAPPING; k++)
{
profilesList[i]->controls[j][k] = gamecontroldefault[j][k];
}
continue;
}
#endif
for (k = 0; k < MAXINPUTMAPPING; k++)
{
profilesList[i]->controls[j][k] = READINT32(save_p);

View file

@ -27,7 +27,7 @@
#define SKINNAMESIZE 16
#define PROFILENAMELEN 6
#define PROFILEVER 1
#define PROFILEVER 2
#define MAXPROFILES 16
#define PROFILESFILE "ringprofiles.prf"
#define PROFILE_GUEST 0