quantum-space-buddies/QSB/TimeSync/Patches/TimePatches.cs
2022-02-05 10:14:27 +00:00

34 lines
930 B
C#

using HarmonyLib;
using QSB.Patches;
using QSB.Utility;
namespace QSB.TimeSync.Patches
{
[HarmonyPatch]
internal class TimePatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPrefix]
[HarmonyPatch(typeof(PlayerCameraEffectController), nameof(PlayerCameraEffectController.OnStartOfTimeLoop))]
public static bool PlayerCameraEffectController_OnStartOfTimeLoop()
{
DebugLog.DebugWrite($"OnStartOfTimeLoop");
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(OWTime), nameof(OWTime.Pause))]
public static bool StopPausing(OWTime.PauseType pauseType)
=> pauseType
is OWTime.PauseType.Initializing
or OWTime.PauseType.Streaming
or OWTime.PauseType.Loading;
[HarmonyPrefix]
[HarmonyPatch(typeof(SubmitActionSkipToNextLoop), nameof(SubmitActionSkipToNextLoop.AdvanceToNewTimeLoop))]
public static bool StopMeditation()
=> false;
}
}