1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00

Merge pull request #5560 from GeorgeK1ng/campaigns

[1.7] Campaigns configurations improvements
This commit is contained in:
Ivan Savenko
2025-04-02 13:54:50 +03:00
committed by GitHub
30 changed files with 285 additions and 71 deletions

View File

@ -425,22 +425,6 @@ void CMainMenu::openCampaignScreen(std::string name)
return;
}
bool campaignsFound = true;
for (auto const & entry : config[name]["items"].Vector())
{
ResourcePath resourceID(entry["file"].String(), EResType::CAMPAIGN);
if(entry["optional"].Bool())
continue;
if(!CResourceHandler::get()->existsResource(resourceID))
campaignsFound = false;
}
if (!campaignsFound)
{
CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
return;
}
ENGINE->windows().createAndPushWindow<CCampaignScreen>(config, name);
}