mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
G_UpdateTimeStickerMedals, M_StartTimeAttack: If you've beaten all game-provided times, show your personal best record on the in-level HUD instead.
This commit is contained in:
parent
eab22e73a6
commit
e7b63a5fad
3 changed files with 19 additions and 9 deletions
22
src/g_game.c
22
src/g_game.c
|
|
@ -492,7 +492,7 @@ tic_t G_GetBestLap(INT16 map)
|
|||
|
||||
struct stickermedalinfo stickermedalinfo;
|
||||
|
||||
void G_UpdateTimeStickerMedals(UINT16 map)
|
||||
void G_UpdateTimeStickerMedals(UINT16 map, boolean showownrecord)
|
||||
{
|
||||
emblem_t *emblem = M_GetLevelEmblems(map+1);
|
||||
boolean gonnadrawtime = false;
|
||||
|
|
@ -556,13 +556,21 @@ bademblem:
|
|||
|
||||
stickermedalinfo.timetoreach = mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time;
|
||||
}
|
||||
|
||||
snprintf(stickermedalinfo.targettext, 9, "%i'%02i\"%02i",
|
||||
G_TicsToMinutes(stickermedalinfo.timetoreach, false),
|
||||
G_TicsToSeconds(stickermedalinfo.timetoreach),
|
||||
G_TicsToCentiseconds(stickermedalinfo.timetoreach));
|
||||
}
|
||||
}
|
||||
|
||||
if (!gonnadrawtime && showownrecord)
|
||||
{
|
||||
stickermedalinfo.timetoreach = G_GetBestTime(map);
|
||||
}
|
||||
|
||||
if (stickermedalinfo.timetoreach != UINT32_MAX)
|
||||
{
|
||||
snprintf(stickermedalinfo.targettext, 9, "%i'%02i\"%02i",
|
||||
G_TicsToMinutes(stickermedalinfo.timetoreach, false),
|
||||
G_TicsToSeconds(stickermedalinfo.timetoreach),
|
||||
G_TicsToCentiseconds(stickermedalinfo.timetoreach));
|
||||
}
|
||||
}
|
||||
|
||||
void G_TickTimeStickerMedals(void)
|
||||
|
|
@ -630,7 +638,7 @@ void G_UpdateRecords(void)
|
|||
if (stickermedalinfo.regenemblem != NULL
|
||||
&& gamedata->collected[(stickermedalinfo.regenemblem-emblemlocations)])
|
||||
{
|
||||
G_UpdateTimeStickerMedals(gamemap-1);
|
||||
G_UpdateTimeStickerMedals(gamemap-1, false);
|
||||
}
|
||||
|
||||
stickermedalinfo.jitter = 4*earnedEmblems;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ extern struct stickermedalinfo
|
|||
char targettext[9];
|
||||
} stickermedalinfo;
|
||||
|
||||
void G_UpdateTimeStickerMedals(UINT16 map);
|
||||
void G_UpdateTimeStickerMedals(UINT16 map, boolean showownrecord);
|
||||
void G_TickTimeStickerMedals(void);
|
||||
void G_UpdateRecords(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ void M_PrepareTimeAttack(INT32 choice)
|
|||
}
|
||||
|
||||
// Time-sticker Medals
|
||||
G_UpdateTimeStickerMedals(levellist.choosemap);
|
||||
G_UpdateTimeStickerMedals(levellist.choosemap, false);
|
||||
|
||||
// Menu options
|
||||
{
|
||||
|
|
@ -468,4 +468,6 @@ void M_StartTimeAttack(INT32 choice)
|
|||
|
||||
M_ClearMenus(true);
|
||||
D_MapChange(levellist.choosemap+1, levellist.newgametype, (cv_dummygpencore.value == 1), 1, 1, false, false);
|
||||
|
||||
G_UpdateTimeStickerMedals(levellist.choosemap, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue