Merge branch 'replay-rewind' into 'master'

Replay menu fixes for release

Closes #770 and #984

See merge request KartKrew/Kart!1883
This commit is contained in:
James R. 2024-01-29 05:08:02 +00:00
commit 45738973b8
3 changed files with 23 additions and 18 deletions

View file

@ -524,6 +524,7 @@ typedef enum
playback_view2,
playback_view3,
playback_view4,
playback_freecam,
playback_quit
} playback_e;

View file

@ -472,7 +472,8 @@ void M_DrawMenuForeground(void)
}
// draw non-green resolution border
if ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0))
if (currentMenu != &PAUSE_PlaybackMenuDef && // this obscures replay menu and I want to put in minimal effort to fix that
((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0)))
{
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("WEIRDRES", PU_CACHE), NULL);
}
@ -5720,22 +5721,22 @@ void M_DrawPlaybackMenu(void)
if (i == itemOn)
{
V_DrawCharacter(currentMenu->x + currentMenu->menuitems[i].mvar1 + 4, currentMenu->y + 14,
'\x1A' | V_SNAPTOTOP|highlightflags, false);
V_DrawMenuString(currentMenu->x + currentMenu->menuitems[i].mvar1 + 4, currentMenu->y + 14,
V_SNAPTOTOP|highlightflags, "\x1A");
V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y + 18, V_SNAPTOTOP, currentMenu->menuitems[i].text);
V_DrawCenteredMenuString(BASEVIDWIDTH/2, currentMenu->y + 19, V_SNAPTOTOP, currentMenu->menuitems[i].text);
if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_ARROWS)
{
char *str;
if (!(i == playback_viewcount && r_splitscreen == 3))
V_DrawCharacter(BASEVIDWIDTH/2 - 4, currentMenu->y + 28 - (skullAnimCounter/5),
'\x1A' | V_SNAPTOTOP|highlightflags, false); // up arrow
V_DrawMenuString(BASEVIDWIDTH/2 - 4, currentMenu->y + 28 - (skullAnimCounter/5),
V_SNAPTOTOP|highlightflags, "\x1A"); // up arrow
if (!(i == playback_viewcount && r_splitscreen == 0))
V_DrawCharacter(BASEVIDWIDTH/2 - 4, currentMenu->y + 48 + (skullAnimCounter/5),
'\x1B' | V_SNAPTOTOP|highlightflags, false); // down arrow
V_DrawMenuString(BASEVIDWIDTH/2 - 4, currentMenu->y + 48 + (skullAnimCounter/5),
V_SNAPTOTOP|highlightflags, "\x1B"); // down arrow
switch (i)
{
@ -5754,7 +5755,7 @@ void M_DrawPlaybackMenu(void)
continue;
}
V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y + 38, V_SNAPTOTOP|highlightflags, str);
V_DrawCenteredMenuString(BASEVIDWIDTH/2, currentMenu->y + 38, V_SNAPTOTOP|highlightflags, str);
}
}
}

View file

@ -16,7 +16,7 @@ menuitem_t PAUSE_PlaybackMenu[] =
{
{IT_CALL | IT_STRING, "Hide Menu", NULL, "M_PHIDE", {.routine = M_SelectableClearMenus}, 0, 0},
{IT_CALL | IT_STRING, "Rewind", NULL, "M_PREW", {.routine = M_PlaybackRewind}, 20, 0},
{IT_CALL | IT_STRING, "Restart", NULL, "M_PRSTRT", {.routine = M_PlaybackRewind}, 20, 0},
{IT_CALL | IT_STRING, "Pause", NULL, "M_PPAUSE", {.routine = M_PlaybackPause}, 36, 0},
{IT_CALL | IT_STRING, "Fast-Forward", NULL, "M_PFFWD", {.routine = M_PlaybackFastForward}, 52, 0},
{IT_CALL | IT_STRING, "Backup Frame", NULL, "M_PSTEPB", {.routine = M_PlaybackRewind}, 20, 0},
@ -108,12 +108,10 @@ static void M_PlaybackTick(void)
for (i = playback_viewcount; i <= playback_view4; i++)
PAUSE_PlaybackMenu[i].status = IT_DISABLED;
//PAUSE_PlaybackMenu[playback_moreoptions].mvar1 = 72;
//PAUSE_PlaybackMenu[playback_quit].mvar1 = 88;
PAUSE_PlaybackMenu[playback_quit].mvar1 = 72;
PAUSE_PlaybackMenu[playback_freecam].mvar1 = 72;
PAUSE_PlaybackMenu[playback_quit].mvar1 = 88;
//currentMenu->x = BASEVIDWIDTH/2 - 52;
currentMenu->x = BASEVIDWIDTH/2 - 44;
currentMenu->x = BASEVIDWIDTH/2 - 52;
}
else
{
@ -124,9 +122,8 @@ static void M_PlaybackTick(void)
for (i = r_splitscreen+1; i < 4; i++)
PAUSE_PlaybackMenu[playback_view1+i].status = IT_DISABLED;
//PAUSE_PlaybackMenu[playback_moreoptions].mvar1 = 156;
//PAUSE_PlaybackMenu[playback_quit].mvar1 = 172;
PAUSE_PlaybackMenu[playback_quit].mvar1 = 156;
PAUSE_PlaybackMenu[playback_freecam].mvar1 = 156;
PAUSE_PlaybackMenu[playback_quit].mvar1 = 172;
//currentMenu->x = BASEVIDWIDTH/2 - 94;
currentMenu->x = BASEVIDWIDTH/2 - 88;
@ -140,6 +137,7 @@ void M_SetPlaybackMenuPointer(void)
void M_PlaybackRewind(INT32 choice)
{
#if 0
static tic_t lastconfirmtime;
(void)choice;
@ -162,6 +160,11 @@ void M_PlaybackRewind(INT32 choice)
}
CV_SetValue(&cv_playbackspeed, 1);
#else
(void)choice;
G_DoPlayDemo(NULL); // Restart the current demo
M_ClearMenus(true);
#endif
}
void M_PlaybackPause(INT32 choice)