public static void LoadMD5() { using (StreamReader reader = new StreamReader(ArchiveManager.ReadThisFile(@"textures\minimap\md5translate.trs"))) { string line; while (!reader.EndOfStream) { line = reader.ReadLine(); if (!line.StartsWith("dir:")) //skip "dir: ..." entry { //lines.Add(line); lines.Add(line.ToLower()); } } } }
public static void ExportAllMinimaps(string to) { WoWFormatLib.FileReaders.BLPReader minireader = new WoWFormatLib.FileReaders.BLPReader(); for (int i = 0; i < lines.Count(); i++) { string file = lines[i].Substring(0, lines[i].IndexOf("\t")); //path + filenames string hash = lines[i].Substring(lines[i].IndexOf("\t") + 1, lines[i].Length - lines[i].IndexOf("\t") - 1); //filehash try { minireader.LoadBLP(ArchiveManager.ReadThisFile(@"textures\minimap\" + hash)); if (!Directory.Exists(Path.Combine(to + "\\", Path.GetDirectoryName(file)))) { Directory.CreateDirectory(Path.Combine(to + "\\", Path.GetDirectoryName(file))); } minireader.bmp.Save(Path.Combine(to + "\\", Path.GetDirectoryName(file) + "\\" + Path.GetFileNameWithoutExtension(file) + ".png")); } catch (Exception e) { throw new Exception(e.Message); } } }