mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
gap-less layout
This commit is contained in:
@@ -191,10 +191,10 @@ void BattleWindow::createQuickSpellWindow()
|
|||||||
OBJECT_CONSTRUCTION;
|
OBJECT_CONSTRUCTION;
|
||||||
|
|
||||||
quickSpellWindow = std::make_shared<QuickSpellPanel>(owner);
|
quickSpellWindow = std::make_shared<QuickSpellPanel>(owner);
|
||||||
quickSpellWindow->moveTo(Point(pos.x - 55, pos.y));
|
quickSpellWindow->moveTo(Point(pos.x - 52, pos.y));
|
||||||
|
|
||||||
unitActionWindow = std::make_shared<UnitActionPanel>(owner);
|
unitActionWindow = std::make_shared<UnitActionPanel>(owner);
|
||||||
unitActionWindow->moveTo(Point(pos.x + pos.w + 3, pos.y));
|
unitActionWindow->moveTo(Point(pos.x + pos.w, pos.y));
|
||||||
|
|
||||||
if(settings["battle"]["enableQuickSpellPanel"].Bool())
|
if(settings["battle"]["enableQuickSpellPanel"].Bool())
|
||||||
showStickyQuickSpellWindow();
|
showStickyQuickSpellWindow();
|
||||||
@@ -383,37 +383,37 @@ void BattleWindow::updateQueue()
|
|||||||
|
|
||||||
void BattleWindow::setPositionInfoWindow()
|
void BattleWindow::setPositionInfoWindow()
|
||||||
{
|
{
|
||||||
int xOffsetAttacker = quickSpellWindow->isDisabled() ? 0 : -53;
|
int xOffsetAttacker = quickSpellWindow->isDisabled() ? 0 : -51;
|
||||||
int xOffsetDefender = unitActionWindow->isDisabled() ? 0 : 53;
|
int xOffsetDefender = unitActionWindow->isDisabled() ? 0 : 51;
|
||||||
|
|
||||||
int yOffsetAttacker = attackerTimerWidget ? attackerTimerWidget->pos.h + 9 : 0;
|
int yOffsetAttacker = attackerTimerWidget ? attackerTimerWidget->pos.h + 9 : 0;
|
||||||
int yOffsetDefender = defenderTimerWidget ? defenderTimerWidget->pos.h + 9 : 0;
|
int yOffsetDefender = defenderTimerWidget ? defenderTimerWidget->pos.h + 9 : 0;
|
||||||
|
|
||||||
if(defenderHeroWindow)
|
if(defenderHeroWindow)
|
||||||
{
|
{
|
||||||
Point position = (ENGINE->screenDimensions().x >= 1000)
|
Point position = (ENGINE->screenDimensions().x >= 960)
|
||||||
? Point(pos.x + pos.w + 3 + xOffsetDefender, pos.y - 1 + yOffsetDefender)
|
? Point(pos.x + pos.w - 1 + xOffsetDefender, pos.y - 1 + yOffsetDefender)
|
||||||
: Point(pos.x + pos.w -79, pos.y + 195);
|
: Point(pos.x + pos.w -79, pos.y + 195);
|
||||||
defenderHeroWindow->moveTo(position);
|
defenderHeroWindow->moveTo(position);
|
||||||
}
|
}
|
||||||
if(attackerHeroWindow)
|
if(attackerHeroWindow)
|
||||||
{
|
{
|
||||||
Point position = (ENGINE->screenDimensions().x >= 1000)
|
Point position = (ENGINE->screenDimensions().x >= 960)
|
||||||
? Point(pos.x - 81 + xOffsetAttacker, pos.y - 1 + yOffsetAttacker)
|
? Point(pos.x - 77 + xOffsetAttacker, pos.y - 1 + yOffsetAttacker)
|
||||||
: Point(pos.x + 1, pos.y + 195);
|
: Point(pos.x + 1, pos.y + 195);
|
||||||
attackerHeroWindow->moveTo(position);
|
attackerHeroWindow->moveTo(position);
|
||||||
}
|
}
|
||||||
if(defenderStackWindow)
|
if(defenderStackWindow)
|
||||||
{
|
{
|
||||||
Point position = (ENGINE->screenDimensions().x >= 1000)
|
Point position = (ENGINE->screenDimensions().x >= 960)
|
||||||
? Point(pos.x + pos.w + 3 + xOffsetDefender, defenderHeroWindow ? defenderHeroWindow->pos.y + 210 : pos.y - 1 + yOffsetDefender)
|
? Point(pos.x + pos.w - 1 + xOffsetDefender, defenderHeroWindow ? defenderHeroWindow->pos.y + 210 : pos.y - 1 + yOffsetDefender)
|
||||||
: Point(pos.x + pos.w -79, defenderHeroWindow ? defenderHeroWindow->pos.y : pos.y + 195);
|
: Point(pos.x + pos.w -79, defenderHeroWindow ? defenderHeroWindow->pos.y : pos.y + 195);
|
||||||
defenderStackWindow->moveTo(position);
|
defenderStackWindow->moveTo(position);
|
||||||
}
|
}
|
||||||
if(attackerStackWindow)
|
if(attackerStackWindow)
|
||||||
{
|
{
|
||||||
Point position = (ENGINE->screenDimensions().x >= 1000)
|
Point position = (ENGINE->screenDimensions().x >= 960)
|
||||||
? Point(pos.x - 81 + xOffsetAttacker, attackerHeroWindow ? attackerHeroWindow->pos.y + 210 : pos.y - 1 + yOffsetAttacker)
|
? Point(pos.x - 77 + xOffsetAttacker, attackerHeroWindow ? attackerHeroWindow->pos.y + 210 : pos.y - 1 + yOffsetAttacker)
|
||||||
: Point(pos.x + 1, attackerHeroWindow ? attackerHeroWindow->pos.y : pos.y + 195);
|
: Point(pos.x + 1, attackerHeroWindow ? attackerHeroWindow->pos.y : pos.y + 195);
|
||||||
attackerStackWindow->moveTo(position);
|
attackerStackWindow->moveTo(position);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ HeroInfoBasicPanel::HeroInfoBasicPanel(const InfoAboutHero & hero, const Point *
|
|||||||
|
|
||||||
if(initializeBackground)
|
if(initializeBackground)
|
||||||
{
|
{
|
||||||
background = std::make_shared<CPicture>(ImagePath::builtin("CHRPOP"));
|
background = std::make_shared<CPicture>(ImagePath::builtin("CHRPOP"), Rect(1, 1, 76, 200), 1, 1);
|
||||||
background->setPlayerColor(hero.owner);
|
background->setPlayerColor(hero.owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ StackInfoBasicPanel::StackInfoBasicPanel(const CStack * stack, bool initializeBa
|
|||||||
|
|
||||||
if(initializeBackground)
|
if(initializeBackground)
|
||||||
{
|
{
|
||||||
background = std::make_shared<CPicture>(ImagePath::builtin("CCRPOP"));
|
background = std::make_shared<CPicture>(ImagePath::builtin("CCRPOP"), Rect(1, 1, 76, 286), 1, 1);
|
||||||
background->pos.y += 37;
|
background->pos.y += 37;
|
||||||
background->setPlayerColor(stack->getOwner());
|
background->setPlayerColor(stack->getOwner());
|
||||||
background2 = std::make_shared<CPicture>(ImagePath::builtin("CHRPOP"));
|
background2 = std::make_shared<CPicture>(ImagePath::builtin("CHRPOP"), Rect(1, 1, 76, 200), 1, 1);
|
||||||
background2->setPlayerColor(stack->getOwner());
|
background2->setPlayerColor(stack->getOwner());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user