mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
|
@ -1,7 +1,9 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Util.AnimatorManager;
|
||||
using BTKUILib;
|
||||
using BTKUILib.UIObjects;
|
||||
using BTKUILib.UIObjects.Components;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.ASTExtension.Integrations;
|
||||
|
||||
|
@ -29,6 +31,9 @@ public static partial class BtkUiAddon
|
|||
Category category = QuickMenuAPI.PlayerSelectPage.AddCategory(ASTExtensionMod.ModName, ASTExtensionMod.ModName);
|
||||
Button button = category.AddButton("Copy Height", "ASM_Icon_AvatarHeightCopy", "Copy selected players Eye Height.");
|
||||
button.OnPress += OnCopyPlayerHeight;
|
||||
|
||||
Button button2 = category.AddButton("Copy AAS", string.Empty, "Copy selected players AAS.");
|
||||
button2.OnPress += OnCopyPlayerAAS;
|
||||
}
|
||||
|
||||
private static void OnPlayerSelected(string _, string id)
|
||||
|
@ -38,18 +43,56 @@ public static partial class BtkUiAddon
|
|||
|
||||
private static void OnCopyPlayerHeight()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_selectedPlayer))
|
||||
return;
|
||||
|
||||
if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player))
|
||||
return;
|
||||
|
||||
if (player._avatar == null)
|
||||
return;
|
||||
if (string.IsNullOrEmpty(_selectedPlayer))
|
||||
return;
|
||||
|
||||
if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player))
|
||||
return;
|
||||
|
||||
if (player._avatar == null)
|
||||
return;
|
||||
|
||||
float height = player.netIkController.GetRemoteHeight();
|
||||
ASTExtensionMod.Instance.SetAvatarHeight(height);
|
||||
float height = player.netIkController.GetRemoteHeight();
|
||||
ASTExtensionMod.Instance.SetAvatarHeight(height);
|
||||
}
|
||||
|
||||
private static void OnCopyPlayerAAS()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_selectedPlayer))
|
||||
return;
|
||||
|
||||
if (!CVRPlayerManager.Instance.GetPlayerPuppetMaster(_selectedPlayer, out PuppetMaster player))
|
||||
return;
|
||||
|
||||
AvatarAnimatorManager localAnimator = PlayerSetup.Instance.animatorManager;
|
||||
AvatarAnimatorManager remoteAnimator = player.animatorManager;
|
||||
if (!localAnimator.IsInitialized
|
||||
|| !remoteAnimator.IsInitialized)
|
||||
return;
|
||||
|
||||
// Copy AAS
|
||||
foreach ((var parameterName, CVRAnimatorManager.ParamDef paramDef) in remoteAnimator.Parameters)
|
||||
{
|
||||
switch (paramDef.type)
|
||||
{
|
||||
case AnimatorControllerParameterType.Trigger:
|
||||
case AnimatorControllerParameterType.Bool:
|
||||
remoteAnimator.GetParameter(parameterName, out bool value);
|
||||
localAnimator.SetParameter(parameterName, value);
|
||||
break;
|
||||
case AnimatorControllerParameterType.Float:
|
||||
remoteAnimator.GetParameter(parameterName, out float value2);
|
||||
localAnimator.SetParameter(parameterName, value2);
|
||||
break;
|
||||
case AnimatorControllerParameterType.Int:
|
||||
remoteAnimator.GetParameter(parameterName, out int value3);
|
||||
localAnimator.SetParameter(parameterName, value3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion Player Select Page
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue