private void saveNUTZLIBToolStripMenuItem_Click(object sender, EventArgs e) { using (var sfd = new SaveFileDialog()) { sfd.Filter = "Namco Universal Texture (.nut)|*.nut|" + "All Files (*.*)|*.*"; if (sfd.ShowDialog() == DialogResult.OK) { if (sfd.FileName.EndsWith(".nut") && NUT != null) { FileOutput o = new FileOutput(); o.writeBytes(FileData.DeflateZLIB(NUT.Rebuild())); o.save(sfd.FileName); } } } }
public override void Save() { if (FilePath.Equals("")) { SaveAs(); return; } FileOutput o = new FileOutput(); byte[] n = NUT.Rebuild(); DialogResult dialogResult = MessageBox.Show("Would you like to compress this NUT file with zlib?\nIf you are unsure, select \"No\".", "zlib Compression", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { n = FileData.DeflateZLIB(n); } o.writeBytes(n); o.save(FilePath); Edited = false; }