private void butDeleteSpecialEffect_Click(object sender, EventArgs e) { SpecialEffect eff = cmbSpecialEffects.SelectedItem as SpecialEffect; if (eff != null && typeof(SpecialEffect) == eff.GetType()) { Item selectedItem = SelectedItem.Tag as Item; selectedItem.Stats.RemoveSpecialEffect(eff); UpdateSpecialEffects(); } }
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(); } }