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

improvements for non quadratic maps

This commit is contained in:
Laserlicht
2023-10-21 16:49:50 +02:00
committed by GitHub
parent f3acc939b9
commit e03f2a9d3a
6 changed files with 31 additions and 5 deletions

View File

@ -123,6 +123,7 @@ InfoCard::InfoCard()
pos.y += 6;
labelSaveDate = std::make_shared<CLabel>(310, 38, FONT_SMALL, ETextAlignment::BOTTOMRIGHT, Colors::WHITE);
labelMapSize = std::make_shared<CLabel>(332, 56, FONT_TINY, ETextAlignment::CENTER, Colors::WHITE);
mapName = std::make_shared<CLabel>(26, 39, FONT_BIG, ETextAlignment::TOPLEFT, Colors::YELLOW);
Rect descriptionRect(26, 149, 320, 115);
mapDescription = std::make_shared<CTextBox>("", descriptionRect, 1);
@ -185,6 +186,7 @@ InfoCard::InfoCard()
void InfoCard::disableLabelRedraws()
{
labelSaveDate->setAutoRedraw(false);
labelMapSize->setAutoRedraw(false);
mapName->setAutoRedraw(false);
mapDescription->label->setAutoRedraw(false);
labelVictoryConditionText->setAutoRedraw(false);
@ -200,6 +202,7 @@ 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());