mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
Remember how many cards were originally in deck when replacing with uuid version.
This commit is contained in:
parent
7f22d48a5e
commit
7bc34619c1
1 changed files with 6 additions and 0 deletions
|
|
@ -91,6 +91,12 @@ void CardAmountWidget::addPrinting(const QString &zone)
|
|||
recursiveExpand(newCardIndex);
|
||||
QModelIndex find_card = deckModel->findCard(rootCard->getName(), zone);
|
||||
if (find_card.isValid() && find_card != newCardIndex) {
|
||||
auto amount = deckModel->data(find_card, Qt::DisplayRole);
|
||||
if (amount.toInt() > 1) {
|
||||
for (int i = 0; i < amount.toInt() - 1; i++) {
|
||||
deckModel->addCard(rootCard->getName(), setInfoForCard, zone);
|
||||
}
|
||||
}
|
||||
deckModel->removeRow(find_card.row(), find_card.parent());
|
||||
};
|
||||
newCardIndex = deckModel->findCard(rootCard->getName(), zone, setInfoForCard.getProperty("uuid"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue