diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-12-02 18:49:49 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-12-02 18:49:49 -0500 |
commit | 5cc5f089b9645a60385ff293b5a7202f260bfc0f (patch) | |
tree | 68f8bee734d164277f711b8ac54bd1064c0757d6 /src/SMAPI/Events | |
parent | e0b72374cd14298aacc6f71dc391fdc9814be37c (diff) | |
parent | dc4f89acb6cd8f838934b60e8f5645c6145706f8 (diff) | |
download | SMAPI-5cc5f089b9645a60385ff293b5a7202f260bfc0f.tar.gz SMAPI-5cc5f089b9645a60385ff293b5a7202f260bfc0f.tar.bz2 SMAPI-5cc5f089b9645a60385ff293b5a7202f260bfc0f.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Events')
-rw-r--r-- | src/SMAPI/Events/EventArgsInput.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs index ff904675..54ce9b53 100644 --- a/src/SMAPI/Events/EventArgsInput.cs +++ b/src/SMAPI/Events/EventArgsInput.cs @@ -56,11 +56,11 @@ namespace StardewModdingAPI.Events public void SuppressButton(SButton button) { // keyboard - if (this.Button.TryGetKeyboard(out Keys key)) + if (button.TryGetKeyboard(out Keys key)) Game1.oldKBState = new KeyboardState(Game1.oldKBState.GetPressedKeys().Union(new[] { key }).ToArray()); // controller - else if (this.Button.TryGetController(out Buttons controllerButton)) + else if (button.TryGetController(out Buttons controllerButton)) { var newState = GamePad.GetState(PlayerIndex.One); var thumbsticks = Game1.oldPadState.ThumbSticks; @@ -127,6 +127,21 @@ namespace StardewModdingAPI.Events Game1.oldPadState = new GamePadState(thumbsticks, triggers, buttons, dpad); } + + // mouse + else if (button == SButton.MouseLeft || button == SButton.MouseMiddle || button == SButton.MouseRight || button == SButton.MouseX1 || button == SButton.MouseX2) + { + Game1.oldMouseState = new MouseState( + 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 + ); + } } } } |