1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-09 10:29:45 +01:00

Display centiseconds on time trial result and Game Complete

Centiseconds won't be saved to any save file or anything. This is just
to make speedrunning a bit more competitive, being able to know the
precise time of a time trial or full game run.

The time trial par time on the result screen always has ".99" after it.
This is basically due to the game comparing the number of seconds to the
par number of seconds using less-than-or-equal-to instead of simply
less-than.
This commit is contained in:
Misa 2020-06-29 15:53:19 -07:00 committed by Ethan Lee
parent ad27a5c154
commit f64e9237c4
3 changed files with 6 additions and 2 deletions

View file

@ -258,6 +258,7 @@ void Game::init(void)
timetrialparlost = false;
timetrialpar = 0;
timetrialresulttime = 0;
timetrialresultframes = 0;
totalflips = 0;
hardestroom = "Welcome Aboard";
@ -1390,6 +1391,7 @@ void Game::updatestate()
obj.removetrigger(82);
hascontrol = false;
timetrialresulttime = seconds + (minutes * 60) + (hours * 60 * 60);
timetrialresultframes = frames;
timetrialrank = 0;
if (timetrialresulttime <= timetrialpar) timetrialrank++;
if (trinkets() >= timetrialshinytarget) timetrialrank++;
@ -3219,6 +3221,7 @@ void Game::updatestate()
graphics.createtextbox(" All Crew Members Rescued! ", -1, 64, 0, 0, 0);
}
savetime = timestring();
savetime += "." + help.twodigits(frames*100 / 30);
break;
case 3503:
{
@ -6883,6 +6886,7 @@ std::string Game::resulttimestring()
{
tempstring = "00:" + help.twodigits(timetrialresulttime);
}
tempstring += "." + help.twodigits(timetrialresultframes*100 / 30);
return tempstring;
}

View file

@ -258,7 +258,7 @@ public:
//Time Trials
bool intimetrial, timetrialparlost;
int timetrialcountdown, timetrialshinytarget, timetriallevel;
int timetrialpar, timetrialresulttime, timetrialrank;
int timetrialpar, timetrialresulttime, timetrialresultframes, timetrialrank;
int creditposition;
int oldcreditposition;

View file

@ -661,7 +661,7 @@ void menurender()
{
graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3);
std::string tempstring = game.resulttimestring() + " / " + game.partimestring();
std::string tempstring = game.resulttimestring() + " / " + game.partimestring() + ".99";
graphics.drawspritesetcol(30, 80-15, 50, 22);
graphics.Print(65, 80-15, "TIME TAKEN:", 255, 255, 255);