mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix positioning and size of turn timers widget with English fonts
This commit is contained in:
parent
d8c69d39d8
commit
ebbba0029f
@ -54,19 +54,19 @@ TurnTimerWidget::TurnTimerWidget(const Point & position, PlayerColor player)
|
||||
{
|
||||
pos.w = 76;
|
||||
|
||||
pos.h += 16;
|
||||
playerLabelsMain[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 8, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
pos.h += 20;
|
||||
playerLabelsMain[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 10, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
|
||||
if (timers.battleTimer != 0)
|
||||
{
|
||||
pos.h += 16;
|
||||
playerLabelsBattle[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 8, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
pos.h += 20;
|
||||
playerLabelsBattle[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 10, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
}
|
||||
|
||||
if (!timers.accumulatingUnitTimer && timers.unitTimer != 0)
|
||||
{
|
||||
pos.h += 16;
|
||||
playerLabelsUnit[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 8, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
pos.h += 20;
|
||||
playerLabelsUnit[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 10, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
}
|
||||
|
||||
updateTextLabel(player, LOCPLINT->cb->getPlayerTurnTime(player));
|
||||
@ -76,7 +76,7 @@ TurnTimerWidget::TurnTimerWidget(const Point & position, PlayerColor player)
|
||||
if (!timers.accumulatingTurnTimer && timers.baseTimer != 0)
|
||||
pos.w = 120;
|
||||
else
|
||||
pos.w = 50;
|
||||
pos.w = 60;
|
||||
|
||||
for(PlayerColor player(0); player < PlayerColor::PLAYER_LIMIT; ++player)
|
||||
{
|
||||
@ -86,8 +86,8 @@ TurnTimerWidget::TurnTimerWidget(const Point & position, PlayerColor player)
|
||||
if (!LOCPLINT->cb->getStartInfo()->playerInfos.at(player).isControlledByHuman())
|
||||
continue;
|
||||
|
||||
pos.h += 16;
|
||||
playerLabelsMain[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 8, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
pos.h += 20;
|
||||
playerLabelsMain[player] = std::make_shared<CLabel>(pos.w / 2, pos.h - 10, FONT_BIG, ETextAlignment::CENTER, graphics->playerColors[player], "");
|
||||
|
||||
updateTextLabel(player, LOCPLINT->cb->getPlayerTurnTime(player));
|
||||
}
|
||||
|
@ -131,8 +131,8 @@ void BattleWindow::createStickyHeroInfoWindows()
|
||||
InfoAboutHero info;
|
||||
info.initFromHero(owner.defendingHeroInstance, InfoAboutHero::EInfoLevel::INBATTLE);
|
||||
Point position = (GH.screenDimensions().x >= 1000)
|
||||
? Point(pos.x + pos.w + 15, pos.y + 50)
|
||||
: Point(pos.x + pos.w -79, pos.y + 185);
|
||||
? Point(pos.x + pos.w + 15, pos.y + 60)
|
||||
: Point(pos.x + pos.w -79, pos.y + 195);
|
||||
defenderHeroWindow = std::make_shared<HeroInfoBasicPanel>(info, &position);
|
||||
}
|
||||
if(owner.attackingHeroInstance)
|
||||
@ -140,8 +140,8 @@ void BattleWindow::createStickyHeroInfoWindows()
|
||||
InfoAboutHero info;
|
||||
info.initFromHero(owner.attackingHeroInstance, InfoAboutHero::EInfoLevel::INBATTLE);
|
||||
Point position = (GH.screenDimensions().x >= 1000)
|
||||
? Point(pos.x - 93, pos.y + 50)
|
||||
: Point(pos.x + 1, pos.y + 185);
|
||||
? Point(pos.x - 93, pos.y + 60)
|
||||
: Point(pos.x + 1, pos.y + 195);
|
||||
attackerHeroWindow = std::make_shared<HeroInfoBasicPanel>(info, &position);
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ void BattleWindow::createTimerInfoWindows()
|
||||
{
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||
|
||||
if(LOCPLINT->cb->getStartInfo()->turnTimerInfo.unitTimer != 0)
|
||||
if(LOCPLINT->cb->getStartInfo()->turnTimerInfo.battleTimer != 0 || LOCPLINT->cb->getStartInfo()->turnTimerInfo.unitTimer != 0)
|
||||
{
|
||||
PlayerColor attacker = owner.getBattle()->sideToPlayer(BattleSide::ATTACKER);
|
||||
PlayerColor defender = owner.getBattle()->sideToPlayer(BattleSide::DEFENDER);
|
||||
|
Loading…
Reference in New Issue
Block a user