diff --git a/cockatrice/src/client/network/replay_timeline_widget.cpp b/cockatrice/src/client/network/replay_timeline_widget.cpp index 83b1abda0..deb77d623 100644 --- a/cockatrice/src/client/network/replay_timeline_widget.cpp +++ b/cockatrice/src/client/network/replay_timeline_widget.cpp @@ -162,6 +162,10 @@ void ReplayTimelineWidget::processNewEvents(PlaybackMode playbackMode) if (playbackMode == BACKWARD_SKIP || currentTime - replayTimeline[currentEvent] > BIG_SKIP_MS) options |= Player::EventProcessingOption::SKIP_REVEAL_WINDOW; + // backwards skip => always skip tap animation + if (playbackMode == BACKWARD_SKIP) + options |= Player::EventProcessingOption::SKIP_TAP_ANIMATION; + emit processNextEvent(options); ++currentEvent; } diff --git a/cockatrice/src/game/player/player.cpp b/cockatrice/src/game/player/player.cpp index dd98305ff..71402fc61 100644 --- a/cockatrice/src/game/player/player.cpp +++ b/cockatrice/src/game/player/player.cpp @@ -1893,7 +1893,8 @@ void Player::setCardAttrHelper(const GameEventContext &context, CardItem *card, CardAttribute attribute, const QString &avalue, - bool allCards) + bool allCards, + EventProcessingOptions options) { if (card == nullptr) { return; @@ -1907,7 +1908,8 @@ void Player::setCardAttrHelper(const GameEventContext &context, if (!allCards) { emit logSetTapped(this, card, tapped); } - card->setTapped(tapped, !moveCardContext); + bool canAnimate = !options.testFlag(SKIP_TAP_ANIMATION) && !moveCardContext; + card->setTapped(tapped, canAnimate); } break; } @@ -2049,7 +2051,9 @@ void Player::eventCreateToken(const Event_CreateToken &event) zone->addCard(card, true, event.x(), event.y()); } -void Player::eventSetCardAttr(const Event_SetCardAttr &event, const GameEventContext &context) +void Player::eventSetCardAttr(const Event_SetCardAttr &event, + const GameEventContext &context, + EventProcessingOptions options) { CardZone *zone = zones.value(QString::fromStdString(event.zone_name()), 0); if (!zone) { @@ -2059,8 +2063,8 @@ void Player::eventSetCardAttr(const Event_SetCardAttr &event, const GameEventCon if (!event.has_card_id()) { const CardList &cards = zone->getCards(); for (int i = 0; i < cards.size(); ++i) { - setCardAttrHelper(context, cards.at(i), event.attribute(), QString::fromStdString(event.attr_value()), - true); + setCardAttrHelper(context, cards.at(i), event.attribute(), QString::fromStdString(event.attr_value()), true, + options); } if (event.attribute() == AttrTapped) { emit logSetTapped(this, nullptr, event.attr_value() == "1"); @@ -2071,7 +2075,7 @@ void Player::eventSetCardAttr(const Event_SetCardAttr &event, const GameEventCon qWarning() << "Player::eventSetCardAttr: card id=" << event.card_id() << "not found"; return; } - setCardAttrHelper(context, card, event.attribute(), QString::fromStdString(event.attr_value()), false); + setCardAttrHelper(context, card, event.attribute(), QString::fromStdString(event.attr_value()), false, options); } } @@ -2444,7 +2448,7 @@ void Player::processGameEvent(GameEvent::GameEventType type, eventCreateToken(event.GetExtension(Event_CreateToken::ext)); break; case GameEvent::SET_CARD_ATTR: - eventSetCardAttr(event.GetExtension(Event_SetCardAttr::ext), context); + eventSetCardAttr(event.GetExtension(Event_SetCardAttr::ext), context, options); break; case GameEvent::SET_CARD_COUNTER: eventSetCardCounter(event.GetExtension(Event_SetCardCounter::ext)); diff --git a/cockatrice/src/game/player/player.h b/cockatrice/src/game/player/player.h index 832e613b7..5aecaa932 100644 --- a/cockatrice/src/game/player/player.h +++ b/cockatrice/src/game/player/player.h @@ -229,7 +229,8 @@ private slots: public: enum EventProcessingOption { - SKIP_REVEAL_WINDOW = 0x0001 + SKIP_REVEAL_WINDOW = 0x0001, + SKIP_TAP_ANIMATION = 0x0002 }; Q_DECLARE_FLAGS(EventProcessingOptions, EventProcessingOption) @@ -301,7 +302,8 @@ private: CardItem *card, CardAttribute attribute, const QString &avalue, - bool allCards); + bool allCards, + EventProcessingOptions options); void addRelatedCardActions(const CardItem *card, QMenu *cardMenu); void addRelatedCardView(const CardItem *card, QMenu *cardMenu); void createCard(const CardItem *sourceCard, @@ -328,7 +330,8 @@ private: void eventCreateArrow(const Event_CreateArrow &event); void eventDeleteArrow(const Event_DeleteArrow &event); void eventCreateToken(const Event_CreateToken &event); - void eventSetCardAttr(const Event_SetCardAttr &event, const GameEventContext &context); + void + eventSetCardAttr(const Event_SetCardAttr &event, const GameEventContext &context, EventProcessingOptions options); void eventSetCardCounter(const Event_SetCardCounter &event); void eventCreateCounter(const Event_CreateCounter &event); void eventSetCounter(const Event_SetCounter &event);