New mod: PlayerMovementCopycat

Collider radius upon avatar scaling
This commit is contained in:
SDraw 2023-05-04 11:40:47 +03:00
parent 3dceb85037
commit 0f5e1484d1
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
16 changed files with 1122 additions and 7 deletions

View file

@ -68,12 +68,17 @@ namespace ml_amt
);
}
// Alternative collider height
// Alternative collider height and radius
HarmonyInstance.Patch(
typeof(MovementSystem).GetMethod("UpdateCollider", BindingFlags.NonPublic | BindingFlags.Instance),
new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnUpdateCollider_Prefix), BindingFlags.Static | BindingFlags.NonPublic)),
null
);
HarmonyInstance.Patch(
typeof(PlayerSetup).GetMethod("SetupIKScaling", BindingFlags.NonPublic | BindingFlags.Instance),
null,
new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnSetupIKScaling_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
// AAS overriding fix
HarmonyInstance.Patch(
@ -252,7 +257,25 @@ namespace ml_amt
return false;
}
static void OnSetupIKScaling_Postfix(
ref PlayerSetup __instance,
float ____avatarHeight
)
{
if(!Settings.CollisionScale)
return;
try
{
__instance._movementSystem.UpdateAvatarHeight(Mathf.Clamp(____avatarHeight, 0.05f, float.MaxValue), true);
}
catch(System.Exception l_exception)
{
MelonLoader.MelonLogger.Error(l_exception);
}
}
// AnimatorOverrideController runtime animation replacement fix
static void OnOverride_Prefix(ref CVRAnimatorManager __instance, out AnimatorAnalyzer __state)
{
__state = new AnimatorAnalyzer();

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("AvatarMotionTweaker")]
[assembly: AssemblyVersion("1.2.7")]
[assembly: AssemblyFileVersion("1.2.7")]
[assembly: AssemblyVersion("1.2.8")]
[assembly: AssemblyFileVersion("1.2.8")]
[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.2.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.2.8", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonOptionalDependencies("ml_prm", "ml_pmc")]
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]