private void RandomParty_Click(object sender, EventArgs e) { if (Session.Project.Heroes.Count != 0) { string msg = "This will clear the PC list."; msg += Environment.NewLine; msg += "Are you sure you want to do this?"; DialogResult dr = MessageBox.Show(msg, "Masterplan", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.No) { return; } Session.Project.Heroes.Clear(); } HeroGroup group = HeroGroup.CreateGroup(Session.Project.Party.Size); foreach (HeroData hd in group.Heroes) { if (hd == null) { continue; } Hero h = hd.ConvertToHero(); Session.Project.Heroes.Add(h); } Session.Modified = true; update_view(); }
private void RandomParty_Click(object sender, EventArgs e) { if (Session.Project.Heroes.Count != 0) { if (MessageBox.Show(string.Concat(string.Concat("This will clear the PC list.", Environment.NewLine), "Are you sure you want to do this?"), "Masterplan", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) { return; } Session.Project.Heroes.Clear(); } foreach (HeroData hero in HeroGroup.CreateGroup(Session.Project.Party.Size).Heroes) { if (hero == null) { continue; } Hero hero1 = hero.ConvertToHero(); Session.Project.Heroes.Add(hero1); } Session.Modified = true; this.update_view(); }