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

@ -1,6 +1,8 @@
#ifndef REPLAY_TIMELINE_WIDGET
#define REPLAY_TIMELINE_WIDGET
#include "../../game/player/player.h"
#include <QList>
#include <QMouseEvent>
#include <QWidget>
@ -12,11 +14,18 @@ class ReplayTimelineWidget : public QWidget
{
Q_OBJECT
signals:
void processNextEvent();
void processNextEvent(Player::EventProcessingOptions options);
void replayFinished();
void rewound();
private:
enum PlaybackMode
{
NORMAL_PLAYBACK,
FORWARD_SKIP,
BACKWARD_SKIP
};
QTimer *replayTimer;
static constexpr int BASE_REWIND_BUFFERING_TIMEOUT_MS = 180;
static constexpr int MAX_REWIND_BUFFERING_TIMEOUT_MS = 280;
@ -33,7 +42,7 @@ private:
void handleBackwardsSkip(bool doRewindBuffering);
int calcRewindBufferingTimeout() const;
void processRewind();
void processNewEvents();
void processNewEvents(PlaybackMode playbackMode);
private slots:
void replayTimerTimeout();