From fec6adf82d5eda99c6bf34a21b0e01adc2b10d22 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 29 Apr 2018 21:55:26 -0400 Subject: fix build error on Linux/Mac --- src/SMAPI/Framework/Input/GamePadStateBuilder.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/Input') 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; } } + + /// Get a bitmask representing the given buttons. + /// The buttons to represent. + private Buttons GetBitmask(IEnumerable buttons) + { + Buttons flag = 0; + foreach (Buttons button in buttons) + flag |= button; + return flag; + } } } -- cgit