def extract_mod(self, path: Path, modid: str): '''Perform extraction for mod data.''' mod_data = self.manager.arkman.getModData(modid) assert mod_data selectable_maps: Optional[str] = None if modid not in get_official_mods(): if int(mod_data.get('type', 1)) != 2: return selectable_maps = mod_data.get('maps', None) if not selectable_maps: return # Core versions are based on the game version and build number version = createExportVersion( self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore # Extract the map path = (path / f'{modid}-{mod_data["name"]}') maps = group_levels_by_directory( self.discoverer.discover_mod_levels(modid)) for directory, levels in maps.items(): directory_name = get_leaf_from_assetname(directory) if self.manager.config.extract_maps and directory_name not in self.manager.config.extract_maps: continue persistent: Optional[str] = None if selectable_maps: persistent = f'{directory}/{selectable_maps[0]}' logger.info(f'Performing extraction from map: {directory}') self._extract_and_save(version, path, Path(directory_name), levels, modid, persistent)
def extract_core(self, path: Path): '''Perform extraction for core (non-mod) data.''' if not self.manager.config.export_wiki.ExportVanillaMaps: return # Prepare a schema, if requested for name, model_info in EXPORTS.items(): model, _ = model_info _output_schema(model, path / self._get_schema_file_path(name)) # Core versions are based on the game version and build number version = createExportVersion( self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore # Extract every core map maps = group_levels_by_directory( self.discoverer.discover_vanilla_levels()) for directory, levels in maps.items(): directory_name = get_leaf_from_assetname(directory) if self.manager.config.extract_maps and directory_name not in self.manager.config.extract_maps: continue logger.info(f'Performing extraction from map: {directory}') self._extract_and_save(version, path, Path(directory_name), levels)
def extract_mod(self, path: Path, modid: str): # Mod versions are based on the game version and mod change date version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.get_mod_version(modid)) # type: ignore filename = self.get_mod_file_path(modid) proxy_iter = self.manager.iterate_mod_exports_of_type(self.get_ue_type(), modid) self._extract_and_save(version, modid, path, filename, proxy_iter)
def extract_core(self, path: Path): # Core versions are based on the game version and build number version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore filename = self.get_core_file_path() proxy_iter = self.manager.iterate_core_exports_of_type(self.get_ue_type()) self._extract_and_save(version, None, path, filename, proxy_iter)
def extract_mod(self, path: Path, modid: str): # Re-use the core's schema, if existing schema_file: Optional[PurePosixPath] = None schema_model = self.get_schema_model() # pylint: disable=assignment-from-none # stupid pylint if schema_model: schema_file = PurePosixPath('.schema', self.get_schema_filename()) # Mod versions are based on the game version and mod change date version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.get_mod_version(modid)) # type: ignore filename = self.get_mod_file_path(modid) proxy_iter = self.manager.iterate_mod_exports_of_type(self.get_ue_type(), modid) self._extract_and_save(version, modid, path, filename, proxy_iter, schema_file=schema_file)
def extract_core(self, path: Path): # Prepare a schema, if requested schema_file: Optional[PurePosixPath] = None schema_model = self.get_schema_model() # pylint: disable=assignment-from-none # stupid pylint if schema_model: schema_file = PurePosixPath('.schema', self.get_schema_filename()) _output_schema(schema_model, path / schema_file) # Core versions are based on the game version and build number version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore filename = self.get_core_file_path() proxy_iter = self.manager.iterate_core_exports_of_type(self.get_ue_type()) self._extract_and_save(version, None, path, filename, proxy_iter, schema_file=schema_file)
def extract_core(self, path: Path): '''Perform extraction for core (non-mod) data.''' if not self.manager.config.export_wiki.ExportVanillaMaps: return # Core versions are based on the game version and build number version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore # Extract every core map maps = self._group_levels_by_directory(self.discoverer.discover_vanilla_levels()) for directory, levels in maps.items(): logger.info(f'Performing extraction from map: {directory}') directory_name = PurePosixPath(directory.split('/')[-1]) self._extract_and_save(version, path, directory_name, levels)
def extract_mod(self, path: Path, modid: str): '''Perform extraction for mod data.''' mod_data = self.manager.arkman.getModData(modid) assert mod_data if int(mod_data.get('type', 1)) != 2: return selectable_maps = mod_data.get('maps', None) if not selectable_maps: return # Core versions are based on the game version and build number version = createExportVersion(self.manager.arkman.getGameVersion(), self.manager.arkman.getGameBuildId()) # type: ignore # Extract the map path = (path / f'{modid}-{mod_data["name"]}') maps = self._group_levels_by_directory(self.discoverer.discover_mod_levels(modid)) for directory, levels in maps.items(): logger.info(f'Performing extraction from map: {directory}') directory_name = PurePosixPath(directory.split('/')[-1]) self._extract_and_save(version, path, directory_name, levels, known_persistent=f'{directory}/{selectable_maps[0]}')
def _create_version(self, timestamp: str) -> str: return createExportVersion(self.game_version, timestamp) # type: ignore