示例#1
0
        /// <summary>Raised after the player scrolls the mouse wheel.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void onMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            int currentToolIndex = Game1.player.CurrentToolIndex;

            this.newToolIndex = currentToolIndex;

            bool mouseWheelMovedDown   = e.Delta < 0;
            bool invertScrollDirection = Game1.options.invertScrollDirection;

            if (mouseWheelMovedDown && !invertScrollDirection)
            {
                this.newToolIndex++;
            }
            else
            {
                this.newToolIndex--;
            }

            // Wrap Around
            if (this.newToolIndex < 0)
            {
                this.newToolIndex = 11;
            }

            if (this.newToolIndex >= 12)
            {
                this.newToolIndex = 0;
            }

            this.updateToolIndex = true;
        }
        /// <summary>Raised after the player scrolls the mouse wheel.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            var cursor = helper.Input.GetCursorPosition().ScreenPixels;

            if (this.isWithinBounds((int)cursor.X, (int)cursor.Y) && this.EmotesMenuBoxComponent.IsOpen)
            {
                MouseState mouseState = Game1.oldMouseState;
                Game1.oldMouseState = new MouseState(mouseState.X, mouseState.Y, e.NewValue, mouseState.LeftButton, mouseState.MiddleButton, mouseState.RightButton, mouseState.XButton1, mouseState.XButton2);
                receiveScrollWheelAction(e.Delta);
            }
        }
示例#3
0
        /// <summary>Raised after the player scrolls the mouse wheel.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void onMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            if (!isInitiated)
            {
                return;
            }

            if (verticalToolbar.numToolsinToolbar > 0)
            {
                checkHoveredItem(e.Delta > 0 ? 1 : -1);
            }
        }
示例#4
0
 private void onMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
 {
     Dropdown.ActiveDropdown?.receiveScrollWheelAction(e.Delta);
     if (ModConfigMenu.ActiveConfigMenu is ModConfigMenu mcm)
     {
         mcm.receiveScrollWheelActionSmapi(e.Delta);
     }
     if (SpecificModConfigMenu.ActiveConfigMenu is SpecificModConfigMenu smcm)
     {
         smcm.receiveScrollWheelActionSmapi(e.Delta);
     }
 }
示例#5
0
        /// <summary>Raised after the player scrolls the mouse wheel.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            var cursor = e.Position.GetScaledScreenPixels();

            ModEntry.ModMonitor.Log($"(x: {cursor.X}, y: {cursor.Y}) (x: {Game1.getMouseX()}, y: {Game1.getMouseY()})");
            if (this.isWithinBounds((int)cursor.X, (int)cursor.Y))
            {
                MouseState mouseState = Game1.oldMouseState;
                Game1.oldMouseState = new MouseState(mouseState.X, mouseState.Y, e.NewValue, mouseState.LeftButton, mouseState.MiddleButton, mouseState.RightButton, mouseState.XButton1, mouseState.XButton2);
                receiveScrollWheelAction(e.Delta);
            }
        }
示例#6
0
 /// Mouse wheel scrolling of tabs.
 private void RecieveMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
 {
     if (e.Delta > 0)
     {
         SetSelectedTab(_selectedTab + 1);
         ClampRootTab();
     }
     else
     {
         SetSelectedTab(_selectedTab - 1);
         ClampRootTab();
     }
 }
示例#7
0
        /// <summary>The method invoked when the mouse wheel is scrolled.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The event arguments.</param>
        private void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            bool scrollHandled = this.ReceiveScrollWheelAction(e.Delta);

            if (scrollHandled)
            {
                MouseState cur = Game1.oldMouseState;
                Game1.oldMouseState = new MouseState(
                    x: cur.X,
                    y: cur.Y,
                    scrollWheel: e.NewValue,
                    leftButton: cur.LeftButton,
                    middleButton: cur.MiddleButton,
                    rightButton: cur.RightButton,
                    xButton1: cur.XButton1,
                    xButton2: cur.XButton2
                    );
            }
        }
 public void OnMouseWheelMove(MouseWheelScrolledEventArgs eventArgs)
 {
     if (eventArgs.Args.Delta > 0)
     {
         selectedApplicationIndex -= 1;
         if (selectedApplicationIndex < 0)
         {
             selectedApplicationIndex = applications.Count - 1;
         }
     }
     else
     {
         selectedApplicationIndex += 1;
         if (selectedApplicationIndex >= applications.Count)
         {
             selectedApplicationIndex = 0;
         }
     }
 }
示例#9
0
        private void Input_MouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            bool flag = Context.IsWorldReady;

            if (isExtendedModeOn)
            {
                if (e.OldValue != e.NewValue)
                {
                    isWheeling = true;
                }
                else
                {
                    isWheeling = false;
                }

                if (flag)
                {
                    if (isHoldingLeftCtrl || isHoldingRightCtrl)
                    {
                        if (e.OldValue < e.NewValue)
                        {
                            currentToolIndex = Game1.player.CurrentToolIndex;
                            if (Game1.options.zoomLevel <= Options.maxZoom)
                            {
                                Game1.options.zoomLevel += 0.05f;
                            }
                            Game1.exitActiveMenu();
                        }
                        else if (e.OldValue > e.NewValue)
                        {
                            currentToolIndex = Game1.player.CurrentToolIndex;
                            if (Game1.options.zoomLevel >= Options.minZoom)
                            {
                                Game1.options.zoomLevel -= 0.05f;
                            }
                            Game1.exitActiveMenu();
                        }
                    }
                }
            }
        }
示例#10
0
        // Scroll to empty toolbar slot on mouse wheel scroll
        private static void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            if (!Context.CanPlayerMove || Game1.activeClickableMenu != null ||
                Game1.player.UsingTool || Game1.pickingTool)
            {
                return;
            }

            NewToolIndex = Game1.player.CurrentToolIndex;

            if (e.Delta < 0 && !Game1.options.invertScrollDirection)
            {
                ++NewToolIndex;
            }
            else
            {
                --NewToolIndex;
            }

            NewToolIndex = (NewToolIndex + TBSlots) % TBSlots;
        }
示例#11
0
        private void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
        {
            if (!drawAnimal)
            {
                return;
            }

            if (e.NewValue < e.OldValue && heartLevel > 0)
            {
                heartLevel -= 1;
            }
            else if (e.NewValue > e.OldValue && heartLevel < 5)
            {
                heartLevel += 1;
            }
            else
            {
                return;
            }

            Game1.playSound("smallSelect");
        }
示例#12
0
    private void OnMouseWheelScrolled(object?sender, MouseWheelScrolledEventArgs e)
    {
        if (Context.ScreenId != ScreenID)
        {
            return;
        }

        bool handled = ReceiveScrollWheelAction(e.Delta);

        if (handled)
        {
            MouseState old = Game1.oldMouseState;
            Game1.oldMouseState = new MouseState(
                x: old.X,
                y: old.Y,
                scrollWheel: e.NewValue,
                leftButton: old.LeftButton,
                middleButton: old.MiddleButton,
                rightButton: old.RightButton,
                xButton1: old.XButton1,
                xButton2: old.XButton2
                );
        }
    }
示例#13
0
 private void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
 {
 }
 /// <summary>Raised after the player scrolls the mouse wheel.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 protected virtual void OnMouseWheelScrolled(object sender, MouseWheelScrolledEventArgs e)
 {
 }