summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Input/GamePadStateBuilder.cs')
-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;
+ }
}
}