Beispiel #1
0
        private void OnEditEffect(object parameter)
        {
            if (parameter == null || !CanEditEffect(parameter))
            {
                return;
            }

            var effect = (EffectWrapper)parameter;

            var dialog = new EffectEditorDialog
            {
                EffectToEdit  = (EffectWrapper)(effect).Clone(),
                EffectsSource =
                    m_effects ??
                    (m_effects = ObjectDataManager.Instance.EnumerateObjects <EffectRecord>().ToList())
            };

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            var index = Item.WrappedEffects.IndexOf(effect);

            Item.WrappedEffects.Remove(effect);
            Item.WrappedEffects.Insert(index, dialog.EffectToEdit);
        }
Beispiel #2
0
        private void OnAddEffect(object parameter)
        {
            var dialog = new EffectEditorDialog
            {
                EffectsSource =
                    m_effects ??
                    (m_effects = ObjectDataManager.Instance.EnumerateObjects <EffectRecord>().ToList())
            };

            var effect = new EffectDiceWrapper(new EffectInstanceDice()
            {
                EffectId = (uint)m_effects.First().Id
            });

            dialog.EffectToEdit = effect;

            if (dialog.ShowDialog() == true)
            {
                Item.WrappedEffects.Add(dialog.EffectToEdit);
            }
        }