private void ParcelEditBtn_Click(object sender, EventArgs e) { if (SelectedParcel != null) { int index = fPoint.Parcels.IndexOf(SelectedParcel); ParcelForm dlg = new ParcelForm(SelectedParcel); if (dlg.ShowDialog() == DialogResult.OK) { fPoint.Parcels[index] = dlg.Parcel; update_parcels(); } } }
private void AddParcel_Click(object sender, EventArgs e) { ParcelForm parcelForm = new ParcelForm(new Parcel() { Name = "New Treasure Parcel" }); if (parcelForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Session.Project.TreasureParcels.Add(parcelForm.Parcel); Session.Modified = true; this.update_list(); } }
private void ParcelAddParcel_Click(object sender, EventArgs e) { Parcel p = new Parcel(); p.Name = "New Treasure Parcel"; ParcelForm dlg = new ParcelForm(p); if (dlg.ShowDialog() == DialogResult.OK) { fPoint.Parcels.Add(dlg.Parcel); update_parcels(); } }
private void EditBtn_Click(object sender, EventArgs e) { if (this.SelectedParcel != null) { List <Parcel> listContaining = this.get_list_containing(this.SelectedParcel); int num = listContaining.IndexOf(this.SelectedParcel); ParcelForm parcelForm = new ParcelForm(this.SelectedParcel); if (parcelForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { listContaining[num] = parcelForm.Parcel; Session.Modified = true; this.update_list(); } } }
private void AddParcel_Click(object sender, EventArgs e) { Parcel p = new Parcel(); p.Name = "New Treasure Parcel"; ParcelForm dlg = new ParcelForm(p); if (dlg.ShowDialog() == DialogResult.OK) { Session.Project.TreasureParcels.Add(dlg.Parcel); Session.Modified = true; update_list(); } }
private void ParcelList_DoubleClick(object sender, EventArgs e) { if (this.SelectedParcel != null) { ParcelForm parcelForm = new ParcelForm(this.SelectedParcel); if (parcelForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.SelectedParcel.Name = parcelForm.Parcel.Name; this.SelectedParcel.Details = parcelForm.Parcel.Details; this.SelectedParcel.HeroID = parcelForm.Parcel.HeroID; this.SelectedParcel.MagicItemID = parcelForm.Parcel.MagicItemID; this.SelectedParcel.ArtifactID = parcelForm.Parcel.ArtifactID; this.SelectedParcel.Value = parcelForm.Parcel.Value; this.update_parcels(); Session.Modified = true; } } }
private void EditBtn_Click(object sender, EventArgs e) { if (SelectedParcel != null) { List <Parcel> list = get_list_containing(SelectedParcel); int index = list.IndexOf(SelectedParcel); ParcelForm dlg = new ParcelForm(SelectedParcel); if (dlg.ShowDialog() == DialogResult.OK) { list[index] = dlg.Parcel; Session.Modified = true; update_list(); } } }
private void ParcelList_DoubleClick(object sender, EventArgs e) { if (SelectedParcel != null) { ParcelForm dlg = new ParcelForm(SelectedParcel); if (dlg.ShowDialog() == DialogResult.OK) { // Save changes SelectedParcel.Name = dlg.Parcel.Name; SelectedParcel.Details = dlg.Parcel.Details; SelectedParcel.HeroID = dlg.Parcel.HeroID; SelectedParcel.MagicItemID = dlg.Parcel.MagicItemID; SelectedParcel.ArtifactID = dlg.Parcel.ArtifactID; SelectedParcel.Value = dlg.Parcel.Value; update_parcels(); Session.Modified = true; } } }
private void ItemList_DoubleClick(object sender, EventArgs e) { switch (fType) { case OverviewType.Encounters: { if (SelectedEncounter != null) { int level = Workspace.GetPartyLevel(SelectedEncounter.First); EncounterBuilderForm dlg = new EncounterBuilderForm(SelectedEncounter.Second, level, false); if (dlg.ShowDialog() == DialogResult.OK) { SelectedEncounter.First.Element = dlg.Encounter; Session.Modified = true; update_list(); } return; } } break; case OverviewType.Traps: { if (SelectedTrap != null) { if (SelectedTrap.First.Element is TrapElement) { TrapElement te = SelectedTrap.First.Element as TrapElement; TrapBuilderForm dlg = new TrapBuilderForm(SelectedTrap.Second); if (dlg.ShowDialog() == DialogResult.OK) { te.Trap = dlg.Trap; Session.Modified = true; update_list(); } return; } if (SelectedTrap.First.Element is Encounter) { Encounter enc = SelectedTrap.First.Element as Encounter; int index = enc.Traps.IndexOf(SelectedTrap.Second); TrapBuilderForm dlg = new TrapBuilderForm(SelectedTrap.Second); if (dlg.ShowDialog() == DialogResult.OK) { enc.Traps[index] = dlg.Trap; Session.Modified = true; update_list(); } return; } } } break; case OverviewType.SkillChallenges: { if (SelectedChallenge != null) { if (SelectedChallenge.First.Element is SkillChallenge) { SkillChallenge sc = SelectedChallenge.First.Element as SkillChallenge; SkillChallengeBuilderForm dlg = new SkillChallengeBuilderForm(SelectedChallenge.Second); if (dlg.ShowDialog() == DialogResult.OK) { sc.Name = dlg.SkillChallenge.Name; sc.Level = dlg.SkillChallenge.Level; sc.Complexity = dlg.SkillChallenge.Complexity; sc.Success = dlg.SkillChallenge.Success; sc.Failure = dlg.SkillChallenge.Failure; sc.Skills.Clear(); foreach (SkillChallengeData scd in dlg.SkillChallenge.Skills) { sc.Skills.Add(scd.Copy()); } Session.Modified = true; update_list(); } return; } if (SelectedChallenge.First.Element is Encounter) { Encounter enc = SelectedChallenge.First.Element as Encounter; int index = enc.SkillChallenges.IndexOf(SelectedChallenge.Second); SkillChallengeBuilderForm dlg = new SkillChallengeBuilderForm(SelectedChallenge.Second); if (dlg.ShowDialog() == DialogResult.OK) { enc.SkillChallenges[index] = dlg.SkillChallenge; Session.Modified = true; update_list(); } return; } } } break; case OverviewType.Treasure: { if (SelectedParcel != null) { int index = SelectedParcel.First.Parcels.IndexOf(SelectedParcel.Second); ParcelForm dlg = new ParcelForm(SelectedParcel.Second); if (dlg.ShowDialog() == DialogResult.OK) { SelectedParcel.First.Parcels[index] = dlg.Parcel; Session.Modified = true; update_list(); } return; } } break; } }
private void ItemList_DoubleClick(object sender, EventArgs e) { switch (this.fType) { case OverviewType.Encounters: { if (this.SelectedEncounter == null) { break; } int partyLevel = Workspace.GetPartyLevel(this.SelectedEncounter.First); EncounterBuilderForm encounterBuilderForm = new EncounterBuilderForm(this.SelectedEncounter.Second, partyLevel, false); if (encounterBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.SelectedEncounter.First.Element = encounterBuilderForm.Encounter; Session.Modified = true; this.update_list(); } return; } case OverviewType.Traps: { if (this.SelectedTrap == null) { break; } if (this.SelectedTrap.First.Element is TrapElement) { TrapElement element = this.SelectedTrap.First.Element as TrapElement; TrapBuilderForm trapBuilderForm = new TrapBuilderForm(this.SelectedTrap.Second); if (trapBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { element.Trap = trapBuilderForm.Trap; Session.Modified = true; this.update_list(); } return; } if (!(this.SelectedTrap.First.Element is Encounter)) { break; } Encounter trap = this.SelectedTrap.First.Element as Encounter; int num = trap.Traps.IndexOf(this.SelectedTrap.Second); TrapBuilderForm trapBuilderForm1 = new TrapBuilderForm(this.SelectedTrap.Second); if (trapBuilderForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { trap.Traps[num] = trapBuilderForm1.Trap; Session.Modified = true; this.update_list(); } return; } case OverviewType.SkillChallenges: { if (this.SelectedChallenge == null) { break; } if (this.SelectedChallenge.First.Element is SkillChallenge) { SkillChallenge name = this.SelectedChallenge.First.Element as SkillChallenge; SkillChallengeBuilderForm skillChallengeBuilderForm = new SkillChallengeBuilderForm(this.SelectedChallenge.Second); if (skillChallengeBuilderForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { name.Name = skillChallengeBuilderForm.SkillChallenge.Name; name.Level = skillChallengeBuilderForm.SkillChallenge.Level; name.Complexity = skillChallengeBuilderForm.SkillChallenge.Complexity; name.Success = skillChallengeBuilderForm.SkillChallenge.Success; name.Failure = skillChallengeBuilderForm.SkillChallenge.Failure; name.Skills.Clear(); foreach (SkillChallengeData skill in skillChallengeBuilderForm.SkillChallenge.Skills) { name.Skills.Add(skill.Copy()); } Session.Modified = true; this.update_list(); } return; } if (!(this.SelectedChallenge.First.Element is Encounter)) { break; } Encounter skillChallenge = this.SelectedChallenge.First.Element as Encounter; int num1 = skillChallenge.SkillChallenges.IndexOf(this.SelectedChallenge.Second); SkillChallengeBuilderForm skillChallengeBuilderForm1 = new SkillChallengeBuilderForm(this.SelectedChallenge.Second); if (skillChallengeBuilderForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { skillChallenge.SkillChallenges[num1] = skillChallengeBuilderForm1.SkillChallenge; Session.Modified = true; this.update_list(); } return; } case OverviewType.Treasure: { if (this.SelectedParcel == null) { break; } int parcel = this.SelectedParcel.First.Parcels.IndexOf(this.SelectedParcel.Second); ParcelForm parcelForm = new ParcelForm(this.SelectedParcel.Second); if (parcelForm.ShowDialog() != System.Windows.Forms.DialogResult.OK) { break; } this.SelectedParcel.First.Parcels[parcel] = parcelForm.Parcel; Session.Modified = true; this.update_list(); break; } default: { return; } } }