private void button1_Click(object sender, EventArgs e) { if (Owner.MovesetManager != null && cb_section.SelectedIndex >= 0) { // need to split into lines string[] line = richTextBox1.Text.Split('\n'); ACMDScript script = new ACMDScript(crc); int index = 0; try { foreach (string str in line) { if (str.Equals("")) { continue; } ACMDCompiler.CompileSingleCommand(str); // try to compile index++; } foreach (ACMDCommand s in ACMDCompiler.CompileCommands(line)) { script.Add(s); index++; } SortedList <uint, SALT.Moveset.IScript> scriptList = null; if (cb_section.Text.Equals("GAME")) { scriptList = Owner.MovesetManager.Game.Scripts; } else if (cb_section.Text.Equals("SOUND")) { scriptList = Owner.MovesetManager.Sound.Scripts; } else if (cb_section.Text.Equals("EXPRESSION")) { scriptList = Owner.MovesetManager.Expression.Scripts; } else if (cb_section.Text.Equals("EFFECT")) { scriptList = Owner.MovesetManager.Effect.Scripts; } //Update script if it already exists if (scriptList.ContainsKey(crc)) { scriptList[crc] = script; } if (cb_section.Text.Equals("GAME")) { Owner.ACMDScript = new ForgeACMDScript(script); Owner.ACMDScript.processToFrame(0); } } catch (Exception) { HighlightLine(richTextBox1, index, Color.Red); } } }
private void button1_Click(object sender, EventArgs e) { if (Runtime.Moveset != null && Runtime.Moveset.Game.Scripts.ContainsKey(crc)) { // need to split into lines string[] line = richTextBox1.Text.Split('\n'); ACMDScript script = new ACMDScript(crc); int index = 0; try { foreach (string str in line) { if (str.Equals("")) { continue; } ACMDCompiler.CompileSingleCommand(str); // try to compile index++; } foreach (ACMDCommand s in ACMDCompiler.CompileCommands(line)) { script.Add(s); index++; } Runtime.Moveset.Game.Scripts[crc] = script; } catch (Exception) { HighlightLine(richTextBox1, index, Color.Red); } } }