Example #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();
        }
Example #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();
        }
Example #3
0
        private void editEncounterToolStripMenuItem_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_encounters().Contains(n_in.name)))
            {
                MessageBox.Show("encounter " + n_in.name + " doesnt exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            encounterEdit eddit = new encounterEdit(current_driver, n_in.name);

            eddit.ShowDialog();
        }
Example #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();
        }