public override void HandleInput(MenuInput input)
 {
     if (input.IsMenuRight()) {
         Next();
     } else if (input.IsMenuLeft()) {
         Previous();
     } else if (input.IsMenuCancel()) {
         ExitScreen();
     }
 }
Example #2
0
        public override void HandleInput(MenuInput input)
        {
            bool isPrevious = false;
            bool isNext = false;
            if (Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.Guitar
                || Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.AlternateGuitar)
            {
                isPrevious = input.IsMenuUp();
                isNext = input.IsMenuDown();
            }
            else
            {
                isPrevious = input.IsMenuLeft();
                isNext = input.IsMenuRight();
            }

            // Move to the previous menu entry?
            if (isPrevious)
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1");
                int select = selectedEntry;

                selectedEntry--;

                if (selectedEntry < 0)
                {
                    selectedEntry = MenuEntries.Count - 1;
                }
                if (!MenuEntries[selectedEntry].CanSelect)
                {
                    selectedEntry = select;
                }
            }
            else if (isNext)
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1");
                int select = selectedEntry;

                selectedEntry++;

                if (selectedEntry >= MenuEntries.Count)
                {
                    selectedEntry = 0;
                }
                if (!MenuEntries[selectedEntry].CanSelect)
                {
                    selectedEntry = select;
                }
            }
            else if (input.IsMenuSelect())
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Arail-attack2");
                OnSelectEntry(selectedEntry);
            }
            else if (input.IsMenuCancel())
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Uppercut");
                OnCancel();
            }
        }
        public override void HandleInput(MenuInput input)
        {
            bool isPrevious = false;
            bool isNext = false;
            if (Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.Guitar
                || Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.AlternateGuitar)
            {
                isPrevious = input.IsMenuUp();
                isNext = input.IsMenuDown();
            }
            else
            {
                isPrevious = input.IsMenuLeft();
                isNext = input.IsMenuRight();
            }

            // Move to the previous menu entry?
            if (isPrevious)
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1");
                index--;
                if (index < 0)
                    index = options.Count - 1;
            }

            // Move to the next menu entry?
            if (isNext)
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1");
                index++;
                if (index >= options.Count)
                    index = 0;
            }

            if (input.IsMenuSelect())
            {
                Stage.ActiveStage.GetQB<AudioQB>().PlaySound("MeatSlap2_16");
                options.Data[index]();
            }
            else if (input.IsMenuCancel())
            {
                OnCancel();
            }
        }