1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 06:28:30 +02:00

Show centiseconds for best time trial times (if available)

Since VVVVVV 2.3, time trial best times are stored not just with the
number of seconds, but also the number of frames. However, there was
no room to display it with the old design of the time trials screen.
Now there is, so it can easily be displayed now with a small change!

Unset frames are stored as -1, which fits perfectly into the frames
argument of help.format_time(), because in that case the amount of
centiseconds is not shown.

It should be noted that opening VVVVVV 2.2 will instantly wipe your
frames records, as described by #1030. But many people will likely
never open 2.2 anymore.
This commit is contained in:
Dav999 2023-10-26 00:43:55 +02:00 committed by Misa Elizabeth Kai
parent a46c817c69
commit 36dbb0f73a

View File

@ -1588,9 +1588,10 @@ static void menurender(void)
label_len = SDL_max(label_len, font::len(0, label));
font::print(0, 32, 65+sp*3, label, tr, tg, tb);
font::print(0, label_len+48, 65+sp, game.timetstring(game.besttimes[id_trial]), tr, tg, tb);
char buffer[SCREEN_WIDTH_CHARS + 1];
help.format_time(buffer, sizeof(buffer), game.besttimes[id_trial], game.bestframes[id_trial], true);
font::print(0, label_len+48, 65+sp, buffer, tr, tg, tb);
vformat_buf(
buffer, sizeof(buffer),
loc::gettext("{n_trinkets}/{max_trinkets}"),