NumNext: 0
LocationX: 284
LocationY: 312
+
+EndText:Congratulations!
+You have avenged your family and
+restored peace to the island of Lugaru.
LocationX: 153
LocationY: 210
-
Level 9:
Name: task9
Description: Desert_-_camp
Description: Bonus_Level_-_ZOMBIES!
ChooseNext: 1
NumNext: 0
-NextLevel: 19
LocationX: 400
LocationY: 400
bool campaign = false;
int actuallevel = 0;
+std::string campaignEndText[3];
std::vector<std::string> ListCampaigns()
{
std::ifstream ipstream(Folders::getResourcePath("Campaigns/" + Account::active().getCurrentCampaign() + ".txt"));
if (!ipstream.good()) {
if (Account::active().getCurrentCampaign() == "main") {
- cerr << "Could not found main campaign!" << endl;
+ cerr << "Could not find main campaign!" << endl;
return;
}
- cerr << "Could not found campaign \"" << Account::active().getCurrentCampaign() << "\", falling back to main." << endl;
+ cerr << "Could not find campaign \"" << Account::active().getCurrentCampaign() << "\", falling back to main." << endl;
Account::active().setCurrentCampaign("main");
return LoadCampaign();
}
ipstream >> cl;
campaignlevels.push_back(cl);
}
+ campaignEndText[0] = "Congratulations!";
+ campaignEndText[1] = string("You have completed ") + Account::active().getCurrentCampaign() + " campaign";
+ campaignEndText[2] = "and restored peace to the island of Lugaru.";
+ if (ipstream.good()) {
+ ipstream.ignore(256, ':');
+ getline(ipstream, campaignEndText[0]);
+ getline(ipstream, campaignEndText[1]);
+ getline(ipstream, campaignEndText[2]);
+ }
ipstream.close();
std::ifstream test(Folders::getResourcePath("Textures/" + Account::active().getCurrentCampaign() + "/World.png"));
extern bool campaign;
extern int actuallevel;
+extern std::string campaignEndText[3];
std::vector<std::string> ListCampaigns();
void LoadCampaign();
addButton(numchallengelevels, "Back", 10, 10);
break;
case 10: {
- addLabel(0, "Congratulations!", 220, 330);
- addLabel(1, "You have avenged your family and", 140, 300);
- addLabel(2, "restored peace to the island of Lugaru.", 110, 270);
+ addLabel(0, campaignEndText[0], 220, 330);
+ addLabel(1, campaignEndText[1], 140, 300);
+ addLabel(2, campaignEndText[2], 110, 270);
addButton(3, "Back", 10, 10);
addLabel(4, string("Your score: ") + to_string((int)Account::active().getCampaignScore()), 190, 200);
addLabel(5, string("Highest score: ") + to_string((int)Account::active().getCampaignHighScore()), 190, 180);