Point GetLocationForMode(TargetCoordinateUnits units)
        {
            switch (units)
              {
            case TargetCoordinateUnits.AbsoluteTile:
              return new Point(absoluteTileXUpDown.Value, absoluteTileYUpDown.Value);

            case TargetCoordinateUnits.AbsoluteXY:
              return new Point(absoluteXUpDown.Value, absoluteYUpDown.Value);

            case TargetCoordinateUnits.RelativeTile:
              return new Point((int)relativeTileXComboBox.SelectedValue, (int)relativeTileYComboBox.SelectedValue);

            case TargetCoordinateUnits.RelativeXY:
              return new Point(relativeXUpDown.Value, relativeYUpDown.Value);

            case TargetCoordinateUnits.RelativeRadius:
              goto case TargetCoordinateUnits.RelativeTile;

            case TargetCoordinateUnits.AbsoluteRadius:
              goto case TargetCoordinateUnits.AbsoluteTile;

            default:
              return new Point(0, 0);
              }
        }
        Point GetLocationForMode(TargetCoordinateUnits units)
        {
            switch (units)
            {
            case TargetCoordinateUnits.AbsoluteTile:
                return(new Point(absoluteTileXUpDown.Value, absoluteTileYUpDown.Value));

            case TargetCoordinateUnits.AbsoluteXY:
                return(new Point(absoluteXUpDown.Value, absoluteYUpDown.Value));

            case TargetCoordinateUnits.RelativeTile:
                return(new Point((int)relativeTileXComboBox.SelectedValue, (int)relativeTileYComboBox.SelectedValue));

            case TargetCoordinateUnits.RelativeXY:
                return(new Point(relativeXUpDown.Value, relativeYUpDown.Value));

            case TargetCoordinateUnits.RelativeRadius:
                goto case TargetCoordinateUnits.RelativeTile;

            case TargetCoordinateUnits.AbsoluteRadius:
                goto case TargetCoordinateUnits.AbsoluteTile;

            default:
                return(new Point(0, 0));
            }
        }
Ejemplo n.º 3
0
        public SpellTarget(TargetCoordinateUnits units, Point location, Point offset)
        {
            this.unitType = units;
            this.location = location;
            this.offset   = offset;

            RecalculatePoints();
        }
Ejemplo n.º 4
0
        public SpellTarget(TargetCoordinateUnits units, Point location, Point offset)
        {
            this.unitType = units;
              this.location = location;
              this.offset = offset;

              RecalculatePoints();
        }
        TargetCoordinateUnits GetSelectedMode()
        {
            TargetCoordinateUnits mode = TargetCoordinateUnits.None;

            if (targetModeComboBox == null)
            {
                return(mode);
            }

            var setting = targetModeComboBox.SelectedValue as string;

            if (setting == null)
            {
                return(mode);
            }

            Enum.TryParse(setting, out mode);
            return(mode);
        }
Ejemplo n.º 6
0
 public SpellTarget(TargetCoordinateUnits units, Point location)
     : this(units, location, new Point())
 {
 }
