mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Allow tokens to consider providerIds. (#6075)
Tokens created through Ctrl + T use the pinned printing, if available. Tokens created through a related card menu use a token from the same set, if available. Took 2 hours 25 minutes Took 10 seconds Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
3a42354efd
commit
f2cbdae829
5 changed files with 36 additions and 9 deletions
|
|
@ -198,7 +198,16 @@ void DlgCreateToken::tokenSelectionChanged(const QModelIndex ¤t, const QMo
|
|||
annotationEdit->setText("");
|
||||
}
|
||||
|
||||
pic->setCard(CardDatabaseManager::getInstance()->getPreferredCard(cardInfo));
|
||||
const auto &cardProviderId =
|
||||
SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardInfo->getName());
|
||||
if (!cardProviderId.isEmpty()) {
|
||||
CardRef ref;
|
||||
ref.name = cardInfo->getName();
|
||||
ref.providerId = cardProviderId;
|
||||
pic->setCard(CardDatabaseManager::getInstance()->getCard(ref));
|
||||
} else {
|
||||
pic->setCard(CardDatabaseManager::getInstance()->getPreferredCard(cardInfo));
|
||||
}
|
||||
}
|
||||
|
||||
void DlgCreateToken::updateSearchFieldWithoutUpdatingFilter(const QString &newValue) const
|
||||
|
|
@ -250,5 +259,6 @@ TokenInfo DlgCreateToken::getTokenInfo() const
|
|||
.pt = ptEdit->text(),
|
||||
.annotation = annotationEdit->text(),
|
||||
.destroy = destroyCheckBox->isChecked(),
|
||||
.faceDown = faceDownCheckBox->isChecked()};
|
||||
.faceDown = faceDownCheckBox->isChecked(),
|
||||
.providerId = SettingsCache::instance().cardOverrides().getCardPreferenceOverride(nameEdit->text())};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue