当前位置: 首页>>代码示例>>Python>>正文


Python StartGameOptions.create_load_game方法代码示例

本文整理汇总了Python中horizons.util.startgameoptions.StartGameOptions.create_load_game方法的典型用法代码示例。如果您正苦于以下问题:Python StartGameOptions.create_load_game方法的具体用法?Python StartGameOptions.create_load_game怎么用?Python StartGameOptions.create_load_game使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在horizons.util.startgameoptions.StartGameOptions的用法示例。


在下文中一共展示了StartGameOptions.create_load_game方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_save_load_ticket_1421

# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_load_game [as 别名]
def test_save_load_ticket_1421(gui):
	"""
	Boatbuilder crashes when saving/loading while a ship is being produced.
	"""

	# Select boat builder
	gui.cursor_click(64, 10, 'left')

	# Select trade ships tab
	gui.trigger('tab_base', '1')

	# Build huker
	gui.trigger('boatbuilder_showcase', 'ok_0')

	# Select war ships tab
	gui.trigger('tab_base', '2')

	# Build frigate
	gui.trigger('boatbuilder_showcase', 'ok_0')

	fd, filename = tempfile.mkstemp()
	os.close(fd)

	assert gui.session.save(savegamename=filename)

	options = StartGameOptions.create_load_game(filename, None)
	horizons.main.start_singleplayer(options)
开发者ID:BenjaminHarper,项目名称:unknown-horizons,代码行数:29,代码来源:test_boatbuilder.py

示例2: _load_cmd_map

# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_load_game [as 别名]
def _load_cmd_map(savegame, ai_players, force_player_id=None):
	"""Load a map specified by user.
	@param savegame: either the displayname of a savegame or a path to a savegame
	@return: bool, whether loading succeeded"""
	# first check for partial or exact matches in the normal savegame list
	savegames = SavegameManager.get_saves()
	map_file = _find_matching_map(savegame, savegames)
	if not map_file:
		return False

	options = StartGameOptions.create_load_game(map_file, force_player_id)
	start_singleplayer(options)
	return True
开发者ID:Rareson,项目名称:unknown-horizons,代码行数:15,代码来源:main.py

示例3: saveload

# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_load_game [as 别名]
def saveload(gui):
	"""Save and load the game (gui test version). Use like this:

	# For gui tests
	saveload(gui)
	"""
	fd, filename = tempfile.mkstemp()
	os.close(fd)
	assert gui.session.save(savegamename=filename)
	options = StartGameOptions.create_load_game(filename, None)
	# This hands out a new session, but `gui.session` is a property.
	horizons.main.start_singleplayer(options)
	# Restore some properties that were changed for tests:
	# Set game speed to maximum, and disable autoscroll.
	gui.setup()
开发者ID:Octavianuspg,项目名称:unknown-horizons,代码行数:17,代码来源:helper.py

示例4: _load_last_quicksave

# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_load_game [as 别名]
def _load_last_quicksave(session=None, force_player_id=None):
	"""Load last quicksave
	@param session: value of session
	@return: bool, whether loading succeeded"""
	save_files = SavegameManager.get_quicksaves()[0]
	if _modules.session is not None:
		if not save_files:
			_modules.session.ingame_gui.open_popup(_("No quicksaves found"),
			                                       _("You need to quicksave before you can quickload."))
			return False
	else:
		if not save_files:
			print "Error: No quicksave found."
			return False

	save = max(save_files)
	options = StartGameOptions.create_load_game(save, force_player_id)
	start_singleplayer(options)
	return True
开发者ID:Rareson,项目名称:unknown-horizons,代码行数:21,代码来源:main.py


注:本文中的horizons.util.startgameoptions.StartGameOptions.create_load_game方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。