quantum-space-buddies/QSB/TimeSync/WakeUpPatches.cs
2020-12-14 20:31:31 +01:00

24 lines
671 B
C#

using OWML.ModHelper.Events;
using QSB.Patches;
namespace QSB.TimeSync
{
public class WakeUpPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect;
public static bool OnStartOfTimeLoopPrefix(ref PlayerCameraEffectController __instance)
{
if (__instance.gameObject.CompareTag("MainCamera") && QSBSceneManager.CurrentScene != OWScene.EyeOfTheUniverse)
{
__instance.Invoke("WakeUp");
}
return false;
}
public override void DoPatches()
{
QSBCore.Helper.HarmonyHelper.AddPrefix<PlayerCameraEffectController>("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix));
}
}
}