Exemple #1
0
 private void InputManagerOnMouseClick(object sender, MouseEventArgs mouseEventArgs)
 {
     if ((mouseEventArgs.Buttons & MouseButtons.Left) != 0)
     {
         if (Utils.IsUnderRectangle(Game.MouseScreenPosition, _position.X, _position.Y, _size.X, _size.Y))
         {
             OnClick?.Invoke();
         }
     }
 }
        private void OnMouseClick(object sender, MouseEventArgs args)
        {
            if (args.Buttons != MouseButtons.Left && args.Buttons != MouseButtons.Right)
            {
                return;
            }

            this.Targets = EntityManager <Hero> .Entities.Where(e => e.IsVisible && e.IsAlive && !e.IsIllusion && e.Team != this.Owner.Team)
                           .Where(e => e.Position.Distance(Game.MousePosition) < 400)
                           .OrderBy(e => e.Position.Distance(Game.MousePosition))
                           .ToArray();
        }
        private void OnMouseClick(object sender, MouseEventArgs e)
        {
            if (e.Buttons != MouseButtons.Left)
            {
                return;
            }
            var button = _buttons.FirstOrDefault(x => x.UnderMouse);

            if (button == null)
            {
                return;
            }
            button.Active = true;
            foreach (var b in _buttons.Where(x => !x.UnderMouse && button.OnAttack == x.OnAttack))
            {
                b.Active = false;
            }
        }