summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-04-29 21:55:26 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-04-29 21:55:26 -0400
commitfec6adf82d5eda99c6bf34a21b0e01adc2b10d22 (patch)
tree54d7317c3fda592a9d9833cbede0603cbec3ef66 /src
parent2dcd88deb147759c3ce9be3ccaeaf0625bd6d4a5 (diff)
downloadSMAPI-fec6adf82d5eda99c6bf34a21b0e01adc2b10d22.tar.gz
SMAPI-fec6adf82d5eda99c6bf34a21b0e01adc2b10d22.tar.bz2
SMAPI-fec6adf82d5eda99c6bf34a21b0e01adc2b10d22.zip
fix build error on Linux/Mac
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Framework/Input/GamePadStateBuilder.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
index 5eeb7ef6..33557385 100644
--- a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
@@ -133,7 +132,7 @@ namespace StardewModdingAPI.Framework.Input
rightThumbStick: this.RightStickPos,
leftTrigger: this.LeftTrigger,
rightTrigger: this.RightTrigger,
- buttons: this.GetPressedButtons().ToArray()
+ buttons: this.GetBitmask(this.GetPressedButtons()) // MonoDevelop requires one bitmask here; don't specify multiple values
);
}
@@ -149,5 +148,15 @@ namespace StardewModdingAPI.Framework.Input
yield return button;
}
}
+
+ /// <summary>Get a bitmask representing the given buttons.</summary>
+ /// <param name="buttons">The buttons to represent.</param>
+ private Buttons GetBitmask(IEnumerable<Buttons> buttons)
+ {
+ Buttons flag = 0;
+ foreach (Buttons button in buttons)
+ flag |= button;
+ return flag;
+ }
}
}