private void AddButton_Click(object sender, EventArgs e)
        {
            Encounter encounter = new Encounter();

            using (EncounterForm child = new EncounterForm())
            {
                child.Setup(Context, Zone, encounter);

                if (child.ShowDialog() == DialogResult.OK)
                {
                    child.Apply();
                    Zone.Encounters.Add(encounter);

                    Context.UnsavedChanges = true;
                    Context.UpdateEncounters();
                }
            }
        }
        private void Edit()
        {
            if (Options.SelectedIndex == -1)
            {
                return;
            }

            Encounter encounter = Zone.Encounters[Options.SelectedIndex];

            using (EncounterForm child = new EncounterForm())
            {
                child.Setup(Context, Zone, encounter);

                if (child.ShowDialog() == DialogResult.OK)
                {
                    child.Apply();
                    Context.UnsavedChanges = true;
                    Context.UpdateEncounters();
                }
            }
        }
Beispiel #3
0
            public Row(int index, EncounterForm parent)
            {
                Parent = parent;

                Minimum   = Parent.Encounter.Minimums[index];
                Maximum   = Parent.Encounter.Maximums[index];
                MonsterId = Parent.Encounter.MonsterIds[index];

                MinimumBox = new NumericUpDown()
                {
                    Minimum = 0,
                    Maximum = 255,
                    Dock    = DockStyle.Fill,
                    Value   = Minimum
                };
                MinimumBox.ValueChanged += MinimumBox_ValueChanged;

                MaximumBox = new NumericUpDown()
                {
                    Minimum = 0,
                    Maximum = 255,
                    Dock    = DockStyle.Fill,
                    Value   = Maximum
                };
                MaximumBox.ValueChanged += MaximumBox_ValueChanged;

                MonsterBox = new ComboBox()
                {
                    Dock = DockStyle.Fill
                };
                MonsterBox.SelectedIndexChanged += MonsterBox_SelectedIndexChanged;
                RefreshMonsterList();

                Parent.MonsterTable.Controls.Add(MinimumBox, 0, index);
                Parent.MonsterTable.Controls.Add(MaximumBox, 1, index);
                Parent.MonsterTable.Controls.Add(MonsterBox, 2, index);
            }