private void LoadPacks() { _allPathableResourceManagers = new List <PathableResourceManager>(); var iconProgressIndicator = new Progress <string>((report) => { GameService.Pathing.Icon.LoadingMessage = report; }); var dirDataReader = new DirectoryReader(_markerDirectory); var dirResourceManager = new PathableResourceManager(dirDataReader); _allPathableResourceManagers.Add(dirResourceManager); dirDataReader.LoadOnFileType((Stream fileStream, IDataReader dataReader) => { PackFormat.TacO.Readers.MarkerPackReader.ReadFromXmlPack(fileStream, dirResourceManager); }, ".xml", iconProgressIndicator); // TODO: Cleanup string[] packFiles = Directory.GetFiles(_markerDirectory, "*.zip", SearchOption.AllDirectories); foreach (string packFile in packFiles) { // Potentially contains many packs within var zipDataReader = new ZipArchiveReader(packFile); var zipResourceManager = new PathableResourceManager(zipDataReader); _allPathableResourceManagers.Add(zipResourceManager); zipDataReader.LoadOnFileType((Stream fileStream, IDataReader dataReader) => { PackFormat.TacO.Readers.MarkerPackReader.ReadFromXmlPack(fileStream, zipResourceManager); }, ".xml", iconProgressIndicator); } }
private void LoadPacks() { _currentReader = new MarkerPackReader(); _allPathableResourceManagers = new List <PathableResourceManager>(); var iconProgressIndicator = new Progress <string>((report) => { _mapIcon.LoadingMessage = report; }); var dirDataReader = new DirectoryReader(_markerDirectory); var dirResourceManager = new PathableResourceManager(dirDataReader); _allPathableResourceManagers.Add(dirResourceManager); dirDataReader.LoadOnFileType((Stream fileStream, IDataReader dataReader) => { _currentReader.ReadFromXmlPack(fileStream, dirResourceManager); }, ".xml", iconProgressIndicator); // Load archive marker packs List <string> zipPackFiles = new List <string>(); zipPackFiles.AddRange(Directory.GetFiles(_markerDirectory, "*.zip", SearchOption.AllDirectories)); zipPackFiles.AddRange(Directory.GetFiles(_markerDirectory, "*.taco", SearchOption.AllDirectories)); foreach (string packFile in zipPackFiles) { // Potentially contains many packs within var zipDataReader = new ZipArchiveReader(packFile); var zipResourceManager = new PathableResourceManager(zipDataReader); _allPathableResourceManagers.Add(zipResourceManager); zipDataReader.LoadOnFileType((Stream fileStream, IDataReader dataReader) => { _currentReader.ReadFromXmlPack(fileStream, zipResourceManager); }, ".xml", iconProgressIndicator); } _packsLoaded = true; }
private void UnpackInternalModules() { var internalModulesReader = new ZipArchiveReader("ref.dat"); internalModulesReader.LoadOnFileType(ExtractPackagedModule, MODULE_EXTENSION); }