Beispiel #1
0
        public override void HandleInput(float delta, InputState input)
        {
            PlayerIndex playerIndex;

            if (_skipScreen.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                this.ExitScreen();
            }
        }
Beispiel #2
0
 public virtual void HandleInput(float delta, InputState input)
 {
 }
        public override void HandleInput(float delta, InputState input)
        {
            PlayerIndex playerIndex;
            float speed = 5;

            if (_inputContinue.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                OnCancel(playerIndex);
            }

            if (_moveUp.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                if (_position.Y < this.ScreenManager.GraphicsDevice.Viewport.Height * 0.2)
                {
                    this._position.Y += speed;
                }
            }

            if (_moveDown.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                if (_position.Y + _texture.Height >= this.ScreenManager.GraphicsDevice.Viewport.Height * 0.8)
                {
                    this._position.Y -= speed;
                }
            }
        }
        public override void HandleInput(float delta, InputState input)
        {
            PlayerIndex playerIndex;

            #region Move Up and Down the List
            // Move to the previous menu entry?
            if (menuUp.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                selectedEntry--;

                if (selectedEntry < 0)
                {
                    selectedEntry = menuEntries.Count - 1;
                }

                while (menuEntries[selectedEntry].ItemType == MenuEntryType.Separator || !menuEntries[selectedEntry].Enabled)
                {
                    selectedEntry--;

                    if (selectedEntry < 0)
                    {
                        selectedEntry = menuEntries.Count - 1;
                    }
                }
            }

            // Move to the next menu entry?
            if (menuDown.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                selectedEntry++;

                if (selectedEntry >= menuEntries.Count)
                {
                    selectedEntry = 0;
                }

                while (menuEntries[selectedEntry].ItemType == MenuEntryType.Separator || !menuEntries[selectedEntry].Enabled)
                {
                    selectedEntry++;
                    if (selectedEntry >= menuEntries.Count)
                    {
                        selectedEntry = 0;
                    }
                }
            }
            #endregion

            #region Cycle through the levels

            if (menuLeft.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                switch (selectedEntry)
                {
                    case 0:
                        {
                            _settingsInstance.AmbienceVolume--;
                        }
                        break;
                    case 1:
                        {
                            _settingsInstance.EffectsVolume--;
                        }
                        break;
                    case 2:
                        {
                            _settingsInstance.MusicVolume--;
                        }
                        break;
                    case 3:
                        {
                            _settingsInstance.VoiceVolume--;
                        }
                        break;
                    default:
                        break;
                }
            }

            if (menuRight.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                switch (selectedEntry)
                {
                    case 0:
                        {
                            _settingsInstance.AmbienceVolume++;
                        }
                        break;
                    case 1:
                        {
                            _settingsInstance.EffectsVolume++;
                        }
                        break;
                    case 2:
                        {
                            _settingsInstance.MusicVolume++;
                        }
                        break;
                    case 3:
                        {
                            _settingsInstance.VoiceVolume++;
                        }
                        break;
                    default:
                        break;
                }
            }

            if (menuSelect.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                OnSelectEntry(selectedEntry, playerIndex);
            }
            else if (menuCancel.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                OnCancel(playerIndex);
            }

            #endregion

            this.SetMenuEntryText();
        }
Beispiel #5
0
        public override void HandleInput(float delta, InputState input)
        {
            PlayerIndex playerIndex;

            // Move to the previous menu entry?
            if (menuUp.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                selectedEntry--;

                if (selectedEntry < 0)
                {
                    selectedEntry = menuEntries.Count - 1;
                }

                while (menuEntries[selectedEntry].ItemType == MenuEntryType.Separator || !menuEntries[selectedEntry].Enabled)
                {
                    selectedEntry--;

                    if (selectedEntry < 0)
                    {
                        selectedEntry = menuEntries.Count - 1;
                    }
                }

                AudioManager.Instance.PlayCue("UI_Move_1", true);
            }

            // Move to the next menu entry?
            if (menuDown.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                selectedEntry++;

                if (selectedEntry >= menuEntries.Count)
                {
                    selectedEntry = 0;
                }

                while(menuEntries[selectedEntry].ItemType == MenuEntryType.Separator || !menuEntries[selectedEntry].Enabled)
                {
                    selectedEntry++;
                    if (selectedEntry >= menuEntries.Count)
                    {
                        selectedEntry = 0;
                    }
                }
                AudioManager.Instance.PlayCue("UI_Move_1", true);
            }

            if (menuSelect.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                AudioManager.Instance.PlayCue("UI_Select_1", true);
                OnSelectEntry(selectedEntry, playerIndex);

            }
            else if (menuCancel.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                OnCancel(playerIndex);
            }
        }