private void newMonsterToolStripMenuItem_Click(object sender, EventArgs e) { if (!(check_if_db_open())) { return; } name_input n_in = new name_input(); n_in.ShowDialog(); if (n_in.name == "") { return; } if (current_driver.get_list_of_monsters().Contains(n_in.name)) { var yn = MessageBox.Show("Monster " + n_in.name + " alredy exists replace?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (yn != DialogResult.Yes) { return; } } current_driver.new_monster(n_in.name); monster m = current_driver.read_monster(n_in.name); Monster_Editor me = new Monster_Editor(current_driver, m); me.ShowDialog(); }
private void Add_Click(object sender, EventArgs e) { name_input n = new name_input(); n.ShowDialog(); if (!(check_ok(n.name))) { return; } ; if (ty == "monster") { drive.new_monster(n.name); Monster_Editor me = new Monster_Editor(drive, drive.read_monster(n.name)); me.ShowDialog(); } if (ty == "encounter") { drive.new_encounter(n.name); encounterEdit en = new encounterEdit(drive, n.name); en.ShowDialog(); } update_list(); }
private void OK_Click(object sender, EventArgs e) { fighter nf = new fighter(); if (!(check_name_ok() && check_monster_ok())) { return; } nf.fighter_name = name_box.Text; nf.encounter_id = _name; nf.monster_id = Monster_Select.Text; nf.hitpoits = drive.read_monster(nf.monster_id).hitpoints; drive.new_fighter(nf); this.Close(); }