private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (isRoot && _curFighter == null) { return; } else if (!isRoot && _curFile == null) { return; } for (int i = 0; i < tabControl1.TabCount; i++) { var p = tabControl1.TabPages[i] as CodeEditControl; TabControl tmp = (TabControl)p.Controls[0]; for (int x = 0; x < tmp.TabCount; x++) { ACMD_EDITOR box = (ACMD_EDITOR)tmp.TabPages[x].Controls[0]; if (box.Script.Empty) { continue; } box.ApplyChanges(); if (!isRoot) { _curFile.EventLists[box.Script.AnimationCRC] = box.Script; } else { _curFighter[x].EventLists[box.Script.AnimationCRC] = box.Script; } } } if (isRoot) { _curFighter.Main.Export(rootPath + "/game.bin"); _curFighter.GFX.Export(rootPath + "/effect.bin"); _curFighter.SFX.Export(rootPath + "/sound.bin"); _curFighter.Expression.Export(rootPath + "/expression.bin"); _curFighter.MotionTable.Export(rootPath + "/Motion.mtable"); } else { _curFile.Export(FileName); } }
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = 0; i < tabControl1.TabCount; i++) { var p = tabControl1.TabPages[i] as CodeEditControl; TabControl tmp = (TabControl)p.Controls[0]; for (int x = 0; x < tmp.TabCount; x++) { ACMD_EDITOR box = (ACMD_EDITOR)tmp.TabPages[x].Controls[0]; if (box.Script.Empty) { continue; } box.ApplyChanges(); if (!isRoot) { _curFile.EventLists[box.Script.AnimationCRC] = box.Script; } else { _curFighter[x].EventLists[box.Script.AnimationCRC] = box.Script; } } } if (isRoot) { using (FolderSelectDialog dlg = new FolderSelectDialog()) if (dlg.ShowDialog() == DialogResult.OK) { _curFighter.Export(dlg.SelectedPath); } } else { using (SaveFileDialog dlg = new SaveFileDialog { Filter = "ACMD Binary (*.bin)|*.bin|All Files (*.*)|*.*" }) if (dlg.ShowDialog() == DialogResult.OK) { _curFile.Export(dlg.FileName); } } }
private void tabControl1_MouseClick(object sender, MouseEventArgs e) { for (int i = 0; i < tabControl1.TabCount; i++) { var p = tabControl1.TabPages[i] as CodeEditControl; TabControl tmp = (TabControl)p.Controls[0]; Rectangle r = tabControl1.GetTabRect(i); Rectangle closeButton = new Rectangle(r.Right - 18, r.Top + 3, 13, Font.Height); if (closeButton.Contains(e.Location)) { for (int x = 0; x < tmp.TabCount; x++) { ACMD_EDITOR box = (ACMD_EDITOR)tmp.TabPages[x].Controls[0]; if (box.Script.Empty) { continue; } box.ApplyChanges(); if (!isRoot) { _curFile.EventLists[box.Script.AnimationCRC] = box.Script; } else { _curFighter[x].EventLists[box.Script.AnimationCRC] = box.Script; } } tabControl1.TabPages.Remove(p); return; } } }