mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Don't be summoned back to the star by default
This commit is contained in:
parent
a755f150d3
commit
177f69861a
@ -20,6 +20,12 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
public bool freeMapAngle;
|
||||
|
||||
/// <summary>
|
||||
/// When well past the furthest orbit, should the player be summoned back to the star?
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool returnToSolarSystemWhenTooFar = true;
|
||||
|
||||
/// <summary>
|
||||
/// An override value for the far clip plane. Allows you to see farther.
|
||||
/// </summary>
|
||||
|
||||
@ -89,6 +89,8 @@ namespace NewHorizons
|
||||
|
||||
public static bool HasDLC { get => EntitlementsManager.IsDlcOwned() == EntitlementsManager.AsyncOwnershipStatus.Owned; }
|
||||
|
||||
public static StarSystemConfig GetCurrentSystemConfig => SystemDict[Instance.CurrentStarSystem].Config;
|
||||
|
||||
public override object GetApi()
|
||||
{
|
||||
return new NewHorizonsApi();
|
||||
|
||||
@ -50,8 +50,8 @@ namespace NewHorizons.Patches.WarpPatches
|
||||
.RemoveInstructions(2)
|
||||
.Insert(
|
||||
// First do an if statement to see if the warp drive is locked on
|
||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StarChartHandler), nameof(StarChartHandler.IsWarpDriveLockedOn))),
|
||||
new CodeInstruction(OpCodes.Brtrue_S, returnLabel),
|
||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ShipCockpitControllerPatches), nameof(ShipCockpitControllerPatches.ShouldReturn))),
|
||||
new CodeInstruction(OpCodes.Brfalse_S, returnLabel),
|
||||
|
||||
// Then get the center of the universe and its reference frame
|
||||
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Locator), nameof(Locator.GetCenterOfTheUniverse))),
|
||||
@ -59,5 +59,10 @@ namespace NewHorizons.Patches.WarpPatches
|
||||
)
|
||||
.InstructionEnumeration();
|
||||
}
|
||||
|
||||
private static bool ShouldReturn()
|
||||
{
|
||||
return !StarChartHandler.IsWarpDriveLockedOn() && Main.GetCurrentSystemConfig.returnToSolarSystemWhenTooFar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user