1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

allow custom loadbar-backgrounds for campaigns

This commit is contained in:
Laserlicht
2024-08-31 16:03:42 +02:00
parent 0b8f92250d
commit 16cbd6a7d2
9 changed files with 36 additions and 5 deletions

View File

@ -532,7 +532,10 @@ void CServerHandler::sendGuiAction(ui8 action) const
void CServerHandler::sendRestartGame() const
{
GH.windows().createAndPushWindow<CLoadingScreen>();
if(si->campState && !si->campState->getLoadingBackground().empty())
GH.windows().createAndPushWindow<CLoadingScreen>(si->campState->getLoadingBackground());
else
GH.windows().createAndPushWindow<CLoadingScreen>();
LobbyRestartGame endGame;
sendLobbyPack(endGame);
@ -576,7 +579,12 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const
verifyStateBeforeStart(allowOnlyAI ? true : settings["session"]["onlyai"].Bool());
if(!settings["session"]["headless"].Bool())
GH.windows().createAndPushWindow<CLoadingScreen>();
{
if(si->campState && !si->campState->getLoadingBackground().empty())
GH.windows().createAndPushWindow<CLoadingScreen>(si->campState->getLoadingBackground());
else
GH.windows().createAndPushWindow<CLoadingScreen>();
}
LobbyPrepareStartGame lpsg;
sendLobbyPack(lpsg);