void Update() { var isInShip = _cockpitController.IsPlayerAtFlightConsole(); if (isInShip && !_canInteractWithTools) { SetEnabled(true); } else if (!isInShip && _canInteractWithTools) { SetEnabled(false); } if (_referenceFrameTracker.isActiveAndEnabled && Common.IsUsingAnyTool()) { _referenceFrameTracker.enabled = false; } else if (!_referenceFrameTracker.isActiveAndEnabled && !Common.IsUsingAnyTool()) { _referenceFrameTracker.enabled = true; } if (_referenceFrameTracker.GetReferenceFrame() == null && _referenceFrameTracker.GetPossibleReferenceFrame() == null) { return; } if (OWInput.IsNewlyPressed(InputLibrary.interact)) { _pressedInteract = true; } if (OWInput.IsNewlyHeld(InputLibrary.interact)) { ControllerInput.SimulateInput(XboxAxis.dPadY, 1); _wasHoldingInteract = true; } if (OWInput.IsNewlyReleased(InputLibrary.interact)) { if (_wasHoldingInteract) { ControllerInput.SimulateInput(XboxAxis.dPadY, 0); _wasHoldingInteract = false; } else if (_pressedInteract && !IsFocused(_probe) && !IsFocused(_signalscope) && !IsFocused(_landingCam)) { ControllerInput.SimulateInput(XboxButton.LeftStickClick); } _pressedInteract = false; } }
private void HandleInput() { if (ModHelper.Input.IsNewlyPressedExact(_crouchCombo)) { _crouchStartTime = Time.realtimeSinceStartup; } else if (ModHelper.Input.WasNewlyReleased(_crouchCombo) && !OWInput.IsPressed(InputLibrary.jump)) { _crouchStartTime = null; _playerCharacterController.SetValue("_jumpChargeTime", 0); } else if (OWInput.IsNewlyReleased(InputLibrary.jump)) { _crouchStartTime = null; } }