1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

add persistent storage & completed campaign support

This commit is contained in:
Laserlicht
2023-09-20 22:18:53 +02:00
committed by GitHub
parent 52b86eb9c1
commit dfb5ccbeaf
5 changed files with 29 additions and 8 deletions

View File

@ -683,6 +683,9 @@ void CServerHandler::startCampaignScenario(std::shared_ptr<CampaignState> cs)
auto & epilogue = ourCampaign->scenario(*ourCampaign->lastScenario()).epilog;
auto finisher = [=]()
{
Settings entry = persistent.write["campaign"][ourCampaign->campaignSet][ourCampaign->getFilename()]["completed"];
entry->Bool() = true;
if(!ourCampaign->isCampaignFinished())
{
GH.windows().pushWindow(CMM);