Exemplo n.º 1
0
			def sanity_checker(string):
				try:
					SavegameManager.create_multiplayersave_filename(string)
				except RuntimeError:
					return False
				else:
					return True
Exemplo n.º 2
0
	def __call__(self, issuer):
		session = issuer.session
		try:
			path = SavegameManager.create_multiplayersave_filename(self.name)
		except RuntimeError, e:
			headline = _("Invalid filename")
			msg = _("Received an invalid filename for a save command.")
			session.gui.show_error_popup(headline, msg, unicode(e))
			return
Exemplo n.º 3
0
	def __call__(self, issuer):
		session = issuer.session
		try:
			path = SavegameManager.create_multiplayersave_filename(self.name)
		except RuntimeError as e:
			headline = _("Invalid filename")
			msg = _("Received an invalid filename for a save command.")
			session.gui.show_error_popup(headline, msg, unicode(e))
			return

		self.log.debug("SaveCommand: save to %s", path)

		success = session._do_save(path)
		if success:
			session.ingame_gui.message_widget.add(point=None, string_id='SAVED_GAME') # TODO: distinguish auto/quick/normal
		else:
			session.gui.show_popup(_('Error'), _('Failed to save.'))
Exemplo n.º 4
0
	def __call__(self, issuer):
		session = issuer.session
		try:
			path = SavegameManager.create_multiplayersave_filename(self.name)
		except RuntimeError as e:
			headline = _("Invalid filename")
			msg = _("Received an invalid filename for a save command.")
			session.gui.show_error_popup(headline, msg, unicode(e))
			return

		self.log.debug("SaveCommand: save to %s", path)

		success = session._do_save(path)
		if success:
			session.ingame_gui.message_widget.add(point=None, string_id='SAVED_GAME') # TODO: distinguish auto/quick/normal
		else:
			session.gui.show_popup(_('Error'), _('Failed to save.'))