diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-11-26 15:39:41 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-11-26 15:39:41 -0500 |
commit | ca13b2834c3d34be94c4d46a59cba945e62cce33 (patch) | |
tree | 786ef205df9844f2fa6249405e21949cd34fd1db /src/SMAPI/Events/EventArgsInput.cs | |
parent | c0c65ec6ddcf50c2a97fa74ebf94e714892ba3c2 (diff) | |
download | SMAPI-ca13b2834c3d34be94c4d46a59cba945e62cce33.tar.gz SMAPI-ca13b2834c3d34be94c4d46a59cba945e62cce33.tar.bz2 SMAPI-ca13b2834c3d34be94c4d46a59cba945e62cce33.zip |
fix e.SuppressButton() not working with some mouse buttons, update release notes (#389)
Diffstat (limited to 'src/SMAPI/Events/EventArgsInput.cs')
-rw-r--r-- | src/SMAPI/Events/EventArgsInput.cs | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs index 276bfef6..54ce9b53 100644 --- a/src/SMAPI/Events/EventArgsInput.cs +++ b/src/SMAPI/Events/EventArgsInput.cs @@ -129,30 +129,17 @@ namespace StardewModdingAPI.Events } // mouse - else if (button == SButton.MouseLeft) + else if (button == SButton.MouseLeft || button == SButton.MouseMiddle || button == SButton.MouseRight || button == SButton.MouseX1 || button == SButton.MouseX2) { Game1.oldMouseState = new MouseState( - Game1.oldMouseState.X, - Game1.oldMouseState.Y, - Game1.oldMouseState.ScrollWheelValue, - ButtonState.Pressed, - Game1.oldMouseState.MiddleButton, - Game1.oldMouseState.RightButton, - Game1.oldMouseState.XButton1, - Game1.oldMouseState.XButton2 - ); - } - else if (button == SButton.MouseRight) - { - Game1.oldMouseState = new MouseState( - Game1.oldMouseState.X, - Game1.oldMouseState.Y, - Game1.oldMouseState.ScrollWheelValue, - Game1.oldMouseState.LeftButton, - Game1.oldMouseState.MiddleButton, - ButtonState.Pressed, - Game1.oldMouseState.XButton1, - Game1.oldMouseState.XButton2 + x: Game1.oldMouseState.X, + y: Game1.oldMouseState.Y, + scrollWheel: Game1.oldMouseState.ScrollWheelValue, + leftButton: button == SButton.MouseLeft ? ButtonState.Pressed : Game1.oldMouseState.LeftButton, + middleButton: button == SButton.MouseMiddle ? ButtonState.Pressed : Game1.oldMouseState.MiddleButton, + rightButton: button == SButton.MouseRight ? ButtonState.Pressed : Game1.oldMouseState.RightButton, + xButton1: button == SButton.MouseX1 ? ButtonState.Pressed : Game1.oldMouseState.XButton1, + xButton2: button == SButton.MouseX2 ? ButtonState.Pressed : Game1.oldMouseState.XButton2 ); } } |