1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

#3142 - fi custom campaign selection screen

This commit is contained in:
Andrii Danylchenko 2023-11-04 14:34:07 +02:00
parent a8cc5e1d60
commit d50ebd7d58
2 changed files with 5 additions and 3 deletions

View File

@ -209,7 +209,6 @@ void InfoCard::changeSelection()
return;
labelSaveDate->setText(mapInfo->date);
labelMapSize->setText(std::to_string(mapInfo->mapHeader->width) + "x" + std::to_string(mapInfo->mapHeader->height));
mapName->setText(mapInfo->getNameTranslated());
mapDescription->setText(mapInfo->getDescriptionTranslated());
@ -220,8 +219,11 @@ void InfoCard::changeSelection()
if(SEL->screenType == ESelectionScreen::campaignList)
return;
iconsMapSizes->setFrame(mapInfo->getMapSizeIconId());
const CMapHeader * header = mapInfo->mapHeader.get();
labelMapSize->setText(std::to_string(header->width) + "x" + std::to_string(header->height));
iconsMapSizes->setFrame(mapInfo->getMapSizeIconId());
iconsVictoryCondition->setFrame(header->victoryIconIndex);
labelVictoryConditionText->setText(header->victoryMessage.toString());
iconsLossCondition->setFrame(header->defeatIconIndex);

View File

@ -1530,7 +1530,7 @@ void CGHeroInstance::afterAddToMap(CMap * map)
{
auto existingHero = std::find_if(map->objects.begin(), map->objects.end(), [&](const CGObjectInstance * o) ->bool
{
return (o->ID == Obj::HERO || o->ID == Obj::PRISON) && o->subID == subID && o != this;
return o && (o->ID == Obj::HERO || o->ID == Obj::PRISON) && o->subID == subID && o != this;
});
if(existingHero != map->objects.end())