mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
[Refactor] Move attach and arrow previews from game logic into CardMenu
This commit is contained in:
parent
e34166ae85
commit
86e08db9ff
8 changed files with 28 additions and 30 deletions
|
|
@ -1417,14 +1417,6 @@ void PlayerActions::actSetPT(QList<CardItem *> selectedCards, const QString &pt)
|
|||
player->getGame()->getGameEventHandler()->sendGameCommand(prepareGameCommand(commandList), playerid);
|
||||
}
|
||||
|
||||
void PlayerActions::actDrawArrow()
|
||||
{
|
||||
auto *card = player->getGame()->getActiveCard();
|
||||
if (card) {
|
||||
card->drawArrow(Qt::red);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerActions::actIncP(QList<CardItem *> selectedCards)
|
||||
{
|
||||
actIncPT(selectedCards, 1, 0);
|
||||
|
|
@ -1516,16 +1508,6 @@ void PlayerActions::actSetAnnotation(QList<CardItem *> selectedCards, const QStr
|
|||
sendGameCommand(prepareGameCommand(commandList));
|
||||
}
|
||||
|
||||
void PlayerActions::actAttach()
|
||||
{
|
||||
auto *card = player->getGame()->getActiveCard();
|
||||
if (!card) {
|
||||
return;
|
||||
}
|
||||
|
||||
card->drawAttachArrow();
|
||||
}
|
||||
|
||||
void PlayerActions::actUnattach(QList<CardItem *> selectedCards)
|
||||
{
|
||||
QList<const ::google::protobuf::Message *> commandList;
|
||||
|
|
|
|||
|
|
@ -197,9 +197,7 @@ public slots:
|
|||
void actRequestSetCardCounterDialog(QList<CardItem *> selectedCards, int counterId);
|
||||
void actSetCardCounter(QList<CardItem *> selectedCards, int counterId, const QString &counterValue);
|
||||
void actIncrementAllCardCounters(QList<CardItem *> cardsToUpdate);
|
||||
void actAttach();
|
||||
void actUnattach(QList<CardItem *> selectedCards);
|
||||
void actDrawArrow();
|
||||
void actIncPT(QList<CardItem *> selectedCards, int deltaP, int deltaT);
|
||||
void actResetPT(QList<CardItem *> selectedCards);
|
||||
void actRequestSetPTDialog(QList<CardItem *> selectedCards);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ signals:
|
|||
/** @} */
|
||||
|
||||
void cardZoneChanged(CardItem *card, bool sameZone);
|
||||
void requestCardMenuUpdate(const CardItem *card);
|
||||
void requestCardMenuUpdate(CardItem *card);
|
||||
|
||||
private:
|
||||
/** Owning player instance. */
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ signals:
|
|||
/** @brief Emitted when the remote playmat (card/params) is updated from player properties. */
|
||||
void playmatChanged();
|
||||
void newCardAdded(AbstractCardItem *card);
|
||||
void requestCardMenuUpdate(const CardItem *card);
|
||||
void requestCardMenuUpdate(CardItem *card);
|
||||
void counterAdded(CounterState *state);
|
||||
void counterRemoved(int counterId);
|
||||
void rearrangeCounters();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue