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); } }
public override void Update(float tpf) { base.Update(tpf); if (targeting) { endPoint = StaticMouse.GetPosition(); MoveLine(); } }
public void Update(float tpf) { if (ReloadTime > 0) { ReloadTime -= tpf; } else if (shooting) { Shoot(StaticMouse.GetPosition()); } }
public void OnCanvasMouseMove(Point point) { point = (StaticMouse.Instance != null && StaticMouse.ALLOWED) ? StaticMouse.GetPosition() : point; moveListeners.ForEach(l => l.OnMouseMove(point)); }