Beispiel #1
0
        private void butAddSpecialEffect_Click(object sender, EventArgs e)
        {
            FormEditSpecialEffect form = new FormEditSpecialEffect();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                Item selectedItem = SelectedItem.Tag as Item;
                selectedItem.Stats.AddSpecialEffect(new SpecialEffect(form.Trigger, form.Stats,
                                                                      form.Duration, form.Cooldown, form.Chance, form.Stacks));
                UpdateSpecialEffects();
            }
            form.Dispose();
        }
Beispiel #2
0
        private void butEditSpecialEffect_Click(object sender, EventArgs e)
        {
            SpecialEffect eff = cmbSpecialEffects.SelectedItem as SpecialEffect;

            if (eff != null && typeof(SpecialEffect) == eff.GetType())
            {
                FormEditSpecialEffect form = new FormEditSpecialEffect(eff.Stats, eff.Trigger, eff.Duration, eff.Cooldown, eff.Chance, eff.MaxStack);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    Item selectedItem = SelectedItem.Tag as Item;
                    selectedItem.Stats.RemoveSpecialEffect(eff);
                    form.Stats.InvalidateSparseData();
                    selectedItem.Stats.AddSpecialEffect(new SpecialEffect(form.Trigger, form.Stats,
                                                                          form.Duration, form.Cooldown, form.Chance, form.Stacks));
                    UpdateSpecialEffects();
                }
                form.Dispose();
            }
        }