private void exportw2rigjsonToolStripMenuItem_Click(object sender, EventArgs e) { if (modFileList.SelectedNode != null) { Console.WriteLine(ActiveMod.FileDirectory + "\\" + modFileList.SelectedNode.FullPath); } string w2rigFilePath = ActiveMod.FileDirectory + "\\" + modFileList.SelectedNode.FullPath; using (var sf = new SaveFileDialog()) { sf.Filter = "W3 json | *.json"; sf.FileName = Path.GetFileName(ActiveMod.FileDirectory + "\\" + modFileList.SelectedNode.FullPath + ".json"); if (sf.ShowDialog() == DialogResult.OK) { CommonData cdata = new CommonData(); Rig exportRig = new Rig(cdata); byte[] data; data = File.ReadAllBytes(w2rigFilePath); using (MemoryStream ms = new MemoryStream(data)) using (BinaryReader br = new BinaryReader(ms)) { CR2WFile rigFile = new CR2WFile(br); exportRig.LoadData(rigFile); exportRig.SaveRig(sf.FileName); } MessageBox.Show(this, "Sucessfully wrote file!", "WolvenKit", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }