mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
30 lines
1018 B
C#
30 lines
1018 B
C#
using HarmonyLib;
|
|
using NewHorizons.Handlers;
|
|
using NewHorizons.Utility;
|
|
using UnityEngine;
|
|
namespace NewHorizons.Patches
|
|
{
|
|
[HarmonyPatch]
|
|
public static class WarpDrivePatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(ShipCockpitController), 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;
|
|
}
|
|
}
|
|
}
|