Added button to restart single-player games#3960
Conversation
WalkthroughThis PR adds a singleplayer game restart feature. A new restart button appears in the game sidebar (visible only for singleplayer, non-replay games), dispatches a custom event on confirmation, persists game configuration to sessionStorage, stops gameplay, and reloads the page. On reload, the persisted configuration is recovered and the game automatically rejoins with a fresh game ID. ChangesSingleplayer restart flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description:
A button has been added to restart single-player games. Due to the individual ID system for each game, the game isn't actually restarted; instead, an identical game is created with the same parameters the user set when starting the game.
I've tested the functionality, adding custom options, disabling buildings, etc. Everything seems to be working correctly.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
sardidefcon