mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 01:53:54 -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;
|
attacking = false;
|
||||||
facedown = false;
|
facedown = false;
|
||||||
counters.clear();
|
counters.clear();
|
||||||
pt.clear();
|
pt.clear();
|
||||||
annotation.clear();
|
if (!keepAnnotations) {
|
||||||
|
annotation.clear();
|
||||||
|
}
|
||||||
attachedTo = 0;
|
attachedTo = 0;
|
||||||
attachedCards.clear();
|
attachedCards.clear();
|
||||||
setTapped(false, false);
|
setTapped(false, false);
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ public:
|
||||||
{
|
{
|
||||||
return attachedCards;
|
return attachedCards;
|
||||||
}
|
}
|
||||||
void resetState();
|
void resetState(bool keepAnnotations = false);
|
||||||
void processCardInfo(const ServerInfo_Card &_info);
|
void processCardInfo(const ServerInfo_Card &_info);
|
||||||
|
|
||||||
QMenu *getCardMenu() const
|
QMenu *getCardMenu() const
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ void StackZone::addCardImpl(CardItem *card, int x, int /*y*/)
|
||||||
card->setName();
|
card->setName();
|
||||||
}
|
}
|
||||||
card->setParentItem(this);
|
card->setParentItem(this);
|
||||||
card->resetState();
|
card->resetState(true);
|
||||||
card->setVisible(true);
|
card->setVisible(true);
|
||||||
card->update();
|
card->update();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,15 @@ Server_Card::~Server_Card()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server_Card::resetState()
|
void Server_Card::resetState(bool keepAnnotations)
|
||||||
{
|
{
|
||||||
counters.clear();
|
counters.clear();
|
||||||
setTapped(false);
|
setTapped(false);
|
||||||
setAttacking(false);
|
setAttacking(false);
|
||||||
setPT(QString());
|
setPT(QString());
|
||||||
setAnnotation(QString());
|
if (!keepAnnotations) {
|
||||||
|
setAnnotation(QString());
|
||||||
|
}
|
||||||
setDoesntUntap(false);
|
setDoesntUntap(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ public:
|
||||||
return oldStashedCard;
|
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, bool allCards);
|
||||||
QString setAttribute(CardAttribute attribute, const QString &avalue, Event_SetCardAttr *event = nullptr);
|
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);
|
newX = targetzone->getFreeGridColumn(newX, yCoord, card->getName(), faceDown);
|
||||||
} else {
|
} else {
|
||||||
yCoord = 0;
|
yCoord = 0;
|
||||||
card->resetState();
|
card->resetState(targetzone->getName() == "stack");
|
||||||
}
|
}
|
||||||
|
|
||||||
targetzone->insertCard(card, newX, yCoord);
|
targetzone->insertCard(card, newX, yCoord);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue