private void UpdateButton_Click(object sender, EventArgs e) { var str = MIBFileNames[MIBFiles.SelectedIndex]; var dir = string.Format("{0}/{1}", textBox1.Text, str.Substring(0, str.Length - 4)); if (Directory.Exists(dir)) { if (currentMIB != null) { foreach (var item in currentMIB.Entries) { if (item.isDDS) { DDSFile dds = new DDSFile(); if (dds.ReadData(string.Format("{0}/{1}.dds", dir, item.InternalID))) { item.UpdateFromDDS(dds); } } } currentMIB.UpdateOffsets(); currentMIB.WriteFile(string.Format("{0}.mib", dir)); } } }
static void Update(string fileName) { string dir = fileName.Substring(0, fileName.Length - 4); if (Directory.Exists(dir)) { VDriveMibFile outfile = new VDriveMibFile(fileName); foreach (var item in outfile.Entries) { if (item.isDDS) { DDSFile dds = new DDSFile(); if (dds.ReadData(string.Format("{0}/{1}.dds", dir, item.InternalID))) { item.UpdateFromDDS(dds); } } } outfile.UpdateOffsets(); outfile.WriteFile(fileName); } else { Console.WriteLine("Dump the file first"); } }