mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
[ReplayManager] Refactor to send replayed events through signal (#6979)
* [ReplayManager] Refactor to send replayed events through signal * remove blank * pass by const auto ref
This commit is contained in:
parent
23da49ee5b
commit
20cdcdb382
3 changed files with 7 additions and 2 deletions
|
|
@ -98,8 +98,7 @@ ReplayManager::ReplayManager(TabGame *parent, GameReplay *_replay)
|
|||
|
||||
void ReplayManager::replayNextEvent(EventProcessingOptions options)
|
||||
{
|
||||
game->getGame()->getGameEventHandler()->processGameEventContainer(
|
||||
replay->event_list(timelineWidget->getCurrentEvent()), nullptr, options);
|
||||
emit eventReplayed(replay->event_list(timelineWidget->getCurrentEvent()), options);
|
||||
}
|
||||
|
||||
void ReplayManager::replayFinished()
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
signals:
|
||||
void requestChatAndPhaseReset();
|
||||
void eventReplayed(const GameEventContainer &cont, EventProcessingOptions options);
|
||||
|
||||
private:
|
||||
// Replay related members
|
||||
|
|
|
|||
|
|
@ -1169,6 +1169,11 @@ void TabGame::createReplayDock(GameReplay *replay)
|
|||
QDockWidget::DockWidgetMovable);
|
||||
replayDock->setWidget(replayManager);
|
||||
replayDock->setFloating(false);
|
||||
|
||||
connect(replayManager, &ReplayManager::eventReplayed, game->getGameEventHandler(),
|
||||
[this](const auto &event, auto options) {
|
||||
game->getGameEventHandler()->processGameEventContainer(event, nullptr, options);
|
||||
});
|
||||
}
|
||||
|
||||
void TabGame::createDeckViewContainerWidget(bool bReplay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue