public SpellTargetWindow(Spell spell) : this() { this.Spell = spell; maxLevelUpDown.Value = spell.MaximumLevel; maxLevelCheckBox.IsChecked = spell.CurrentLevel < spell.MaximumLevel; if (spell.TargetMode == SpellTargetMode.None) { targetModeComboBox.SelectedValue = "None"; targetModeComboBox.IsEnabled = false; } else targetModeComboBox.SelectedValue = "Self"; if (!SpellMetadataManager.Instance.ContainsSpell(spell.Name)) { WarningBorder.Visibility = Visibility.Visible; var opacityAnimation = new DoubleAnimation(1.0, 0.25, new Duration(TimeSpan.FromSeconds(0.4))); opacityAnimation.AccelerationRatio = 0.75; opacityAnimation.AutoReverse = true; opacityAnimation.RepeatBehavior = RepeatBehavior.Forever; WarningIcon.BeginAnimation(FrameworkElement.OpacityProperty, opacityAnimation); } }
public SpellTargetWindow(Spell spell, SpellQueueItem item, bool isEditMode = true) : this(spell) { if (isEditMode) { this.Title = "Edit Target"; okButton.Content = "_Save Changes"; } this.SpellQueueItem.Id = item.Id; SetTargetForMode(item.Target); maxLevelCheckBox.IsChecked = item.HasTargetLevel; if (item.HasTargetLevel) maxLevelUpDown.Value = item.TargetLevel.Value; this.IsEditMode = isEditMode; }