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); } }
private void generateToolStripMenuItem_Click(object sender, EventArgs e) { if (types.Count > 0) { 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 += @" "; } g.Show(); } else { MessageBox.Show("There are no types to generate!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }