Commit ed9b4efc authored by captnfab's avatar captnfab 🦃
Browse files

Reset state stack on new game

- Closes #44
parent f759ff7f
......@@ -164,9 +164,12 @@ class Round:
self.stage=stage
self.options=options
def switch(self, state_type, options={}, notification=None, save=False, restore=False):
def switch(self, state_type, options={}, notification=None, save=False, restore=False, reset=False):
old_stage = self.options.get('old_stage', None)
old_options = self.options.get('old_options', None)
if reset:
old_stage = None
old_options = None
if restore and old_stage is not None:
self.stage=old_stage
......
......@@ -54,7 +54,7 @@ class GuiMenu:
## First meny entry is either sart or resume game
if self.rnd.state.options.get('old_stage', None) is not None:
self.menu_entries += [
(_("Restart the game"), 'n', Stage.NEWGAME, {"restore": False}),
(_("Restart the game"), 'n', Stage.NEWGAME, {"reset": True}),
(_("Continue the game"), 'r', Stage.NEWGAME, {"restore": True}),
]
# Initially select resume game
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment