2020-08-14 05:04:31 +02:00
|
|
|
|
using OWML.ModHelper.Events;
|
2020-12-14 20:31:31 +01:00
|
|
|
|
using QSB.Patches;
|
2020-08-13 22:06:34 +01:00
|
|
|
|
|
|
|
|
|
namespace QSB.TimeSync
|
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public class WakeUpPatches : QSBPatch
|
|
|
|
|
{
|
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect;
|
2020-08-13 22:06:34 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public static bool OnStartOfTimeLoopPrefix(ref PlayerCameraEffectController __instance)
|
|
|
|
|
{
|
|
|
|
|
if (__instance.gameObject.CompareTag("MainCamera") && QSBSceneManager.CurrentScene != OWScene.EyeOfTheUniverse)
|
|
|
|
|
{
|
|
|
|
|
__instance.Invoke("WakeUp");
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-11-03 21:11:10 +00:00
|
|
|
|
|
2020-12-18 20:28:22 +00:00
|
|
|
|
public override void DoPatches() => QSBCore.Helper.HarmonyHelper.AddPrefix<PlayerCameraEffectController>("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix));
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|