mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Use pinned printing when adding to deck. (#6108)
This commit is contained in:
parent
9c18e99fe2
commit
0f11fbe599
2 changed files with 17 additions and 3 deletions
|
|
@ -142,8 +142,7 @@ void DeckEditorDatabaseDisplayWidget::updateCard(const QModelIndex ¤t, con
|
|||
}
|
||||
|
||||
if (!current.model()->hasChildren(current.sibling(current.row(), 0))) {
|
||||
ExactCard card = CardDatabaseManager::getInstance()->getCard({cardName});
|
||||
emit cardChanged(card);
|
||||
emit cardChanged(getCardOrPinnedPrinting(cardName));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +175,21 @@ ExactCard DeckEditorDatabaseDisplayWidget::currentCard() const
|
|||
|
||||
const QString cardName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
|
||||
|
||||
return CardDatabaseManager::getInstance()->getCard({cardName});
|
||||
return getCardOrPinnedPrinting(cardName);
|
||||
}
|
||||
|
||||
ExactCard DeckEditorDatabaseDisplayWidget::getCardOrPinnedPrinting(QString cardName) const
|
||||
{
|
||||
const auto &cardProviderId = SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName);
|
||||
|
||||
ExactCard card = CardDatabaseManager::getInstance()->getCard({cardName});
|
||||
|
||||
if (cardProviderId != "") {
|
||||
return ExactCard(card.getCardPtr(),
|
||||
CardDatabaseManager::getInstance()->getSpecificPrinting({cardName, cardProviderId}));
|
||||
}
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
void DeckEditorDatabaseDisplayWidget::databaseCustomMenu(QPoint point)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
|
||||
public slots:
|
||||
ExactCard currentCard() const;
|
||||
ExactCard getCardOrPinnedPrinting(QString cardName) const;
|
||||
void setFilterTree(FilterTree *filterTree);
|
||||
void clearAllDatabaseFilters();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue