summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Inheritance/SGame.cs
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI/Inheritance/SGame.cs')
-rw-r--r--StardewModdingAPI/Inheritance/SGame.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs
index 9f30e05e..b28b8d7c 100644
--- a/StardewModdingAPI/Inheritance/SGame.cs
+++ b/StardewModdingAPI/Inheritance/SGame.cs
@@ -34,6 +34,9 @@ namespace StardewModdingAPI.Inheritance
public KeyboardState KStateNow { get; private set; }
public KeyboardState KStatePrior { get; private set; }
+ public MouseState MStateNow { get; private set; }
+ public MouseState MStatePrior { get; private set; }
+
public Keys[] CurrentlyPressedKeys { get; private set; }
public Keys[] PreviouslyPressedKeys { get; private set; }
@@ -66,7 +69,8 @@ namespace StardewModdingAPI.Inheritance
{
KStateNow = Keyboard.GetState();
CurrentlyPressedKeys = KStateNow.GetPressedKeys();
-
+ MStateNow = Mouse.GetState();
+
foreach (Keys k in FramePressedKeys)
Events.InvokeKeyPressed(k);
@@ -76,6 +80,12 @@ namespace StardewModdingAPI.Inheritance
KStatePrior = KStateNow;
}
+ if (MStateNow != MStatePrior)
+ {
+ Events.InvokeMouseChanged(MStateNow);
+ MStatePrior = MStateNow;
+ }
+
if (Game1.activeClickableMenu != null && Game1.activeClickableMenu != PreviousActiveMenu)
{
Events.InvokeMenuChanged(Game1.activeClickableMenu);