private void OpenArchive(string filename) { ClearView(); if (fileSystem != null) { fileSystem.Dispose(); } fileSystem = null; try { var mpqFileSystem = new MpqFileSystem(); mpqFileSystem.Archives.Add(new MpqArchive(filename)); fileSystem = mpqFileSystem; SetTitle(filename); FillTreeView(); saveAsToolStripMenuItem.Enabled = true; saveAsToolStripButton.Enabled = true; } catch (Exception ex) { ErrorDialog(ex.ToString()); } }
public MPQContentResolver(string rootDirectory) { this.RootDirectory = rootDirectory; fileSystem = new MpqFileSystem(); var archive = new MpqArchive(System.IO.Path.Combine(rootDirectory, "d2data.mpq")); fileSystem.Archives.Add(archive); }
private static MpqFileSystem OpenFileSystem(string[] filenames) { var fileSystem = new MpqFileSystem(false); foreach (var filename in filenames) { fileSystem.Archives.Add(new MpqArchive(filename, false)); } return(fileSystem); }
private static int Main(string[] args) { var options = ParseCommandLine(args); if (options.Errors != null) { if (options.ShowLogo) { PrintLogo(); } PrintUsage(); return(-1); } if (options.ShowLogo) { PrintLogo(); } if (options.ShowHelp) { PrintUsage(); } else { IMpqFileSystem fileSystem; switch (options.SourceType) { case SourceType.SingleArchive: fileSystem = new MpqFileSystem(); fileSystem.Archives.Add(new MpqArchive(options.SourceFile)); break; case SourceType.FileSystem: fileSystem = new MpqFileSystem(); break; case SourceType.WoWFileSystem: break; } } return(0); }
private void OpenArchive(string filename) { ClearView(); if (fileSystem != null) fileSystem.Dispose(); fileSystem = null; try { var mpqFileSystem = new MpqFileSystem(); mpqFileSystem.Archives.Add(new MpqArchive(filename)); fileSystem = mpqFileSystem; SetTitle(filename); FillTreeView(); saveAsToolStripMenuItem.Enabled = true; saveAsToolStripButton.Enabled = true; } catch (Exception ex) { ErrorDialog(ex.ToString()); } }