private void lstNPCs_MouseDoubleClick(object sender, MouseEventArgs e) { if (lstNPCs.SelectedIndex > -1) { DataTypes.CivilianProfile EditCiviy = new DataTypes.CivilianProfile(); EditCiviy = Room.Civilians[lstNPCs.SelectedIndex]; frmNPCEditor NewForm = new frmNPCEditor(EditCiviy); NewForm.ShowDialog(); EditCiviy = NewForm.NPC; Room.Civilians[lstNPCs.SelectedIndex] = EditCiviy; GetAllNPCs(); } }
private void cmdAddNPC_Click(object sender, EventArgs e) { DataTypes.CivilianProfile NewCiviy = new DataTypes.CivilianProfile(); frmNPCEditor NewForm = new frmNPCEditor(NewCiviy); NewForm.ShowDialog(); NewCiviy = NewForm.NPC; if (NewCiviy.name != null) { if (Room.Civilians == null) Room.Civilians = new List<DataTypes.CivilianProfile>(); Room.Civilians.Add(NewCiviy); } GetAllNPCs(); }