mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-06 00:39:55 +00:00
Merge branch 'dev' into nh-stuff
This commit is contained in:
commit
87a1cd2fcf
@ -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;
|
||||
}
|
||||
}
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user