private void exportToolStripMenuItem_Click(object sender, EventArgs e) { if (moves.Count > 0) { Move m = moves[moveBox.SelectedIndex]; string txt = $"{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}\""; SuperForm.exportFile($"move{m.id}.txt", txt); } else { MessageBox.Show("There are no moves to generate!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void exportToolStripMenuItem1_Click(object sender, EventArgs e) { if (moves.Count > 0) { 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.exportFile("moves.txt", ret); } else { MessageBox.Show("There are no moves to generate!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void overwriteToolStripMenuItem_Click(object sender, EventArgs e) { if (types.Count > 0) { if (MessageBox.Show("You are about to overwrite \"types.txt\". Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { byIDToolStripMenuItem_Click(sender, e); GennedTypes g = new GennedTypes(); g.txt = null; for (int i = 0; i < types.Count; i++) { g.txt += $@"[{types[i].id}] Name={types[i].name} InternalName={types[i].intname} "; if (types[i].specialtype) { g.txt += @"IsSpecialType=true "; } if (types[i].pseudotype) { g.txt += @"IsPseudoType=true "; } if (types[i].weaknesses.Count > 0) { g.txt += "Weaknesses="; for (int j = 0; j < types[i].weaknesses.Count; j++) { if (j != 0) { g.txt += "," + types[i].weaknesses[j]; } else { g.txt += types[i].weaknesses[j]; } } g.txt += @" "; } if (types[i].resistances.Count > 0) { g.txt += "Resistances="; for (int j = 0; j < types[i].resistances.Count; j++) { if (j != 0) { g.txt += "," + types[i].resistances[j]; } else { g.txt += types[i].resistances[j]; } } g.txt += @" "; } if (types[i].immunities.Count > 0) { g.txt += "Immunities="; for (int j = 0; j < types[i].immunities.Count; j++) { if (j != 0) { g.txt += "," + types[i].immunities[j]; } else { g.txt += types[i].immunities[j]; } } g.txt += @" "; } g.txt += @" "; } SuperForm.exportFile("types.txt", g.txt); } } else { MessageBox.Show("There are no types to generate!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }