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:
parent
e9351b4a00
commit
c3dfd4a4b1
1 changed files with 17 additions and 46 deletions
|
@ -2468,59 +2468,30 @@ void maprender(void)
|
|||
}
|
||||
break;
|
||||
case 2:
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
{
|
||||
int total;
|
||||
#ifndef NO_CUSTOM_LEVELS
|
||||
if (map.custommode)
|
||||
{
|
||||
if (graphics.flipmode)
|
||||
{
|
||||
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);
|
||||
}
|
||||
total = cl.numtrinkets();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (graphics.flipmode)
|
||||
{
|
||||
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);
|
||||
total = 20;
|
||||
}
|
||||
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);
|
||||
/* 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, 152, "[Time Taken]", 196, 196, 255 - help.glow, true);
|
||||
graphics.Print(0, 164, game.timestring(), 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;
|
||||
}
|
||||
case 3:
|
||||
if (game.inintermission)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue