mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +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->moveTo(sacrificedUnits[hLeft->serial]);
|
||||
max->block(!slider->getAmount());
|
||||
selectOppositeItem(side);
|
||||
readyToTrade = true;
|
||||
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()
|
||||
{
|
||||
std::vector<Rect> positions;
|
||||
|
@ -141,6 +141,7 @@ public:
|
||||
|
||||
|
||||
void selectionChanged(bool side) override; //true == left
|
||||
void selectOppositeItem(bool side);
|
||||
void SacrificeAll();
|
||||
void SacrificeBackpack();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user