mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Show stacks selected to sacrifice
This commit is contained in:
parent
137b9cde19
commit
886c8f63c6
@ -1316,10 +1316,28 @@ void CAltarWindow::selectionChanged(bool side)
|
|||||||
slider->block(!slider->getAmount());
|
slider->block(!slider->getAmount());
|
||||||
slider->moveTo(sacrificedUnits[hLeft->serial]);
|
slider->moveTo(sacrificedUnits[hLeft->serial]);
|
||||||
max->block(!slider->getAmount());
|
max->block(!slider->getAmount());
|
||||||
|
selectOppositeItem(side);
|
||||||
readyToTrade = true;
|
readyToTrade = true;
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAltarWindow::selectOppositeItem(bool side)
|
||||||
|
{
|
||||||
|
bool oppositeSide = !side;
|
||||||
|
int pos = vstd::find_pos(items[side], side ? hLeft : hRight);
|
||||||
|
int oppositePos = vstd::find_pos(items[oppositeSide], oppositeSide ? hLeft : hRight);
|
||||||
|
|
||||||
|
if(pos >= 0 && pos != oppositePos)
|
||||||
|
{
|
||||||
|
if(oppositeSide)
|
||||||
|
hLeft = items[oppositeSide][pos];
|
||||||
|
else
|
||||||
|
hRight = items[oppositeSide][pos];
|
||||||
|
|
||||||
|
selectionChanged(oppositeSide);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CAltarWindow::mimicCres()
|
void CAltarWindow::mimicCres()
|
||||||
{
|
{
|
||||||
std::vector<Rect> positions;
|
std::vector<Rect> positions;
|
||||||
|
@ -141,6 +141,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
void selectionChanged(bool side) override; //true == left
|
void selectionChanged(bool side) override; //true == left
|
||||||
|
void selectOppositeItem(bool side);
|
||||||
void SacrificeAll();
|
void SacrificeAll();
|
||||||
void SacrificeBackpack();
|
void SacrificeBackpack();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user