mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
Formatting.
This commit is contained in:
parent
c2926037fc
commit
766f02149b
8 changed files with 21 additions and 17 deletions
|
|
@ -505,8 +505,8 @@ private:
|
||||||
parseSequenceString("Alt+U"),
|
parseSequenceString("Alt+U"),
|
||||||
ShortcutGroup::Playing_Area)},
|
ShortcutGroup::Playing_Area)},
|
||||||
{"Player/aDoesntUntapOnce", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Toggle Skip Untapping (One Turn)"),
|
{"Player/aDoesntUntapOnce", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Toggle Skip Untapping (One Turn)"),
|
||||||
parseSequenceString(""),
|
parseSequenceString(""),
|
||||||
ShortcutGroup::Playing_Area)},
|
ShortcutGroup::Playing_Area)},
|
||||||
{"Player/aFlip", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Turn Card Over"),
|
{"Player/aFlip", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Turn Card Over"),
|
||||||
parseSequenceString("Alt+F"),
|
parseSequenceString("Alt+F"),
|
||||||
ShortcutGroup::Playing_Area)},
|
ShortcutGroup::Playing_Area)},
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,12 @@ void CardState::setDoesntUntap(bool _doesntUntap)
|
||||||
|
|
||||||
void CardState::setDoesntUntapOnce(bool _doesntUntapOnce)
|
void CardState::setDoesntUntapOnce(bool _doesntUntapOnce)
|
||||||
{
|
{
|
||||||
if (doesntUntapOnce == _doesntUntapOnce) {
|
if (doesntUntapOnce == _doesntUntapOnce) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
doesntUntapOnce = _doesntUntapOnce;
|
doesntUntapOnce = _doesntUntapOnce;
|
||||||
emit doesntUntapOnceChanged(_doesntUntapOnce);
|
emit doesntUntapOnceChanged(_doesntUntapOnce);
|
||||||
emit stateChanged();
|
emit stateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardState::setDestroyOnZoneChange(bool _destroyOnZoneChange)
|
void CardState::setDestroyOnZoneChange(bool _destroyOnZoneChange)
|
||||||
|
|
|
||||||
|
|
@ -199,15 +199,16 @@ void PlayerEventHandler::setCardAttrHelper(const GameEventContext &context,
|
||||||
switch (attribute) {
|
switch (attribute) {
|
||||||
case AttrTapped: {
|
case AttrTapped: {
|
||||||
bool tapped = avalue == "1";
|
bool tapped = avalue == "1";
|
||||||
if (!(!tapped && card->getDoesntUntap() && allCards) && !(!tapped && card->getDoesntUntapOnce() && allCards)) {
|
if (!(!tapped && card->getDoesntUntap() && allCards) &&
|
||||||
|
!(!tapped && card->getDoesntUntapOnce() && allCards)) {
|
||||||
if (!allCards) {
|
if (!allCards) {
|
||||||
emit logSetTapped(player, card, tapped);
|
emit logSetTapped(player, card, tapped);
|
||||||
}
|
}
|
||||||
bool canAnimate = !options.testFlag(SKIP_TAP_ANIMATION) && !moveCardContext;
|
bool canAnimate = !options.testFlag(SKIP_TAP_ANIMATION) && !moveCardContext;
|
||||||
card->setTapped(tapped, canAnimate);
|
card->setTapped(tapped, canAnimate);
|
||||||
} else if (!tapped && card->getDoesntUntapOnce() && allCards) {
|
} else if (!tapped && card->getDoesntUntapOnce() && allCards) {
|
||||||
card->setDoesntUntapOnce(false);
|
card->setDoesntUntapOnce(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AttrAttacking: {
|
case AttrAttacking: {
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ void CardItem::resetState(bool keepAnnotations)
|
||||||
attachedCards.clear();
|
attachedCards.clear();
|
||||||
setTapped(false, false);
|
setTapped(false, false);
|
||||||
setDoesntUntap(false);
|
setDoesntUntap(false);
|
||||||
setDoesntUntapOnce(false);
|
setDoesntUntapOnce(false);
|
||||||
if (scene()) {
|
if (scene()) {
|
||||||
static_cast<GameScene *>(scene())->unregisterAnimationItem(this);
|
static_cast<GameScene *>(scene())->unregisterAnimationItem(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -848,7 +848,8 @@ void MessageLogWidget::connectToPlayerEventHandler(PlayerEventHandler *playerEve
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetCardCounter, this, &MessageLogWidget::logSetCardCounter);
|
connect(playerEventHandler, &PlayerEventHandler::logSetCardCounter, this, &MessageLogWidget::logSetCardCounter);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetTapped, this, &MessageLogWidget::logSetTapped);
|
connect(playerEventHandler, &PlayerEventHandler::logSetTapped, this, &MessageLogWidget::logSetTapped);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetDoesntUntap, this, &MessageLogWidget::logSetDoesntUntap);
|
connect(playerEventHandler, &PlayerEventHandler::logSetDoesntUntap, this, &MessageLogWidget::logSetDoesntUntap);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetDoesntUntapOnce, this, &MessageLogWidget::logSetDoesntUntapOnce);
|
connect(playerEventHandler, &PlayerEventHandler::logSetDoesntUntapOnce, this,
|
||||||
|
&MessageLogWidget::logSetDoesntUntapOnce);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetPT, this, &MessageLogWidget::logSetPT);
|
connect(playerEventHandler, &PlayerEventHandler::logSetPT, this, &MessageLogWidget::logSetPT);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logSetAnnotation, this, &MessageLogWidget::logSetAnnotation);
|
connect(playerEventHandler, &PlayerEventHandler::logSetAnnotation, this, &MessageLogWidget::logSetAnnotation);
|
||||||
connect(playerEventHandler, &PlayerEventHandler::logMoveCard, this, &MessageLogWidget::logMoveCard);
|
connect(playerEventHandler, &PlayerEventHandler::logMoveCard, this, &MessageLogWidget::logMoveCard);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ CardMenu::CardMenu(PlayerGraphicsItem *_player, const CardItem *_card, bool _sho
|
||||||
// Actions using invoke (type dispatch, need selection)
|
// Actions using invoke (type dispatch, need selection)
|
||||||
aTap = makeAction(this, invoke(cmTap));
|
aTap = makeAction(this, invoke(cmTap));
|
||||||
aDoesntUntap = makeAction(this, invoke(cmDoesntUntap), /*checkable=*/true, card && card->getDoesntUntap());
|
aDoesntUntap = makeAction(this, invoke(cmDoesntUntap), /*checkable=*/true, card && card->getDoesntUntap());
|
||||||
aDoesntUntapOnce = makeAction(this, invoke(cmDoesntUntapOnce), /*checkable=*/true, card && card->getDoesntUntapOnce());
|
aDoesntUntapOnce =
|
||||||
|
makeAction(this, invoke(cmDoesntUntapOnce), /*checkable=*/true, card && card->getDoesntUntapOnce());
|
||||||
aFlip = makeAction(this, invoke(cmFlip));
|
aFlip = makeAction(this, invoke(cmFlip));
|
||||||
aPeek = makeAction(this, invoke(cmPeek));
|
aPeek = makeAction(this, invoke(cmPeek));
|
||||||
aClone = makeAction(this, invoke(cmClone));
|
aClone = makeAction(this, invoke(cmClone));
|
||||||
|
|
|
||||||
|
|
@ -1550,7 +1550,7 @@ Server_AbstractPlayer::cmdRevealCards(const Command_RevealCards &cmd, ResponseCo
|
||||||
cardInfo->set_annotation(card->getAnnotation().toStdString());
|
cardInfo->set_annotation(card->getAnnotation().toStdString());
|
||||||
cardInfo->set_destroy_on_zone_change(card->getDestroyOnZoneChange());
|
cardInfo->set_destroy_on_zone_change(card->getDestroyOnZoneChange());
|
||||||
cardInfo->set_doesnt_untap(card->getDoesntUntap());
|
cardInfo->set_doesnt_untap(card->getDoesntUntap());
|
||||||
cardInfo->set_doesnt_untap_once(card->getDoesntUntapOnce());
|
cardInfo->set_doesnt_untap_once(card->getDoesntUntapOnce());
|
||||||
|
|
||||||
QMapIterator<int, int> cardCounterIterator(card->getCounters());
|
QMapIterator<int, int> cardCounterIterator(card->getCounters());
|
||||||
while (cardCounterIterator.hasNext()) {
|
while (cardCounterIterator.hasNext()) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
|
Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone)
|
||||||
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false),
|
: zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false),
|
||||||
facedown(false), destroyOnZoneChange(false), doesntUntap(false), doesntUntapOnce(false), parentCard(0), stashedCard(nullptr)
|
facedown(false), destroyOnZoneChange(false), doesntUntap(false), doesntUntapOnce(false), parentCard(0),
|
||||||
|
stashedCard(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,7 +69,7 @@ void Server_Card::resetState(bool keepAnnotations)
|
||||||
QString Server_Card::setAttribute(CardAttribute attribute, const QString &avalue, bool allCards)
|
QString Server_Card::setAttribute(CardAttribute attribute, const QString &avalue, bool allCards)
|
||||||
{
|
{
|
||||||
if (attribute == AttrTapped && avalue != "1" && allCards && doesntUntapOnce) {
|
if (attribute == AttrTapped && avalue != "1" && allCards && doesntUntapOnce) {
|
||||||
setDoesntUntapOnce(false);
|
setDoesntUntapOnce(false);
|
||||||
return QVariant(tapped).toString();
|
return QVariant(tapped).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue