Rays layer fix

Desktop tracking scale fix
More notifications
This commit is contained in:
SDraw 2023-01-29 19:55:22 +03:00
parent fbad3fdf8e
commit 6bc448d41d
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
8 changed files with 118 additions and 45 deletions

View file

@ -43,6 +43,11 @@ namespace ml_lme
null,
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnRayScale_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
HarmonyInstance.Patch(
typeof(PlayerSetup).GetMethod("SetPlaySpaceScale", BindingFlags.NonPublic | BindingFlags.Instance),
null,
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnPlayspaceScale_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
MelonLoader.MelonCoroutines.Start(WaitForRootLogic());
}
@ -117,5 +122,19 @@ namespace ml_lme
MelonLoader.MelonLogger.Error(e);
}
}
static void OnPlayspaceScale_Postfix(float ____avatarScaleRelation) => ms_instance?.OnPlayspaceScale(____avatarScaleRelation);
void OnPlayspaceScale(float p_relation)
{
try
{
if(m_leapManager != null)
m_leapManager.OnPlayspaceScale(p_relation);
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
}
}