Ejemplo n.º 7
0
 public SpellTarget(TargetCoordinateUnits units, Point location)
     : this(units, location, new Point())
 {
 }
        void ToggleTargetMode(TargetCoordinateUnits units)
        {
            var requiresTarget = units != TargetCoordinateUnits.None;
              var isSelfTarget = units == TargetCoordinateUnits.Self;
              var isRadius = units == TargetCoordinateUnits.AbsoluteRadius || units == TargetCoordinateUnits.RelativeRadius;

              if (characterComboBox != null)
            characterComboBox.Visibility = (units == TargetCoordinateUnits.Character) ? Visibility.Visible : Visibility.Collapsed;

              if (relativeTileXComboBox != null)
            relativeTileXComboBox.Visibility = (units == TargetCoordinateUnits.RelativeTile || units == TargetCoordinateUnits.RelativeRadius) ? Visibility.Visible : Visibility.Collapsed;

              if (relativeXUpDown != null)
            relativeXUpDown.Visibility = (units == TargetCoordinateUnits.RelativeXY) ? Visibility.Visible : Visibility.Collapsed;

              if (absoluteTileXUpDown != null)
            absoluteTileXUpDown.Visibility = (units == TargetCoordinateUnits.AbsoluteTile || units == TargetCoordinateUnits.AbsoluteRadius) ? Visibility.Visible : Visibility.Collapsed;

              if (absoluteXUpDown != null)
            absoluteXUpDown.Visibility = (units == TargetCoordinateUnits.AbsoluteXY) ? Visibility.Visible : Visibility.Collapsed;

              if (offsetXUpDown != null)
            offsetXUpDown.Visibility = (units != TargetCoordinateUnits.None) ? Visibility.Visible : Visibility.Collapsed;

              if (innerRadiusUpDown != null)
            innerRadiusUpDown.Visibility = isRadius ? Visibility.Visible : Visibility.Collapsed;

              if (outerRadiusUpDown != null)
            outerRadiusUpDown.Visibility = isRadius ? Visibility.Visible : Visibility.Collapsed;

              if (manaThresholdCheckBox != null)
              {
            manaThresholdCheckBox.IsEnabled = (units == TargetCoordinateUnits.Character);

            if (!manaThresholdCheckBox.IsEnabled)
              manaThresholdCheckBox.IsChecked = false;
              }

              var height = 300;

              if (requiresTarget)
            height += 40;

              if (isRadius)
            height += 90;

              if (!isSelfTarget && requiresTarget)
            height += 40;

              this.Height = height;
        }
        void ToggleTargetMode(TargetCoordinateUnits units)
        {
            var requiresTarget = units != TargetCoordinateUnits.None;
            var isSelfTarget   = units == TargetCoordinateUnits.Self;
            var isRadius       = units == TargetCoordinateUnits.AbsoluteRadius || units == TargetCoordinateUnits.RelativeRadius;

            if (characterComboBox != null)
            {
                characterComboBox.Visibility = (units == TargetCoordinateUnits.Character) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (relativeTileXComboBox != null)
            {
                relativeTileXComboBox.Visibility = (units == TargetCoordinateUnits.RelativeTile || units == TargetCoordinateUnits.RelativeRadius) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (relativeXUpDown != null)
            {
                relativeXUpDown.Visibility = (units == TargetCoordinateUnits.RelativeXY) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (absoluteTileXUpDown != null)
            {
                absoluteTileXUpDown.Visibility = (units == TargetCoordinateUnits.AbsoluteTile || units == TargetCoordinateUnits.AbsoluteRadius) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (absoluteXUpDown != null)
            {
                absoluteXUpDown.Visibility = (units == TargetCoordinateUnits.AbsoluteXY) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (offsetXUpDown != null)
            {
                offsetXUpDown.Visibility = (units != TargetCoordinateUnits.None) ? Visibility.Visible : Visibility.Collapsed;
            }

            if (innerRadiusUpDown != null)
            {
                innerRadiusUpDown.Visibility = isRadius ? Visibility.Visible : Visibility.Collapsed;
            }

            if (outerRadiusUpDown != null)
            {
                outerRadiusUpDown.Visibility = isRadius ? Visibility.Visible : Visibility.Collapsed;
            }

            if (manaThresholdCheckBox != null)
            {
                manaThresholdCheckBox.IsEnabled = (units == TargetCoordinateUnits.Character);

                if (!manaThresholdCheckBox.IsEnabled)
                {
                    manaThresholdCheckBox.IsChecked = false;
                }
            }

            var height = 300;

            if (requiresTarget)
            {
                height += 40;
            }

            if (isRadius)
            {
                height += 90;
            }

            if (!isSelfTarget && requiresTarget)
            {
                height += 40;
            }

            this.Height = height;
        }