diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index c5893bc..86679cd 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -310,16 +310,6 @@ void GameWorldView::onFrame() m_schematicChoiceShown = false; } - // Artifact count update - const int currentArtifactCount = m_sim->artifactCount(); - if (currentArtifactCount != m_lastArtifactCount) - { - m_lastArtifactCount = currentArtifactCount; - EventManager::getInstance()->sendEventImmediately( - std::make_shared( - currentArtifactCount, m_sim->config().world.artifacts.artifactWinCount)); - } - // Win check if (m_sim->isWon() && !m_winShown) { @@ -338,6 +328,20 @@ void GameWorldView::onFrame() } } + // Artifact count is a passive reflection of sim state (not a live-input source + // like the schematic/game-over polls above), so it updates during replay too — + // the recorded ApplySchematicChoice drives m_sim->artifactCount() forward and + // the header bar must track it. Fires on the first frame (count 0 vs the -1 + // sentinel), which also populates the win-count max (replacing the "0/?" label). + const int currentArtifactCount = m_sim->artifactCount(); + if (currentArtifactCount != m_lastArtifactCount) + { + m_lastArtifactCount = currentArtifactCount; + EventManager::getInstance()->sendEventImmediately( + std::make_shared( + currentArtifactCount, m_sim->config().world.artifacts.artifactWinCount)); + } + update(); }