Esempio n. 1
0
        private void newEncounterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!(check_if_db_open()))
            {
                return;
            }
            name_input n = new name_input();

            n.ShowDialog();
            if (n.name == "")
            {
                return;
            }
            ;
            if (current_driver.get_list_of_encounters().Contains(n.name))
            {
                var yn = MessageBox.Show("Encounter " + n.name + " alredy exists replace?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (yn != DialogResult.Yes)
                {
                    return;
                }
            }
            current_driver.new_encounter(n.name);
            encounterEdit eedit = new encounterEdit(current_driver, n.name);

            eedit.ShowDialog();
        }
Esempio n. 2
0
        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();
        }