public override void Update(GameTime gameTime)
{
if(input.select())
{
buttonPressed = true;
}
if (timeout <= 0)
{
if (input.up() > .999)
{
Audio.GetInstance().Play(Load<SoundEffect>("Audio/buttonHover"));
buttonPressed = false;
if (current == -1)
{
current = 0;
}
else
{
current = (current - 1 + buttons.Count) % buttons.Count;
}
timeout = 200;
}
else if (input.down() > .999)
{
Audio.GetInstance().Play(Load<SoundEffect>("Audio/buttonHover"));
buttonPressed = false;
if (current == -1)
{
current = 0;
}
else
{
current = (current + 1) % buttons.Count;
}
timeout = 200;
}
}
else
{
timeout -= gameTime.ElapsedGameTime.Milliseconds;
}
hovering = false;
for(int i = 0; i < buttons.Count; i++)
{
UpdateButton(buttons[i], i == current);
}
startHovering = !hovering;
}