Ejemplo n.º 1
0
 /// <summary>
 /// Handles mouse moved event.
 /// </summary>
 /// <param name="args">The mouse moved event data.</param>
 void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
 {
     if (cameraType == CameraMovementType.FreeFloat)
     {
         camera.AddDecayingRotation(new Vector2(args.DeltaX, args.DeltaY) * MouseRotationSensitivity);
     }
 }
Ejemplo n.º 2
0
 public override void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
 {
     if (mouseButtonDown)
     {
         map.ChangeTileHeight(centerTile, highlight.Size, -args.DeltaY * Sensitivity);
     }
 }
Ejemplo n.º 3
0
 public override void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
 {
     if (mouseDown)
     {
         map.ChangeHeight(selector.SelectedVerticies, -args.DeltaY * Sensitivity);
         map.HighlightCornerList(selector.SelectedVerticies, Color.Green);
     }
 }
Ejemplo n.º 4
0
        void OnMouseMove(MHUrhoMouseMovedEventArgs e)
        {
            if (ui.UIHovering)
            {
                return;
            }

            HighlightBuildingRectangle();
        }
Ejemplo n.º 5
0
        void MouseMove(MHUrhoMouseMovedEventArgs args)
        {
            Vector2 newMovement = (Button.ScreenToElement(args.CursorPosition) - MinimapClickPos).ToVector2();

            newMovement.Y = -newMovement.Y;
            CameraMover.SetStaticHorizontalMovement(CameraMover.StaticHorizontalMovement + (newMovement - PreviousCameraMovement));

            PreviousCameraMovement = newMovement;
        }
Ejemplo n.º 6
0
        void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
        {
            if (ui.UIHovering)
            {
                return;
            }

            manipulator?.OnMouseMoved(args);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Safely invokes the <see cref="MouseMove"/> event with the given <paramref name="args"/>.
 /// Protects against plugin thrown exceptions.
 /// </summary>
 /// <param name="args">The arguments to invoke the event with</param>
 void InvokeMouseMove(MHUrhoMouseMovedEventArgs args)
 {
     try
     {
         MouseMove?.Invoke(args);
     }
     catch (Exception e)
     {
         Urho.IO.Log.Write(LogLevel.Warning,
                           $"There was an unexpected exception during the invocation of {nameof(MouseMove)}: {e.Message}");
     }
 }
Ejemplo n.º 8
0
        void OnMouseMove(MHUrhoMouseMovedEventArgs e)
        {
            if (ui.UIHovering)
            {
                return;
            }

            if (fixedCenter != null)
            {
                Map.HighlightRectangle(fixedCenter, new IntVector2(EdgeSize, EdgeSize), color);
                return;
            }

            HighlightSquareAndSignal();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Handles the engine mouse moved event and translates it to platform mouse moved event.
        /// </summary>
        /// <param name="e">The engine mouse button down data.</param>
        protected override void MouseMoved(MouseMovedEventArgs e)
        {
            //Because of the software Cursor, the OS cursor stays in the middle of the screen and e.X and e.Y represent the OS cursor position
            //UI.CursorPosition is updated after this, so i need to move it myself
            var args = new MHUrhoMouseMovedEventArgs(UI.CursorPosition + new IntVector2(e.DX, e.DY), e.DX, e.DY, (MouseButton)e.Buttons, e.Qualifiers);


            InvokeMouseMove(args);

            //Invisible cursor cannot be on the border
            if (!cursorVisible)
            {
                cachedTileUnderCursor = null;
                return;
            }

            IntVector2 prevMousePos = new IntVector2(args.X - args.DeltaX, args.Y - args.DeltaY);
            IntVector2 mousePos     = new IntVector2(args.X, args.Y);

            if (IsBorder(prevMousePos) || IsBorder(mousePos))
            {
                List <ScreenBorder> prevBorders = GetBorders(prevMousePos);
                List <ScreenBorder> borders     = GetBorders(mousePos);

                foreach (var prevBorder in prevBorders)
                {
                    if (!borders.Contains(prevBorder))
                    {
                        InvokeLeftScreenBorder(prevBorder);
                    }
                }


                foreach (var border in borders)
                {
                    if (!prevBorders.Contains(border))
                    {
                        InvokeEnteredScreenBorder(border);
                    }
                }
            }



            cachedTileUnderCursor = null;
        }
Ejemplo n.º 10
0
        public override void OnMouseMove(MHUrhoMouseMovedEventArgs e)
        {
            if (line == null)
            {
                ITile tile = input.GetTileUnderCursor();
                if (tile == null)
                {
                    return;
                }
                Color color = BuildingType.CanBuild(GetBuildingRectangle(tile, BuildingType).TopLeft(),
                                                    input.Player,
                                                    Level) &&
                              cost.HasResources(input.Player)
                                                                ? AbleColor
                                                                : UnableColor;
                Level.Map.HighlightTileList(new [] { tile }, color);
                return;
            }

            UpdateHighlight();
        }
Ejemplo n.º 11
0
 public virtual void OnMouseMove(MHUrhoMouseMovedEventArgs e)
 {
 }
Ejemplo n.º 12
0
 void OnMouseMove(MHUrhoMouseMovedEventArgs e)
 {
     currentBuilder?.OnMouseMove(e);
 }
Ejemplo n.º 13
0
 void MouseMove(MHUrhoMouseMovedEventArgs e)
 {
     MouseAndCameraMove();
 }
Ejemplo n.º 14
0
 public virtual void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
 {
 }
Ejemplo n.º 15
0
 public override void OnMouseMove(MHUrhoMouseMovedEventArgs e)
 {
     HighlightBuildingRectangle();
 }
Ejemplo n.º 16
0
 public override void OnMouseMoved(MHUrhoMouseMovedEventArgs args)
 {
     MouseOrCameraMove();
 }
Ejemplo n.º 17
0
 void OnMouseMove(MHUrhoMouseMovedEventArgs e)
 {
     currentSpawner?.OnMouseMove(e);
 }