mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44: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
|
|
@ -296,7 +296,7 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
if (event->button() == Qt::LeftButton)
|
||||
setCursor(Qt::ClosedHandCursor);
|
||||
else if (event->button() == Qt::MiddleButton)
|
||||
emit showCardInfoPopup(event->screenPos(), name);
|
||||
emit showCardInfoPopup(event->screenPos(), name, providerId);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ private slots:
|
|||
}
|
||||
signals:
|
||||
void hovered(AbstractCardItem *card);
|
||||
void showCardInfoPopup(QPoint pos, QString cardName);
|
||||
void showCardInfoPopup(const QPoint &pos, const QString &cardName, const QString &providerId);
|
||||
void deleteCardInfoPopup(QString cardName);
|
||||
void sigPixmapUpdated();
|
||||
void cardShiftClicked(QString cardName);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ public:
|
|||
[[nodiscard]] CardInfoPerSet getPreferredSetForCard(const QString &cardName) const;
|
||||
[[nodiscard]] CardInfoPerSet getSpecificSetForCard(const QString &cardName, const QString &providerId) const;
|
||||
QString getPreferredPrintingProviderIdForCard(const QString &cardName);
|
||||
[[nodiscard]] CardInfoPtr guessCard(const QString &cardName) const;
|
||||
[[nodiscard]] CardInfoPtr guessCard(const QString &cardName, const QString &providerId = QString()) const;
|
||||
|
||||
/*
|
||||
* Get a card by its simple name. The name will be simplified in this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue