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

Merge branch 'vcmi/master' into 'vcmi/develop'

This commit is contained in:
Ivan Savenko
2023-09-15 13:59:02 +03:00
118 changed files with 9641 additions and 492 deletions

View File

@@ -89,6 +89,8 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType)
break;
}
buttonStart->block(true); // to be unblocked after map list is ready
buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), CGI->generaltexth->zelp[105], [&]()
{
CSH->sendClientDisconnecting();
@@ -127,34 +129,11 @@ void CLobbyScreen::startCampaign()
void CLobbyScreen::startScenario(bool allowOnlyAI)
{
try
if (CSH->validateGameStart(allowOnlyAI))
{
CSH->sendStartGame(allowOnlyAI);
buttonStart->block(true);
}
catch(ModIncompatibility & e)
{
logGlobal->warn("Incompatibility exception during start scenario: %s", e.what());
auto errorMsg = CGI->generaltexth->translate("vcmi.server.errors.modsIncompatibility") + '\n';
errorMsg += e.what();
CInfoWindow::showInfoDialog(errorMsg, CInfoWindow::TCompsInfo(), PlayerColor(1));
}
catch(std::exception & e)
{
logGlobal->error("Exception during startScenario: %s", e.what());
if(std::string(e.what()) == "ExceptionNoHuman")
CInfoWindow::showInfoDialog(CGI->generaltexth->allTexts[530], CInfoWindow::TCompsInfo(), PlayerColor(1));
if(std::string(e.what()) == "ExceptionNoTemplate")
CInfoWindow::showInfoDialog(CGI->generaltexth->allTexts[751], CInfoWindow::TCompsInfo(), PlayerColor(1));
}
catch(...)
{
logGlobal->error("Unknown exception");
}
}
void CLobbyScreen::toggleMode(bool host)
@@ -193,6 +172,8 @@ void CLobbyScreen::updateAfterStateChange()
if(CSH->mi && tabOpt)
tabOpt->recreate();
buttonStart->block(CSH->mi == nullptr || CSH->isGuest());
card->changeSelection();
if (card->iconDifficulty)
{