display map author if available in map header

This commit is contained in:
titiger 2019-03-11 01:56:06 +01:00
parent e50e4f3007
commit aec1e6d416
3 changed files with 10 additions and 1 deletions

View File

@ -313,6 +313,8 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelMapInfo.registerGraphicComponent(containerName,"labelMapInfo");
labelMapInfo.init(xoffset+100, mapPos-labelOffset-10, 200, 40);
labelMapInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
labelMapInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());
labelMapInfo.setText("?");
labelMap.registerGraphicComponent(containerName,"labelMap");

View File

@ -284,6 +284,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelMapInfo.registerGraphicComponent(containerName,"labelMapInfo");
labelMapInfo.init(xoffset+100, mapPos-labelOffset-10, 200, 40);
labelMapInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
labelMapInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());
labelTileset.registerGraphicComponent(containerName,"labelTileset");
labelTileset.init(xoffset+500, mapHeadPos);

View File

@ -1108,7 +1108,12 @@ bool MapPreview::loadMapInfo(string file, MapInfo *mapInfo, string i18nMaxMapPla
mapInfo->players= header.maxFactions;
mapInfo->desc = i18nMaxMapPlayersTitle + ": " + intToStr(mapInfo->players) + "\n";
mapInfo->desc += i18nMapSizeTitle + ": " + intToStr(mapInfo->size.x) + " x " + intToStr(mapInfo->size.y);
mapInfo->desc += i18nMapSizeTitle + ": " + intToStr(mapInfo->size.x) + " x " + intToStr(mapInfo->size.y)+"\n";
string author=header.author;
if( author.length()>35){
author=author.substr(0,35)+"...";
}
mapInfo->desc +=author;
validMap = true;
}