mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
Show correct art on middle mouse popup (#5385)
This commit is contained in:
parent
dec001114a
commit
dad1aea128
13 changed files with 33 additions and 24 deletions
|
|
@ -501,13 +501,14 @@ CardInfoPtr CardDatabase::getCardBySimpleName(const QString &cardName) const
|
|||
return getCardFromMap(simpleNameCards, CardInfo::simplifyName(cardName));
|
||||
}
|
||||
|
||||
CardInfoPtr CardDatabase::guessCard(const QString &cardName) const
|
||||
CardInfoPtr CardDatabase::guessCard(const QString &cardName, const QString &providerId) const
|
||||
{
|
||||
CardInfoPtr temp = getCard(cardName);
|
||||
CardInfoPtr temp = providerId.isEmpty() ? getCard(cardName) : getCardByNameAndProviderId(cardName, providerId);
|
||||
|
||||
if (temp == nullptr) { // get card by simple name instead
|
||||
temp = getCardBySimpleName(cardName);
|
||||
if (temp == nullptr) { // still could not find the card, so simplify the cardName too
|
||||
QString simpleCardName = CardInfo::simplifyName(cardName);
|
||||
const auto &simpleCardName = CardInfo::simplifyName(cardName);
|
||||
temp = getCardBySimpleName(simpleCardName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue