diff options
author | YonKuma <kumarei@gmail.com> | 2017-11-08 22:51:25 -0500 |
---|---|---|
committer | YonKuma <kumarei@gmail.com> | 2017-11-08 22:51:25 -0500 |
commit | 7dc7f010a64ef0cf057a67bbee85196ce1d695c0 (patch) | |
tree | 00da0c53078090eda0fc0c104e7dc4b09102981a /src/SMAPI/Events/EventArgsInput.cs | |
parent | a6071feaf84518c436fba0d148e3ea7d547663da (diff) | |
download | SMAPI-7dc7f010a64ef0cf057a67bbee85196ce1d695c0.tar.gz SMAPI-7dc7f010a64ef0cf057a67bbee85196ce1d695c0.tar.bz2 SMAPI-7dc7f010a64ef0cf057a67bbee85196ce1d695c0.zip |
Added code to suppress mouse clicks
issue Pathoschild/SMAPI#384
Diffstat (limited to 'src/SMAPI/Events/EventArgsInput.cs')
-rw-r--r-- | src/SMAPI/Events/EventArgsInput.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs index ff904675..0df5275b 100644 --- a/src/SMAPI/Events/EventArgsInput.cs +++ b/src/SMAPI/Events/EventArgsInput.cs @@ -127,6 +127,37 @@ namespace StardewModdingAPI.Events Game1.oldPadState = new GamePadState(thumbsticks, triggers, buttons, dpad); } + + // mouse + else if (button.TryGetStardewInput(out InputButton inputButton)) + { + if (inputButton.mouseLeft) + { + 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 (inputButton.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 + ); + } + } } } } |