def act(self): for size in self.sizes: option_name = 'size_{:d}'.format(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
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
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
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
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