2021-10-15 21:06:51 +01:00
|
|
|
|
using HarmonyLib;
|
2022-06-07 17:16:16 -07:00
|
|
|
|
using QSB.Inputs;
|
2021-10-15 21:06:51 +01:00
|
|
|
|
using QSB.Patches;
|
2021-11-20 11:48:46 +00:00
|
|
|
|
using QSB.Utility;
|
2021-06-12 15:58:34 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.TimeSync.Patches;
|
|
|
|
|
|
|
|
|
|
[HarmonyPatch]
|
|
|
|
|
internal class TimePatches : QSBPatch
|
2021-06-12 15:58:34 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
2022-02-05 10:14:27 +00:00
|
|
|
|
|
2022-06-07 17:16:16 -07:00
|
|
|
|
[HarmonyPostfix]
|
|
|
|
|
[HarmonyPatch(typeof(PlayerCameraEffectController), nameof(PlayerCameraEffectController.WakeUp))]
|
|
|
|
|
public static void PlayerCameraEffectController_WakeUp(PlayerCameraEffectController __instance)
|
|
|
|
|
{
|
|
|
|
|
// prevent funny thing when you pause while waking up
|
|
|
|
|
QSBInputManager.Instance.SetInputsEnabled(false);
|
|
|
|
|
Delay.RunWhen(() => !__instance._isOpeningEyes, () => QSBInputManager.Instance.SetInputsEnabled(true));
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
[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;
|
2022-02-27 04:40:44 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(SubmitActionSkipToNextLoop), nameof(SubmitActionSkipToNextLoop.AdvanceToNewTimeLoop))]
|
|
|
|
|
public static bool StopMeditation()
|
|
|
|
|
=> false;
|
2022-08-14 16:11:28 -07:00
|
|
|
|
}
|