1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

campaignset

This commit is contained in:
Laserlicht
2023-09-20 03:13:54 +02:00
committed by GitHub
parent 7b37c2353a
commit 34182069f5
6 changed files with 29 additions and 19 deletions

View File

@@ -349,14 +349,16 @@ void CMainMenu::openLobby(ESelectionScreen screenType, bool host, const std::vec
GH.windows().createAndPushWindow<CSimpleJoinScreen>(host);
}
void CMainMenu::openCampaignLobby(const std::string & campaignFileName)
void CMainMenu::openCampaignLobby(const std::string & campaignFileName, std::string campaignSet)
{
auto ourCampaign = CampaignHandler::getCampaign(campaignFileName);
openCampaignLobby(ourCampaign);
openCampaignLobby(ourCampaign, campaignSet);
}
void CMainMenu::openCampaignLobby(std::shared_ptr<CampaignState> campaign)
void CMainMenu::openCampaignLobby(std::shared_ptr<CampaignState> campaign, std::string campaignSet)
{
campaign->campaignSet = campaignSet;
CSH->resetStateForLobby(StartInfo::CAMPAIGN);
CSH->screenType = ESelectionScreen::campaignList;
CSH->campaignStateToSend = campaign;
@@ -367,7 +369,7 @@ void CMainMenu::openCampaignScreen(std::string name)
{
if(vstd::contains(CMainMenuConfig::get().getCampaigns().Struct(), name))
{
GH.windows().createAndPushWindow<CCampaignScreen>(CMainMenuConfig::get().getCampaigns()[name]);
GH.windows().createAndPushWindow<CCampaignScreen>(CMainMenuConfig::get().getCampaigns(), name);
return;
}
logGlobal->error("Unknown campaign set: %s", name);