public frmNPCEditor(DataTypes.CivilianProfile ThisNPC) { InitializeComponent(); ChangeMade = false; NPC = ThisNPC; PopulateFields(); }
private void lstNPCs_MouseDoubleClick(object sender, MouseEventArgs e) { if (lstNPCs.SelectedIndex > -1) { DataTypes.CivilianProfile EditCiviy = new DataTypes.CivilianProfile(); EditCiviy = Event.NPCs[lstNPCs.SelectedIndex]; frmNPCEditor NewForm = new frmNPCEditor(EditCiviy); NewForm.ShowDialog(); EditCiviy = NewForm.NPC; Event.NPCs[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 (Event.NPCs == null) { Event.NPCs = new List <DataTypes.CivilianProfile>(); } Event.NPCs.Add(NewCiviy); } GetAllNPCs(); }
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(); }