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; }
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); * }*/ }
private void loadViewportButton_Click(object sender, EventArgs e) { // Compile the MTA just in case and load into the active viewport. mta = new MTA(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); ModelViewport modelViewport = (ModelViewport)MainForm.Instance.GetActiveModelViewport(); if (modelViewport != null) { modelViewport.CurrentMaterialAnimation = mta; } }
private void button2_Click(object sender, EventArgs e) { mta = new MTA(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); MainForm.Instance.viewports[0].loadMTA(mta); }
private void button2_Click(object sender, EventArgs e) { mta = new MTA(); mta.Compile(new List <string>(richTextBox1.Text.Split('\n'))); }