mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-23 10:52:16 -07:00
Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting.
This commit is contained in:
parent
9d1f0e6067
commit
f7fa8521b7
1 changed files with 4 additions and 2 deletions
|
|
@ -1029,6 +1029,7 @@ void TabDeckEditor::actSwapCard()
|
||||||
if (!currentIndex.isValid())
|
if (!currentIndex.isValid())
|
||||||
return;
|
return;
|
||||||
const QString cardName = currentIndex.sibling(currentIndex.row(), 1).data().toString();
|
const QString cardName = currentIndex.sibling(currentIndex.row(), 1).data().toString();
|
||||||
|
const QString cardUUID = currentIndex.sibling(currentIndex.row(), 2).data().toString();
|
||||||
const QModelIndex gparent = currentIndex.parent().parent();
|
const QModelIndex gparent = currentIndex.parent().parent();
|
||||||
|
|
||||||
if (!gparent.isValid())
|
if (!gparent.isValid())
|
||||||
|
|
@ -1038,8 +1039,9 @@ void TabDeckEditor::actSwapCard()
|
||||||
actDecrement();
|
actDecrement();
|
||||||
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
|
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
|
||||||
|
|
||||||
// Third argument (true) says create the card no mater what, even if not in DB
|
// Third argument (true) says create the card no matter what, even if not in DB
|
||||||
QModelIndex newCardIndex = deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
|
QModelIndex newCardIndex = deckModel->addCard(
|
||||||
|
cardName, CardDatabaseManager::getInstance()->getSpecificSetForCard(cardName, cardUUID), otherZoneName, true);
|
||||||
recursiveExpand(newCardIndex);
|
recursiveExpand(newCardIndex);
|
||||||
|
|
||||||
setModified(true);
|
setModified(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue