mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add time loop patches
This commit is contained in:
parent
041e915fa5
commit
c4aafce3d8
@ -58,6 +58,7 @@ namespace NewHorizons
|
|||||||
|
|
||||||
public string DefaultStarSystem => SystemDict.ContainsKey(_defaultSystemOverride) ? _defaultSystemOverride : _defaultStarSystem;
|
public string DefaultStarSystem => SystemDict.ContainsKey(_defaultSystemOverride) ? _defaultSystemOverride : _defaultStarSystem;
|
||||||
public string CurrentStarSystem => _currentStarSystem;
|
public string CurrentStarSystem => _currentStarSystem;
|
||||||
|
public bool TimeLoopEnabled => SystemDict[CurrentStarSystem]?.Config?.enableTimeLoop ?? true;
|
||||||
public bool IsWarpingFromShip { get; private set; } = false;
|
public bool IsWarpingFromShip { get; private set; } = false;
|
||||||
public bool IsWarpingFromVessel { get; private set; } = false;
|
public bool IsWarpingFromVessel { get; private set; } = false;
|
||||||
public bool IsWarpingBackToEye { get; internal set; } = false;
|
public bool IsWarpingBackToEye { get; internal set; } = false;
|
||||||
|
|||||||
50
NewHorizons/Patches/TimeLoopPatches.cs
Normal file
50
NewHorizons/Patches/TimeLoopPatches.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace NewHorizons.Patches
|
||||||
|
{
|
||||||
|
[HarmonyPatch]
|
||||||
|
public static class TimeLoopPatches
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Disables starfield updates
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(StarfieldController), nameof(StarfieldController.Update))]
|
||||||
|
public static bool StarfieldController_Update() => Main.Instance.TimeLoopEnabled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables interloper destruction
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(TempCometCollisionFix), nameof(TempCometCollisionFix.Update))]
|
||||||
|
public static bool TempCometCollisionFix_Update() => Main.Instance.TimeLoopEnabled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables sun logic
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(SunController), nameof(SunController.Update))]
|
||||||
|
public static bool SunController_Update(SunController __instance) => Main.Instance.TimeLoopEnabled && __instance.isActiveAndEnabled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables sun expansion
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(SunController), nameof(SunController.UpdateScale))]
|
||||||
|
public static bool SunController_UpdateScale(SunController __instance) => Main.Instance.TimeLoopEnabled && __instance.isActiveAndEnabled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables sun collapse SFX
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(SunController), nameof(SunController.OnTriggerSupernova))]
|
||||||
|
public static bool SunController_OnTriggerSupernova(SunController __instance) => Main.Instance.TimeLoopEnabled && __instance.isActiveAndEnabled;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables end times music
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(GlobalMusicController), nameof(GlobalMusicController.UpdateEndTimesMusic))]
|
||||||
|
public static bool GlobalMusicController_UpdateEndTimesMusic() => Main.Instance.TimeLoopEnabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user