summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/EventArgsInput.cs
diff options
context:
space:
mode:
authorYonKuma <kumarei@gmail.com>2017-11-08 22:51:25 -0500
committerYonKuma <kumarei@gmail.com>2017-11-08 22:51:25 -0500
commit7dc7f010a64ef0cf057a67bbee85196ce1d695c0 (patch)
tree00da0c53078090eda0fc0c104e7dc4b09102981a /src/SMAPI/Events/EventArgsInput.cs
parenta6071feaf84518c436fba0d148e3ea7d547663da (diff)
downloadSMAPI-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.cs31
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
+ );
+ }
+ }
}
}
}