public override void ButtonClicked(MenuButton button)
 {
     base.ButtonClicked(button);
     if (button == backButton)
     {
         BackButtonPressed();
     }
     else if (button == applyToAllGamepadsButton)
     {
         ApplyToAllGamepadsPressed();
     }
     else
     {
         GamepadControlsMenuButton controlsButton = (GamepadControlsMenuButton)button;
         if (controlsButton.buttonType == GamepadControlsMenuButtonType.Button)
         {
             controlsButton.SetWaitingForInput();
             buttonIndexPressed             = buttonList.IndexOf(button);
             waitingForAllKeysToBeUnpressed = true;
             waitingForKeyPress             = true;
         }
         else if (controlsButton.buttonType == GamepadControlsMenuButtonType.JoystickOption)
         {
             JoystickOptions currentInput = (JoystickOptions)ControlsConfig.gamepadControls[controlsButton.controlsTKey][controlsButton.controllerIndex];
             controlsButton.SetNewInput(ControlsConfig.GetNextJoystickOption(currentInput));
         }
         else if (controlsButton.buttonType == GamepadControlsMenuButtonType.Toggle)
         {
             bool currentToggle = (ControlsConfig.gamepadControls[controlsButton.controlsTKey][controlsButton.controllerIndex] == (int)ToggleOptions.True);
             controlsButton.SetNewInput(!currentToggle);
         }
     }
 }
Example #2
0
        public static void LoadAllSettings()
        {
            Globals.gameInstance.settingsManager = new SettingsManager();
            Globals.gameInstance.settingsManager.Load();

            ResolutionConfig.LoadGraphicalSettings();
            AudioConfig.LoadAudioSettings();
            ControlsConfig.LoadControlsSettings();
        }
 public static bool MenuDownPressed()
 {
     foreach (int controllerIndex in ControlsConfig.GetAllControllerIndexes())
     {
         if (PlayerControls.MenuDownPressed(controllerIndex))
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
 private void Setup(string _buttonText, int _input)
 {
     controlsTKey = _buttonText;
     SetSideImageSize(_input);
     if (ControlsConfig.IsInputToggleOptions(_input))
     {
         buttonType = KeyboardControlsMenuButtonType.Toggle;
     }
     else
     {
         buttonType = KeyboardControlsMenuButtonType.Button;
     }
 }
 public static bool PausePressed()
 {
     if (CurrentlySettingControl())
     {
         //When setting control in controls menu, don't want to unpause the game
         return(false);
     }
     foreach (int controllerIndex in ControlsConfig.GetAllControllerIndexes())
     {
         if (PlayerControls.PausePressed(controllerIndex))
         {
             return(true);
         }
     }
     return(false);
 }
 protected override void BackPressed()
 {
     ControlsConfig.SaveControlsSettings();
     currentlySelectedButtonIndex = 0;
     parentMenu.CloseSubMenu();
 }
 private void ApplyToAllGamepadsPressed()
 {
     ControlsConfig.ApplyControlsToAllGamepads(playerNumber);
     ((ControlsMenu)parentMenu).UpdateAllControlsButtonImages();
 }
 private void UpdateNewControlsPreset()
 {
     UpdateTitleLabel(DefaultControls.currentGamepadPreset[playerNumber]);
     ControlsConfig.ApplyPresetToGamepad(playerNumber, DefaultControls.currentGamepadPreset[playerNumber]);
     UpdateAllButtonImages();
 }
 private void ResetToDefaultButtonPressed()
 {
     ControlsConfig.ResetToDefault(playerNumber);
     UpdateAllButtonImages();
 }
 private void ResetToDefaultButtonPressed()
 {
     ControlsConfig.ResetToDefault(ControlsConfig.keyboardControllerIndex);
     UpdateAllButtonImages();
 }
Example #11
0
 private void UpdateNewControlsPreset()
 {
     UpdateTitleLabel(DefaultControls.currentKeyboardPreset[0]);
     ControlsConfig.ApplyPresetToKeyboard(DefaultControls.currentKeyboardPreset[0]);
     UpdateAllButtonImages();
 }