mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Get rid of Game::savearea (std::string)
This is what got saved to the area part of the <summary> tags, and it was specifically set upon pressing ACTION to save in the map menu. Which meant tsave.vvv may not get an accurate area name (notably "nowhere" if you hadn't quicksaved before in that session) even though it's not displayed anywhere so it didn't really matter. But this variable can be removed - there's only one place where <summary> is written for both quicksaves and telesaves, so that now gets the area at saving time. Fun fact: custom level quicksaves also have a <summary> tag, and it's even less functional than the one in tsave.vvv, because it stores whatever main-game area name applies to your current coordinates. So I simply filled in the level's name instead (just like what the actual save box says).
This commit is contained in:
parent
0ea41e7913
commit
f23ffc0457
5 changed files with 7 additions and 7 deletions
|
@ -267,7 +267,6 @@ void Game::init(void)
|
||||||
gamesaved = false;
|
gamesaved = false;
|
||||||
gamesavefailed = false;
|
gamesavefailed = false;
|
||||||
savetime = "00:00";
|
savetime = "00:00";
|
||||||
savearea = "nowhere";
|
|
||||||
savetrinkets = 0;
|
savetrinkets = 0;
|
||||||
|
|
||||||
intimetrial = false;
|
intimetrial = false;
|
||||||
|
@ -5846,7 +5845,7 @@ struct Game::Summary Game::writemaingamesave(tinyxml2::XMLDocument& doc)
|
||||||
xml::update_tag(msgs, "finalstretch", (int) map.finalstretch);
|
xml::update_tag(msgs, "finalstretch", (int) map.finalstretch);
|
||||||
|
|
||||||
|
|
||||||
std::string legacy_summary = savearea + ", " + timestring();
|
std::string legacy_summary = std::string(map.currentarea(saverx, savery)) + ", " + timestring();
|
||||||
xml::update_tag(msgs, "summary", legacy_summary.c_str());
|
xml::update_tag(msgs, "summary", legacy_summary.c_str());
|
||||||
|
|
||||||
|
|
||||||
|
@ -6009,7 +6008,7 @@ bool Game::customsavequick(const std::string& savfile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string legacy_summary = savearea + ", " + timestring();
|
std::string legacy_summary = customleveltitle + ", " + timestring();
|
||||||
xml::update_tag(msgs, "summary", legacy_summary.c_str());
|
xml::update_tag(msgs, "summary", legacy_summary.c_str());
|
||||||
|
|
||||||
if(!FILESYSTEM_saveTiXml2Document(("saves/"+levelfile+".vvv").c_str(), doc))
|
if(!FILESYSTEM_saveTiXml2Document(("saves/"+levelfile+".vvv").c_str(), doc))
|
||||||
|
|
|
@ -359,7 +359,6 @@ public:
|
||||||
bool gamesaved;
|
bool gamesaved;
|
||||||
bool gamesavefailed;
|
bool gamesavefailed;
|
||||||
std::string savetime;
|
std::string savetime;
|
||||||
std::string savearea;
|
|
||||||
int savetrinkets;
|
int savetrinkets;
|
||||||
bool startscript;
|
bool startscript;
|
||||||
std::string newscript;
|
std::string newscript;
|
||||||
|
|
|
@ -3068,7 +3068,6 @@ static void mapmenuactionpress(const bool version2_2)
|
||||||
music.playef(Sound_GAMESAVED);
|
music.playef(Sound_GAMESAVED);
|
||||||
|
|
||||||
game.savetime = game.timestring();
|
game.savetime = game.timestring();
|
||||||
game.savearea = map.currentarea(game.roomx, game.roomy);
|
|
||||||
game.savetrinkets = game.trinkets();
|
game.savetrinkets = game.trinkets();
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
|
|
|
@ -3012,7 +3012,11 @@ void maprender(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
font::print(PR_CEN, -1, FLIP(80, 8), game.savearea, 25, 255 - help.glow/2, 255 - help.glow/2);
|
font::print(
|
||||||
|
PR_CEN, -1, FLIP(80, 8),
|
||||||
|
map.currentarea(game.last_quicksave.saverx, game.last_quicksave.savery),
|
||||||
|
25, 255 - help.glow/2, 255 - help.glow/2
|
||||||
|
);
|
||||||
for (i = 0; i < SDL_arraysize(game.crewstats); ++i)
|
for (i = 0; i < SDL_arraysize(game.crewstats); ++i)
|
||||||
{
|
{
|
||||||
/* Crewmates are annoying. Their height is 21 pixels, but to flip them,
|
/* Crewmates are annoying. Their height is 21 pixels, but to flip them,
|
||||||
|
|
|
@ -3127,7 +3127,6 @@ void scriptclass::hardreset(void)
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
game.savetime = "00:00";
|
game.savetime = "00:00";
|
||||||
game.savearea = "nowhere";
|
|
||||||
game.savetrinkets = 0;
|
game.savetrinkets = 0;
|
||||||
if (!version2_2)
|
if (!version2_2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue