mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
removed unused param; optimized pos
This commit is contained in:
parent
36881c226f
commit
7ddc87f4a2
@ -449,12 +449,10 @@ void HeroInfoBasicPanel::show(Canvas & to)
|
||||
}
|
||||
|
||||
|
||||
StackInfoBasicPanel::StackInfoBasicPanel(const CStack * stack, Point * position, bool initializeBackground)
|
||||
StackInfoBasicPanel::StackInfoBasicPanel(const CStack * stack, bool initializeBackground)
|
||||
: CIntObject(0)
|
||||
{
|
||||
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
||||
if (position != nullptr)
|
||||
moveTo(*position);
|
||||
|
||||
if(initializeBackground)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ private:
|
||||
std::vector<std::shared_ptr<CMultiLineLabel>> labelsMultiline;
|
||||
std::vector<std::shared_ptr<CAnimImage>> icons;
|
||||
public:
|
||||
StackInfoBasicPanel(const CStack * stack, Point * position, bool initializeBackground = true);
|
||||
StackInfoBasicPanel(const CStack * stack, bool initializeBackground = true);
|
||||
|
||||
void show(Canvas & to) override;
|
||||
|
||||
|
@ -298,15 +298,15 @@ void BattleWindow::setPositionInfoWindow()
|
||||
if(defenderStackWindow)
|
||||
{
|
||||
Point position = (GH.screenDimensions().x >= 1000)
|
||||
? Point(pos.x + pos.w + 15, defenderHeroWindow ? defenderHeroWindow->pos.y + 210 : pos.y)
|
||||
: Point(pos.x + pos.w -79, defenderHeroWindow ? defenderHeroWindow->pos.y : pos.y + 135);
|
||||
? Point(pos.x + pos.w + 15, defenderHeroWindow ? defenderHeroWindow->pos.y + 210 : pos.y + 60)
|
||||
: Point(pos.x + pos.w -79, defenderHeroWindow ? defenderHeroWindow->pos.y : pos.y + 195);
|
||||
defenderStackWindow->moveTo(position);
|
||||
}
|
||||
if(attackerStackWindow)
|
||||
{
|
||||
Point position = (GH.screenDimensions().x >= 1000)
|
||||
? Point(pos.x - 93, attackerHeroWindow ? attackerHeroWindow->pos.y + 210 : pos.y)
|
||||
: Point(pos.x + 1, attackerHeroWindow ? attackerHeroWindow->pos.y : pos.y + 135);
|
||||
? Point(pos.x - 93, attackerHeroWindow ? attackerHeroWindow->pos.y + 210 : pos.y + 60)
|
||||
: Point(pos.x + 1, attackerHeroWindow ? attackerHeroWindow->pos.y : pos.y + 195);
|
||||
attackerStackWindow->moveTo(position);
|
||||
}
|
||||
}
|
||||
@ -325,7 +325,7 @@ void BattleWindow::updateStackInfoWindow(const CStack * stack)
|
||||
|
||||
if(stack && stack->unitSide() == BattleSide::DEFENDER)
|
||||
{
|
||||
defenderStackWindow = std::make_shared<StackInfoBasicPanel>(stack, nullptr);
|
||||
defenderStackWindow = std::make_shared<StackInfoBasicPanel>(stack);
|
||||
defenderStackWindow->setEnabled(showInfoWindows);
|
||||
}
|
||||
else
|
||||
@ -333,7 +333,7 @@ void BattleWindow::updateStackInfoWindow(const CStack * stack)
|
||||
|
||||
if(stack && stack->unitSide() == BattleSide::ATTACKER)
|
||||
{
|
||||
attackerStackWindow = std::make_shared<StackInfoBasicPanel>(stack, nullptr);
|
||||
attackerStackWindow = std::make_shared<StackInfoBasicPanel>(stack);
|
||||
attackerStackWindow->setEnabled(showInfoWindows);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user