Cockatrice/cockatrice/src/interface/widgets/replay/replay_widget.h
BruebachL 7b4827dadd
[Replay] Show the history sidebar in replay tabs (#7613)
Add the Game History dock to the left of replay tabs, wire it to the replay timeline, and register it with the View menu and layout reset.

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-11-04 18:26:51 +01:00

69 lines
1.7 KiB
C++

/**
* @file replay_widget.h
* @ingroup Core
* @ingroup Replay
*/
//! \todo Document this file.
#ifndef REPLAY_WIDGET_H
#define REPLAY_WIDGET_H
#include <QList>
#include <QWidget>
#include <libcockatrice/game/player/event_processing_options.h>
#include <qtmetamacros.h>
class ReplayManager;
class ReplayQuickSettingsWidget;
class GameEventContainer;
class GameReplay;
class QAction;
class QToolButton;
class ReplayTimelineWidget;
/**
* @brief The top-level widget that is put in the replay dock widget.
* Contains the replay timeline as well as the buttons.
*/
class ReplayWidget : public QWidget
{
Q_OBJECT
public:
/**
* @param parent The parent widget
* @param replay Cannot be null. Takes ownership of the replay.
*/
ReplayWidget(QWidget *parent, GameReplay *replay);
[[nodiscard]] const QList<int> &getReplayTimeline() const;
/**
* @brief Index of the last replay event the game state has processed, or -1 before the first event.
*/
[[nodiscard]] int getLastProcessedEventIndex() const;
public slots:
void seekToEvent(int eventIndex);
signals:
void rewound();
void timeChanged(int time);
void eventReplayed(const GameEventContainer &cont, EventProcessingOptions options);
private:
ReplayManager *replayManager;
ReplayTimelineWidget *timelineWidget;
QToolButton *replayPlayButton, *replayFastForwardButton;
ReplayQuickSettingsWidget *settingsWidget;
QAction *aReplaySkipForward, *aReplaySkipBackward, *aReplaySkipForwardBig, *aReplaySkipBackwardBig;
private slots:
void replayFinished();
void replayPlayButtonToggled(bool checked);
void updateTimeScaleFactor(bool checked);
void refreshShortcuts();
};
#endif // REPLAY_WIDGET_H