mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Attach and Unattach apply to entire selection (#4651)
* (un)attach applies to entire selection * additional code formatting, just because it's nicer Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
a2624e36f3
commit
b5305aa5e4
5 changed files with 72 additions and 29 deletions
|
|
@ -3186,9 +3186,7 @@ void Player::actAttach()
|
|||
return;
|
||||
}
|
||||
|
||||
auto *arrow = new ArrowAttachItem(card);
|
||||
scene()->addItem(arrow);
|
||||
arrow->grabMouse();
|
||||
card->drawAttachArrow();
|
||||
}
|
||||
|
||||
void Player::actUnattach()
|
||||
|
|
@ -3197,10 +3195,15 @@ void Player::actUnattach()
|
|||
return;
|
||||
}
|
||||
|
||||
Command_AttachCard cmd;
|
||||
cmd.set_start_zone(game->getActiveCard()->getZone()->getName().toStdString());
|
||||
cmd.set_card_id(game->getActiveCard()->getId());
|
||||
sendGameCommand(cmd);
|
||||
QList<const ::google::protobuf::Message *> commandList;
|
||||
for (QGraphicsItem *item : scene()->selectedItems()) {
|
||||
auto *card = static_cast<CardItem *>(item);
|
||||
auto *cmd = new Command_AttachCard;
|
||||
cmd->set_start_zone(card->getZone()->getName().toStdString());
|
||||
cmd->set_card_id(card->getId());
|
||||
commandList.append(cmd);
|
||||
}
|
||||
sendGameCommand(prepareGameCommand(commandList));
|
||||
}
|
||||
|
||||
void Player::actCardCounterTrigger()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue