Decompiled source of Custom Cosmetics v0.1.2

plugins/com.atomic.customcosmetics.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Aggro.Core;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Custom_Cosmetics.Helpers;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("febjam")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.customcosmetics")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.2.0")]
[assembly: AssemblyInformationalVersion("0.1.2+0f04c36349adc0ea3f823c0dc378e619a2a928d5")]
[assembly: AssemblyProduct("com.atomic.customcosmetics")]
[assembly: AssemblyTitle("Custom_Cosmetics")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace Custom_Cosmetics
{
	[CreateAssetMenu(fileName = "NewCosmetic", menuName = "Custom Cosmetics/Cosmetic Definition")]
	public class CosmeticDefinition : ScriptableObject
	{
		[Serializable]
		public class CosmeticSettings
		{
			public string id;

			public string headName;

			public string bodyName;

			public string faceName;

			public Vector3 headPos;

			public Vector3 headRot;

			public Vector3 headScale;

			public Vector3 bodyPos;

			public Vector3 bodyRot;

			public Vector3 bodyScale;

			public Vector3 facePos;

			public Vector3 faceRot;

			public Vector3 faceScale;
		}

		[Header("Identity")]
		public string cosmeticId = "my-cosmetic";

		[Header("Head")]
		public GameObject headPrefab;

		public Vector3 headPosition = Vector3.zero;

		public Vector3 headRotation = Vector3.zero;

		public Vector3 headScale = Vector3.one;

		[Header("Body")]
		public GameObject bodyPrefab;

		public Vector3 bodyPosition = Vector3.zero;

		public Vector3 bodyRotation = Vector3.zero;

		public Vector3 bodyScale = Vector3.one;

		[Header("Face")]
		public GameObject facePrefab;

		public Vector3 facePosition = Vector3.zero;

		public Vector3 faceRotation = Vector3.zero;

		public Vector3 faceScale = Vector3.one;

		public CosmeticSettings ToSettings()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			return new CosmeticSettings
			{
				id = cosmeticId,
				headName = (Object.op_Implicit((Object)(object)headPrefab) ? ((Object)headPrefab).name : ""),
				headPos = headPosition,
				headRot = headRotation,
				headScale = headScale,
				bodyName = (Object.op_Implicit((Object)(object)bodyPrefab) ? ((Object)bodyPrefab).name : ""),
				bodyPos = bodyPosition,
				bodyRot = bodyRotation,
				bodyScale = bodyScale,
				faceName = (Object.op_Implicit((Object)(object)facePrefab) ? ((Object)facePrefab).name : ""),
				facePos = facePosition,
				faceRot = faceRotation,
				faceScale = faceScale
			};
		}
	}
	public class CustomCostumeData
	{
		public string Name { get; }

		public GameObject? HeadObject { get; }

		public GameObject? BodyObject { get; }

		public GameObject? FaceObject { get; }

		public Vector3 HeadPosition { get; }

		public Quaternion HeadRotation { get; }

		public Vector3 HeadScale { get; }

		public Vector3 BodyPosition { get; }

		public Quaternion BodyRotation { get; }

		public Vector3 BodyScale { get; }

		public Vector3 FacePosition { get; }

		public Quaternion FaceRotation { get; }

		public Vector3 FaceScale { get; }

		public CustomCostumeData(CosmeticDefinition.CosmeticSettings settings, AssetBundle bundle)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			Name = settings.id;
			if (!string.IsNullOrEmpty(settings.headName))
			{
				HeadObject = bundle.LoadAsset<GameObject>(settings.headName);
			}
			if (!string.IsNullOrEmpty(settings.bodyName))
			{
				BodyObject = bundle.LoadAsset<GameObject>(settings.bodyName);
			}
			if (!string.IsNullOrEmpty(settings.faceName))
			{
				FaceObject = bundle.LoadAsset<GameObject>(settings.faceName);
			}
			HeadPosition = settings.headPos;
			HeadRotation = Quaternion.Euler(settings.headRot);
			HeadScale = settings.headScale;
			BodyPosition = settings.bodyPos;
			BodyRotation = Quaternion.Euler(settings.bodyRot);
			BodyScale = settings.bodyScale;
			FacePosition = settings.facePos;
			FaceRotation = Quaternion.Euler(settings.faceRot);
			FaceScale = settings.faceScale;
		}
	}
	[BepInPlugin("com.atomic.customcosmetics", "Custom_Cosmetics", "0.1.2")]
	public class Plugin : BaseUnityPlugin
	{
		public const string CosmeticExtension = ".cosmetic";

		private Harmony harmony;

		public static ConfigEntry<bool> CosmeticDevTools;

		public static ConfigEntry<float> SnapStepPos;

		public static ConfigEntry<float> SnapStepRot;

		public static CosmeticDevUI devUI;

		public const string Id = "com.atomic.customcosmetics";

		internal static ManualLogSource Log { get; private set; } = null;


		public static List<CustomCostumeData> customCostumes { get; private set; } = new List<CustomCostumeData>();


		internal static ConfigEntry<string> SavedCostumeName { get; private set; } = null;


		public static string Name => "Custom_Cosmetics";

		public static string Version => "0.1.2";

		private void Awake()
		{
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			CosmeticDevTools = ((BaseUnityPlugin)this).Config.Bind<bool>("Devtools", "Cosmetic Dev Tools", false, "Brings up UI in the cosmetic selector to reposition ");
			SnapStepPos = ((BaseUnityPlugin)this).Config.Bind<float>("Devtools", "Position Snap Step", 0.001f, "How much to move per click.");
			SnapStepRot = ((BaseUnityPlugin)this).Config.Bind<float>("Devtools", "Rotation Snap Step", 1f, "How many degrees to rotate per click.");
			SavedCostumeName = ((BaseUnityPlugin)this).Config.Bind<string>("Persistence", "LastCostumeName", "", "Internal name of the last selected costume. You do not need to set this.");
			harmony = new Harmony("com.atomic.customcosmetics");
			harmony.PatchAll();
			GameObject val = new GameObject("CosmeticDevUI");
			devUI = val.AddComponent<CosmeticDevUI>();
			((Object)val).hideFlags = (HideFlags)61;
			LoadAllCosmetics();
		}

		private void LoadAllCosmetics()
		{
			string pluginPath = Paths.PluginPath;
			string[] files = Directory.GetFiles(pluginPath, "*.cosmetic", SearchOption.AllDirectories);
			if (files.Length == 0)
			{
				Log.LogInfo((object)"No .cosmetic files found in plugins folder.");
				return;
			}
			Array.Sort(files);
			string[] array = files;
			foreach (string filePath in array)
			{
				TryLoadCosmeticBundle(filePath);
			}
		}

		private void TryLoadCosmeticBundle(string filePath)
		{
			AssetBundle val = AssetBundle.LoadFromFile(filePath);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			TextAsset val2 = val.LoadAsset<TextAsset>("temp_metadata");
			if ((Object)(object)val2 == (Object)null)
			{
				Log.LogWarning((object)("Bundle '" + Path.GetFileName(filePath) + "' has no metadata. Export it with the new builder."));
				val.Unload(true);
				return;
			}
			try
			{
				CosmeticDefinition.CosmeticSettings settings = JsonUtility.FromJson<CosmeticDefinition.CosmeticSettings>(val2.text);
				CustomCostumeData customCostumeData = new CustomCostumeData(settings, val);
				customCostumes.Add(customCostumeData);
				Log.LogInfo((object)("Successfully registered: " + customCostumeData.Name));
			}
			catch (Exception ex)
			{
				Log.LogError((object)("Failed to parse cosmetic metadata: " + ex.Message));
				val.Unload(true);
			}
		}

		public static void AddToGlobalRegistry(CostumeObject customObject)
		{
			CosmeticGlobalData instance = GlobalScriptableObject<CosmeticGlobalData>.instance;
			if (!((Object)(object)instance == (Object)null) && !instance.costumes.Contains(customObject))
			{
				List<CostumeObject> list = instance.costumes.ToList();
				list.Add(customObject);
				instance.costumes = list.ToArray();
				Log.LogInfo((object)("Registered " + ((Object)customObject).name + " to Global Cosmetic Data."));
			}
		}
	}
}
namespace Custom_Cosmetics.Patches
{
	[HarmonyPatch]
	public static class CostumeManagerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerCostumeManager), "OnEntityCreated")]
		public static void RestoreSavedCostume(PlayerCostumeManager __instance)
		{
			string value = Plugin.SavedCostumeName.Value;
			if (string.IsNullOrEmpty(value))
			{
				return;
			}
			for (int i = 0; i < __instance.costumes.Length; i++)
			{
				if (__instance.costumes[i].name == value)
				{
					__instance.currentCostumeID = i;
					break;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerCostumeManager), "GetIndexFromCostumeObject")]
		public static void FallbackToNameMatch(PlayerCostumeManager __instance, CostumeObject costumeObject, ref int __result)
		{
			if (__result != -1 || (Object)(object)costumeObject == (Object)null)
			{
				return;
			}
			for (int i = 0; i < __instance.costumes.Length; i++)
			{
				if ((Object)(object)__instance.costumes[i].costumeObject != (Object)null && ((Object)__instance.costumes[i].costumeObject).name == ((Object)costumeObject).name)
				{
					__result = i;
					break;
				}
			}
		}
	}
	[HarmonyPatch]
	public static class Devtools
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(CostumeChangeUI), "OnEntityCreated")]
		public static void OnSelect(CostumeChangeUI __instance)
		{
			if (Plugin.CosmeticDevTools.Value)
			{
				Plugin.devUI._isVisible = true;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameManager), "OnGameManagerLoad")]
		public static void Disable(GameManager __instance)
		{
			if (Plugin.CosmeticDevTools.Value)
			{
				Plugin.devUI._isVisible = false;
			}
		}
	}
	[HarmonyPatch]
	public static class PlaceCostumeOntoPlayer
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(PlayerCostumeManager), "OnEntityCreated")]
		public static void UpdateCostumePrefix(PlayerCostumeManager __instance)
		{
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			Transform parent = __instance.costumes[1].expressions[0].parts[0].frameObjects[0].transform.parent.parent;
			Transform parent2 = __instance.costumes[1].expressions[0].parts[0].frameObjects[0].transform.parent.parent.parent.parent.parent.Find("COSTUME-BODY");
			Transform parent3 = __instance.costumes[1].expressions[0].parts[0].frameObjects[0].transform.parent.parent.parent.Find("COSTUME-FACE");
			foreach (CustomCostumeData customCostume in Plugin.customCostumes)
			{
				string costumeId = customCostume.Name;
				if (!__instance.costumes.Any((Costume c) => c.name == "custom-costume-" + costumeId))
				{
					GameObject head = AttachPart(customCostume.HeadObject, parent, "custom-costume-" + costumeId + "-head", customCostume.HeadPosition, customCostume.HeadRotation, customCostume.HeadScale);
					GameObject body = AttachPart(customCostume.BodyObject, parent2, "custom-costume-" + costumeId + "-body", customCostume.BodyPosition, customCostume.BodyRotation, customCostume.BodyScale);
					GameObject face = AttachPart(customCostume.FaceObject, parent3, "custom-costume-" + costumeId + "-face", customCostume.FacePosition, customCostume.FaceRotation, customCostume.FaceScale);
					Costume costume = CreateCostumeType.CreateCostume(costumeId, ref head, ref body, ref face);
					AddCostumeToArray.AddCostume(__instance, costume);
					if (head != null)
					{
						head.SetActive(false);
					}
					if (body != null)
					{
						body.SetActive(false);
					}
					if (face != null)
					{
						face.SetActive(false);
					}
				}
			}
			__instance.SetUpUnlockedIndicies();
			List<int> list = __instance.unlockedCostumeIndicies.ToList();
			for (int i = 0; i < __instance.costumes.Length; i++)
			{
				if (!list.Contains(i) && __instance.costumes[i].name.StartsWith("custom-costume-"))
				{
					list.Add(i);
				}
			}
			__instance.unlockedCostumeIndicies = list.ToArray();
		}

		private static GameObject? AttachPart(GameObject? prefab, Transform? parent, string instanceName, Vector3 localPos, Quaternion localRot, Vector3 localScale)
		{
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)prefab == (Object)null || (Object)(object)parent == (Object)null)
			{
				return null;
			}
			Transform val = parent.Find(instanceName);
			if ((Object)(object)val != (Object)null)
			{
				return ((Component)val).gameObject;
			}
			GameObject val2 = Object.Instantiate<GameObject>(prefab, parent);
			((Object)val2).name = instanceName;
			Shader val3 = Shader.Find("shader-main");
			if ((Object)(object)val3 != (Object)null)
			{
				Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>(true);
				Renderer[] array = componentsInChildren;
				foreach (Renderer val4 in array)
				{
					Material[] materials = val4.materials;
					foreach (Material val5 in materials)
					{
						val5.shader = val3;
					}
				}
			}
			else
			{
				Plugin.Log.LogWarning((object)"Could not find shader 'shader-main'.");
			}
			val2.transform.localPosition = localPos;
			val2.transform.localRotation = localRot;
			val2.transform.localScale = localScale;
			return val2;
		}
	}
	[HarmonyPatch]
	public static class PlayerCostumeManagerNetworkPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(PlayerCostumeManagerNetwork), "SetCostumeIndex")]
		public static bool SetCostumeIndexPrefix(PlayerCostumeManagerNetwork __instance, int index)
		{
			if (index < 0 || index >= __instance.costumeManager.costumes.Length)
			{
				Plugin.Log.LogWarning((object)$"SetCostumeIndex called with out-of-range index {index}, ignoring.");
				return false;
			}
			EnsureUnlockedIndices(__instance.costumeManager);
			Costume val = __instance.costumeManager.costumes[index];
			if (val.name.StartsWith("custom-costume-"))
			{
				__instance.NetworkcurrentCostumeID = index;
				__instance.costumeManager.currentCostumeID = index;
				__instance.costumeManager.UpdateCostume();
				Plugin.SavedCostumeName.Value = val.name;
				return true;
			}
			Plugin.SavedCostumeName.Value = val.name;
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(PlayerCostumeManagerNetwork), "InitializeCostumeFromSaveData")]
		public static bool SkipIfCustomCostumeSaved(PlayerCostumeManagerNetwork __instance)
		{
			EnsureUnlockedIndices(__instance.costumeManager);
			string value = Plugin.SavedCostumeName.Value;
			if (string.IsNullOrEmpty(value) || !value.StartsWith("custom-costume-"))
			{
				return true;
			}
			for (int i = 0; i < __instance.costumeManager.costumes.Length; i++)
			{
				if (__instance.costumeManager.costumes[i].name == value)
				{
					__instance.NetworkcurrentCostumeID = i;
					__instance.costumeManager.currentCostumeID = i;
					return true;
				}
			}
			return true;
		}

		private static void EnsureUnlockedIndices(PlayerCostumeManager manager)
		{
			if ((Object)(object)manager == (Object)null || manager.costumes == null)
			{
				return;
			}
			List<int> list = manager.unlockedCostumeIndicies?.ToList() ?? new List<int>();
			bool flag = false;
			for (int i = 0; i < manager.costumes.Length; i++)
			{
				if (manager.costumes[i].name != null && manager.costumes[i].name.StartsWith("custom-costume-") && !list.Contains(i))
				{
					list.Add(i);
					flag = true;
				}
			}
			if (flag)
			{
				manager.unlockedCostumeIndicies = list.ToArray();
			}
		}
	}
	[HarmonyPatch]
	public class SaveManagerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(SaveData), "IsCostumeUnlocked")]
		public static void ForceCustomCostumeUnlock(CostumeObject costume, ref bool __result)
		{
			if ((Object)(object)costume != (Object)null && ((Object)costume).name.StartsWith("custom-costume-"))
			{
				__result = true;
			}
		}
	}
	[HarmonyPatch]
	public static class SelectionFix
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(CostumeChangeUI), "OnSelect")]
		public static void OnSelect(CostumeChangeUI __instance)
		{
			Entity val = default(Entity);
			if (!GameUtil.TryGetLocalPlayer(ref val))
			{
				return;
			}
			PlayerCostumeManager @object = ((Entity)(ref val)).GetObject<PlayerCostumeManager>();
			if (!((Object)(object)@object != (Object)null))
			{
				return;
			}
			List<int> list = @object.unlockedCostumeIndicies.ToList();
			for (int i = 0; i < @object.costumes.Length; i++)
			{
				if (!list.Contains(i) && @object.costumes[i].name.StartsWith("custom-costume-"))
				{
					list.Add(i);
				}
			}
			@object.unlockedCostumeIndicies = list.ToArray();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CostumeChangeUI), "Cycle")]
		public static void ClampCostumeIndex()
		{
			Entity val = default(Entity);
			if (!GameUtil.TryGetLocalPlayer(ref val))
			{
				return;
			}
			PlayerCostumeManager @object = ((Entity)(ref val)).GetObject<PlayerCostumeManager>();
			if (!((Object)(object)@object == (Object)null))
			{
				int num = @object.unlockedCostumeIndicies.Length - 1;
				if (@object.currentUnlockedCostumeIndex > num)
				{
					@object.currentUnlockedCostumeIndex = num;
				}
				if (@object.currentUnlockedCostumeIndex < 0)
				{
					@object.currentUnlockedCostumeIndex = 0;
				}
			}
		}
	}
}
namespace Custom_Cosmetics.Helpers
{
	public class AddCostumeToArray
	{
		public static void AddCostume(PlayerCostumeManager manager, Costume costume)
		{
			if (!((Object)(object)manager == (Object)null))
			{
				List<Costume> list = manager.costumes.ToList();
				list.Add(costume);
				manager.costumes = list.ToArray();
				int num = manager.costumes.Length - 1;
				if (!manager.unlockedCostumeIndicies.Contains(num))
				{
					List<int> list2 = manager.unlockedCostumeIndicies.ToList();
					list2.Add(num);
					manager.unlockedCostumeIndicies = list2.ToArray();
				}
			}
		}
	}
	public class CosmeticDevUI : MonoBehaviour
	{
		private class FloatInputState
		{
			public string text;

			public float value;

			public bool isFocused;

			public int controlId;
		}

		public bool _isVisible;

		private Rect _windowRect = new Rect(20f, 20f, 360f, 500f);

		private Vector2 _scrollPos;

		private string _selectedTab = "Head";

		private Dictionary<string, FloatInputState> _inputStates;

		private int _currentTabIndex;

		private int _nextControlId = 1000;

		private GameObject _headObj;

		private GameObject _bodyObj;

		private GameObject _faceObj;

		private void Awake()
		{
			_inputStates = new Dictionary<string, FloatInputState>();
		}

		private void Update()
		{
			if (!Plugin.CosmeticDevTools.Value)
			{
				_isVisible = false;
				return;
			}
			FetchCurrentCostumeObjects();
			UpdateInputStates();
		}

		private void UpdateInputStates()
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			GameObject[] array = (GameObject[])(object)new GameObject[3] { _headObj, _bodyObj, _faceObj };
			string[] array2 = new string[3] { "Head", "Body", "Face" };
			string[] array3 = new string[3] { "Pos", "Rot", "Scale" };
			string[] array4 = new string[3] { "X", "Y", "Z" };
			for (int i = 0; i < 3; i++)
			{
				GameObject val = array[i];
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				Vector3 localPosition = val.transform.localPosition;
				Vector3 localEulerAngles = val.transform.localEulerAngles;
				Vector3 localScale = val.transform.localScale;
				Vector3[] array5 = (Vector3[])(object)new Vector3[3] { localPosition, localEulerAngles, localScale };
				for (int j = 0; j < 3; j++)
				{
					for (int k = 0; k < 3; k++)
					{
						string key = array2[i] + "_" + array3[j] + "_" + array4[k];
						if (!_inputStates.ContainsKey(key))
						{
							_inputStates[key] = new FloatInputState
							{
								controlId = _nextControlId++
							};
						}
						if (!_inputStates[key].isFocused)
						{
							_inputStates[key].value = ((Vector3)(ref array5[j]))[k];
						}
					}
				}
			}
		}

		private void FetchCurrentCostumeObjects()
		{
			Entity val = default(Entity);
			if (!GameUtil.TryGetLocalPlayer(ref val))
			{
				return;
			}
			PlayerCostumeManager @object = ((Entity)(ref val)).GetObject<PlayerCostumeManager>();
			if ((Object)(object)@object != (Object)null && @object.costumes != null && @object.currentCostumeID < @object.costumes.Length)
			{
				Costume val2 = @object.costumes[@object.currentCostumeID];
				if (val2 != null && val2.name.StartsWith("custom-costume-"))
				{
					string text = val2.name.Replace("custom-costume-", "");
					_headObj = GameObject.Find("custom-costume-" + text + "-head");
					_bodyObj = GameObject.Find("custom-costume-" + text + "-body");
					_faceObj = GameObject.Find("custom-costume-" + text + "-face");
				}
			}
		}

		private void OnGUI()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (_isVisible)
			{
				_windowRect = GUI.Window(999, _windowRect, new WindowFunction(DrawWindow), "Cosmetic DevTools");
			}
		}

		private void DrawWindow(int windowID)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 25f));
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUI.backgroundColor = ((_selectedTab == "Head") ? Color.cyan : Color.gray);
			if (GUILayout.Button("HEAD", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				_selectedTab = "Head";
				_currentTabIndex = 0;
			}
			GUI.backgroundColor = ((_selectedTab == "Body") ? Color.cyan : Color.gray);
			if (GUILayout.Button("BODY", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				_selectedTab = "Body";
				_currentTabIndex = 1;
			}
			GUI.backgroundColor = ((_selectedTab == "Face") ? Color.cyan : Color.gray);
			if (GUILayout.Button("FACE", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				_selectedTab = "Face";
				_currentTabIndex = 2;
			}
			GUI.backgroundColor = Color.white;
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			_scrollPos = GUILayout.BeginScrollView(_scrollPos, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			GameObject val = (GameObject)(_selectedTab switch
			{
				"Head" => _headObj, 
				"Body" => _bodyObj, 
				"Face" => _faceObj, 
				_ => null, 
			});
			if ((Object)(object)val != (Object)null)
			{
				DrawTransformControls(val);
			}
			else
			{
				GUILayout.Box("No " + _selectedTab + " object found for this costume.", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(50f) });
				GUILayout.Label("Make sure you're wearing a custom costume that has this part.", Array.Empty<GUILayoutOption>());
			}
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUI.backgroundColor = Color.green;
			if (GUILayout.Button("LOG TO CONSOLE", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				LogCurrentSettings();
			}
			GUI.backgroundColor = Color.white;
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
		}

		private void DrawTransformControls(GameObject obj)
		{
			float value = Plugin.SnapStepPos.Value;
			float value2 = Plugin.SnapStepRot.Value;
			DrawSectionHeader("POSITION", $"Step: {value:F3}");
			DrawFloat3Row("Pos", obj.transform, delegate(Transform t, Vector3 v)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				t.localPosition = v;
			}, value);
			GUILayout.Space(8f);
			DrawSectionHeader("ROTATION", $"Step: {value2:F1}°");
			DrawFloat3Row("Rot", obj.transform, delegate(Transform t, Vector3 v)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				t.localRotation = Quaternion.Euler(v);
			}, value2);
			GUILayout.Space(8f);
			DrawSectionHeader("SCALE", $"Step: {value:F3}°");
			DrawFloat3Row("Scale", obj.transform, delegate(Transform t, Vector3 v)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				t.localScale = v;
			}, value);
		}

		private void DrawSectionHeader(string title, string info)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Box(title, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
			GUILayout.Label(info, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) });
			GUILayout.EndHorizontal();
		}

		private void DrawFloat3Row(string transformType, Transform target, Action<Transform, Vector3> applyChange, float step)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			Action<Transform, Vector3> applyChange2 = applyChange;
			Transform target2 = target;
			string transformType2 = transformType;
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			Vector3 currentValue = (Vector3)(transformType2 switch
			{
				"Pos" => target2.localPosition, 
				"Rot" => target2.localEulerAngles, 
				"Scale" => target2.localScale, 
				_ => Vector3.zero, 
			});
			DrawFloatField(transformType2, "X", _currentTabIndex, currentValue.x, delegate(float newValue)
			{
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				Vector3 arg3 = default(Vector3);
				((Vector3)(ref arg3))..ctor(newValue, currentValue.y, currentValue.z);
				applyChange2(target2, arg3);
				UpdateInputStateValue(transformType2, "X", newValue);
			}, step);
			DrawFloatField(transformType2, "Y", _currentTabIndex, currentValue.y, delegate(float newValue)
			{
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				Vector3 arg2 = default(Vector3);
				((Vector3)(ref arg2))..ctor(currentValue.x, newValue, currentValue.z);
				applyChange2(target2, arg2);
				UpdateInputStateValue(transformType2, "Y", newValue);
			}, step);
			DrawFloatField(transformType2, "Z", _currentTabIndex, currentValue.z, delegate(float newValue)
			{
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				Vector3 arg = default(Vector3);
				((Vector3)(ref arg))..ctor(currentValue.x, currentValue.y, newValue);
				applyChange2(target2, arg);
				UpdateInputStateValue(transformType2, "Z", newValue);
			}, step);
			GUILayout.EndHorizontal();
		}

		private void UpdateInputStateValue(string transformType, string axis, float value)
		{
			string key = GetTabName(_currentTabIndex) + "_" + transformType + "_" + axis;
			if (_inputStates.ContainsKey(key) && !_inputStates[key].isFocused)
			{
				_inputStates[key].value = value;
				_inputStates[key].text = value.ToString("F4");
			}
		}

		private string GetTabName(int tabIndex)
		{
			return tabIndex switch
			{
				1 => "Body", 
				0 => "Head", 
				_ => "Face", 
			};
		}

		private void DrawFloatField(string transformType, string axisLabel, int tabIndex, float currentValue, Action<float> onValueChanged, float step)
		{
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Invalid comparison between Unknown and I4
			string text = GetTabName(tabIndex) + "_" + transformType + "_" + axisLabel;
			if (!_inputStates.ContainsKey(text))
			{
				_inputStates[text] = new FloatInputState
				{
					value = currentValue,
					text = currentValue.ToString("F4"),
					controlId = _nextControlId++
				};
			}
			FloatInputState floatInputState = _inputStates[text];
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			GUILayout.Label(axisLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("-", (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(25f),
				GUILayout.Height(20f)
			}))
			{
				float num = currentValue - step;
				onValueChanged(num);
				floatInputState.value = num;
				if (!floatInputState.isFocused)
				{
					floatInputState.text = num.ToString("F4");
				}
			}
			string text2 = (floatInputState.isFocused ? floatInputState.text : currentValue.ToString("F4"));
			GUI.SetNextControlName("field_" + text);
			string text3 = GUILayout.TextField(text2, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(50f),
				GUILayout.Height(20f)
			});
			if ((int)Event.current.type == 7)
			{
				bool flag = GUI.GetNameOfFocusedControl() == "field_" + text;
				if (flag && !floatInputState.isFocused)
				{
					floatInputState.isFocused = true;
					floatInputState.text = currentValue.ToString(CultureInfo.InvariantCulture);
				}
				else if (!flag && floatInputState.isFocused)
				{
					floatInputState.isFocused = false;
					if (TryParseFloat(floatInputState.text, out var result))
					{
						onValueChanged(result);
						floatInputState.value = result;
					}
				}
			}
			if (text3 != text2)
			{
				floatInputState.text = text3;
				if (TryParseFloat(text3, out var result2))
				{
					onValueChanged(result2);
					floatInputState.value = result2;
				}
			}
			if (GUILayout.Button("+", (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(25f),
				GUILayout.Height(20f)
			}))
			{
				float num2 = currentValue + step;
				onValueChanged(num2);
				floatInputState.value = num2;
				if (!floatInputState.isFocused)
				{
					floatInputState.text = num2.ToString("F4");
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
		}

		private bool TryParseFloat(string input, out float result)
		{
			string s = input.Replace(',', '.');
			return float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out result);
		}

		private void LogCurrentSettings()
		{
			string text = "\n╔══════════════════════════════════════════════════════════╗\n";
			text += "║           COSMETIC DEFINITION SETTINGS                       ║\n";
			text += "╚══════════════════════════════════════════════════════════════╝\n\n";
			text += FormatPart("Head", _headObj);
			text = text + "\n" + FormatPart("Body", _bodyObj);
			text = text + "\n" + FormatPart("Face", _faceObj);
			text += "\n══════════════════════════════════════════════════════════════";
			Debug.Log((object)text);
		}

		private string FormatPart(string name, GameObject obj)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)obj == (Object)null)
			{
				return "✗ " + name + ": Not found\n";
			}
			Vector3 localPosition = obj.transform.localPosition;
			Vector3 localEulerAngles = obj.transform.localEulerAngles;
			Vector3 localScale = obj.transform.localScale;
			return "► " + name.ToUpper() + " ◄\n  Position: (" + FormatFloat(localPosition.x) + ", " + FormatFloat(localPosition.y) + ", " + FormatFloat(localPosition.z) + ")\n  Rotation: (" + FormatFloat(localEulerAngles.x) + ", " + FormatFloat(localEulerAngles.y) + ", " + FormatFloat(localEulerAngles.z) + ")\n  Scale:    (" + FormatFloat(localScale.x) + ", " + FormatFloat(localScale.y) + ", " + FormatFloat(localScale.z) + ")\n";
		}

		private string FormatFloat(float value)
		{
			return value.ToString("F4", CultureInfo.InvariantCulture);
		}
	}
	public static class CreateCostumeType
	{
		public static Costume CreateCostume(string name, ref GameObject? head, ref GameObject? body, ref GameObject? face)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Expected O, but got Unknown
			Part val = null;
			if ((Object)(object)head != (Object)null)
			{
				Part val2 = new Part();
				val2.frameObjects = (GameObject[])(object)new GameObject[1] { head };
				val2.partType = (PartType)1;
				val = val2;
			}
			Part val3 = null;
			if ((Object)(object)body != (Object)null)
			{
				Part val2 = new Part();
				val2.frameObjects = (GameObject[])(object)new GameObject[1] { body };
				val2.partType = (PartType)2;
				val3 = val2;
			}
			Part val4 = null;
			if ((Object)(object)face != (Object)null)
			{
				Part val2 = new Part();
				val2.frameObjects = (GameObject[])(object)new GameObject[1] { face };
				val2.partType = (PartType)0;
				val4 = val2;
			}
			Expression val5 = new Expression();
			val5.expressionClip = (ExpressionClip)0;
			val5.parts = ((IEnumerable<Part>)(object)new Part[3] { val, val3, val4 }).Where((Part p) => p != null).ToArray();
			Expression val6 = val5;
			CostumeObject val7 = ScriptableObject.CreateInstance<CostumeObject>();
			((Object)val7).name = name.ToUpper();
			val7.costumeName = name;
			val7.startsUnlocked = true;
			CosmeticGlobalData instance = GlobalScriptableObject<CosmeticGlobalData>.instance;
			if ((Object)(object)instance != (Object)null && instance.costumes != null && instance.costumes.Length != 0)
			{
				val7.costumeTextures = instance.costumes[0].costumeTextures;
			}
			Plugin.AddToGlobalRegistry(val7);
			Costume val8 = new Costume();
			val8.costumeObject = val7;
			val8.expressions = (Expression[])(object)new Expression[1] { val6 };
			val8.name = "custom-costume-" + name;
			return val8;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ConstantExpectedAttribute : Attribute
	{
		public object? Min { get; set; }

		public object? Max { get; set; }
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ExperimentalAttribute : Attribute
	{
		public string DiagnosticId { get; }

		public string? UrlFormat { get; set; }

		public ExperimentalAttribute(string diagnosticId)
		{
			DiagnosticId = diagnosticId;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	[ExcludeFromCodeCoverage]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class SetsRequiredMembersAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class StringSyntaxAttribute : Attribute
	{
		public const string CompositeFormat = "CompositeFormat";

		public const string DateOnlyFormat = "DateOnlyFormat";

		public const string DateTimeFormat = "DateTimeFormat";

		public const string EnumFormat = "EnumFormat";

		public const string GuidFormat = "GuidFormat";

		public const string Json = "Json";

		public const string NumericFormat = "NumericFormat";

		public const string Regex = "Regex";

		public const string TimeOnlyFormat = "TimeOnlyFormat";

		public const string TimeSpanFormat = "TimeSpanFormat";

		public const string Uri = "Uri";

		public const string Xml = "Xml";

		public string Syntax { get; }

		public object?[] Arguments { get; }

		public StringSyntaxAttribute(string syntax)
		{
			Syntax = syntax;
			Arguments = new object[0];
		}

		public StringSyntaxAttribute(string syntax, params object?[] arguments)
		{
			Syntax = syntax;
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class UnscopedRefAttribute : Attribute
	{
	}
}
namespace System.Runtime.Versioning
{
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiresPreviewFeaturesAttribute : Attribute
	{
		public string? Message { get; }

		public string? Url { get; set; }

		public RequiresPreviewFeaturesAttribute()
		{
		}

		public RequiresPreviewFeaturesAttribute(string? message)
		{
			Message = message;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CollectionBuilderAttribute : Attribute
	{
		public Type BuilderType { get; }

		public string MethodName { get; }

		public CollectionBuilderAttribute(Type builderType, string methodName)
		{
			BuilderType = builderType;
			MethodName = methodName;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class CompilerFeatureRequiredAttribute : Attribute
	{
		public const string RefStructs = "RefStructs";

		public const string RequiredMembers = "RequiredMembers";

		public string FeatureName { get; }

		public bool IsOptional { get; set; }

		public CompilerFeatureRequiredAttribute(string featureName)
		{
			FeatureName = featureName;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
	{
		public string[] Arguments { get; }

		public InterpolatedStringHandlerArgumentAttribute(string argument)
		{
			Arguments = new string[1] { argument };
		}

		public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
		{
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class InterpolatedStringHandlerAttribute : Attribute
	{
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[ExcludeFromCodeCoverage]
	internal static class IsExternalInit
	{
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ModuleInitializerAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class OverloadResolutionPriorityAttribute : Attribute
	{
		public int Priority { get; }

		public OverloadResolutionPriorityAttribute(int priority)
		{
			Priority = priority;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ParamCollectionAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiredMemberAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	[ExcludeFromCodeCoverage]
	internal sealed class RequiresLocationAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class SkipLocalsInitAttribute : Attribute
	{
	}
}