1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Remove map.customtrinkets

This variable's sole purpose is to copy ed.numtrinkets, even though ed
has always been a name that's been accessible globally. So let's not
dupe cope.
This commit is contained in:
Misa 2020-04-08 21:56:47 -07:00 committed by Ethan Lee
parent c077e51fb4
commit 85bd7d9a2d
5 changed files with 21 additions and 11 deletions

View file

@ -1947,12 +1947,14 @@ void Game::updatestate()
graphics.addline("You have found a shiny trinket!");
graphics.textboxcenterx();
#if !defined(NO_CUSTOM_LEVELS)
if(map.custommode)
{
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(map.customtrinkets)+ " ", 50, 65, 174, 174, 174);
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets)+ " ", 50, 65, 174, 174, 174);
graphics.textboxcenterx();
}
else
#endif
{
graphics.createtextbox(" " + help.number(trinkets()) + " out of Twenty ", 50, 65, 174, 174, 174);
graphics.textboxcenterx();
@ -1965,12 +1967,14 @@ void Game::updatestate()
graphics.addline("You have found a shiny trinket!");
graphics.textboxcenterx();
#if !defined(NO_CUSTOM_LEVELS)
if(map.custommode)
{
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(map.customtrinkets)+ " ", 50, 135, 174, 174, 174);
graphics.createtextbox(" " + help.number(trinkets()) + " out of " + help.number(ed.numtrinkets)+ " ", 50, 135, 174, 174, 174);
graphics.textboxcenterx();
}
else
#endif
{
graphics.createtextbox(" " + help.number(trinkets()) + " out of Twenty ", 50, 135, 174, 174, 174);
graphics.textboxcenterx();
@ -2089,13 +2093,15 @@ void Game::updatestate()
//Update level stats
if(map.customcrewmates-crewmates()==0)
{
#if !defined(NO_CUSTOM_LEVELS)
//Finished level
if(map.customtrinkets-trinkets()==0)
if(ed.numtrinkets-trinkets()==0)
{
//and got all the trinkets!
updatecustomlevelstats(customlevelfilename, 3);
}
else
#endif
{
updatecustomlevelstats(customlevelfilename, 1);
}

View file

@ -42,7 +42,6 @@ mapclass::mapclass()
custommode=false;
custommodeforreal=false;
customtrinkets=0;
customx=0; customy=0;
customwidth=20; customheight=20;
custommmxoff=0; custommmyoff=0; custommmxsize=0; custommmysize=0;
@ -1732,7 +1731,6 @@ void mapclass::loadlevel(int rx, int ry)
}
}
customtrinkets=ed.numtrinkets;
customcrewmates=ed.numcrewmates;
//do the appear/remove roomname here

View file

@ -134,7 +134,6 @@ public:
bool custommodeforreal;
int customx, customy;
int customwidth, customheight;
int customtrinkets;
int customcrewmates;
int custommmxoff, custommmyoff, custommmxsize, custommmysize;
int customzoom;

View file

@ -2245,11 +2245,13 @@ void maprender()
graphics.Print(185-12, 220, "[STATS]", 196, 196, 255 - help.glow);
graphics.Print(258, 220, "SAVE", 64, 64, 64);
if(map.custommode){
#if !defined(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(game.trinkets()) + " out of " + help.number(map.customtrinkets), 96,96,96, true);
graphics.Print(0, 152, help.number(game.trinkets()) + " out of " + help.number(ed.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);
@ -2260,7 +2262,7 @@ void maprender()
else
{
graphics.Print(0, 52, "[Trinkets found]", 196, 196, 255 - help.glow, true);
graphics.Print(0, 64, help.number(game.trinkets()) + " out of "+help.number(map.customtrinkets), 96,96,96, true);
graphics.Print(0, 64, help.number(game.trinkets()) + " out of "+help.number(ed.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);
@ -2268,7 +2270,10 @@ void maprender()
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
{
if (graphics.flipmode)
{
graphics.Print(0, 164, "[Trinkets found]", 196, 196, 255 - help.glow, true);

View file

@ -1887,11 +1887,13 @@ void scriptclass::run()
graphics.textboxcenterx();
std::string usethisnum;
#if !defined(NO_CUSTOM_LEVELS)
if (map.custommode)
{
usethisnum = help.number(map.customtrinkets);
usethisnum = help.number(ed.numtrinkets);
}
else
#endif
{
usethisnum = "Twenty";
}