From 3f5d4dd71e7e03cc84eae6dc3ac103a620c5e54e Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 15 Oct 2016 20:02:34 +0100 Subject: [PATCH] Add a check for no scenarios --- src/GameWindow.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/GameWindow.py b/src/GameWindow.py index e0dc0c0..49d10e1 100644 --- a/src/GameWindow.py +++ b/src/GameWindow.py @@ -160,6 +160,15 @@ def choose_scenario(self): # Get the available Scenarios (those under ./scenarios/) scenario_list = glob.glob("./scenarios/*.scibot") + # If no scenarios, exit! + if len(scenario_list) is 0: + print("No scibot files found.") + print("Please place them in ./scenarios/") + self.rendering_mode = RenderingMode.END_RENDERING + sleep(1) + pygame.quit() + sys.exit() + # If only one scenario, use that one! if len(scenario_list) is 1: self.scenario = scenario_list[0]