mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2026-06-26 00:08:13 +00:00
[NAK_CVR_Mods] Unfucked for 2026r182
This commit is contained in:
parent
c13dc8375a
commit
281403d68b
209 changed files with 3936 additions and 1122 deletions
37
DehumanizePlayers/Main.cs
Normal file
37
DehumanizePlayers/Main.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue