LeapCSharp update to 6.14.0

Fixed interaction input
This commit is contained in:
SDraw 2024-01-28 14:33:12 +03:00
parent f3aa0bc72d
commit 56686834d0
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
32 changed files with 89 additions and 34 deletions

View file

@ -1,4 +1,5 @@
using ABI_RC.Core.Player;
using ABI.CCK.Components;
using ABI_RC.Core.Player;
using System.Collections;
using System.Reflection;
using UnityEngine;
@ -42,6 +43,12 @@ namespace ml_lme
null,
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnPlayspaceScale_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
HarmonyInstance.Patch(
typeof(CVRPickupObject).GetMethod(nameof(CVRPickupObject.Grab), BindingFlags.Public | BindingFlags.Instance),
null,
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnPickupGrab_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
ModSupporter.Init();
MelonLoader.MelonCoroutines.Start(WaitForRootLogic());
@ -121,5 +128,19 @@ namespace ml_lme
MelonLoader.MelonLogger.Error(e);
}
}
static void OnPickupGrab_Postfix(ref CVRPickupObject __instance) => ms_instance?.OnPickupGrab(__instance);
void OnPickupGrab(CVRPickupObject p_pickup)
{
try
{
if(m_leapManager != null)
m_leapManager.OnPickupGrab(p_pickup);
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
}
}