X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FLevel%2FCampaign.cpp;h=02072d0137d101338dd3f0e8b908156e9c14ae6c;hp=410abcc7535c3177a203ee5f0dc79a70d82219e9;hb=f4bb5680c5056f3df67e0068b10f267a91268874;hpb=380d8141271d6fa12954f6fe46e736315cffd594 diff --git a/Source/Level/Campaign.cpp b/Source/Level/Campaign.cpp index 410abcc..02072d0 100644 --- a/Source/Level/Campaign.cpp +++ b/Source/Level/Campaign.cpp @@ -32,6 +32,7 @@ std::vector campaignlevels; bool campaign = false; int actuallevel = 0; +std::string campaignEndText[3]; std::vector ListCampaigns() { @@ -64,10 +65,10 @@ void LoadCampaign() 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(); } @@ -80,6 +81,15 @@ void 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"));