mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
25 lines
796 B
C#
25 lines
796 B
C#
using HarmonyLib;
|
|
|
|
namespace NewHorizons.Patches.WarpPatches;
|
|
|
|
[HarmonyPatch(typeof(InputManager))]
|
|
public static class InputManagerPatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(nameof(InputManager.ChangeInputMode))]
|
|
public static bool InputManager_ChangeInputMode(InputManager __instance, InputMode mode)
|
|
{
|
|
// Can't use player state because it is updated after this method is called
|
|
var atFlightConsole = Locator.GetPlayerCameraController()?._shipController?.IsPlayerAtFlightConsole() ?? false;
|
|
// If we're flying the ship don't let it break our input by changing us to another input mode
|
|
if (atFlightConsole && mode == InputMode.Character)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|