mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
Add keybaord shortcut for creating related cards (#2426)
* Extract createCard from actCreateRelatedCard * Merge related cards and reverse related cards before handling * Add "Create all related cards" action to a card * Stop displaying all related tokens if only one token is available * Add shortcut for Creating all tokens related to selected card * Extract method for adding related card actions * Prefer foreach to index based iteration * Guard against null cards, card menus, or cardInfos * Remove QRegExp dependency from commonly depended header
This commit is contained in:
parent
c0e7d0c7c7
commit
b9cd942308
4 changed files with 114 additions and 53 deletions
|
|
@ -141,6 +141,7 @@ private slots:
|
|||
void actOpenDeckInDeckEditor();
|
||||
void actCreatePredefinedToken();
|
||||
void actCreateRelatedCard();
|
||||
void actCreateAllRelatedCards();
|
||||
void cardMenuAction();
|
||||
void actCardCounterTrigger();
|
||||
void actAttach();
|
||||
|
|
@ -209,6 +210,9 @@ private:
|
|||
PlayerTarget *playerTarget;
|
||||
|
||||
void setCardAttrHelper(const GameEventContext &context, CardItem *card, CardAttribute attribute, const QString &avalue, bool allCards);
|
||||
void addRelatedCardActions(const CardItem *card, QMenu *cardMenu);
|
||||
void createCard(const CardItem *sourceCard, const QString &dbCardName);
|
||||
QString dbNameFromTokenDisplayName(const QString &tokenName);
|
||||
|
||||
QRectF bRect;
|
||||
|
||||
|
|
@ -281,7 +285,7 @@ public:
|
|||
const QMap<int, ArrowItem *> &getArrows() const { return arrows; }
|
||||
void setCardMenu(QMenu *menu);
|
||||
QMenu *getCardMenu() const;
|
||||
void updateCardMenu(CardItem *card);
|
||||
void updateCardMenu(const CardItem *card);
|
||||
bool getActive() const { return active; }
|
||||
void setActive(bool _active);
|
||||
void setShortcutsActive();
|
||||
|
|
@ -306,6 +310,7 @@ public:
|
|||
PendingCommand *prepareGameCommand(const QList< const ::google::protobuf::Message * > &cmdList);
|
||||
void sendGameCommand(PendingCommand *pend);
|
||||
void sendGameCommand(const google::protobuf::Message &command);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue