private void button1_Click(object sender, EventArgs e) { //try //{ mta = new MTA(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); using (var sfd = new SaveFileDialog()) { sfd.Filter = "Material Animation (.mta)|*.mta|" + "All Files (*.*)|*.*"; if (sfd.ShowDialog() == DialogResult.OK) { File.WriteAllBytes(sfd.FileName, mta.Rebuild()); } } //} /*catch (Exception ex) * { * throw; * Console.WriteLine(ex.ToString()); * MessageBox.Show("Failed to build MTA, make sure your formatting is correct", "MTA Build Error", MessageBoxButtons.OK, MessageBoxIcon.Error); * }*/ }
public override void Save() { if (FilePath.Equals("")) { SaveAs(); return; } FileOutput o = new FileOutput(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); byte[] n = mta.Rebuild(); o.writeBytes(n); o.save(FilePath); Edited = false; }