basic start on VR

This commit is contained in:
TehRealSalt 2018-11-25 22:55:49 -05:00
parent 5af6c33ca6
commit 622e94797b
3 changed files with 23 additions and 0 deletions

View file

@ -326,6 +326,7 @@ enum GameType // SRB2Kart
extern tic_t totalplaytime;
extern UINT32 matchesplayed;
extern UINT16 versusrecord[2];
extern UINT8 stagefailed;

View file

@ -169,6 +169,7 @@ INT32 sstimer; // Time allotted in the special stage
tic_t totalplaytime;
UINT32 matchesplayed; // SRB2Kart
UINT16 versusrecord[2]; // SRB2Kart: Online rankings
boolean gamedataloaded = false;
// Time attack data for levels
@ -3744,9 +3745,13 @@ void G_LoadGameData(void)
// to new gamedata
G_ClearRecords(); // main and nights records
M_ClearSecrets(); // emblems, unlocks, maps visited, etc
totalplaytime = 0; // total play time (separate from all)
matchesplayed = 0; // SRB2Kart: matches played & finished
for (i = 0; i < 2; i++) // SRB2Kart: online VR system
versusrecord[i] = 5000;
if (M_CheckParm("-nodata"))
return; // Don't load.
@ -3777,6 +3782,9 @@ void G_LoadGameData(void)
totalplaytime = READUINT32(save_p);
matchesplayed = READUINT32(save_p);
for (i = 0; i < 2; i++)
versusrecord[i] = READUINT16(save_p);
modded = READUINT8(save_p);
// Aha! Someone's been screwing with the save file!
@ -3925,6 +3933,9 @@ void G_SaveGameData(boolean force)
WRITEUINT32(save_p, totalplaytime);
WRITEUINT32(save_p, matchesplayed);
for (i = 0; i < 2; i++)
WRITEUINT16(save_p, versusrecord[i]);
btemp = (UINT8)(savemoddata || modifiedgame);
WRITEUINT8(save_p, btemp);

View file

@ -6319,9 +6319,16 @@ static void M_DrawLevelStats(void)
G_TicsToHours(totalplaytime),
G_TicsToMinutes(totalplaytime, false),
G_TicsToSeconds(totalplaytime)));
V_DrawString(20, 42, highlightflags, "Total Matches:");
V_DrawRightAlignedString(BASEVIDWIDTH-16, 42, 0, va("%i played", matchesplayed));
V_DrawString(20, 50, highlightflags, "Race Versus Record:");
V_DrawRightAlignedString(BASEVIDWIDTH-16, 50, 0, va("%i", versusrecord[0]));
V_DrawString(20, 58, highlightflags, "Battle Versus Record:");
V_DrawRightAlignedString(BASEVIDWIDTH-16, 58, 0, va("%i", versusrecord[1]));
for (i = 0; i < NUMMAPS; i++)
{
if (!mapheaderinfo[i] || !(mapheaderinfo[i]->menuflags & LF2_RECORDATTACK))
@ -8452,6 +8459,8 @@ static UINT8 erasecontext = 0;
static void M_EraseDataResponse(INT32 ch)
{
UINT8 i;
if (ch != 'y' && ch != KEY_ENTER)
return;
@ -8463,6 +8472,8 @@ static void M_EraseDataResponse(INT32 ch)
// SRB2Kart: This actually needs to be done FIRST, so that you don't immediately regain playtime/matches secrets
totalplaytime = 0;
matchesplayed = 0;
for (i = 0; i < 2; i++)
versusrecord[i] = 5000;
F_StartIntro();
}
if (erasecontext != 1)