1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-05 02:39:41 +01:00

De-duplicate map menu stats screen rendering code

Between accounting for Flip Mode and custom levels, this code was
copy-pasted three times, leading to _four_ instances of one code!

Anyways, I've cleaned it up. The position of the text in Flip Mode is
going to differ by 4 pixels from how it was previously, but that really
shouldn't matter.
This commit is contained in:
Misa 2021-09-25 17:16:52 -07:00
parent e9351b4a00
commit c3dfd4a4b1

View file

@ -2468,59 +2468,30 @@ void maprender(void)
} }
break; break;
case 2: case 2:
#if !defined(NO_CUSTOM_LEVELS) {
if(map.custommode) int total;
#ifndef NO_CUSTOM_LEVELS
if (map.custommode)
{ {
if (graphics.flipmode) total = cl.numtrinkets();
{
graphics.Print(0, 164, "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 152, help.number_words(game.trinkets()) + " out of " + help.number_words(cl.numtrinkets()), 96,96,96, true);
graphics.Print(0, 114, "[Number of Deaths]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 102,help.String(game.deathcounts), 96,96,96, true);
graphics.Print(0, 64, "[Time Taken]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 52, game.timestring(), 96, 96, 96, true);
}
else
{
graphics.Print(0, 52, "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 64, help.number_words(game.trinkets()) + " out of "+help.number_words(cl.numtrinkets()), 96,96,96, true);
graphics.Print(0, 102, "[Number of Deaths]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 114,help.String(game.deathcounts), 96,96,96, true);
graphics.Print(0, 152, "[Time Taken]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 164, game.timestring(), 96, 96, 96, true);
}
} }
else else
#endif #endif
{ {
if (graphics.flipmode) total = 20;
{
graphics.Print(0, 164, "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 152, help.number_words(game.trinkets()) + " out of Twenty", 96,96,96, true);
graphics.Print(0, 114, "[Number of Deaths]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 102,help.String(game.deathcounts), 96,96,96, true);
graphics.Print(0, 64, "[Time Taken]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 52, game.timestring(), 96, 96, 96, true);
}
else
{
graphics.Print(0, 52, "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 64, help.number_words(game.trinkets()) + " out of Twenty", 96,96,96, true);
graphics.Print(0, 102, "[Number of Deaths]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 114,help.String(game.deathcounts), 96,96,96, true);
graphics.Print(0, 152, "[Time Taken]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 164, game.timestring(), 96, 96, 96, true);
}
} }
/* Stats. */
graphics.Print(0, FLIP(52), "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, FLIP(64), help.number_words(game.trinkets()) + " out of " + help.number_words(total), 96, 96, 96, true);
graphics.Print(0, FLIP(102), "[Number of Deaths]", 196, 196, 255 - help.glow, true);
graphics.Print(0, FLIP(114), help.String(game.deathcounts), 96, 96, 96, true);
graphics.Print(0, FLIP(152), "[Time Taken]", 196, 196, 255 - help.glow, true);
graphics.Print(0, FLIP(164), game.timestring(), 96, 96, 96, true);
break; break;
}
case 3: case 3:
if (game.inintermission) if (game.inintermission)
{ {