Decompiled source of ConfigurableBody v1.0.0

Mods/ConfigurableBody.dll

Decompiled 9 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ConfigurableBody;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "ConfigurableBody", "1.0.0", "MajedCT", null)]
[assembly: MelonGame("Kubunautilus", "BrutalistickVR")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ConfigurableBody")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ConfigurableBody")]
[assembly: AssemblyTitle("ConfigurableBody")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ConfigurableBody
{
	public class Core : MelonMod
	{
		public static MelonPreferences_Entry<int> mode;

		public static MelonPreferences_Category category;

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Initialized.");
			category = MelonPreferences.CreateCategory("ConfigurableBody", "Configurable Body");
			mode = category.CreateEntry<int>("Mode", 1, "Mode", "1 = hands, legs, body | 2 = hands, feet, body | 3 = hands, body | 4 = hands only | 5 = true hands only,\n0 to disable the mod.", false, false, (ValueValidator)null, (string)null);
			category.SaveToFile(true);
		}

		public override void OnSceneWasInitialized(int buildIndex, string sceneName)
		{
			if (mode.Value == 0 || sceneName == "MainMenuScene")
			{
				return;
			}
			Transform child = GameObject.Find("RShoulderPoint").transform.parent.GetChild(GameObject.Find("RShoulderPoint").transform.GetSiblingIndex() + 2);
			GameObject val = GameObject.Find("LElbowPoint");
			Il2CppArrayBase<ConfigurableJoint> components = val.GetComponents<ConfigurableJoint>();
			ConfigurableJoint val2 = components[1];
			CapsuleCollider componentInChildren = val.GetComponentInChildren<CapsuleCollider>();
			MeshRenderer componentInChildren2 = val.GetComponentInChildren<MeshRenderer>();
			GameObject val3 = GameObject.Find("RElbowPoint");
			Il2CppArrayBase<ConfigurableJoint> components2 = val3.GetComponents<ConfigurableJoint>();
			ConfigurableJoint val4 = components2[1];
			CapsuleCollider componentInChildren3 = val3.GetComponentInChildren<CapsuleCollider>();
			MeshRenderer componentInChildren4 = val3.GetComponentInChildren<MeshRenderer>();
			if (mode.Value > 0 && mode.Value < 6)
			{
				val2.angularXMotion = (ConfigurableJointMotion)0;
				val2.angularZMotion = (ConfigurableJointMotion)0;
				val2.angularYMotion = (ConfigurableJointMotion)0;
				val4.angularXMotion = (ConfigurableJointMotion)0;
				val4.angularZMotion = (ConfigurableJointMotion)0;
				val4.angularYMotion = (ConfigurableJointMotion)0;
			}
			GameObject val5 = GameObject.Find("LegsIK");
			int value = mode.Value;
			int num = value;
			if (num <= 5)
			{
				if (num >= 1)
				{
					switch (num)
					{
					case 1:
						GameObject.Find("RShoulderPoint").SetActive(false);
						((Component)child).gameObject.SetActive(false);
						GameObject.Find("CollarboneL").SetActive(false);
						GameObject.Find("CollarboneR").SetActive(false);
						break;
					case 2:
					{
						GameObject.Find("RShoulderPoint").SetActive(false);
						((Component)child).gameObject.SetActive(false);
						GameObject.Find("CollarboneL").SetActive(false);
						GameObject.Find("CollarboneR").SetActive(false);
						Transform val6 = ((IEnumerable<Transform>)((Component)val5.transform).GetComponentsInChildren<Transform>(false)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "Hip_R"));
						Transform val7 = ((IEnumerable<Transform>)((Component)val5.transform).GetComponentsInChildren<Transform>(false)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "Hip_L"));
						Transform val8 = ((IEnumerable<Transform>)((Component)val5.transform).GetComponentsInChildren<Transform>(false)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "Knee_R"));
						Transform val9 = ((IEnumerable<Transform>)((Component)val5.transform).GetComponentsInChildren<Transform>(false)).FirstOrDefault((Func<Transform, bool>)((Transform t) => ((Object)t).name == "Knee_L"));
						((Component)val6).gameObject.SetActive(false);
						((Component)val7).gameObject.SetActive(false);
						((Component)val8).gameObject.SetActive(false);
						((Component)val9).gameObject.SetActive(false);
						break;
					}
					case 3:
						GameObject.Find("RShoulderPoint").SetActive(false);
						((Component)child).gameObject.SetActive(false);
						GameObject.Find("CollarboneL").SetActive(false);
						GameObject.Find("CollarboneR").SetActive(false);
						val5.SetActive(false);
						break;
					case 4:
						GameObject.Find("RShoulderPoint").SetActive(false);
						((Component)child).gameObject.SetActive(false);
						GameObject.Find("CollarboneL").SetActive(false);
						GameObject.Find("CollarboneR").SetActive(false);
						val5.SetActive(false);
						GameObject.Find("PlayerPelvis").SetActive(false);
						GameObject.Find("NeckCylinderPivot").SetActive(false);
						break;
					default:
						GameObject.Find("RShoulderPoint").SetActive(false);
						((Component)child).gameObject.SetActive(false);
						GameObject.Find("CollarboneL").SetActive(false);
						GameObject.Find("CollarboneR").SetActive(false);
						val5.SetActive(false);
						GameObject.Find("PlayerPelvis").SetActive(false);
						GameObject.Find("NeckCylinderPivot").SetActive(false);
						Object.Destroy((Object)(object)componentInChildren2);
						Object.Destroy((Object)(object)componentInChildren);
						Object.Destroy((Object)(object)componentInChildren4);
						Object.Destroy((Object)(object)componentInChildren3);
						break;
					}
				}
				else
				{
					MelonLogger.Msg("YOU A STINKY FACE >:(");
				}
			}
			else
			{
				MelonLogger.Msg("YOU A POOPY HEAD >:(");
			}
		}
	}
}