mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-27 02:12:46 +00:00
Replays: let name be changed any time until the file is saved
This commit is contained in:
parent
983fb4c53c
commit
38e1ae1c53
7 changed files with 17 additions and 50 deletions
|
|
@ -2878,7 +2878,7 @@ static void Got_Mapcmd(const UINT8 **cp, INT32 playernum)
|
|||
if (demo.playback && !demo.timing)
|
||||
precache = false;
|
||||
|
||||
demo.savemode = (cv_recordmultiplayerdemos.value == 2) ? DSM_WILLAUTOSAVE : DSM_NOTSAVING;
|
||||
demo.willsave = (cv_recordmultiplayerdemos.value == 2);
|
||||
demo.savebutton = 0;
|
||||
|
||||
G_InitNew(pencoremode, mapnumber, presetplayer, skipprecutscene);
|
||||
|
|
|
|||
|
|
@ -3992,7 +3992,7 @@ boolean G_CheckDemoStatus(void)
|
|||
if (!demo.recording)
|
||||
return false;
|
||||
|
||||
if (modeattacking || demo.savemode != demovars_s::DSM_NOTSAVING)
|
||||
if (modeattacking || demo.willsave)
|
||||
{
|
||||
if (demobuf.p)
|
||||
{
|
||||
|
|
@ -4081,14 +4081,13 @@ void G_SaveDemo(void)
|
|||
md5_buffer((char *)p+16, (demobuf.buffer + length) - (p+16), p);
|
||||
#endif
|
||||
|
||||
if (FIL_WriteFile(demoname, demobuf.buffer, demobuf.p - demobuf.buffer)) // finally output the file.
|
||||
demo.savemode = demovars_s::DSM_SAVED;
|
||||
bool saved = FIL_WriteFile(demoname, demobuf.buffer, demobuf.p - demobuf.buffer); // finally output the file.
|
||||
Z_Free(demobuf.buffer);
|
||||
demo.recording = false;
|
||||
|
||||
if (!modeattacking)
|
||||
{
|
||||
if (demo.savemode == demovars_s::DSM_SAVED)
|
||||
if (saved)
|
||||
{
|
||||
CONS_Printf(M_GetText("Demo %s recorded\n"), demoname);
|
||||
if (gamedata->eversavedreplay == false)
|
||||
|
|
@ -4111,7 +4110,7 @@ boolean G_CheckDemoTitleEntry(void)
|
|||
if (!G_PlayerInputDown(0, gc_b, 0) && !G_PlayerInputDown(0, gc_x, 0))
|
||||
return false;
|
||||
|
||||
demo.savemode = demovars_s::DSM_WILLSAVE;
|
||||
demo.willsave = true;
|
||||
M_OpenVirtualKeyboard(
|
||||
false,
|
||||
[](const char* replace) -> const char*
|
||||
|
|
|
|||
|
|
@ -90,12 +90,7 @@ struct demovars_s {
|
|||
boolean netgame; // multiplayer netgame
|
||||
|
||||
tic_t savebutton; // Used to determine when the local player can choose to save the replay while the race is still going
|
||||
enum {
|
||||
DSM_NOTSAVING,
|
||||
DSM_WILLAUTOSAVE,
|
||||
DSM_WILLSAVE,
|
||||
DSM_SAVED
|
||||
} savemode;
|
||||
boolean willsave;
|
||||
|
||||
boolean freecam;
|
||||
|
||||
|
|
|
|||
|
|
@ -4549,7 +4549,7 @@ void G_AfterIntermission(void)
|
|||
M_PlaybackQuit(0);
|
||||
return;
|
||||
}
|
||||
else if (demo.recording && (modeattacking || demo.savemode != DSM_NOTSAVING))
|
||||
else if (demo.recording && (modeattacking || demo.willsave))
|
||||
G_SaveDemo();
|
||||
|
||||
if (modeattacking) // End the run.
|
||||
|
|
|
|||
|
|
@ -1178,9 +1178,8 @@ void P_Ticker(boolean run)
|
|||
{
|
||||
G_WriteAllGhostTics();
|
||||
|
||||
if (cv_recordmultiplayerdemos.value && (demo.savemode == DSM_NOTSAVING || demo.savemode == DSM_WILLAUTOSAVE))
|
||||
if (demo.savebutton && demo.savebutton + 3*TICRATE < leveltime)
|
||||
G_CheckDemoTitleEntry();
|
||||
if (cv_recordmultiplayerdemos.value && demo.savebutton && demo.savebutton + 3*TICRATE < leveltime)
|
||||
G_CheckDemoTitleEntry();
|
||||
}
|
||||
else if (demo.playback) // Use Ghost data for consistency checks.
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1459,26 +1459,11 @@ void ST_DrawServerSplash(boolean timelimited)
|
|||
|
||||
void ST_DrawSaveReplayHint(INT32 flags)
|
||||
{
|
||||
const char *text = "";
|
||||
switch (demo.savemode)
|
||||
{
|
||||
case DSM_NOTSAVING:
|
||||
text = "\xAB" "or " "\xAE" "Save replay";
|
||||
break;
|
||||
|
||||
case DSM_WILLAUTOSAVE:
|
||||
text = "Replay will be saved. \xAB" "Change title";
|
||||
break;
|
||||
|
||||
case DSM_WILLSAVE:
|
||||
text = "Replay will be saved.";
|
||||
break;
|
||||
|
||||
case DSM_SAVED:
|
||||
text = "Replay saved!";
|
||||
break;
|
||||
}
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, flags|V_YELLOWMAP, text);
|
||||
V_DrawRightAlignedThinString(
|
||||
BASEVIDWIDTH - 2, 2,
|
||||
flags|V_YELLOWMAP,
|
||||
demo.willsave ? "Replay will be saved. \xAB" "Change title" : "\xAB" "or " "\xAE" "Save replay"
|
||||
);
|
||||
}
|
||||
|
||||
static fixed_t ST_CalculateFadeIn(player_t *player)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ static INT32 powertype = PWRLV_DISABLED;
|
|||
static INT32 intertic;
|
||||
static INT32 endtic = -1;
|
||||
static INT32 sorttic = -1;
|
||||
static INT32 replayprompttic;
|
||||
|
||||
static fixed_t mqscroll = 0;
|
||||
static fixed_t chkscroll = 0;
|
||||
|
|
@ -1690,12 +1689,8 @@ skiptallydrawer:
|
|||
}
|
||||
|
||||
finalcounter:
|
||||
{
|
||||
if ((modeattacking == ATTACKING_NONE) && (demo.recording || demo.savemode == demovars_s::DSM_SAVED) && !demo.playback)
|
||||
{
|
||||
ST_DrawSaveReplayHint(0);
|
||||
}
|
||||
}
|
||||
if ((modeattacking == ATTACKING_NONE) && demo.recording)
|
||||
ST_DrawSaveReplayHint(0);
|
||||
|
||||
if (Y_CanSkipIntermission())
|
||||
{
|
||||
|
|
@ -1731,13 +1726,7 @@ void Y_Ticker(void)
|
|||
return;
|
||||
|
||||
if (demo.recording)
|
||||
{
|
||||
if (demo.savemode == demovars_s::DSM_NOTSAVING)
|
||||
{
|
||||
replayprompttic++;
|
||||
G_CheckDemoTitleEntry();
|
||||
}
|
||||
}
|
||||
G_CheckDemoTitleEntry();
|
||||
|
||||
// Check for pause or menu up in single player
|
||||
if (paused || P_AutoPause())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue