Exemplo n.º 1
0
        public void OnCanvasClick(Point point, MouseButtonEventArgs e)
        {
            if (userActionsDisabled || !isGameInitialized)
            {
                return;
            }

            if (StaticMouse.Instance != null && StaticMouse.ALLOWED)
            {
                point = StaticMouse.GetPosition();
            }

            if (e.ChangedButton == MouseButton.Left && e.ButtonState == MouseButtonState.Pressed &&
                !IsPointInViewPort(point) && StaticMouse.Instance != null && StaticMouse.ALLOWED)
            {
                ProcessStaticMouseActionBarClick(point);
                return;
            }

            if (IsPointInViewPort(point))
            {
                clickListeners.ForEach(l => l.OnCanvasClick(point, e));
            }
            else
            {
                inputMgr.OnActionBarClick(point, e);
            }
        }
Exemplo n.º 2
0
        public override void Update(float tpf)
        {
            base.Update(tpf);

            if (targeting)
            {
                endPoint = StaticMouse.GetPosition();
                MoveLine();
            }
        }
Exemplo n.º 3
0
 public void Update(float tpf)
 {
     if (ReloadTime > 0)
     {
         ReloadTime -= tpf;
     }
     else if (shooting)
     {
         Shoot(StaticMouse.GetPosition());
     }
 }
Exemplo n.º 4
0
 public void OnCanvasMouseMove(Point point)
 {
     point = (StaticMouse.Instance != null && StaticMouse.ALLOWED) ? StaticMouse.GetPosition() : point;
     moveListeners.ForEach(l => l.OnMouseMove(point));
 }