[Replay] Fix cards accumulating in zone view when rewinding (#7357)

* [Replay] Fix cards accumulating in zone view when rewinding

* rename method
This commit is contained in:
RickyRister 2026-10-02 08:17:34 -07:00 • committed by GitHub
parent ecd955bc60
commit ffcb9094ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 31 additions and 3 deletions

View file

@ -259,7 +259,7 @@ void TabGame::linkCardToChat(const QString &cardName)
sayEdit->setFocus();
}
void TabGame::resetChatAndPhase()
void TabGame::resetForRewind()
{
// reset chat log
messageLog->clearChat();
@ -267,6 +267,9 @@ void TabGame::resetChatAndPhase()
// reset phase markers
game->getGameState()->setCurrentPhase(-1);
// reset view zones
static_cast<GameScene *>(gameView->scene())->emptyActiveViews();
// reset spectator state so the replay can rebuild it from the start
game->getPlayerManager()->clearSpectators();
playerListWidget->clearSpectators();
@ -1270,7 +1273,7 @@ void TabGame::createReplayDock(GameReplay *replay)
replayDock->setWidget(replayWidget);
replayDock->setFloating(false);
connect(replayWidget, &ReplayWidget::rewound, this, &TabGame::resetChatAndPhase);
connect(replayWidget, &ReplayWidget::rewound, this, &TabGame::resetForRewind);
connect(replayWidget, &ReplayWidget::eventReplayed, game->getGameEventHandler(),
[this](const auto &event, auto options) {
game->getGameEventHandler()->processGameEventContainer(event, nullptr, options);