mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Keep card annotations on stack (#5399)
This commit is contained in:
parent
b2a8748bc6
commit
6e1047032d
6 changed files with 12 additions and 8 deletions
|
|
@ -217,13 +217,15 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
|
|||
}
|
||||
}
|
||||
|
||||
void CardItem::resetState()
|
||||
void CardItem::resetState(bool keepAnnotations)
|
||||
{
|
||||
attacking = false;
|
||||
facedown = false;
|
||||
counters.clear();
|
||||
pt.clear();
|
||||
annotation.clear();
|
||||
if (!keepAnnotations) {
|
||||
annotation.clear();
|
||||
}
|
||||
attachedTo = 0;
|
||||
attachedCards.clear();
|
||||
setTapped(false, false);
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public:
|
|||
{
|
||||
return attachedCards;
|
||||
}
|
||||
void resetState();
|
||||
void resetState(bool keepAnnotations = false);
|
||||
void processCardInfo(const ServerInfo_Card &_info);
|
||||
|
||||
QMenu *getCardMenu() const
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void StackZone::addCardImpl(CardItem *card, int x, int /*y*/)
|
|||
card->setName();
|
||||
}
|
||||
card->setParentItem(this);
|
||||
card->resetState();
|
||||
card->resetState(true);
|
||||
card->setVisible(true);
|
||||
card->update();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,13 +54,15 @@ Server_Card::~Server_Card()
|
|||
}
|
||||
}
|
||||
|
||||
void Server_Card::resetState()
|
||||
void Server_Card::resetState(bool keepAnnotations)
|
||||
{
|
||||
counters.clear();
|
||||
setTapped(false);
|
||||
setAttacking(false);
|
||||
setPT(QString());
|
||||
setAnnotation(QString());
|
||||
if (!keepAnnotations) {
|
||||
setAnnotation(QString());
|
||||
}
|
||||
setDoesntUntap(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public:
|
|||
return oldStashedCard;
|
||||
}
|
||||
|
||||
void resetState();
|
||||
void resetState(bool keepAnnotations = false);
|
||||
QString setAttribute(CardAttribute attribute, const QString &avalue, bool allCards);
|
||||
QString setAttribute(CardAttribute attribute, const QString &avalue, Event_SetCardAttr *event = nullptr);
|
||||
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges,
|
|||
newX = targetzone->getFreeGridColumn(newX, yCoord, card->getName(), faceDown);
|
||||
} else {
|
||||
yCoord = 0;
|
||||
card->resetState();
|
||||
card->resetState(targetzone->getName() == "stack");
|
||||
}
|
||||
|
||||
targetzone->insertCard(card, newX, yCoord);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue