[ASTExtension] Fixes for 2025r180

This commit is contained in:
NotAKidoS 2025-08-27 01:23:37 -05:00
parent 7f5ca4b29d
commit 4123a1f25d
5 changed files with 21 additions and 18 deletions

View file

@ -9,13 +9,13 @@ public static class PlayerSetupExtensions
// immediate measurement of the player's avatar height // immediate measurement of the player's avatar height
public static float GetCurrentAvatarHeight(this PlayerSetup playerSetup) public static float GetCurrentAvatarHeight(this PlayerSetup playerSetup)
{ {
if (playerSetup._avatar == null) if (!playerSetup.IsAvatarLoaded)
{ {
ASTExtensionMod.Logger.Error("GetCurrentAvatarHeight: Avatar is null"); ASTExtensionMod.Logger.Error("GetCurrentAvatarHeight: Avatar is null");
return 0f; return 0f;
} }
Vector3 localScale = playerSetup._avatar.transform.localScale; Vector3 localScale = playerSetup.AvatarTransform.localScale;
Vector3 initialScale = playerSetup.initialScale; Vector3 initialScale = playerSetup.initialScale;
float initialHeight = playerSetup._initialAvatarHeight; float initialHeight = playerSetup._initialAvatarHeight;
Vector3 scaleDifference = CVRTools.DivideVectors(localScale - initialScale, initialScale); Vector3 scaleDifference = CVRTools.DivideVectors(localScale - initialScale, initialScale);

View file

@ -49,7 +49,7 @@ public static partial class BtkUiAddon
if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player)) if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player))
return; return;
if (player._avatar == null) if (!player.IsAvatarLoaded)
return; return;
float height = player.netIkController.GetRemoteHeight(); float height = player.netIkController.GetRemoteHeight();
@ -64,8 +64,8 @@ public static partial class BtkUiAddon
if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player)) if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player))
return; return;
AvatarAnimatorManager localAnimator = PlayerSetup.Instance.animatorManager; AvatarAnimatorManager localAnimator = PlayerSetup.Instance.AnimatorManager;
AvatarAnimatorManager remoteAnimator = player.animatorManager; AvatarAnimatorManager remoteAnimator = player.AnimatorManager;
if (!localAnimator.IsInitialized if (!localAnimator.IsInitialized
|| !remoteAnimator.IsInitialized) || !remoteAnimator.IsInitialized)
return; return;

View file

@ -81,7 +81,7 @@ public class ASTExtensionMod : MelonMod
); );
HarmonyInstance.Patch( HarmonyInstance.Patch(
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.ClearAvatar), typeof(PlayerBase).GetMethod(nameof(PlayerBase.ClearAvatar),
BindingFlags.Public | BindingFlags.Instance), BindingFlags.Public | BindingFlags.Instance),
prefix: new HarmonyMethod(typeof(ASTExtensionMod).GetMethod(nameof(OnClearAvatar), prefix: new HarmonyMethod(typeof(ASTExtensionMod).GetMethod(nameof(OnClearAvatar),
BindingFlags.NonPublic | BindingFlags.Static)) BindingFlags.NonPublic | BindingFlags.Static))
@ -112,8 +112,11 @@ public class ASTExtensionMod : MelonMod
Instance.OnLocalAvatarLoad(); Instance.OnLocalAvatarLoad();
} }
private static void OnClearAvatar(ref CVRAvatar ____avatarDescriptor) private static void OnClearAvatar(ref PlayerBase __instance)
=> Instance.OnLocalAvatarClear(____avatarDescriptor); {
if (!__instance.IsLocalPlayer) return;
Instance.OnLocalAvatarClear(__instance.AvatarDescriptor);
}
#endregion Harmony Patches #endregion Harmony Patches
@ -227,7 +230,7 @@ public class ASTExtensionMod : MelonMod
{ {
parameterName = null; parameterName = null;
AvatarAnimatorManager animatorManager = PlayerSetup.Instance.animatorManager; AvatarAnimatorManager animatorManager = PlayerSetup.Instance.AnimatorManager;
if (!animatorManager.IsInitialized) if (!animatorManager.IsInitialized)
{ {
Logger.Error("AnimatorManager is not initialized!"); Logger.Error("AnimatorManager is not initialized!");
@ -254,7 +257,7 @@ public class ASTExtensionMod : MelonMod
maxHeight = 0f; maxHeight = 0f;
modifier = 1f; modifier = 1f;
AvatarAnimatorManager animatorManager = PlayerSetup.Instance.animatorManager; AvatarAnimatorManager animatorManager = PlayerSetup.Instance.AnimatorManager;
if (!animatorManager.IsInitialized) if (!animatorManager.IsInitialized)
{ {
Logger.Error("AnimatorManager is not initialized!"); Logger.Error("AnimatorManager is not initialized!");
@ -319,7 +322,7 @@ public class ASTExtensionMod : MelonMod
if (!_currentAvatarSupported) if (!_currentAvatarSupported)
return; return;
AvatarAnimatorManager animatorManager = PlayerSetup.Instance.animatorManager; AvatarAnimatorManager animatorManager = PlayerSetup.Instance.AnimatorManager;
if (!animatorManager.IsInitialized) if (!animatorManager.IsInitialized)
{ {
Logger.Error("AnimatorManager is not initialized!"); Logger.Error("AnimatorManager is not initialized!");

View file

@ -17,7 +17,7 @@ using System.Reflection;
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension" downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension"
)] )]
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] [assembly: MelonGame("ChilloutVR", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] [assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonColor(255, 246, 25, 99)] // red-pink [assembly: MelonColor(255, 246, 25, 99)] // red-pink
@ -27,6 +27,6 @@ using System.Reflection;
namespace NAK.ASTExtension.Properties; namespace NAK.ASTExtension.Properties;
internal static class AssemblyInfoParams internal static class AssemblyInfoParams
{ {
public const string Version = "1.0.3"; public const string Version = "1.0.4";
public const string Author = "NotAKidoS"; public const string Author = "NotAKidoS";
} }

View file

@ -1,9 +1,9 @@
{ {
"_id": 223, "_id": 223,
"name": "ASTExtension", "name": "ASTExtension",
"modversion": "1.0.3", "modversion": "1.0.4",
"gameversion": "2025r179", "gameversion": "2025r180",
"loaderversion": "0.6.1", "loaderversion": "0.7.2",
"modtype": "Mod", "modtype": "Mod",
"author": "NotAKidoS", "author": "NotAKidoS",
"description": "Extension mod for [Avatar Scale Tool](https://github.com/NotAKidoS/AvatarScaleTool):\n- VR Gesture to scale\n- Persistent height\n- Copy height from others\n\nBest used with Avatar Scale Tool, but will attempt to work with found scaling setups.\nRequires already having Avatar Scaling on the avatar. This is **not** Universal Scaling.", "description": "Extension mod for [Avatar Scale Tool](https://github.com/NotAKidoS/AvatarScaleTool):\n- VR Gesture to scale\n- Persistent height\n- Copy height from others\n\nBest used with Avatar Scale Tool, but will attempt to work with found scaling setups.\nRequires already having Avatar Scaling on the avatar. This is **not** Universal Scaling.",
@ -17,8 +17,8 @@
"requirements": [ "requirements": [
"BTKUILib" "BTKUILib"
], ],
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r46/ASTExtension.dll", "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r47/ASTExtension.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension/", "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension/",
"changelog": "- Recompiled for 2025r179", "changelog": "- Fixes for 2025r180",
"embedcolor": "#f61963" "embedcolor": "#f61963"
} }