Decompiled source of ModConfig v0.1.0

com.atomic.modconfig.dll

Decompiled 8 hours ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModConfig.Core;
using ModConfig.UI;
using ModConfig.Utilities;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Localization.Components;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("GameAssembly")]
[assembly: IgnoresAccessChecksTo("SharedAssembly")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.atomic.modconfig")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("com.atomic.modconfig")]
[assembly: AssemblyTitle("ModConfig")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.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 ModConfig
{
	[BepInPlugin("com.atomic.modconfig", "ModConfig", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static Harmony harmony;

		public static bool shownErrorThisSession;

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

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "ModConfig";

		public static string Version => "0.1.0";

		private void Awake()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			harmony = new Harmony("com.atomic.modconfig");
			harmony.PatchAll();
		}

		public static bool IsBepInExModInstalled(string guid)
		{
			return Chainloader.PluginInfos.ContainsKey(guid);
		}
	}
	[HarmonyPatch]
	public static class Patches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(MenuTabs), "Awake")]
		public static void HookIntoGUI(MenuTabs __instance)
		{
			ModConfigManager.Inject(__instance);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FullScreenMessage), "ShowInternal")]
		public static void Keybind_Localization(ref string message, string header, bool isError, bool requiresMouse, params ButtonEntry[] buttonEntries)
		{
			if (message.Contains("UI/SETTINGS_Keybinds_ModConfigMap_"))
			{
				string text = message.Replace("UI/SETTINGS_Keybinds_ModConfigMap_", "");
				message = text;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(ActionRebindOption), "RefreshBindingDisplay", new Type[] { })]
		public static void KeybindFinish(ControlsRebind __instance)
		{
			KeybindHook component = ((Component)__instance).GetComponent<KeybindHook>();
			if (!((Object)(object)component == (Object)null))
			{
				component.onRebind?.Invoke();
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(InputIconsSet), "GetIcon")]
		public static bool getIconFix(InputIconsSet __instance, string binding, ref Sprite __result)
		{
			if (binding == "<Keyboard>/none")
			{
				__result = UICreator.getEmptyKeyIcon();
				return false;
			}
			return true;
		}
	}
}
namespace ModConfig.Utilities
{
	public class KeybindHook : MonoBehaviour
	{
		public Action onRebind;

		public KeyCode PathToKeyCode(string path)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_00ae: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//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)
			if (string.IsNullOrEmpty(path))
			{
				return (KeyCode)0;
			}
			string text = (path.Contains("/") ? path.Split('/')[1] : path);
			if (Enum.TryParse<KeyCode>(text, ignoreCase: true, out KeyCode result))
			{
				return result;
			}
			string text2 = text.ToLower();
			if (1 == 0)
			{
			}
			KeyCode result2 = (KeyCode)(text2 switch
			{
				"escape" => 27, 
				"enter" => 13, 
				"leftshift" => 304, 
				"rightshift" => 303, 
				_ => 0, 
			});
			if (1 == 0)
			{
			}
			return result2;
		}
	}
}
namespace ModConfig.UI
{
	public class ModConfigMain : MonoBehaviour
	{
		private static ModConfigMain Instance;

		private static Transform graphicsPage;

		private static Transform audioPage;

		private static Transform modsPage;

		private static Transform modsContent;

		public static Transform controlsPage;

		private void Awake()
		{
			Instance = this;
			graphicsPage = ((Component)this).transform.Find("Graphics");
			audioPage = ((Component)this).transform.Find("Audio");
			controlsPage = ((Component)this).transform.Find("Controls");
			modsPage = ((Component)this).transform.Find("Mods");
			modsContent = modsPage.Find("ModContent");
			UICloner.GetUIRefs(graphicsPage, audioPage);
			if (Plugin.IsBepInExModInstalled("com.sinai.unityexplorer") && !Plugin.shownErrorThisSession)
			{
				Plugin.Log.LogWarning((object)"Unity explorer is a know incompatibility!");
			}
			UICreator.CreateMainTopBar(((Component)modsPage).gameObject, out GameObject topBarContent);
			ConfigGetter.InitialiseConfigs(((Component)modsPage).gameObject, topBarContent);
		}
	}
	public class UICloner
	{
		public static GameObject titleTMP;

		public static GameObject container;

		public static GameObject dropdown;

		public static GameObject slider;

		public static GameObject button;

		public static Sprite emptyKeyIcon;

		public static void GetUIRefs(Transform graphicsPage, Transform audioPage)
		{
			if (!((Object)(object)graphicsPage == (Object)null))
			{
				titleTMP = Object.Instantiate<GameObject>(((Component)graphicsPage.Find("Title")).gameObject, (Transform)null);
				((Object)titleTMP).name = "MODCONFIG_TITLE_TEMPLATE";
				Object.DestroyImmediate((Object)(object)titleTMP.GetComponentInChildren<LocalizeStringEvent>());
				Transform val = Object.Instantiate<Transform>(graphicsPage.Find("Option Container"));
				((Object)val).name = "MODCONFIG_CONTAINER_TEMPLATE";
				dropdown = Object.Instantiate<GameObject>(((Component)val.Find("Resolution")).gameObject, (Transform)null);
				((Object)dropdown).name = "MODCONFIG_DROPDOWN_TEMPLATE";
				Object.DestroyImmediate((Object)(object)dropdown.GetComponentInChildren<LocalizeDropdown>());
				Object.DestroyImmediate((Object)(object)dropdown.GetComponentInChildren<LocalizeStringEvent>());
				dropdown.GetComponent<DropdownOption>().localized = null;
				button = Object.Instantiate<GameObject>(((Component)graphicsPage.parent.Find("General/Tutorial").GetChild(0)).gameObject, (Transform)null);
				((Object)button).name = "MODCONFIG_BUTTON_TEMPLATE";
				Object.DestroyImmediate((Object)(object)button.GetComponentInChildren<LocalizeStringEvent>());
				slider = Object.Instantiate<GameObject>(((Component)audioPage.Find("Volume Options/Master Volume")).gameObject);
				((Object)slider).name = "MODCONFIG_SLIDER_TEMPLATE";
				Object.DestroyImmediate((Object)(object)slider.GetComponentInChildren<LocalizeStringEvent>());
				while (((Component)val).transform.childCount > 0)
				{
					Object.DestroyImmediate((Object)(object)((Component)((Component)val).transform.GetChild(0)).gameObject);
				}
				container = ((Component)val).gameObject;
			}
		}
	}
	public class UICreator
	{
		public static void CreateMainTopBar(GameObject modsPage, out GameObject topBarContent)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_0085: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Expected O, but got Unknown
			GameObject val = new GameObject("MainTopBar", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(ScrollRect)
			});
			val.transform.SetParent(modsPage.transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0.92f);
			component.anchorMax = Vector2.one;
			Vector2 offsetMin = (component.offsetMax = Vector2.zero);
			component.offsetMin = offsetMin;
			((Graphic)val.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0f);
			GameObject val2 = new GameObject("Viewport", new Type[2]
			{
				typeof(RectTransform),
				typeof(RectMask2D)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component2 = val2.GetComponent<RectTransform>();
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.sizeDelta = Vector2.zero;
			topBarContent = new GameObject("Content", new Type[3]
			{
				typeof(RectTransform),
				typeof(HorizontalLayoutGroup),
				typeof(ContentSizeFitter)
			});
			topBarContent.transform.SetParent(val2.transform, false);
			RectTransform component3 = topBarContent.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0f);
			component3.anchorMax = new Vector2(0f, 1f);
			component3.pivot = new Vector2(0f, 0.5f);
			HorizontalLayoutGroup component4 = topBarContent.GetComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = false;
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 20f;
			((LayoutGroup)component4).padding = new RectOffset(30, 30, 5, 5);
			topBarContent.GetComponent<ContentSizeFitter>().horizontalFit = (FitMode)2;
			topBarContent.GetComponent<ContentSizeFitter>().verticalFit = (FitMode)2;
			ScrollRect component5 = val.GetComponent<ScrollRect>();
			component5.content = component3;
			component5.viewport = component2;
			component5.horizontal = true;
			component5.vertical = false;
		}

