本文整理汇总了Python中horizons.util.startgameoptions.StartGameOptions.create_editor_load方法的典型用法代码示例。如果您正苦于以下问题:Python StartGameOptions.create_editor_load方法的具体用法?Python StartGameOptions.create_editor_load怎么用?Python StartGameOptions.create_editor_load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类horizons.util.startgameoptions.StartGameOptions
的用法示例。
在下文中一共展示了StartGameOptions.create_editor_load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: act
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_editor_load [as 别名]
def act(self):
for size in self.sizes:
option_name = 'size_%d' % size
if self._gui.findChild(name=option_name).marked:
self._windows.close()
# the empty list is interpreted as the empty list of random map island strings
options = StartGameOptions.create_editor_load([])
options.map_padding = size // 2
horizons.main.start_singleplayer(options)
return
示例2: _edit_map
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_editor_load [as 别名]
def _edit_map(map_file):
"""
Start editing the specified map file.
@param map_file: path to the map file or a list of random island strings
@return: bool, whether loading succeeded
"""
if not map_file:
return False
options = StartGameOptions.create_editor_load(map_file)
start_singleplayer(options)
return True
示例3: act
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_editor_load [as 别名]
def act(self):
for size in self.sizes:
option_name = 'size_%d' % size
if self._gui.findChild(name=option_name).marked:
self.parent.hide()
self.parent.parent.show_loading_screen()
# the empty list is interpreted as the empty list of random map island strings
options = StartGameOptions.create_editor_load([])
options.map_padding = size // 2
session = horizons.main.start_singleplayer(options)
session.world_editor = WorldEditor(session.world)
return
示例4: _edit_map
# 需要导入模块: from horizons.util.startgameoptions import StartGameOptions [as 别名]
# 或者: from horizons.util.startgameoptions.StartGameOptions import create_editor_load [as 别名]
def _edit_map(map_file):
"""
Start editing the specified map file.
@param map_file: path to the map file or a list of random island strings
@return: bool, whether loading succeeded
"""
if not map_file:
return False
options = StartGameOptions.create_editor_load(map_file)
start_singleplayer(options)
from horizons.editor.worldeditor import WorldEditor
_modules.session.world_editor = WorldEditor(_modules.session.world)
return True