I'm trying to allow the player to press any button to continue from the main page. I was able to do this by making a List of Buttons and looping through these and checking for one of them being down; however, I feel like this code is kind of ugly and wonder if there's a simpler way to do it that I'm just not thinking of?
Here's my what my code looks like now:
if (GamePad.GetState(PlayerIndex.One).IsConnected)
{
var buttonList = new List<Buttons>()
{
{Buttons.A},
{Buttons.B},
{Buttons.Y},
{Buttons.X},
{Buttons.Start},
{Buttons.Back},
{Buttons.RightShoulder},
{Buttons.LeftShoulder},
{Buttons.RightTrigger},
{Buttons.LeftTrigger}
};
foreach (var button in buttonList)
{
if (GamePad.GetState(PlayerIndex.One).IsButtonDown(button))
ExitMainMenu= true;
}
}