private void paddedYAZ0SARCszsToolStripMenuItem_Click(object sender, EventArgs e) { Settings s = new Settings(); s.bigEndian = bigEndianToolStripMenuItem.Checked; (new exportSettings(s)).ShowDialog(); if (!s.save) { return; } using (var sfd = new SaveFileDialog()) { sfd.Filter = "All supported Filetypes (.szs, .sarc, .arc, .pack, .bars, .bgenv)|*.szs;*.sarc;*.arc;*.pack;*.bars;*.bgenv|" + "YAZ0 compressed File (.szs)|*.szs|" + "SARC archive (.sarc, .arc, .pack, .bars, .bgenv)|*.sarc;*.arc;*.pack;*.bars;*.bgenv|" + "All Files|*.*"; if (sfd.ShowDialog() == DialogResult.OK) { SARC sarc = new SARC(); sarc.padding = s.offset; if (!s.bigEndian) { sarc.endian = Endianness.Little; } foreach (TreeNode t in treeView1.Nodes) { sarc.files.Add(t.Text, (byte[])t.Tag); } if (Path.GetExtension(sfd.FileName) == ".szs") { File.WriteAllBytes(sfd.FileName, YAZ0.LazyCompress(sarc.Rebuild(), s.flags)); } else { File.WriteAllBytes(sfd.FileName, sarc.Rebuild()); } } } }
private void yAZ0FileszsToolStripMenuItem_Click(object sender, EventArgs e) { if (treeView1.Nodes.Count > 0) { using (var sfd = new SaveFileDialog()) { sfd.Filter = "YAZ0 Compressed SARC (.szs)|*.szs"; if (sfd.ShowDialog() == DialogResult.OK) { if (treeView1.SelectedNode != null) { File.WriteAllBytes(sfd.FileName, YAZ0.LazyCompress((byte[])treeView1.SelectedNode.Tag)); } else { File.WriteAllBytes(sfd.FileName, YAZ0.LazyCompress((byte[])treeView1.Nodes[0].Tag)); } } } } }
private void yAZ0SARCToolStripMenuItem_Click(object sender, EventArgs e) { using (var sfd = new SaveFileDialog()) { sfd.Filter = "YAZ0 Compressed SARC (.szs)|*.szs"; if (sfd.ShowDialog() == DialogResult.OK) { SARC sarc = new SARC(); sarc.padding = globalPadding; if (!bigEndianToolStripMenuItem.Checked) { sarc.endian = Endianness.Little; } foreach (TreeNode t in treeView1.Nodes) { sarc.files.Add(t.Text, (byte[])t.Tag); } File.WriteAllBytes(sfd.FileName, YAZ0.LazyCompress(sarc.Rebuild())); } } }