private void textColourToolStripMenuItem_Click(object sender, EventArgs e)
{
ColorDialog d = new ColorDialog();
DialogResult result = d.ShowDialog();
if (result == DialogResult.OK)
{
rtbForeColour = d.Color;
foreach (FixedRichTextBox rtb in scripts)
{
rtb.SelectAll();
rtb.SelectionColor = d.Color;
rtb.DeselectAll();
rtbNotes.SelectAll();
rtbNotes.SelectionColor = d.Color;
rtbNotes.DeselectAll();
rtb.ForeColor = d.Color;
rtbNotes.ForeColor = d.Color;
}
string[] ini = File.ReadAllLines(System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini");
List<string> newIni = new List<string>();
foreach (string s in ini)
{
if (s.StartsWith("textcolour"))
{
string[] line = s.Split('=');
line[1] = d.Color.ToString().Substring(7).Substring(0, d.Color.ToString().Substring(7).Length - 1);
newIni.Add(line[0] + "=" + line[1]);
}
else
{
newIni.Add(s);
}
}
File.WriteAllLines(System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini", newIni.ToArray());
}
}