private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { if (tae != null && saveFileDialog1.ShowDialog() == DialogResult.OK) { string filename = saveFileDialog1.FileName; if (filename.Substring(filename.Length - 4) != ".tae") { filename += ".tae"; } TAE.WriteTae(tae, filename); } }
private void AddEventBtn_Click(object sender, EventArgs e) { if (listBox1.Items.Count != 0 && listBox1.SelectedIndex != -1) { if (dataGridView1.Rows.Count == 0) { tae.data.animDatas[listBox1.SelectedIndex].timeConstants.Add(0); tae.data.animDatas[listBox1.SelectedIndex].timeConstantsCount++; } TAE.AddEvent(tae.data.animDatas[listBox1.SelectedIndex]); listBox1_SelectedIndexChanged(sender, e); dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 1; } }
private void SaveBtn_Click(object sender, EventArgs e) { SaveBtn.Enabled = false; if (tae != null) { if (!File.Exists(textBox1.Text + ".bak")) { File.Move(textBox1.Text, textBox1.Text + ".bak"); } TAE.WriteTae(tae, textBox1.Text); } SaveBtn.Enabled = true; }
private void Open() { tae = new TAE.Tae(); listBox1.Items.Clear(); ResetState(); if (File.Exists(textBox1.Text)) { tae = TAE.ReadTae(textBox1.Text); if (tae.err != null) { MessageBox.Show(tae.err); } else { foreach (TAE.IdStruct id in tae.data.ids) { listBox1.Items.Add(id.id.ToString()); } } } }