Locomotion center according to avatar scale

This commit is contained in:
SDraw 2023-02-16 01:44:12 +03:00
parent b0ae6082bf
commit 268fec558f
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
2 changed files with 34 additions and 3 deletions

View file

@ -47,6 +47,11 @@ namespace ml_amt
null,
new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnCalibrate_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
HarmonyInstance.Patch(
typeof(PlayerSetup).GetMethod("SetPlaySpaceScale", BindingFlags.NonPublic | BindingFlags.Instance),
null,
new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnPlayspaceScale_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
// FBT detour
HarmonyInstance.Patch(
@ -153,6 +158,20 @@ namespace ml_amt
}
}
static void OnPlayspaceScale_Postfix() => ms_instance?.OnPlayspaceScale();
void OnPlayspaceScale()
{
try
{
if(m_localTweaker != null)
m_localTweaker.OnPlayspaceScale();
}
catch(System.Exception l_exception)
{
MelonLoader.MelonLogger.Error(l_exception);
}
}
// FBT detection override
static void FBTDetour_Prefix()
{