mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 12:08:52 +00:00
31 lines
687 B
C#
31 lines
687 B
C#
using HarmonyLib;
|
|
using QSB.Patches;
|
|
|
|
namespace QSB.Inputs.Patches;
|
|
|
|
[HarmonyPatch]
|
|
public class InputPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
|
|
|
[HarmonyPrefix]
|
|
[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;
|
|
}
|
|
} |