Merge branch 'dev' into nh-stuff

This commit is contained in:
Mister_Nebula 2022-11-08 22:10:27 +00:00
commit 87a1cd2fcf
2 changed files with 21 additions and 5 deletions

View File

@ -9,7 +9,23 @@ internal class InputPatches : QSBPatch
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPrefix]
[HarmonyPatch(typeof(OWInput), nameof(OWInput.Update))]
public static bool OWInput_Update()
=> QSBInputManager.Instance.InputsEnabled;
[HarmonyPatch(typeof(AbstractCommands), nameof(AbstractCommands.Update))]
public static bool AbstractCommands_Update(AbstractCommands __instance)
{
if (QSBInputManager.Instance.InputsEnabled)
{
return true;
}
__instance.Consumed = false;
__instance.WasActiveLastFrame = __instance.IsActiveThisFrame;
__instance.IsActiveThisFrame = false;
if (__instance.WasActiveLastFrame)
{
__instance.InputStartedTime = float.MaxValue;
}
return false;
}
}

View File

@ -25,8 +25,8 @@ internal class TimePatches : QSBPatch
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));
Locator.GetPauseCommandListener().AddPauseCommandLock();
Delay.RunWhen(() => !__instance._isOpeningEyes, () => Locator.GetPauseCommandListener().RemovePauseCommandLock());
}
[HarmonyPrefix]