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

@ -614,9 +614,9 @@ void TabGame::closeRequest()
actLeaveGame();
}
void TabGame::replayNextEvent()
void TabGame::replayNextEvent(Player::EventProcessingOptions options)
{
processGameEventContainer(replay->event_list(timelineWidget->getCurrentEvent()), nullptr);
processGameEventContainer(replay->event_list(timelineWidget->getCurrentEvent()), nullptr, options);
}
void TabGame::replayFinished()
@ -862,7 +862,9 @@ Player *TabGame::addPlayer(int playerId, const ServerInfo_User &info)
return newPlayer;
}
void TabGame::processGameEventContainer(const GameEventContainer &cont, AbstractClient *client)
void TabGame::processGameEventContainer(const GameEventContainer &cont,
AbstractClient *client,
Player::EventProcessingOptions options)
{
const GameEventContext &context = cont.context();
messageLog->containerProcessingStarted(context);
@ -937,7 +939,7 @@ void TabGame::processGameEventContainer(const GameEventContainer &cont, Abstract
qDebug() << "unhandled game event: invalid player id";
break;
}
player->processGameEvent(eventType, event, context);
player->processGameEvent(eventType, event, context, options);
emitUserEvent();
}
}
@ -1731,7 +1733,8 @@ void TabGame::createReplayDock()
// timeline widget
timelineWidget = new ReplayTimelineWidget;
timelineWidget->setTimeline(replayTimeline);
connect(timelineWidget, SIGNAL(processNextEvent()), this, SLOT(replayNextEvent()));
connect(timelineWidget, SIGNAL(processNextEvent(Player::EventProcessingOptions)), this,
SLOT(replayNextEvent(Player::EventProcessingOptions)));
connect(timelineWidget, SIGNAL(replayFinished()), this, SLOT(replayFinished()));
connect(timelineWidget, &ReplayTimelineWidget::rewound, this, &TabGame::replayRewind);