[NAK_CVR_Mods] Unfucked for 2026r182

This commit is contained in:
NotAKid 2026-06-18 22:20:56 -05:00
parent c13dc8375a
commit 281403d68b
209 changed files with 3936 additions and 1122 deletions

37
DehumanizePlayers/Main.cs Normal file
View file

@ -0,0 +1,37 @@
using System.Reflection;
using ABI_RC.Core.Player;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
namespace NAK.DehumanizePlayers;
public class DehumanizePlayersMod : MelonMod
{
internal static MelonLogger.Instance Logger;
private static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(DehumanizePlayers));
private static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("enabled", true,
"Dehumanize Players", description: "When enabled creates a dummy animator above the avatar root which handles muscle application.");
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
HarmonyInstance.Patch(
typeof(NetIKController).GetMethod(nameof(NetIKController.SetupAvatar),
BindingFlags.Public | BindingFlags.Instance),
prefix: new HarmonyMethod(typeof(DehumanizePlayersMod).GetMethod(nameof(OnPreNetIKControllerSetupAvatar),
BindingFlags.NonPublic | BindingFlags.Static))
);
}
// ReSharper disable once RedundantAssignment
private static void OnPreNetIKControllerSetupAvatar(GameObject remoteAvatar, ref Animator remoteAnimator)
{
if (!EntryEnabled.Value) return;
remoteAnimator = HumanoidAvatarRebinder.RebindToParentHumanoidAnimator(remoteAvatar);
}
}