mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
29 lines
997 B
C#
29 lines
997 B
C#
using HarmonyLib;
|
|
using NewHorizons.Handlers;
|
|
|
|
namespace NewHorizons.Patches.WarpPatches
|
|
{
|
|
[HarmonyPatch(typeof(ShipCockpitController))]
|
|
public static class ShipCockpitControllerPatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(nameof(ShipCockpitController.Update))]
|
|
public static bool ShipCockpitController_Update(ShipCockpitController __instance)
|
|
{
|
|
if (!Main.HasWarpDrive) return true;
|
|
|
|
StarChartHandler.ShipLogStarChartMode.UpdateWarpPromptVisibility();
|
|
if (__instance._playerAtFlightConsole && OWInput.IsNewlyPressed(InputLibrary.autopilot, InputMode.ShipCockpit))
|
|
{
|
|
var targetSystem = StarChartHandler.ShipLogStarChartMode.GetTargetStarSystem();
|
|
if (targetSystem != null)
|
|
{
|
|
Main.Instance.ChangeCurrentStarSystem(targetSystem, true);
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|