コード例 #1
0
        public override void Activate()
        {
            _inputProcessor = ControllerPool.Controllers.PlayerOne;
            _pauseDialog.SetInputSourceToPlayerController(_inputProcessor);
            //_pauseDialog.SkipLevelButtonDisabled = false;
            _controllerDialog.SetInputSourcesToPlayerControllers();

            _levelData = new Data.SurvivalLevelData();

            StatusDisplay.CurrentLevelData     = LevelData;
            StatusDisplay.FreezeDisplayedScore = false;
            SceneIsDeactivating = false;
            RaceAreaName        = "";

            base.Activate();

            Paused = Profile.PauseOnSceneActivation;
            if (Paused)
            {
                ActivatePauseDialog();
            }
            Profile.PauseOnSceneActivation = false;

            _player.InputProcessor = _inputProcessor;
            ((PlayerMotionEngine)_player.MotionEngine).DifficultySpeedBoosterUnit = Profile.CurrentAreaData.SpeedStep;
            _readyPopup.Activate();
        }
コード例 #2
0
        protected override void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
        {
            base.CheckForAndHandleSelection(inputSource);

            if ((inputSource.SelectionTriggered) && (inputSource.SelectionLocation != Vector2.Zero))
            {
                foreach (KeyValuePair <string, Rectangle> kvp in _keyAreas)
                {
                    if (kvp.Value.Contains((int)inputSource.SelectionLocation.X, (int)(inputSource.SelectionLocation.Y - WorldPosition.Y)))
                    {
                        if (kvp.Key == "DEL")
                        {
                            DeleteLastCharacterFromEntry();
                        }
                        else
                        {
                            AddCharacterToEntry(kvp.Key);
                        }
                    }
                }
            }

            if (Entry.Length < 1)
            {
                DisableButton("Start");
            }
            else
            {
                EnableButton("Start");
            }
        }
コード例 #3
0
        protected virtual void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
        {
            bool selectionMade = inputSource.SelectionTriggered;

            if ((selectionMade) && (inputSource.SelectionLocation != Vector2.Zero))
            {
                selectionMade = CheckForSelectionAtTouchLocation(inputSource.SelectionLocation);
            }

            if (inputSource.BButtonPressed)
            {
                selectionMade        = true;
                _activeButtonCaption = _cancelButtonCaption;
            }

            if (selectionMade)
            {
                ActuatingController = inputSource;
                Dismiss();
                if (SelectionCallback != null)
                {
                    SelectionCallback(_activeButtonCaption);
                }
                if (!string.IsNullOrEmpty(ActivateSelectionSoundEffectName))
                {
                    SoundEffectManager.PlayEffect(ActivateSelectionSoundEffectName);
                }
            }
        }
コード例 #4
0
 protected override void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
 {
     if (inputSource.SelectionTriggered)
     {
         if ((inputSource.SelectionLocation != Vector2.Zero) || (_activeButtonCaption == "Start!") || (_activeButtonCaption == "Back"))
         {
             base.CheckForAndHandleSelection(inputSource);
         }
         else
         {
             HandleStepSelection(_activeButtonCaption);
         }
     }
 }
コード例 #5
0
 protected override void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
 {
     base.CheckForAndHandleSelection(inputSource);
     try
     {
         foreach (KeyValuePair <string, OpponentSelector> kvp in _opponents)
         {
             if ((kvp.Value != null) && (kvp.Value.ContainsLocation(inputSource.SelectionLocation)))
             {
                 HandleOpponentSelection(kvp.Value);
                 break;
             }
         }
     }
     catch
     {
     }
 }
コード例 #6
0
        protected virtual void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
        {
            bool selectionMade = inputSource.SelectionTriggered;

            if ((selectionMade) && (inputSource.SelectionLocation != Vector2.Zero))
            {
                selectionMade = CheckForSelectionAtTouchLocation(inputSource.SelectionLocation);
            }

            if (selectionMade)
            {
                if (SelectionCallback != null)
                {
                    SelectionCallback(_activeButtonCaption);
                }
                Dismiss();
            }
        }
コード例 #7
0
 protected override void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
 {
     if (!Rotating)
     {
         if (inputSource.SelectionTriggered)
         {
             if (inputSource.SelectionLocation != Vector2.Zero)
             {
                 base.CheckForAndHandleSelection(inputSource);
             }
             else if (_nonSpinButtonCaptions.Contains(_activeButtonCaption))
             {
                 if ((!(inputSource is GamePadInputProcessor)) ||
                     (!((GamePadInputProcessor)inputSource).SelectionIsByStartButton) ||
                     (!_captionsForButtonsNotActivatedByGamepadStartButton.Contains(_activeButtonCaption)))
                 {
                     ActionButtonPressHandler(_activeButtonCaption);
                     if (!string.IsNullOrEmpty(ActivateSelectionSoundEffectName))
                     {
                         SoundEffectManager.PlayEffect(ActivateSelectionSoundEffectName);
                     }
                 }
             }
             else
             {
                 HandleStepSelection(_activeButtonCaption);
             }
         }
         else if (inputSource.MoveLeft)
         {
             HandleStepSelection("previous");
         }
         else if (inputSource.MoveRight)
         {
             HandleStepSelection("next");
         }
     }
 }
コード例 #8
0
        protected override void CheckForAndHandleSelection(Input.InputProcessorBase inputSource)
        {
            if (inputSource.SelectionTriggered)
            {
                if (inputSource.SelectionLocation != Vector2.Zero)
                {
                    base.CheckForAndHandleSelection(inputSource);
                }
                else
                {
                    if ((_activeButtonCaption == "Back") || (_activeButtonCaption == "Reset Game"))
                    {
                        Dismiss();
                    }
                    else
                    {
                        HandleToggle(_activeButtonCaption);
                    }

                    SoundEffectManager.PlayEffect(ActivateSelectionSoundEffectName);
                }
            }
        }