Example #1
0
	def open_level_set_cmd(self):
		"""Implementation of the 'Play Custom Levels' command."""
		self.ask_save()
		path = request_old_filename(suffixes = [self.game.level_set_suffix],
			directory = self.game.get_custom_level_set_dir())
		if not path:
			raise Cancel
		self.load_level_set(path)
		self.restart_level()
Example #2
0
	def load_game_cmd(self):
		"""Implementation of the 'Load Game' command."""
		game = self.game
		self.ask_save()
		dir = game.get_save_dir()
		path = request_old_filename(suffixes = [game.save_file_suffix],
			directory = dir)
		if not path:
			raise Cancel
		self.restore_game(path)
Example #3
0
 def load_game_cmd(self):
     """Implementation of the 'Load Game' command."""
     game = self.game
     self.ask_save()
     dir = game.get_save_dir()
     path = request_old_filename(suffixes=[game.save_file_suffix],
                                 directory=dir)
     if not path:
         raise Cancel
     self.restore_game(path)
Example #4
0
 def open_level_set_cmd(self):
     """Implementation of the 'Play Custom Levels' command."""
     self.ask_save()
     path = request_old_filename(
         suffixes=[self.game.level_set_suffix], directory=self.game.get_custom_level_set_dir()
     )
     if not path:
         raise Cancel
     self.load_level_set(path)
     self.restart_level()
Example #5
0
	def open_level_cmd(self):
		"""Implementation of the 'Open Level' command."""
		game = self.game
		path = request_old_filename(suffixes = [game.level_file_suffix],
			directory = game.get_level_save_dir())
		if path:
			if self.load_level_file(path):
				self.show_editor_screen()
				return True
		return False