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

Open lobby when players leaves pregame menu opened via lobby

This commit is contained in:
Ivan Savenko 2024-03-26 23:51:42 +02:00
parent 73d8789f8d
commit b9cd9a5822

View File

@ -23,6 +23,7 @@
#include "../widgets/Buttons.h"
#include "../windows/InfoWindows.h"
#include "../render/Colors.h"
#include "../globalLobby/GlobalLobbyClient.h"
#include "../../CCallback.h"
@ -104,8 +105,12 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType)
buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), CGI->generaltexth->zelp[105], [&]()
{
bool wasInLobbyRoom = CSH->inLobbyRoom();
CSH->sendClientDisconnecting();
close();
if (wasInLobbyRoom)
CSH->getGlobalLobby().activateInterface();
}, EShortcut::GLOBAL_CANCEL);
}