add restart button to game over screen

This commit is contained in:
2026-04-21 20:38:18 +02:00
parent 043aaf774a
commit b7f2005504
5 changed files with 76 additions and 1 deletions

View File

@@ -1121,3 +1121,24 @@ void GameWorldView::setGameSpeed(double multiplier)
m_sim->buildingBlocksStock(),
m_gameSpeedMultiplier);
}
void GameWorldView::resetForNewGame()
{
exitBuilderMode();
m_activeBeams.clear();
m_toasts.clear();
m_ghostRotation = Rotation::East;
m_ghostValid = false;
m_demolishMode = false;
m_demolishHoverId = kInvalidEntityId;
m_selectedIds.clear();
m_boxSelecting = false;
m_scrollXTiles = 0.0f;
m_scrollLeft = false;
m_scrollRight = false;
m_gameOverShown = false;
m_gameSpeedMultiplier = 1.0;
m_prevNonZeroSpeed = 1.0;
emit selectionChanged({});
update();
}