mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
70
.DepricatedMods/AASBufferFix/HarmonyPatches.cs
Normal file
70
.DepricatedMods/AASBufferFix/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,70 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.Base;
|
||||
using ABI_RC.Core.Player;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AASBufferFix.HarmonyPatches;
|
||||
|
||||
[HarmonyPatch]
|
||||
internal class HarmonyPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PuppetMaster), "Start")]
|
||||
private static void Postfix_PuppetMaster_Start(ref PuppetMaster __instance)
|
||||
{
|
||||
__instance.AddComponentIfMissing<AASBufferHelper>();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PuppetMaster), "AvatarInstantiated")]
|
||||
private static void Postfix_PuppetMaster_AvatarInstantiated(ref PuppetMaster __instance, ref Animator ____animator)
|
||||
{
|
||||
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
|
||||
|
||||
externalBuffer?.OnAvatarInstantiated(____animator);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PuppetMaster), "AvatarDestroyed")]
|
||||
private static void Postfix_PuppetMaster_AvatarDestroyed(ref PuppetMaster __instance)
|
||||
{
|
||||
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
|
||||
|
||||
externalBuffer?.OnAvatarDestroyed();
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PuppetMaster), "ApplyAdvancedAvatarSettings")]
|
||||
private static bool Prefix_PuppetMaster_ApplyAdvancedAvatarSettings(float[] settingsFloat, int[] settingsInt, byte[] settingsByte, ref PuppetMaster __instance)
|
||||
{
|
||||
AASBufferHelper externalBuffer = __instance.GetComponent<AASBufferHelper>();
|
||||
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
|
||||
{
|
||||
externalBuffer.OnReceiveAAS(settingsFloat, settingsInt, settingsByte);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CVRAnimatorManager), "ApplyAdvancedAvatarSettingsFromBuffer")]
|
||||
private static bool Prefix_CVRAnimatorManager_ApplyAdvancedAvatarSettingsFromBuffer(ref Animator ____animator)
|
||||
{
|
||||
AASBufferHelper externalBuffer = ____animator.GetComponentInParent<AASBufferHelper>();
|
||||
if (externalBuffer != null && !externalBuffer.GameHandlesAAS)
|
||||
{
|
||||
//dont apply if stable buffer no exist
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), "SendAdvancedAvatarSettings")]
|
||||
private static bool Prefix_PlayerSetup_SendAdvancedAvatarSettings(ref PlayerSetup __instance)
|
||||
{
|
||||
//dont sync wrong settings to remote users
|
||||
return !__instance.avatarIsLoading;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue