Do not open card reveal windows when skipping in replays (#5157)

* create EventProcessingOption QFlag

* pass EventProcessingOption all the way down

* implement reveal skipping logic
This commit is contained in:
RickyRister 2024-11-08 17:06:23 -08:00 committed by GitHub
parent dd04c610ec
commit e894e78346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 58 additions and 22 deletions

View file

@ -226,6 +226,13 @@ private slots:
void initSayMenu();
public:
enum EventProcessingOption
{
SKIP_REVEAL_WINDOW = 0x0001
};
Q_DECLARE_FLAGS(EventProcessingOptions, EventProcessingOption)
private:
TabGame *game;
QMenu *sbMenu, *countersMenu, *sayMenu, *createPredefinedTokenMenu, *mRevealLibrary, *mLendLibrary, *mRevealTopCard,
@ -332,7 +339,7 @@ private:
void eventDestroyCard(const Event_DestroyCard &event);
void eventAttachCard(const Event_AttachCard &event);
void eventDrawCards(const Event_DrawCards &event);
void eventRevealCards(const Event_RevealCards &event);
void eventRevealCards(const Event_RevealCards &event, EventProcessingOptions options);
void eventChangeZoneProperties(const Event_ChangeZoneProperties &event);
void cmdSetTopCard(Command_MoveCard &cmd);
void cmdSetBottomCard(Command_MoveCard &cmd);
@ -470,7 +477,10 @@ public:
void processPlayerInfo(const ServerInfo_Player &info);
void processCardAttachment(const ServerInfo_Player &info);
void processGameEvent(GameEvent::GameEventType type, const GameEvent &event, const GameEventContext &context);
void processGameEvent(GameEvent::GameEventType type,
const GameEvent &event,
const GameEventContext &context,
EventProcessingOptions options);
PendingCommand *prepareGameCommand(const ::google::protobuf::Message &cmd);
PendingCommand *prepareGameCommand(const QList<const ::google::protobuf::Message *> &cmdList);
@ -480,6 +490,8 @@ public:
void setLastToken(CardInfoPtr cardInfo);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Player::EventProcessingOptions)
class AnnotationDialog : public QInputDialog
{
Q_OBJECT