using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; namespace DXItemWriter { public partial class Weapon : Form { Form1 Form; wScript newScript; public Weapon(Form1 form) { InitializeComponent(); Form = form; } private void button3_Click(object sender, EventArgs e) { Form.Show(); this.Close(); this.Dispose(); } private void radioButton1_CheckedChanged(object sender, EventArgs e) { listBox1.Enabled = true; listBox2.Enabled = false; } private void radioButton2_CheckedChanged(object sender, EventArgs e) { listBox1.Enabled = false; listBox2.Enabled = true; } private void button1_Click(object sender, EventArgs e) { string fileName = textBox1.Text.ToString() + ".CS"; StreamWriter writer = new StreamWriter(fileName); for (int i = 0; i < richTextBox1.Lines.Length; i++) { writer.WriteLine(richTextBox1.Lines[i]); } writer.Close(); } private void radioButton3_CheckedChanged(object sender, EventArgs e) { richTextBox1.ReadOnly = false; richTextBox1.Enabled = true; } private void radioButton4_CheckedChanged(object sender, EventArgs e) { richTextBox1.ReadOnly = true; richTextBox1.Enabled = false; } private void Update(object sender, EventArgs e) { //Define variable values here newScript.aosStrReq = textBox5.Text; newScript.aosMinDMG = textBox6.Text; newScript.aosMaxDMG = textBox7.Text; newScript.aosSpeed = textBox8.Text; newScript.oldStrReq = textBox9.Text; newScript.oldMinDMG = textBox10.Text; newScript.oldMaxDMG = textBox11.Text; newScript.oldSpeed = textBox12.Text; newScript.DefHitSound = textBox13.Text; newScript.DefMissSound = textBox14.Text; newScript.InitMinHits = textBox15.Text; newScript.InitMaxHits = textBox16.Text; //End Definitions //Begin RTB Text Correction richTextBox1.Text = string.Format( newScript, newScript.aosStrReq, newScript.aosMinDMG, newScript.aosMaxDMG, newScript.aosSpeed, newScript.oldStrReq, newScript.oldMinDMG, newScript.oldMaxDMG, newScript.oldSpeed, newScript.DefHitSound, newScript.DefMissSound, newScript.InitMinHits, newScript.InitMaxHits); //End Correction } private void button4_Click(object sender, EventArgs e) { Update(); } } }