diff options
author | Zoryn Aaron <zoryn4163@gmail.com> | 2016-03-01 17:22:19 -0500 |
---|---|---|
committer | Zoryn Aaron <zoryn4163@gmail.com> | 2016-03-01 17:22:19 -0500 |
commit | c7ecc201bbd5cc18c52f173ae550ea42743b53fb (patch) | |
tree | 7ee2d57748256a3fce66c729a248bfb0c3cea606 /StardewModdingAPI/Inheritance | |
parent | ad683d0a0ff26c23a0c6a2c6ef160a5b6c773411 (diff) | |
download | SMAPI-c7ecc201bbd5cc18c52f173ae550ea42743b53fb.tar.gz SMAPI-c7ecc201bbd5cc18c52f173ae550ea42743b53fb.tar.bz2 SMAPI-c7ecc201bbd5cc18c52f173ae550ea42743b53fb.zip |
partial implement of Required event handlers
Diffstat (limited to 'StardewModdingAPI/Inheritance')
-rw-r--r-- | StardewModdingAPI/Inheritance/SGame.cs | 12 |
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); |