private void overwriteToolStripMenuItem_Click(object sender, EventArgs e) { if (moves.Count > 0) { if (MessageBox.Show("You are about to overwrite \"moves.txt\". Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { string ret = null; for (int i = 0; i < moves.Count; i++) { Move m = moves[i]; ret += $"{m.id},{m.intname},{m.name},{m.effect},{m.basepower},{m.type},{m.category},{m.accuracy},{m.pp},{m.addeff},{convertTarget(m.target)},{m.priority},{m.flags},\"{m.description}\""; if (i != moves.Count - 1) { ret += "\r\n"; } } SuperForm.pbsFile("moves.txt", ret); } } else { MessageBox.Show("There are no moves to generate!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }