Exemplo n.º 1
0
        public ChangeMarkingsWindow(IPokemon pokemon)
        {
            InitializeComponent();
            this.markings = pokemon.Markings;
            this.pokemon  = pokemon;

            this.circleHitBox.Tag   = this.markCircle;
            this.squareHitBox.Tag   = this.markSquare;
            this.triangleHitBox.Tag = this.markTriangle;
            this.heartHitBox.Tag    = this.markHeart;
            this.markCircle.Tag     = MarkingFlags.Circle;
            this.markSquare.Tag     = MarkingFlags.Square;
            this.markTriangle.Tag   = MarkingFlags.Triangle;
            this.markHeart.Tag      = MarkingFlags.Heart;

            this.markedBrush        = new SolidColorBrush(Color.FromRgb(0, 0, 0));
            this.markedHoverBrush   = new SolidColorBrush(Color.FromRgb(120, 120, 120));
            this.unmarkedBrush      = new SolidColorBrush(Color.FromRgb(170, 170, 170));
            this.unmarkedHoverBrush = new SolidColorBrush(Color.FromRgb(220, 220, 220));

            this.markCircle.Foreground   = (pokemon.IsCircleMarked ? markedBrush : unmarkedBrush);
            this.markSquare.Foreground   = (pokemon.IsSquareMarked ? markedBrush : unmarkedBrush);
            this.markTriangle.Foreground = (pokemon.IsTriangleMarked ? markedBrush : unmarkedBrush);
            this.markHeart.Foreground    = (pokemon.IsHeartMarked ? markedBrush : unmarkedBrush);
        }
        public ChangeMarkingsWindow(IPokemon pokemon)
        {
            InitializeComponent();
            this.markings = pokemon.Markings;
            this.pokemon = pokemon;

            this.circleHitBox.Tag = this.markCircle;
            this.squareHitBox.Tag = this.markSquare;
            this.triangleHitBox.Tag = this.markTriangle;
            this.heartHitBox.Tag = this.markHeart;
            this.markCircle.Tag = MarkingFlags.Circle;
            this.markSquare.Tag = MarkingFlags.Square;
            this.markTriangle.Tag = MarkingFlags.Triangle;
            this.markHeart.Tag = MarkingFlags.Heart;

            this.markedBrush = new SolidColorBrush(Color.FromRgb(0, 0, 0));
            this.markedHoverBrush = new SolidColorBrush(Color.FromRgb(120, 120, 120));
            this.unmarkedBrush = new SolidColorBrush(Color.FromRgb(170, 170, 170));
            this.unmarkedHoverBrush = new SolidColorBrush(Color.FromRgb(220, 220, 220));

            this.markCircle.Foreground = (pokemon.IsCircleMarked ? markedBrush : unmarkedBrush);
            this.markSquare.Foreground = (pokemon.IsSquareMarked ? markedBrush : unmarkedBrush);
            this.markTriangle.Foreground = (pokemon.IsTriangleMarked ? markedBrush : unmarkedBrush);
            this.markHeart.Foreground = (pokemon.IsHeartMarked ? markedBrush : unmarkedBrush);
        }
Exemplo n.º 3
0
        private void OnMarkingClicked(object sender, MouseButtonEventArgs e)
        {
            MarkingFlags flag = (MarkingFlags)((Label)((Rectangle)sender).Tag).Tag;

            if (markings.HasFlag(flag))
            {
                markings &= ~flag;
                ((Label)((Rectangle)sender).Tag).Foreground = unmarkedHoverBrush;
            }
            else
            {
                markings |= flag;
                ((Label)((Rectangle)sender).Tag).Foreground = markedHoverBrush;
            }
        }
 private void OnMarkingClicked(object sender, MouseButtonEventArgs e)
 {
     MarkingFlags flag = (MarkingFlags)((Label)((Rectangle)sender).Tag).Tag;
     if (markings.HasFlag(flag)) {
         markings &= ~flag;
         ((Label)((Rectangle)sender).Tag).Foreground = unmarkedHoverBrush;
     }
     else {
         markings |= flag;
         ((Label)((Rectangle)sender).Tag).Foreground = markedHoverBrush;
     }
 }