1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Tutorial load game mode

This commit is contained in:
nordsoft 2023-08-09 15:29:48 +04:00
parent 04c0124759
commit f4869cbfb0
4 changed files with 9 additions and 4 deletions

View File

@ -682,7 +682,7 @@ int CServerHandler::howManyPlayerInterfaces()
ui8 CServerHandler::getLoadMode()
{
if(state == EClientState::GAMEPLAY)
if(loadMode != ELoadMode::TUTORIAL && state == EClientState::GAMEPLAY)
{
if(si->campState)
return ELoadMode::CAMPAIGN;

View File

@ -613,16 +613,21 @@ void SelectionTab::parseSaves(const std::unordered_set<ResourceID> & files)
// Filter out other game modes
bool isCampaign = mapInfo->scenarioOptionsOfSave->mode == StartInfo::CAMPAIGN;
bool isMultiplayer = mapInfo->amountOfHumanPlayersInSave > 1;
bool isTutorial = boost::to_upper_copy(mapInfo->scenarioOptionsOfSave->mapname) == "MAPS/TUTORIAL";
switch(CSH->getLoadMode())
{
case ELoadMode::SINGLE:
if(isMultiplayer || isCampaign)
if(isMultiplayer || isCampaign || isTutorial)
mapInfo->mapHeader.reset();
break;
case ELoadMode::CAMPAIGN:
if(!isCampaign)
mapInfo->mapHeader.reset();
break;
case ELoadMode::TUTORIAL:
if(!isTutorial)
mapInfo->mapHeader.reset();
break;
default:
if(!isMultiplayer)
mapInfo->mapHeader.reset();

View File

@ -199,7 +199,7 @@ static std::function<void()> genCommand(CMenuScreen * menu, std::vector<std::str
case 2:
return std::bind(CMainMenu::openLobby, ESelectionScreen::loadGame, true, nullptr, ELoadMode::CAMPAIGN);
case 3:
return std::bind(CMainMenu::startTutorial);
return std::bind(CMainMenu::openLobby, ESelectionScreen::loadGame, true, nullptr, ELoadMode::TUTORIAL);
}
}
break;

View File

@ -34,7 +34,7 @@ enum ESelectionScreen : ui8 {
enum ELoadMode : ui8
{
NONE = 0, SINGLE, MULTI, CAMPAIGN
NONE = 0, SINGLE, MULTI, CAMPAIGN, TUTORIAL
};
/// The main menu screens listed in the EState enum