		public static void CreateModPage(GameObject modsPage, string modName, out GameObject page)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Expected O, but got Unknown
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Expected O, but got Unknown
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_041a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Expected O, but got Unknown
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			page = new GameObject("PAGE_" + modName, new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(ScrollRect)
			});
			page.transform.SetParent(modsPage.transform, false);
			RectTransform component = page.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = new Vector2(1f, 0.92f);
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			((Graphic)page.GetComponent<Image>()).color = Color.clear;
			GameObject val = new GameObject("Viewport", new Type[2]
			{
				typeof(RectTransform),
				typeof(RectMask2D)
			});
			val.transform.SetParent(page.transform, false);
			RectTransform component2 = val.GetComponent<RectTransform>();
			component2.anchorMin = Vector2.zero;
			component2.anchorMax = Vector2.one;
			component2.offsetMin = Vector2.zero;
			component2.offsetMax = Vector2.zero;
			GameObject val2 = new GameObject("Content", new Type[3]
			{
				typeof(RectTransform),
				typeof(VerticalLayoutGroup),
				typeof(ContentSizeFitter)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component3 = val2.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 1f);
			component3.anchorMax = new Vector2(1f, 1f);
			component3.pivot = new Vector2(0.5f, 1f);
			component3.anchoredPosition = Vector2.zero;
			component3.sizeDelta = Vector2.zero;
			VerticalLayoutGroup component4 = val2.GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component4).spacing = 10f;
			((LayoutGroup)component4).padding = new RectOffset(190, 190, 20, 20);
			((HorizontalOrVerticalLayoutGroup)component4).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandWidth = true;
			((HorizontalOrVerticalLayoutGroup)component4).childForceExpandHeight = false;
			val2.GetComponent<ContentSizeFitter>().verticalFit = (FitMode)2;
			GameObject val3 = new GameObject("Scrollbar", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Scrollbar)
			});
			val3.transform.SetParent(page.transform, false);
			RectTransform component5 = val3.GetComponent<RectTransform>();
			component5.anchorMin = new Vector2(1f, 0f);
			component5.anchorMax = new Vector2(1f, 1f);
			component5.pivot = new Vector2(0.5f, 0.5f);
			component5.sizeDelta = new Vector2(12f, -40f);
			component5.anchoredPosition = new Vector2(-15f, 4f);
			Image component6 = val3.GetComponent<Image>();
			((Graphic)component6).color = new Color(1f, 1f, 1f, 0f);
			GameObject val4 = new GameObject("Track", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val4.transform.SetParent(val3.transform, false);
			RectTransform component7 = val4.GetComponent<RectTransform>();
			component7.anchorMin = new Vector2(0.5f, 0f);
			component7.anchorMax = new Vector2(0.5f, 1f);
			component7.pivot = new Vector2(0.5f, 0.5f);
			component7.sizeDelta = new Vector2(12f, -25f);
			Image component8 = val4.GetComponent<Image>();
			((Graphic)component8).color = new Color(0.87f, 0.89f, 0.84f, 1f);
			GameObject val5 = new GameObject("Handle", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val5.transform.SetParent(val3.transform, false);
			RectTransform component9 = val5.GetComponent<RectTransform>();
			component9.anchorMin = new Vector2(0.5f, 0f);
			component9.anchorMax = new Vector2(0.5f, 1f);
			component9.pivot = new Vector2(0.5f, 0.5f);
			component9.sizeDelta = new Vector2(12f, 0f);
			Image component10 = val5.GetComponent<Image>();
			component10.sprite = ((Component)UICloner.slider.transform.Find("Option Contents/Slider/Handle Slide Area/Handle/Graphic")).GetComponent<Image>().sprite;
			((Graphic)component10).color = Color.white;
			component10.type = (Type)1;
			Scrollbar component11 = val3.GetComponent<Scrollbar>();
			component11.handleRect = component9;
			component11.direction = (Direction)2;
			((Selectable)component11).targetGraphic = (Graphic)(object)component10;
			component11.size = 0.1f;
			ScrollRect component12 = page.GetComponent<ScrollRect>();
			component12.content = component3;
			component12.viewport = component2;
			component12.verticalScrollbar = component11;
			component12.horizontal = false;
			component12.vertical = true;
			component12.movementType = (MovementType)2;
			component12.scrollSensitivity = 30f;
			component12.verticalScrollbarVisibility = (ScrollbarVisibility)1;
			page.SetActive(false);
		}

		public static void CreateNewSection(GameObject modPage, string name, out GameObject container)
		{
			Transform val = modPage.transform.Find("Viewport/Content");
			if ((Object)(object)val == (Object)null && ((Object)modPage).name == "Content")
			{
				val = modPage.transform;
			}
			container = Object.Instantiate<GameObject>(UICloner.container, val);
			((Object)container).name = "CONTAINER_" + name;
		}

		private static void HideAllOtherModPages(GameObject modsPage, GameObject targetPage)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in modsPage.transform)
			{
				Transform val = item;
				if (!(((Object)val).name == "MainTopBar"))
				{
					if ((Object)(object)val == (Object)(object)targetPage.transform)
					{
						((Component)val).gameObject.SetActive(true);
					}
					else
					{
						((Component)val).gameObject.SetActive(false);
					}
				}
			}
		}

		public static void CreateModPageNavigationButton(GameObject topBarContent, GameObject modsPage, GameObject modPage, string name)
		{
			GameObject modsPage2 = modsPage;
			GameObject modPage2 = modPage;
			CreateNewSection(topBarContent, name, out GameObject container);
			CreateButton(container, name, delegate
			{
				HideAllOtherModPages(modsPage2, modPage2);
			});
		}

		public static void CreateTitle(GameObject modPage, string name)
		{
			Transform val = modPage.transform.Find("Viewport/Content");
			GameObject val2 = Object.Instantiate<GameObject>(UICloner.titleTMP, val);
			((Object)val2).name = "TITLE_" + name;
			((TMP_Text)val2.GetComponent<TextMeshProUGUI>()).text = name;
		}

		public static void CreateSubHeading(GameObject modPage, string name, out GameObject titleObj)
		{
			Transform val = modPage.transform.Find("Viewport/Content");
			titleObj = Object.Instantiate<GameObject>(UICloner.titleTMP, val);
			((Object)titleObj).name = "SUBHEADING_" + name;
			TextMeshProUGUI component = titleObj.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).text = name;
			((TMP_Text)component).fontSize = ((TMP_Text)component).fontSize - 4f;
			((TMP_Text)component).fontSizeMin = ((TMP_Text)component).fontSizeMin - 4f;
			((TMP_Text)component).fontSizeMax = ((TMP_Text)component).fontSizeMax - 4f;
		}

		public static void CreateDropdown(GameObject container, string configName, List<string> options, out DropdownOption dropdownOption)
		{
			GameObject val = Object.Instantiate<GameObject>(UICloner.dropdown, container.transform);
			((Object)val).name = "DROPDOWN_" + configName;
			((TMP_Text)((Component)val.transform.Find("Label Text")).GetComponent<TextMeshProUGUI>()).text = configName;
			dropdownOption = val.GetComponent<DropdownOption>();
			dropdownOption.localized = null;
			dropdownOption.SetOptions(options);
			Plugin.Log.LogInfo((object)("Created dropdown for config: " + configName + " in section: " + ((Object)container).name + " with options: " + string.Join(", ", options) + ")"));
		}

		public static void CreateFloatSlider(GameObject container, float value, float minValue, float maxValue, string configName, out SliderOption sliderOption)
		{
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Expected O, but got Unknown
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(UICloner.slider, container.transform);
			((Object)val).name = "SLIDER_" + configName;
			Transform val2 = val.transform.Find("Label Text");
			TextMeshProUGUI component = ((Component)val2).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).text = configName;
			Transform labelValueText = val.transform.Find("Option Contents/Slider Value");
			TextMeshProUGUI valueTextComponent = ((Component)labelValueText).GetComponent<TextMeshProUGUI>();
			RectTransform component2 = ((Component)labelValueText).GetComponent<RectTransform>();
			TextMeshProUGUI obj = valueTextComponent;
			((TMP_Text)obj).fontSize = ((TMP_Text)obj).fontSize - 6f;
			TextMeshProUGUI obj2 = valueTextComponent;
			((TMP_Text)obj2).fontSizeMin = ((TMP_Text)obj2).fontSizeMin - 6f;
			TextMeshProUGUI obj3 = valueTextComponent;
			((TMP_Text)obj3).fontSizeMax = ((TMP_Text)obj3).fontSizeMax - 6f;
			sliderOption = val.GetComponent<SliderOption>();
			sliderOption.SetLimits(minValue, maxValue);
			sliderOption.SetValue(value);
			string text = ((value % 1f == 0f) ? value.ToString("F0") : value.ToString("0.###"));
			sliderOption.SetValueText($"{value}");
			SliderOption localSliderOption = sliderOption;
			GameObject inputTextView = new GameObject("Input Text View");
			inputTextView.transform.SetParent(labelValueText.parent, false);
			RectTransform val3 = inputTextView.AddComponent<RectTransform>();
			val3.anchorMin = component2.anchorMin;
			val3.anchorMax = component2.anchorMax;
			val3.pivot = component2.pivot;
			val3.offsetMin = component2.offsetMin;
			val3.offsetMax = component2.offsetMax;
			val3.sizeDelta = component2.sizeDelta;
			val3.anchoredPosition = component2.anchoredPosition;
			inputTextView.transform.SetSiblingIndex(labelValueText.GetSiblingIndex() + 1);
			TextMeshProUGUI inputTextComponent = inputTextView.AddComponent<TextMeshProUGUI>();
			((TMP_Text)inputTextComponent).font = ((TMP_Text)valueTextComponent).font;
			((TMP_Text)inputTextComponent).fontSize = ((TMP_Text)valueTextComponent).fontSize;
			((TMP_Text)inputTextComponent).fontStyle = ((TMP_Text)valueTextComponent).fontStyle;
			((TMP_Text)inputTextComponent).alignment = ((TMP_Text)valueTextComponent).alignment;
			((Graphic)inputTextComponent).color = ((Graphic)valueTextComponent).color;
			((TMP_Text)inputTextComponent).text = ((TMP_Text)valueTextComponent).text;
			((Graphic)inputTextComponent).raycastTarget = true;
			TMP_InputField inputField = inputTextView.AddComponent<TMP_InputField>();
			inputField.textComponent = (TMP_Text)(object)inputTextComponent;
			inputField.textViewport = ((Component)labelValueText.parent).GetComponent<RectTransform>();
			inputField.contentType = (ContentType)3;
			inputField.lineType = (LineType)0;
			((Selectable)inputField).interactable = true;
			((Selectable)inputField).targetGraphic = (Graphic)(object)inputTextComponent;
			inputTextView.SetActive(false);
			EventTrigger val4 = ((Component)labelValueText).gameObject.AddComponent<EventTrigger>();
			Entry val5 = new Entry();
			val5.eventID = (EventTriggerType)4;
			((UnityEvent<BaseEventData>)(object)val5.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				((Component)labelValueText).gameObject.SetActive(false);
				inputField.text = localSliderOption.value.ToString();
				inputTextView.SetActive(true);
				inputField.ActivateInputField();
				((Selectable)inputField).Select();
			});
			val4.triggers.Add(val5);
			((UnityEvent<string>)(object)inputField.onEndEdit).AddListener((UnityAction<string>)delegate(string newValue)
			{
				if (float.TryParse(newValue, out var result))
				{
					result = Mathf.Clamp(result, minValue, maxValue);
					localSliderOption.SetValue(result);
					string text2 = ((result % 1f == 0f) ? result.ToString("F0") : result.ToString("0.###"));
					localSliderOption.SetValueText(text2);
					((TMP_Text)valueTextComponent).text = text2;
					((TMP_Text)inputTextComponent).text = text2;
					localSliderOption.onChanged?.Invoke();
				}
				inputTextView.SetActive(false);
				((Component)labelValueText).gameObject.SetActive(true);
			});
		}

		public static void CreateIntSlider(GameObject container, int value, int minValue, int maxValue, string configName, out SliderOption sliderOption)
		{
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Expected O, but got Unknown
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Expected O, but got Unknown
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(UICloner.slider, container.transform);
			((Object)val).name = "SLIDER_" + configName;
			Transform val2 = val.transform.Find("Label Text");
			TextMeshProUGUI component = ((Component)val2).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).text = configName;
			Transform labelValueText = val.transform.Find("Option Contents/Slider Value");
			TextMeshProUGUI valueTextComponent = ((Component)labelValueText).GetComponent<TextMeshProUGUI>();
			RectTransform component2 = ((Component)labelValueText).GetComponent<RectTransform>();
			TextMeshProUGUI obj = valueTextComponent;
			((TMP_Text)obj).fontSize = ((TMP_Text)obj).fontSize - 6f;
			TextMeshProUGUI obj2 = valueTextComponent;
			((TMP_Text)obj2).fontSizeMin = ((TMP_Text)obj2).fontSizeMin - 6f;
			TextMeshProUGUI obj3 = valueTextComponent;
			((TMP_Text)obj3).fontSizeMax = ((TMP_Text)obj3).fontSizeMax - 6f;
			sliderOption = val.GetComponent<SliderOption>();
			sliderOption.slider.wholeNumbers = true;
			sliderOption.SetLimits((float)minValue, (float)maxValue);
			sliderOption.SetValue((float)value);
			sliderOption.SetValueText(value.ToString("F0"));
			SliderOption localSliderOption = sliderOption;
			GameObject inputTextView = new GameObject("Input Text View");
			inputTextView.transform.SetParent(labelValueText.parent, false);
			RectTransform val3 = inputTextView.AddComponent<RectTransform>();
			val3.anchorMin = component2.anchorMin;
			val3.anchorMax = component2.anchorMax;
			val3.pivot = component2.pivot;
			val3.offsetMin = component2.offsetMin;
			val3.offsetMax = component2.offsetMax;
			val3.sizeDelta = component2.sizeDelta;
			val3.anchoredPosition = component2.anchoredPosition;
			inputTextView.transform.SetSiblingIndex(labelValueText.GetSiblingIndex() + 1);
			TextMeshProUGUI inputTextComponent = inputTextView.AddComponent<TextMeshProUGUI>();
			((TMP_Text)inputTextComponent).font = ((TMP_Text)valueTextComponent).font;
			((TMP_Text)inputTextComponent).fontSize = ((TMP_Text)valueTextComponent).fontSize;
			((TMP_Text)inputTextComponent).fontStyle = ((TMP_Text)valueTextComponent).fontStyle;
			((TMP_Text)inputTextComponent).alignment = ((TMP_Text)valueTextComponent).alignment;
			((Graphic)inputTextComponent).color = ((Graphic)valueTextComponent).color;
			((TMP_Text)inputTextComponent).text = ((TMP_Text)valueTextComponent).text;
			((Graphic)inputTextComponent).raycastTarget = true;
			TMP_InputField inputField = inputTextView.AddComponent<TMP_InputField>();
			inputField.textComponent = (TMP_Text)(object)inputTextComponent;
			inputField.textViewport = ((Component)labelValueText.parent).GetComponent<RectTransform>();
			inputField.contentType = (ContentType)2;
			inputField.lineType = (LineType)0;
			((Selectable)inputField).interactable = true;
			inputField.characterValidation = (CharacterValidation)2;
			((Selectable)inputField).targetGraphic = (Graphic)(object)inputTextComponent;
			inputTextView.SetActive(false);
			EventTrigger val4 = ((Component)labelValueText).gameObject.AddComponent<EventTrigger>();
			Entry val5 = new Entry();
			val5.eventID = (EventTriggerType)4;
			((UnityEvent<BaseEventData>)(object)val5.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				((Component)labelValueText).gameObject.SetActive(false);
				inputField.text = localSliderOption.value.ToString();
				inputTextView.SetActive(true);
				inputField.ActivateInputField();
				((Selectable)inputField).Select();
			});
			val4.triggers.Add(val5);
			((UnityEvent<string>)(object)inputField.onEndEdit).AddListener((UnityAction<string>)delegate(string newValue)
			{
				if (int.TryParse(newValue, out var result))
				{
					result = Mathf.Clamp(result, minValue, maxValue);
					localSliderOption.SetValue((float)result);
					string text = result.ToString("F0");
					localSliderOption.SetValueText(text);
					((TMP_Text)valueTextComponent).text = text;
					((TMP_Text)inputTextComponent).text = text;
					localSliderOption.onChanged?.Invoke();
				}
				else
				{
					((TMP_Text)inputTextComponent).text = ((TMP_Text)valueTextComponent).text;
				}
				inputTextView.SetActive(false);
				((Component)labelValueText).gameObject.SetActive(true);
			});
		}

		public static void CreateStringInput(GameObject container, string name, Action<string> onChange, string defaultValue = "")
		{
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Expected O, but got Unknown
			Action<string> onChange2 = onChange;
			GameObject val = Object.Instantiate<GameObject>(UICloner.slider, container.transform);
			((Object)val).name = "INPUT_" + name;
			((TMP_Text)((Component)val.transform.Find("Label Text")).GetComponent<TextMeshProUGUI>()).text = name;
			Transform val2 = val.transform.Find("Option Contents");
			RectTransform component = ((Component)val2).GetComponent<RectTransform>();
			if ((Object)(object)((Component)val2).GetComponent<RectMask2D>() == (Object)null)
			{
				((Component)val2).gameObject.AddComponent<RectMask2D>();
			}
			Object.DestroyImmediate((Object)(object)val.GetComponent<SliderOption>());
			Transform val3 = val2.Find("Slider");
			if ((Object)(object)val3 != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)((Component)val3).gameObject);
			}
			Transform val4 = val2.Find("Caret");
			if ((Object)(object)val4 != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)((Component)val4).gameObject);
			}
			GameObject displayTextObj = ((Component)val2.Find("Slider Value")).gameObject;
			((Object)displayTextObj).name = "Display Text";
			TextMeshProUGUI displayTextComponent = displayTextObj.GetComponent<TextMeshProUGUI>();
			RectTransform component2 = displayTextObj.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0f);
			component2.anchorMax = new Vector2(1f, 1f);
			component2.offsetMin = new Vector2(10f, 0f);
			component2.offsetMax = new Vector2(-10f, 0f);
			((TMP_Text)displayTextComponent).textWrappingMode = (TextWrappingModes)0;
			((TMP_Text)displayTextComponent).text = defaultValue;
			((TMP_Text)displayTextComponent).alignment = (TextAlignmentOptions)513;
			((TMP_Text)displayTextComponent).overflowMode = (TextOverflowModes)2;
			GameObject inputTextView = new GameObject("Input Text View");
			inputTextView.transform.SetParent(val2, false);
			RectTransform val5 = inputTextView.AddComponent<RectTransform>();
			val5.anchorMin = component2.anchorMin;
			val5.anchorMax = component2.anchorMax;
			val5.offsetMin = component2.offsetMin;
			val5.offsetMax = component2.offsetMax;
			TextMeshProUGUI val6 = inputTextView.AddComponent<TextMeshProUGUI>();
			((TMP_Text)val6).font = ((TMP_Text)displayTextComponent).font;
			((TMP_Text)val6).fontSize = ((TMP_Text)displayTextComponent).fontSize;
			((TMP_Text)val6).alignment = (TextAlignmentOptions)513;
			((Graphic)val6).color = ((Graphic)displayTextComponent).color;
			((Graphic)val6).raycastTarget = true;
			((TMP_Text)val6).textWrappingMode = (TextWrappingModes)0;
			TMP_InputField inputField = inputTextView.AddComponent<TMP_InputField>();
			inputField.textViewport = component;
			inputField.textComponent = (TMP_Text)(object)val6;
			inputField.contentType = (ContentType)0;
			inputField.lineType = (LineType)0;
			inputTextView.SetActive(false);
			EventTrigger val7 = displayTextObj.AddComponent<EventTrigger>();
			Entry val8 = new Entry
			{
				eventID = (EventTriggerType)4
			};
			((UnityEvent<BaseEventData>)(object)val8.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				displayTextObj.SetActive(false);
				inputTextView.SetActive(true);
				inputField.text = ((TMP_Text)displayTextComponent).text;
				inputField.ActivateInputField();
			});
			val7.triggers.Add(val8);
			((UnityEvent<string>)(object)inputField.onEndEdit).AddListener((UnityAction<string>)delegate(string newValue)
			{
				((TMP_Text)displayTextComponent).text = newValue;
				onChange2?.Invoke(newValue);
				inputTextView.SetActive(false);
				displayTextObj.SetActive(true);
			});
		}

		public static void CreateButton(GameObject container, string name, Action action)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			Action action2 = action;
			GameObject val = Object.Instantiate<GameObject>(UICloner.button, container.transform);
			((Object)val).name = "BUTTON_" + name;
			((TMP_Text)val.GetComponentInChildren<TextMeshProUGUI>()).text = name;
			((UnityEventBase)val.GetComponent<Button>().onClick).RemoveAllListeners();
			((UnityEvent)val.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
			{
				action2();
			});
			val.GetComponent<Transform>().localPosition = Vector3.zero;
		}

		private static string KeyCodeToPath(KeyCode key)
		{
			return "<Keyboard>/" + ((object)(KeyCode)(ref key)).ToString().ToLower();
		}

		public static void CreateKeybinding(GameObject container, string configName, KeyCode defaultValue, out ActionRebindOption actionRebindOption, out KeybindHook actionHook)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0045: 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
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Expected O, but got Unknown
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Expected O, but got Unknown
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Expected O, but got Unknown
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Invalid comparison between Unknown and I4
			InputActionMap val = new InputActionMap("ModConfigMap");
			InputAction val2 = InputActionSetupExtensions.AddAction(val, configName, (InputActionType)0, (string)null, (string)null, (string)null, (string)null, (string)null);
			BindingSyntax val3 = InputActionSetupExtensions.AddBinding(val2, "<Keyboard>/none", (string)null, (string)null, (string)null);
			InputBinding binding = ((BindingSyntax)(ref val3)).binding;
			int hashCode = ((object)(InputBinding)(ref binding)).GetHashCode();
			hashCode = 0;
			InputActionRebindingExtensions.ApplyBindingOverride(val2, hashCode, KeyCodeToPath(defaultValue));
			val2.Enable();
			GameObject val4 = Object.Instantiate<GameObject>(UICloner.dropdown, container.transform);
			((Object)val4).name = "MC_KEYBIND_" + configName;
			((TMP_Text)((Component)val4.transform.Find("Label Text")).GetComponent<TextMeshProUGUI>()).text = configName;
			Transform val5 = val4.transform.Find("Option Contents");
			if (Object.op_Implicit((Object)(object)val5.Find("Dropdown")))
			{
				Object.DestroyImmediate((Object)(object)((Component)val5.Find("Dropdown")).gameObject);
			}
			HorizontalLayoutGroup val6 = GameObjectExtensions.AddOrGetComponent<HorizontalLayoutGroup>(((Component)val5).gameObject);
			((HorizontalOrVerticalLayoutGroup)val6).childControlWidth = false;
			((HorizontalOrVerticalLayoutGroup)val6).childControlHeight = false;
			((HorizontalOrVerticalLayoutGroup)val6).childForceExpandWidth = false;
			((HorizontalOrVerticalLayoutGroup)val6).spacing = 10f;
			((LayoutGroup)val6).childAlignment = (TextAnchor)5;
			GameObject val7 = new GameObject("KbdButton", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Button)
			});
			val7.transform.SetParent(val5, false);
			float num = 40f;
			RectTransform component = val7.GetComponent<RectTransform>();
			component.sizeDelta = new Vector2(num, num);
			Image component2 = val7.GetComponent<Image>();
			component2.preserveAspect = true;
			GameObject val8 = new GameObject("Text", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val8.transform.SetParent(val7.transform, false);
			TextMeshProUGUI component3 = val8.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component3).alignment = (TextAlignmentOptions)514;
			((TMP_Text)component3).fontSize = 18f;
			((Graphic)component3).color = Color.white;
			((Graphic)component3).raycastTarget = false;
			RectTransform component4 = val8.GetComponent<RectTransform>();
			component4.anchorMin = Vector2.zero;
			component4.anchorMax = Vector2.one;
			component4.offsetMin = Vector2.zero;
			component4.offsetMax = Vector2.zero;
			GameObject val9 = new GameObject("ResetButton", new Type[2]
			{
				typeof(RectTransform),
				typeof(Button)
			});
			val9.transform.SetParent(val5, false);
			val9.GetComponent<RectTransform>().sizeDelta = new Vector2(0f, 0f);
			actionRebindOption = val4.AddComponent<ActionRebindOption>();
			actionRebindOption.keyboardRebindButton = new RebindButton
			{
				parentObject = val7,
				button = val7.GetComponent<Button>(),
				bindingIcon = component2,
				tmpBinding = component3,
				resetButton = val9.GetComponent<Button>()
			};
			GameObject val10 = new GameObject("Dummy_Gamepad");
			val10.transform.SetParent(val4.transform);
			val10.SetActive(false);
			actionRebindOption.gamepadRebindButton = new RebindButton
			{
				parentObject = val10,
				button = val10.AddComponent<Button>(),
				resetButton = val10.AddComponent<Button>(),
				bindingIcon = val10.AddComponent<Image>(),
				tmpBinding = val10.AddComponent<TextMeshProUGUI>()
			};
			ControlsRebind component5 = ((Component)ModConfigMain.controlsPage).GetComponent<ControlsRebind>();
			GameObject val11 = (GameObject)(((Object)(object)component5 != (Object)null) ? ((object)((Component)component5).gameObject) : ((object)container));
			actionHook = val4.AddComponent<KeybindHook>();
			if ((int)defaultValue == 0)
			{
				component2.sprite = getEmptyKeyIcon();
				((Behaviour)component2).enabled = true;
			}
			try
			{
				actionRebindOption.Initialize(component5, val2, hashCode, -1);
			}
			catch (Exception)
			{
			}
		}

		public static Sprite getEmptyKeyIcon()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)UICloner.emptyKeyIcon != (Object)null)
			{
				return UICloner.emptyKeyIcon;
			}
			string text = "ModConfig.UI.empty-key.png";
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			using (Stream stream = executingAssembly.GetManifestResourceStream(text))
			{
				if (stream == null)
				{
					Plugin.Log.LogError((object)("Resource not found: " + text));
					return null;
				}
				byte[] array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
				Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
				if (ImageConversion.LoadImage(val, array))
				{
					return UICloner.emptyKeyIcon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
				}
			}
			return null;
		}
	}
}
namespace ModConfig.Core
{
	public class ConfigGetter
	{
		public static void InitialiseConfigs(GameObject modsPage, GameObject topBar)
		{
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0674: Unknown result type (might be due to invalid IL or missing references)
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			bool flag = true;
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				string name = pluginInfo.Value.Metadata.Name;
				ConfigFile config = pluginInfo.Value.Instance.Config;
				UICreator.CreateModPage(modsPage, name, out GameObject page);
				UICreator.CreateModPageNavigationButton(topBar, modsPage, page, name);
				if (flag)
				{
					page.SetActive(true);
					flag = false;
				}
				IEnumerable<IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>>> enumerable = from entry in (IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)config
					group entry by entry.Value.Definition.Section;
				UICreator.CreateTitle(page, name);
				foreach (IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>> item3 in enumerable)
				{
					string key = item3.Key;
					UICreator.CreateSubHeading(page, key, out GameObject _);
					UICreator.CreateNewSection(page, key, out GameObject container);
					foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item4 in item3)
					{
						ConfigEntryBase entryBase = item4.Value;
						Type settingType = entryBase.SettingType;
						if (settingType == typeof(bool))
						{
							UICreator.CreateDropdown(container, entryBase.Definition.Key, new List<string> { "True", "False" }, out DropdownOption dropdownOption3);
							bool flag2 = (bool)entryBase.BoxedValue;
							dropdownOption3.SetValue((!flag2) ? 1 : 0);
							DropdownOption obj = dropdownOption3;
							obj.onChanged = (Action)Delegate.Combine(obj.onChanged, (Action)delegate
							{
								entryBase.BoxedValue = dropdownOption3.value == 0;
								Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
							});
							continue;
						}
						if (settingType == typeof(float))
						{
							if (entryBase.Description.AcceptableValues is AcceptableValueRange<float> val)
							{
								UICreator.CreateFloatSlider(container, (float)entryBase.BoxedValue, val.MinValue, val.MaxValue, entryBase.Definition.Key, out SliderOption sliderOption);
								SliderOption obj2 = sliderOption;
								obj2.onChanged = (Action)Delegate.Combine(obj2.onChanged, (Action)delegate
								{
									entryBase.BoxedValue = sliderOption.value;
									sliderOption.SetValueText(entryBase.BoxedValue.ToString());
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								});
							}
							else
							{
								UICreator.CreateFloatSlider(container, (float)entryBase.BoxedValue, 0f, 999f, entryBase.Definition.Key, out SliderOption sliderOption2);
								SliderOption obj3 = sliderOption2;
								obj3.onChanged = (Action)Delegate.Combine(obj3.onChanged, (Action)delegate
								{
									entryBase.BoxedValue = sliderOption2.value;
									sliderOption2.SetValueText(entryBase.BoxedValue.ToString());
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								});
							}
							continue;
						}
						if (settingType == typeof(int))
						{
							if (entryBase.Description.AcceptableValues is AcceptableValueRange<int> val2)
							{
								UICreator.CreateIntSlider(container, (int)entryBase.BoxedValue, val2.MinValue, val2.MaxValue, entryBase.Definition.Key, out SliderOption sliderOption3);
								SliderOption obj4 = sliderOption3;
								obj4.onChanged = (Action)Delegate.Combine(obj4.onChanged, (Action)delegate
								{
									entryBase.BoxedValue = sliderOption3.value;
									sliderOption3.SetValueText(entryBase.BoxedValue.ToString());
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								});
							}
							else
							{
								UICreator.CreateIntSlider(container, (int)entryBase.BoxedValue, 0, 999, entryBase.Definition.Key, out SliderOption sliderOption4);
								SliderOption obj5 = sliderOption4;
								obj5.onChanged = (Action)Delegate.Combine(obj5.onChanged, (Action)delegate
								{
									entryBase.BoxedValue = sliderOption4.value;
									sliderOption4.SetValueText(entryBase.BoxedValue.ToString());
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								});
							}
							continue;
						}
						if (settingType == typeof(string))
						{
							if (entryBase.Description.AcceptableValues is AcceptableValueList<string> val3)
							{
								List<string> options = val3.AcceptableValues.ToList();
								UICreator.CreateDropdown(container, entryBase.Definition.Key, options, out DropdownOption dropdownOption2);
								string item = (string)entryBase.BoxedValue;
								dropdownOption2.SetValue(options.IndexOf(item));
								DropdownOption obj6 = dropdownOption2;
								obj6.onChanged = (Action)Delegate.Combine(obj6.onChanged, (Action)delegate
								{
									entryBase.BoxedValue = options[dropdownOption2.value];
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								});
							}
							else
							{
								UICreator.CreateStringInput(container, entryBase.Definition.Key, delegate(string newVal)
								{
									entryBase.BoxedValue = newVal;
									Plugin.Log.LogInfo((object)$"Config {entryBase.Definition.Key} updated to {entryBase.BoxedValue}");
								}, (string)entryBase.BoxedValue);
							}
							continue;
						}
						if (settingType == typeof(Color))
						{
							Color val4 = (Color)entryBase.BoxedValue;
							string defaultValue = ColorUtility.ToHtmlStringRGBA(val4);
							UICreator.CreateStringInput(container, entryBase.Definition.Key, delegate(string newText)
							{
								//IL_002e: Unknown result type (might be due to invalid IL or missing references)
								Color val9 = default(Color);
								if (ColorUtility.TryParseHtmlString(newText.StartsWith("#") ? newText : ("#" + newText), ref val9))
								{
									entryBase.BoxedValue = val9;
									Plugin.Log.LogInfo((object)("Config " + entryBase.Definition.Key + " updated to " + newText));
								}
							}, defaultValue);
							continue;
						}
						if (settingType == typeof(KeyCode))
						{
							ConfigEntry<KeyCode> configEntry2 = (ConfigEntry<KeyCode>)(object)entryBase;
							UICreator.CreateKeybinding(container, ((ConfigEntryBase)configEntry2).Definition.Key, configEntry2.Value, out ActionRebindOption actionRebindOption2, out KeybindHook actionHook2);
							KeybindHook keybindHook = actionHook2;
							keybindHook.onRebind = (Action)Delegate.Combine(keybindHook.onRebind, (Action)delegate
							{
								//IL_000c: Unknown result type (might be due to invalid IL or missing references)
								//IL_0011: Unknown result type (might be due to invalid IL or missing references)
								//IL_001f: Unknown result type (might be due to invalid IL or missing references)
								//IL_0024: Unknown result type (might be due to invalid IL or missing references)
								//IL_0034: Unknown result type (might be due to invalid IL or missing references)
								//IL_0039: Unknown result type (might be due to invalid IL or missing references)
								//IL_0040: Unknown result type (might be due to invalid IL or missing references)
								//IL_0066: Unknown result type (might be due to invalid IL or missing references)
								InputBinding val7 = actionRebindOption2.action.bindings[actionRebindOption2.keyboardBindingIndex];
								string effectivePath2 = ((InputBinding)(ref val7)).effectivePath;
								KeyCode val8 = actionHook2.PathToKeyCode(effectivePath2);
								((ConfigEntryBase)configEntry2).BoxedValue = val8;
								Plugin.Log.LogInfo((object)$"Config {((ConfigEntryBase)configEntry2).Definition.Key} updated to {val8}");
							});
							continue;
						}
						if (settingType == typeof(KeyboardShortcut))
						{
							ConfigEntry<KeyboardShortcut> configEntry = (ConfigEntry<KeyboardShortcut>)(object)entryBase;
							GameObject container2 = container;
							string key2 = ((ConfigEntryBase)configEntry).Definition.Key;
							KeyboardShortcut value = configEntry.Value;
							UICreator.CreateKeybinding(container2, key2, ((KeyboardShortcut)(ref value)).MainKey, out ActionRebindOption actionRebindOption, out KeybindHook actionHook);
							KeybindHook keybindHook2 = actionHook;
							keybindHook2.onRebind = (Action)Delegate.Combine(keybindHook2.onRebind, (Action)delegate
							{
								//IL_000c: Unknown result type (might be due to invalid IL or missing references)
								//IL_0011: Unknown result type (might be due to invalid IL or missing references)
								//IL_001f: Unknown result type (might be due to invalid IL or missing references)
								//IL_0024: Unknown result type (might be due to invalid IL or missing references)
								//IL_0034: Unknown result type (might be due to invalid IL or missing references)
								//IL_0039: Unknown result type (might be due to invalid IL or missing references)
								//IL_0040: Unknown result type (might be due to invalid IL or missing references)
								//IL_0046: Unknown result type (might be due to invalid IL or missing references)
								//IL_006b: Unknown result type (might be due to invalid IL or missing references)
								InputBinding val5 = actionRebindOption.action.bindings[actionRebindOption.keyboardBindingIndex];
								string effectivePath = ((InputBinding)(ref val5)).effectivePath;
								KeyCode val6 = actionHook.PathToKeyCode(effectivePath);
								configEntry.Value = new KeyboardShortcut(val6, Array.Empty<KeyCode>());
								Plugin.Log.LogInfo((object)$"Config {((ConfigEntryBase)configEntry).Definition.Key} updated to {val6}");
							});
							continue;
						}
						if (settingType.IsEnum)
						{
							List<string> enumNames = Enum.GetNames(settingType).ToList();
							UICreator.CreateDropdown(container, entryBase.Definition.Key, enumNames, out DropdownOption dropdownOption);
							string item2 = entryBase.BoxedValue.ToString();
							int value2 = enumNames.IndexOf(item2);
							dropdownOption.SetValue(value2);
							DropdownOption obj7 = dropdownOption;
							obj7.onChanged = (Action)Delegate.Combine(obj7.onChanged, (Action)delegate
							{
								string value3 = enumNames[dropdownOption.value];
								object boxedValue = Enum.Parse(settingType, value3);
								entryBase.BoxedValue = boxedValue;
							});
							continue;
						}
						string defaultValue2 = entryBase.BoxedValue?.ToString() ?? "";
						UICreator.CreateStringInput(container, "[?] " + entryBase.Definition.Key, delegate(string newText)
						{
							try
							{
								entryBase.BoxedValue = newText;
							}
							catch (Exception ex)
							{
								Plugin.Log.LogWarning((object)$"[ModConfig] Failed to set unrecognised type {settingType}: {ex.Message}");
							}
						}, defaultValue2);
					}
				}
			}
		}

		public static void SaveAllConfigs()
		{
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				try
				{
					pluginInfo.Value.Instance.Config.Save();
					Plugin.Log.LogInfo((object)("Saved config for: " + pluginInfo.Value.Metadata.Name));
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)("Failed to save config for " + pluginInfo.Value.Metadata.Name + ": " + ex.Message));
				}
			}
		}
	}
	public static class ModConfigManager
	{
		private const string TAB_NAME = "Mods";

		private static readonly Color BG_COLOR = new Color(1f, 0.8024f, 0.8584f, 1f);

		private static readonly float SPACING = -45f;

		private static readonly Vector3 BUTTON_SCALE = new Vector3(0.8f, 0.8f, 0.8f);

		private static readonly float PADDING_X = 190f;

		public static Dictionary<string, List<ConfigEntryBase>> LoadAllModConfigs()
		{
			Dictionary<string, List<ConfigEntryBase>> dictionary = new Dictionary<string, List<ConfigEntryBase>>();
			foreach (PluginInfo item in Chainloader.PluginInfos.Values.OrderBy((PluginInfo p) => p.Metadata.Name))
			{
				if (!((Object)(object)item.Instance == (Object)null) && item.Instance.Config != null)
				{
					List<ConfigEntryBase> list = (from e in (IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)item.Instance.Config
						where !e.Value.Description.Tags.Contains("Hidden")
						select e.Value).ToList();
					if (list.Count > 0)
					{
						dictionary[item.Metadata.Name] = list;
						Debug.Log((object)$"Found {list.Count} config entries for mod: {item.Metadata.Name}");
					}
				}
			}
			return dictionary;
		}

		public static void Inject(MenuTabs menuTabs)
		{
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: 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)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)menuTabs == (Object)null || (Object)(object)((Component)menuTabs).transform.Find("Menu/Options Tab/Mods") != (Object)null)
			{
				return;
			}
			Transform val = ((Component)menuTabs).transform.Find("Menu/Options Tab");
			Transform val2 = val.Find("Controls");
			GameObject val3 = ((IEnumerable<GameObject>)menuTabs.tabs).FirstOrDefault((Func<GameObject, bool>)((GameObject t) => ((Object)t).name.Contains("Controls")));
			if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val3 == (Object)null))
			{
				((HorizontalOrVerticalLayoutGroup)((Component)val).GetComponent<HorizontalLayoutGroup>()).spacing = SPACING;
				ChangeButtons(menuTabs);
				GameObject val4 = Object.Instantiate<GameObject>(((Component)val2).gameObject, val);
				((Object)val4).name = "Mods";
				((Graphic)val4.GetComponent<Image>()).color = BG_COLOR;
				((Graphic)((Component)val4.transform.Find("Highlight/Background")).GetComponent<Image>()).color = BG_COLOR;
				((Graphic)((Component)val4.transform.Find("Highlight/Background/Stripes")).GetComponent<Image>()).color = BG_COLOR - new Color(0.05f, 0.05f, 0.05f, 0f);
				SetupButtonText(val4);
				GameObject val5 = Object.Instantiate<GameObject>(val3, val3.transform.parent);
				((Object)val5).name = "Mods";
				while (val5.transform.childCount > 0)
				{
					Object.DestroyImmediate((Object)(object)((Component)val5.transform.GetChild(0)).gameObject);
				}
				CleanContentPage(val5);
				ModConfigMain modConfigMain = ((Component)val5.transform.parent).gameObject.AddComponent<ModConfigMain>();
				UpdateMenuTabs(menuTabs, val4, val5);
			}
		}

		private static void UpdateMenuTabs(MenuTabs menuTabs, GameObject buttonObj, GameObject page)
		{
			//IL_0083: 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_00d9: Expected O, but got Unknown
			MenuTabs menuTabs2 = menuTabs;
			List<Button> list = menuTabs2.tabButtons.ToList();
			List<GameObject> list2 = menuTabs2.tabs.ToList();
			list.Add(buttonObj.GetComponent<Button>());
			list2.Add(page);
			menuTabs2.tabButtons = list.ToArray();
			menuTabs2.tabs = list2.ToArray();
			menuTabs2.textColors = menuTabs2.textColors.Append(menuTabs2.textColors.Last()).ToArray();
			int index = menuTabs2.tabButtons.Length - 1;
			((UnityEventBase)buttonObj.GetComponent<Button>().onClick).RemoveAllListeners();
			((UnityEvent)buttonObj.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
			{
				menuTabs2.SelectTab(index);
			});
		}

		private static void SetupButtonText(GameObject button)
		{
			Object.DestroyImmediate((Object)(object)button.GetComponentInChildren<LocalizeStringEvent>());
			TMP_Text[] componentsInChildren = button.GetComponentsInChildren<TMP_Text>();
			foreach (TMP_Text val in componentsInChildren)
			{
				val.text = "Mods";
			}
		}

		private static void CleanContentPage(GameObject page)
		{
			string[] source = new string[6] { "RectTransform", "CanvasRenderer", "Canvas", "Image", "ScrollRect", "Mask" };
			Component[] components = page.GetComponents<Component>();
			foreach (Component val in components)
			{
				if (val is MonoBehaviour && !source.Contains(((object)val).GetType().Name))
				{
					Object.DestroyImmediate((Object)(object)val);
				}
			}
		}

		private static void ChangeButtons(MenuTabs menu)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			List<Button> list = menu.tabButtons.ToList();
			foreach (Button item in list)
			{
				((Component)item).transform.localScale = BUTTON_SCALE;
			}
		}
	}
}
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
	{
	}
}