Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        private void Edit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                return;
            }
            string n = listBox1.SelectedItem.ToString();

            if (ty == "monster")
            {
                Monster_Editor me = new Monster_Editor(drive, drive.read_monster(n));
                me.ShowDialog();
            }
            if (ty == "encounter")
            {
                encounterEdit en = new encounterEdit(drive, n);
                en.ShowDialog();
            }
            update_list();
        }
Ejemplo n.º 3
0
        private void editMonsterToolStripMenuItem_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)))
            {
                MessageBox.Show("Monster " + n_in.name + " doesnt exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            monster        m  = current_driver.read_monster(n_in.name);
            Monster_Editor me = new Monster_Editor(current_driver, m);

            me.ShowDialog();
        }
Ejemplo n.º 4
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();
        }