Exemplo n.º 1
0
        public override void PerformAction(InputAction inputAction)
        {
            var pass = _playerOptionsSet.PerformAction(inputAction);

            if (pass)
            {
                //NetHelper.Instance.BroadcastPlayerOptions(inputAction.Player);
                return;
            }

            //Ignore inputs from players not playing EXCEPT for system keys.
            if ((inputAction.Player > 0) && (!Core.Players[inputAction.Player - 1].IsHumanPlayer))
            {
                return;
            }
            //NetHelper.Instance.BroadcastAction(inputAction);
            switch (inputAction.Action)
            {
            case "LEFT":
                if (_selectingCPUSkill)
                {
                    ChangeSelectedCPUDifficulty(-1);
                    RaiseSoundTriggered(SoundEvent.MENU_OPTION_SELECT_LEFT);
                }
                else
                {
                    ChangeGameType(-1);
                    RaiseSoundTriggered(SoundEvent.MENU_SELECT_UP);
                }

                break;

            case "RIGHT":
                if (_selectingCPUSkill)
                {
                    ChangeSelectedCPUDifficulty(1);
                    RaiseSoundTriggered(SoundEvent.MENU_OPTION_SELECT_RIGHT);
                }
                else
                {
                    ChangeGameType(1);
                    RaiseSoundTriggered(SoundEvent.MENU_SELECT_DOWN);
                }

                break;

            case "BACK":
                Core.ScreenTransition("NewGame");
                RaiseSoundTriggered(SoundEvent.MENU_BACK);
                break;

            case "START":
                DoAction();
                break;

            case "SELECT":
                _playerOptionsSet.SetChangeMode(inputAction.Player, true);
                break;
            }
        }
Exemplo n.º 2
0
        public override void PerformAction(InputAction inputAction)
        {
            if (_preloadState == PreloadState.LOADING_STARTED)
            {
                return;
            }

            var pass = _playerOptionsSet.PerformAction(inputAction);

            if (pass)
            {
                CheckCPUDifficulty();
                return;
            }

            pass = _songSortDisplay.PerformAction(inputAction);
            if (pass)
            {
                RaiseSoundTriggered(SoundEvent.SONG_SORT_CHANGE);
                JumpToBookmark();
                return;
            }


            //Ignore inputs from players not playing EXCEPT for system keys.
            if ((inputAction.Player > 0) && (!Core.Players[inputAction.Player - 1].IsHumanPlayer))
            {
                return;
            }

            switch (inputAction.Action)
            {
            case "UP":
                MoveSelectionUp();
                break;

            case "DOWN":
                MoveSelectionDown();
                break;

            case "BEATLINE":
                _songSortDisplay.Active            = true;
                _songSortDisplay.SelectedSongIndex = _selectedIndex;
                RaiseSoundTriggered(SoundEvent.SONG_SORT_DISPLAY);
                break;

            case "SELECT":
                _playerOptionsSet.SetChangeMode(inputAction.Player, true);
                break;

            case "START":
                StartSong();
                break;

            case "BACK":
                Core.ScreenTransition("ModeSelect");
                RaiseSoundTriggered(SoundEvent.MENU_BACK);
                break;
            }
        }
Exemplo n.º 3
0
        public override void PerformAction(InputAction inputAction)
        {
            var pass = _playerOptionsSet.PerformAction(inputAction);

            if (pass)
            {
                TryToStart();
                return;
            }

            //Ignore inputs from players not playing EXCEPT for system keys.
            if ((inputAction.Player > 0) && (!Core.Players[inputAction.Player - 1].IsHumanPlayer))
            {
                return;
            }

            var playerIdx = inputAction.Player - 1;

            switch (inputAction.Action)
            {
            case "LEFT":
                if (!_ready[playerIdx])
                {
                    Core.Players[playerIdx].Team = Core.Players[playerIdx].Team == 2 ? 0 : 1;
                }
                RaiseSoundTriggered(SoundEvent.TEAM_CHANGE);
                break;

            case "RIGHT":
                if (!_ready[playerIdx])
                {
                    Core.Players[playerIdx].Team = Core.Players[playerIdx].Team == 1 ? 0 : 2;
                }
                RaiseSoundTriggered(SoundEvent.TEAM_CHANGE);
                break;

            case "START":
                if (Core.Players[playerIdx].Team != 0)
                {
                    _ready[playerIdx] = !_ready[playerIdx];
                    RaiseSoundTriggered(SoundEvent.TEAM_DECIDE);
                    TryToStart();
                }
                break;

            case "SELECT":
                _playerOptionsSet.SetChangeMode(inputAction.Player, true);
                break;

            case "BACK":
                for (int x = 0; x < 4; x++)
                {
                    Core.Players[x].Team = 0;
                }
                Core.ScreenTransition("ModeSelect");
                RaiseSoundTriggered(SoundEvent.MENU_BACK);
                break;
            }
        }