mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -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)
|
void ReplayManager::replayNextEvent(EventProcessingOptions options)
|
||||||
{
|
{
|
||||||
game->getGame()->getGameEventHandler()->processGameEventContainer(
|
emit eventReplayed(replay->event_list(timelineWidget->getCurrentEvent()), options);
|
||||||
replay->event_list(timelineWidget->getCurrentEvent()), nullptr, options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReplayManager::replayFinished()
|
void ReplayManager::replayFinished()
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void requestChatAndPhaseReset();
|
void requestChatAndPhaseReset();
|
||||||
|
void eventReplayed(const GameEventContainer &cont, EventProcessingOptions options);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Replay related members
|
// Replay related members
|
||||||
|
|
|
||||||
|
|
@ -1169,6 +1169,11 @@ void TabGame::createReplayDock(GameReplay *replay)
|
||||||
QDockWidget::DockWidgetMovable);
|
QDockWidget::DockWidgetMovable);
|
||||||
replayDock->setWidget(replayManager);
|
replayDock->setWidget(replayManager);
|
||||||
replayDock->setFloating(false);
|
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)
|
void TabGame::createDeckViewContainerWidget(bool bReplay)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue