1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Implemented room description display (map/template name)

This commit is contained in:
Ivan Savenko
2024-03-11 19:47:35 +02:00
parent 69236b73ca
commit 715e094f5c
10 changed files with 73 additions and 11 deletions

View File

@ -595,6 +595,24 @@ void CVCMIServer::updateStartInfoOnMapChange(std::shared_ptr<CMapInfo> mapInfo,
else
si->mapGenOptions.reset();
}
if (lobbyProcessor)
{
std::string roomDescription;
if (si->mapGenOptions)
{
if (si->mapGenOptions->getMapTemplate())
roomDescription = si->mapGenOptions->getMapTemplate()->getName();
// else - no template selected.
// TODO: handle this somehow?
}
else
roomDescription = mi->getNameTranslated();
lobbyProcessor->sendChangeRoomDescription(roomDescription);
}
si->mapname = mi->fileURI;
}