diff --git a/ASTExtension/Main.cs b/ASTExtension/Main.cs index 881bcbf..76d3731 100644 --- a/ASTExtension/Main.cs +++ b/ASTExtension/Main.cs @@ -2,6 +2,7 @@ using ABI_RC.Core.InteractionSystem; using ABI_RC.Core.Player; using ABI_RC.Core.Savior; +using ABI_RC.Core.Util; using ABI_RC.Core.Util.AnimatorManager; using ABI_RC.Systems.InputManagement; using ABI.CCK.Components; @@ -73,8 +74,8 @@ public class ASTExtensionMod : MelonMod ); HarmonyInstance.Patch( - typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupAvatar), - BindingFlags.Public | BindingFlags.Instance), + typeof(ColliderTools).GetMethod(nameof(ColliderTools.PlaceDefaultPointers), + BindingFlags.Public | BindingFlags.Static), postfix: new HarmonyMethod(typeof(ASTExtensionMod).GetMethod(nameof(OnSetupAvatar), BindingFlags.NonPublic | BindingFlags.Static)) ); @@ -104,9 +105,12 @@ public class ASTExtensionMod : MelonMod private static void OnGestureRecogniserInitialized() => Instance.InitializeScaleGesture(); - - private static void OnSetupAvatar(ref CVRAvatar ____avatarDescriptor) - => Instance.OnLocalAvatarLoad(____avatarDescriptor); + + private static void OnSetupAvatar(bool isLocalPlayer) + { + if (!isLocalPlayer) return; + Instance.OnLocalAvatarLoad(); + } private static void OnClearAvatar(ref CVRAvatar ____avatarDescriptor) => Instance.OnLocalAvatarClear(____avatarDescriptor); @@ -115,7 +119,7 @@ public class ASTExtensionMod : MelonMod #region Game Events - private void OnLocalAvatarLoad(CVRAvatar _) + private void OnLocalAvatarLoad() { if (!FindSupportedParameter(out string parameterName)) return; @@ -272,14 +276,14 @@ public class ASTExtensionMod : MelonMod animatorManager.GetParameter(parameterName, out float initialValue); // set min height to 0 - animator.SetFloat(parameterName, 0f); + animatorManager.SetParameter(parameterName, 0f); animator.Update(0f); // apply minHeight = PlayerSetup.Instance.GetCurrentAvatarHeight(); // set max height to 1++ for (int i = 1; i <= 100; i++) { - animator.SetFloat(parameterName, i); + animatorManager.SetParameter(parameterName, i); animator.Update(0f); // apply var height = PlayerSetup.Instance.GetCurrentAvatarHeight(); if (height <= maxHeight) break; // stop if height is not increasing @@ -288,7 +292,7 @@ public class ASTExtensionMod : MelonMod } // reset the parameter to its initial value - animator.SetFloat(parameterName, initialValue); + animatorManager.SetParameter(parameterName, initialValue); animator.Update(0f); // apply // check if there was no change diff --git a/ASTExtension/Properties/AssemblyInfo.cs b/ASTExtension/Properties/AssemblyInfo.cs index 747a7d8..faa1dc6 100644 --- a/ASTExtension/Properties/AssemblyInfo.cs +++ b/ASTExtension/Properties/AssemblyInfo.cs @@ -27,6 +27,6 @@ using System.Reflection; namespace NAK.ASTExtension.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.0"; + public const string Version = "1.0.1"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/ASTExtension/format.json b/ASTExtension/format.json index 5e137ce..a773287 100644 --- a/ASTExtension/format.json +++ b/ASTExtension/format.json @@ -1,7 +1,7 @@ { "_id": 223, "name": "ASTExtension", - "modversion": "1.0.0", + "modversion": "1.0.1", "gameversion": "2024r175", "loaderversion": "0.6.1", "modtype": "Mod", @@ -17,8 +17,8 @@ "requirements": [ "BTKUILib" ], - "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r34/ASTExtension.dll", + "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r35/ASTExtension.dll", "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension/", - "changelog": "- Initial release", + "changelog": "- Fixed an issue where the parameter calibration process would sometimes result in the mouth pointer being misplaced when generated.", "embedcolor": "#f61963" } \ No newline at end of file