Decompiled source of Mod Menu v1.0.2

BepInEx/plugins/ModMenu/ModMenu.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using ComputerysModdingUtilities;
using HarmonyLib;
using ModMenu.Behaviours.OptionControllers;
using ModMenu.Mods;
using ModMenu.Options;
using ModMenu.Patches;
using ModMenu.Utils;
using Newtonsoft.Json;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: StraftatMod(true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace ModMenu
{
	public static class ModMenuManager
	{
		public static Mod[] mods;

		public static void Init()
		{
			Dictionary<string, PluginInfo>.ValueCollection values = Chainloader.PluginInfos.Values;
			List<Mod> list = new List<Mod>();
			foreach (PluginInfo item in values)
			{
				ModInfo modInfo = default(ModInfo);
				modInfo.guid = item.Metadata.GUID;
				modInfo.name = item.Metadata.Name;
				modInfo.version = item.Metadata.Version.ToString();
				ModInfo info = modInfo;
				list.Add(new Mod(info));
			}
			mods = list.ToArray();
		}
	}
	public static class PluginInfo
	{
		public const string guid = "kestrel.straftat.modmenu";

		public const string name = "ModMenu";

		public const string version = "1.0.2";
	}
	[BepInPlugin("kestrel.straftat.modmenu", "ModMenu", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		public enum TestEnum
		{
			OptionA,
			OptionB,
			OptionC,
			OptionD,
			AndSoOn
		}

		internal static ManualLogSource Logger;

		public static readonly string loadBearingColonThree = ":3";

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (loadBearingColonThree != ":3")
			{
				Application.Quit();
			}
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			Instance = this;
			Logger = ((BaseUnityPlugin)this).Logger;
			Assets.Init();
			CreateExampleConfigs();
			new Harmony("kestrel.straftat.modmenu").PatchAll();
			Logger.LogInfo((object)"Hiiiiiiiiiiii :3");
		}

		private void CreateExampleConfigs()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: 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_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Config.Bind<bool>("Examples.Basic", "Bool", false, "A bool");
			((BaseUnityPlugin)this).Config.Bind<string>("Examples.Basic", "String", "Hiiiii", "A string");
			((BaseUnityPlugin)this).Config.Bind<float>("Examples.Numeric", "Unrestricted Float", 0f, "A float");
			((BaseUnityPlugin)this).Config.Bind<float>("Examples.Numeric", "Acceptable Range Float", 0f, new ConfigDescription("A float with a range restriction", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-100f, 100f), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.Bind<float>("Examples.Numeric", "Acceptable List Float", 0f, new ConfigDescription("A float with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList<float>(new float[6] { 0f, 0.5f, 1f, 1.5f, 2f, 10f }), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.Bind<int>("Examples.Numeric", "Unrestricted Int", 0, "An int");
			((BaseUnityPlugin)this).Config.Bind<int>("Examples.Numeric", "Acceptable Range Int", 0, new ConfigDescription("An int with a range restriction", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-10, 10), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.Bind<int>("Examples.Numeric", "Acceptable List Int", 0, new ConfigDescription("An int with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList<int>(new int[7] { 0, 1, 2, 3, 4, 5, 10 }), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.Bind<uint>("Examples.Numeric", "UInt", 0u, "An unsigned int");
			((BaseUnityPlugin)this).Config.Bind<sbyte>("Examples.Numeric", "SByte", (sbyte)0, "A signed byte");
			((BaseUnityPlugin)this).Config.Bind<byte>("Examples.Numeric", "Byte", (byte)0, "A byte");
			((BaseUnityPlugin)this).Config.Bind<Vector2>("Examples.UnityTypes", "Unrestricted Vector2", Vector2.zero, "A Vector2");
			((BaseUnityPlugin)this).Config.Bind<Vector2>("Examples.UnityTypes", "Acceptable List Vector2", Vector2.zero, new ConfigDescription("A Vector2 with a list of acceptable values", (AcceptableValueBase)(object)new AcceptableValueList<Vector2>((Vector2[])(object)new Vector2[6]
			{
				Vector2.zero,
				Vector2.one,
				Vector2.up,
				Vector2.down,
				Vector2.left,
				Vector2.right
			}), Array.Empty<object>()));
			((BaseUnityPlugin)this).Config.Bind<Vector3>("Examples.UnityTypes", "Vector3", Vector3.zero, "A Vector3");
			((BaseUnityPlugin)this).Config.Bind<Vector4>("Examples.UnityTypes", "Vector4", Vector4.zero, "A Vector4");
			((BaseUnityPlugin)this).Config.Bind<Quaternion>("Examples.UnityTypes", "Quaternion", Quaternion.identity, "A Quaternion");
			((BaseUnityPlugin)this).Config.Bind<Color>("Examples.UnityTypes", "Color", Color.white, "A Color");
			((BaseUnityPlugin)this).Config.Bind<TestEnum>("Examples.Other", "Enum", TestEnum.OptionA, "An enum");
			((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Examples.Other", "Keyboard Shortcut", new KeyboardShortcut((KeyCode)285, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "A keyboard shortcut");
			((BaseUnityPlugin)this).Config.Bind<KeyCode>("Examples.Other", "KeyCode", (KeyCode)97, "A keycode");
		}
	}
}
namespace ModMenu.Utils
{
	public static class AcceptableValueBaseExtensions
	{
		public static string HumanizedString(this AcceptableValueBase avb)
		{
			Type type = ((object)avb).GetType();
			if (avb.IsAcceptableValueRange())
			{
				object value = type.GetProperty("MinValue").GetValue(avb);
				object value2 = type.GetProperty("MaxValue").GetValue(avb);
				return "Accepts " + value?.ToString() + " to " + value2;
			}
			if (avb.IsAcceptableValueList())
			{
				object[] array = ((IEnumerable)type.GetProperty("AcceptableValues").GetValue(avb)).Cast<object>().ToArray();
				return "Accepts " + string.Join(", ", from v in array.SkipLast(1)
					select v.ToString()) + " and " + array[^1];
			}
			throw new NotSupportedException($"Type \"{type}\" is not supported.");
		}

		public static bool IsAcceptableValueList(this AcceptableValueBase avb)
		{
			return ((object)avb).GetType().GetGenericTypeDefinition() == typeof(AcceptableValueList<>);
		}

		public static bool IsAcceptableValueRange(this AcceptableValueBase avb)
		{
			return ((object)avb).GetType().GetGenericTypeDefinition() == typeof(AcceptableValueRange<>);
		}
	}
	public static class Assets
	{
		private static AssetBundle m_bundle;

		public static Sprite DefaultModIcon { get; private set; }

		public static GameObject CategoryHeader { get; private set; }

		public static GameObject IntegralSliderOption { get; private set; }

		public static GameObject FloatingSliderOption { get; private set; }

		public static GameObject IntegralInputFieldOption { get; private set; }

		public static GameObject FloatingInputFieldOption { get; private set; }

		public static GameObject BoolCheckboxOption { get; private set; }

		public static GameObject StringInputFieldOption { get; private set; }

		public static GameObject EnumDropdownOption { get; private set; }

		public static GameObject KeyCodeOption { get; private set; }

		public static GameObject KeyboardShortcutOption { get; private set; }

		public static GameObject AcceptableListDropdownOption { get; private set; }

		public static GameObject Vector2Option { get; private set; }

		public static GameObject Vector3Option { get; private set; }

		public static GameObject Vector4Option { get; private set; }

		public static GameObject QuaternionOption { get; private set; }

		public static GameObject ColorOption { get; private set; }

		internal static T Load<T>(string name) where T : Object
		{
			return m_bundle.LoadAsset<T>(name);
		}

		public static void Init()
		{
			Plugin.Logger.LogInfo((object)"Loading assets...");
			m_bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "modmenu"));
			DefaultModIcon = Assets.Load<Sprite>("NoIcon");
			CategoryHeader = Assets.Load<GameObject>("CategoryHeader");
			IntegralSliderOption = Assets.Load<GameObject>("IntegralSliderOption");
			FloatingSliderOption = Assets.Load<GameObject>("FloatingSliderOption");
			IntegralInputFieldOption = Assets.Load<GameObject>("IntegralInputFieldOption");
			FloatingInputFieldOption = Assets.Load<GameObject>("FloatingInputFieldOption");
			BoolCheckboxOption = Assets.Load<GameObject>("BoolCheckboxOption");
			StringInputFieldOption = Assets.Load<GameObject>("StringInputFieldOption");
			EnumDropdownOption = Assets.Load<GameObject>("EnumDropdownOption");
			KeyCodeOption = Assets.Load<GameObject>("KeyCodeOption");
			KeyboardShortcutOption = Assets.Load<GameObject>("KeyboardShortcutOption");
			AcceptableListDropdownOption = Assets.Load<GameObject>("AcceptableListDropdownOption");
			Vector2Option = Assets.Load<GameObject>("Vector2Option");
			Vector3Option = Assets.Load<GameObject>("Vector3Option");
			Vector4Option = Assets.Load<GameObject>("Vector4Option");
			QuaternionOption = Assets.Load<GameObject>("QuaternionOption");
			ColorOption = Assets.Load<GameObject>("ColorOption");
			Plugin.Logger.LogInfo((object)"Assets loaded!");
		}
	}
	public static class TypeExtensions
	{
		public static bool IsIntegral(this Type type)
		{
			if (!(type == typeof(sbyte)) && !(type == typeof(byte)) && !(type == typeof(short)) && !(type == typeof(ushort)) && !(type == typeof(int)) && !(type == typeof(uint)) && !(type == typeof(long)))
			{
				return type == typeof(ulong);
			}
			return true;
		}

		public static bool IsFloating(this Type type)
		{
			if (!(type == typeof(float)) && !(type == typeof(double)))
			{
				return type == typeof(decimal);
			}
			return true;
		}
	}
}
namespace ModMenu.Patches
{
	[HarmonyPatch(typeof(PauseManager))]
	public static class PauseManagerPatch
	{
		public static readonly HashSet<KeybindOptionController> currentlyRebindingContollers = new HashSet<KeybindOptionController>();

		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void InitModsTab(GameObject ___optionsMenu)
		{
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			//IL_015d: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)___optionsMenu))
			{
				return;
			}
			((Component)___optionsMenu.transform.Find("OPTIONS HUD").GetChild(0).GetChild(3)).gameObject.SetActive(false);
			GameObject pcTab = ((Component)___optionsMenu.transform.Find("PcTab")).gameObject;
			GameObject audioTab = ((Component)___optionsMenu.transform.Find("AudioTab")).gameObject;
			GameObject graphTab = ((Component)___optionsMenu.transform.Find("GraphTab")).gameObject;
			GameObject modsTab = Object.Instantiate<GameObject>(Assets.Load<GameObject>("ModMenu"), ___optionsMenu.transform);
			((Object)modsTab).name = "ModsTab";
			modsTab.SetActive(false);
			Transform val = ___optionsMenu.transform.Find("Tabsbutton");
			Button component = Object.Instantiate<GameObject>(Assets.Load<GameObject>("ModsTabButton"), ((Component)val).transform).GetComponent<Button>();
			UnityAction val2 = default(UnityAction);
			for (int i = 0; i < val.childCount; i++)
			{
				RectTransform component2 = ((Component)val.GetChild(i)).GetComponent<RectTransform>();
				if (component2 == null)
				{
					continue;
				}
				component2.sizeDelta = new Vector2(110f, 63.21f);
				component2.anchoredPosition = new Vector2((float)(-710 + i * 110), 343.8f);
				ButtonClickedEvent onClick = ((Component)component2).GetComponent<Button>().onClick;
				UnityAction obj = val2;
				if (obj == null)
				{
					UnityAction val3 = delegate
					{
						modsTab.SetActive(false);
					};
					UnityAction val4 = val3;
					val2 = val3;
					obj = val4;
				}
				((UnityEvent)onClick).AddListener(obj);
			}
			((UnityEvent)component.onClick).AddListener((UnityAction)delegate
			{
				modsTab.SetActive(true);
				pcTab.SetActive(false);
				audioTab.SetActive(false);
				graphTab.SetActive(false);
			});
		}

		[HarmonyPatch("Menu")]
		[HarmonyPrefix]
		public static bool DoNotOpenIfRebinding()
		{
			return currentlyRebindingContollers.Count == 0;
		}
	}
}
namespace ModMenu.Options
{
	public class AcceptableListDropdownOption : Option
	{
		public AcceptableListDropdownOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.AcceptableListDropdownOption, parent);
		}
	}
	public class BoolOption : ValueOption<bool>
	{
		public BoolOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.BoolCheckboxOption, parent);
		}
	}
	public class ColorOption : ValueOption<Color>
	{
		public ColorOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.ColorOption, parent);
		}
	}
	public class EnumDropdownOption : Option
	{
		public EnumDropdownOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.EnumDropdownOption, parent);
		}
	}
	public class FloatingInputFieldOption : Option
	{
		public FloatingInputFieldOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.FloatingInputFieldOption, parent);
		}
	}
	public class FloatingSliderOption : Option
	{
		public FloatingSliderOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.FloatingSliderOption, parent);
		}
	}
	public class IntegralInputFieldOption : Option
	{
		public IntegralInputFieldOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.IntegralInputFieldOption, parent);
		}
	}
	public class IntegralSliderOption : Option
	{
		public IntegralSliderOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.IntegralSliderOption, parent);
		}
	}
	public class KeyboardShortcutOption : ValueOption<KeyboardShortcut>
	{
		public KeyboardShortcutOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.KeyboardShortcutOption, parent);
		}
	}
	public class KeyCodeOption : ValueOption<KeyCode>
	{
		public KeyCodeOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.KeyCodeOption, parent);
		}
	}
	public abstract class Option
	{
		public string Name => BaseEntry.Definition.Key;

		public string Section => BaseEntry.Definition.Section;

		public string Description => BaseEntry.Description.Description;

		public AcceptableValueBase AcceptableValues => BaseEntry.Description.AcceptableValues;

		public ConfigEntryBase BaseEntry { get; }

		public object BoxedValue
		{
			get
			{
				return BaseEntry.BoxedValue;
			}
			set
			{
				BaseEntry.BoxedValue = value;
			}
		}

		protected Option(ConfigEntryBase entry)
		{
			BaseEntry = entry;
		}

		public abstract GameObject InstantiateOptionObject(Transform parent);

		public void ResetToDefault()
		{
			BoxedValue = BaseEntry.DefaultValue;
		}

		public static Option CreateForEntry(ConfigEntryBase entry)
		{
			Type settingType = entry.SettingType;
			AcceptableValueBase acceptableValues = entry.Description.AcceptableValues;
			if (acceptableValues != null && acceptableValues.IsAcceptableValueList())
			{
				return new AcceptableListDropdownOption(entry);
			}
			if (settingType == typeof(bool))
			{
				return new BoolOption(entry);
			}
			if (settingType == typeof(string))
			{
				return new StringInputFieldOption(entry);
			}
			if (settingType.IsIntegral())
			{
				if (acceptableValues != null && acceptableValues.IsAcceptableValueRange())
				{
					return new IntegralSliderOption(entry);
				}
				return new IntegralInputFieldOption(entry);
			}
			if (settingType.IsFloating())
			{
				if (acceptableValues != null && acceptableValues.IsAcceptableValueRange())
				{
					return new FloatingSliderOption(entry);
				}
				return new FloatingInputFieldOption(entry);
			}
			if (settingType == typeof(KeyCode))
			{
				return new KeyCodeOption(entry);
			}
			if (settingType == typeof(KeyboardShortcut))
			{
				return new KeyboardShortcutOption(entry);
			}
			if (settingType == typeof(Vector2))
			{
				return new Vector2Option(entry);
			}
			if (settingType == typeof(Vector3))
			{
				return new Vector3Option(entry);
			}
			if (settingType == typeof(Vector4))
			{
				return new Vector4Option(entry);
			}
			if (settingType == typeof(Quaternion))
			{
				return new QuaternionOption(entry);
			}
			if (settingType == typeof(Color))
			{
				return new ColorOption(entry);
			}
			if (settingType.IsEnum && !settingType.IsDefined(typeof(FlagsAttribute), inherit: false))
			{
				return new EnumDropdownOption(entry);
			}
			throw new NotSupportedException($"Options of type \"{settingType}\" are not supported.");
		}
	}
	public abstract class ValueOption<T> : Option
	{
		public T Value
		{
			get
			{
				return (T)base.BaseEntry.BoxedValue;
			}
			set
			{
				base.BaseEntry.BoxedValue = value;
			}
		}

		protected ValueOption(ConfigEntryBase entry)
			: base(entry)
		{
		}
	}
	public class QuaternionOption : ValueOption<Quaternion>
	{
		public QuaternionOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.QuaternionOption, parent);
		}
	}
	public class StringInputFieldOption : ValueOption<string>
	{
		public StringInputFieldOption(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.StringInputFieldOption, parent);
		}
	}
	public class Vector2Option : ValueOption<Vector2>
	{
		public Vector2Option(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.Vector2Option, parent);
		}
	}
	public class Vector3Option : ValueOption<Vector3>
	{
		public Vector3Option(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.Vector3Option, parent);
		}
	}
	public class Vector4Option : ValueOption<Vector4>
	{
		public Vector4Option(ConfigEntryBase entry)
			: base(entry)
		{
		}

		public override GameObject InstantiateOptionObject(Transform parent)
		{
			return Object.Instantiate<GameObject>(Assets.Vector4Option, parent);
		}
	}
}
namespace ModMenu.Mods
{
	public class Mod
	{
		public readonly List<Option> config = new List<Option>();

		public ModInfo info;

		public readonly PluginInfo pluginInfo;

		public bool HasAnyConfigs => config.Count > 0;

		public bool HasAdvancedMetadata { get; private set; }

		public Mod(ModInfo info)
		{
			this.info = info;
			if (Chainloader.PluginInfos.TryGetValue(info.guid, out pluginInfo))
			{
				LoadMetadata();
				LoadConfigEntries();
			}
		}

		private void LoadConfigEntries()
		{
			foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in pluginInfo.Instance.Config)
			{
				try
				{
					config.Add(Option.CreateForEntry(item.Value));
				}
				catch (NotSupportedException ex)
				{
					Plugin.Logger.LogWarning((object)$"Error generating config entry \"{item.Key}\" for \"{info.name}\": {ex.Message}");
				}
			}
		}

		private void LoadMetadata()
		{
			info.icon = Assets.DefaultModIcon;
			info.description = "No description found.";
			if (pluginInfo == null)
			{
				return;
			}
			string text = Path.GetFullPath(pluginInfo.Location);
			DirectoryInfo parent = Directory.GetParent(text);
			while (parent != null && !string.Equals(parent.Name, "plugins", StringComparison.OrdinalIgnoreCase))
			{
				text = parent.FullName;
				parent = Directory.GetParent(text);
			}
			if (!text.EndsWith(".dll"))
			{
				string text2 = Directory.EnumerateFiles(text, "icon.png", SearchOption.AllDirectories).FirstOrDefault();
				if (!string.IsNullOrEmpty(text2))
				{
					TryLoadIcon(text2);
				}
				string text3 = Directory.EnumerateFiles(text, "manifest.json", SearchOption.AllDirectories).FirstOrDefault();
				if (!string.IsNullOrEmpty(text3))
				{
					TryLoadManifest(text3);
				}
			}
		}

		private bool TryLoadIcon(string path)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(256, 256);
			if (!ImageConversion.LoadImage(val, File.ReadAllBytes(path)))
			{
				return false;
			}
			info.icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
			HasAdvancedMetadata = true;
			return true;
		}

		private bool TryLoadManifest(string path)
		{
			//IL_0041: Expected O, but got Unknown
			try
			{
				ThunderstoreManifest thunderstoreManifest = JsonConvert.DeserializeObject<ThunderstoreManifest>(File.ReadAllText(path));
				info.description = thunderstoreManifest.Description;
				info.name = thunderstoreManifest.Name.Replace('_', ' ');
				HasAdvancedMetadata = true;
			}
			catch (JsonException val)
			{
				JsonException val2 = val;
				Plugin.Logger.LogWarning((object)("Error trying to load manifest for \"" + info.name + "\": " + ((Exception)(object)val2).Message));
				return false;
			}
			return true;
		}
	}
	public struct ModInfo
	{
		public string name;

		public string guid;

		public string description;

		public string version;

		public Sprite icon;
	}
	public class ThunderstoreManifest
	{
		[JsonProperty("name")]
		public string Name { get; set; }

		[JsonProperty("version_number")]
		public string Version { get; set; }

		[JsonProperty("website_url")]
		public string WebsiteUrl { get; set; }

		[JsonProperty("description")]
		public string Description { get; set; }

		[JsonProperty("dependencies")]
		public string[] Dependencies { get; set; }
	}
}
namespace ModMenu.Behaviours
{
	public class CategoryHeader : MonoBehaviour
	{
		public TextMeshProUGUI headerText;

		public string Text
		{
			get
			{
				return ((TMP_Text)headerText).text;
			}
			set
			{
				((TMP_Text)headerText).text = value;
			}
		}
	}
	public class ModInfoPanel : MonoBehaviour
	{
		public TextMeshProUGUI descriptionText;

		public TextMeshProUGUI nameText;

		public TextMeshProUGUI extraInfoText;

		public Image icon;

		public ShowTooltip nameTooltip;

		private void Awake()
		{
			ClearInfo();
		}

		public void ShowInfoFor(Mod mod)
		{
			((Behaviour)icon).enabled = true;
			((TMP_Text)nameText).text = mod.info.name;
			((TMP_Text)nameText).ForceMeshUpdate(false, false);
			nameTooltip.textToShow = (((TMP_Text)nameText).isTextTruncated ? mod.info.name : "");
			((TMP_Text)descriptionText).text = mod.info.description;
			icon.sprite = mod.info.icon;
			((TMP_Text)extraInfoText).text = mod.info.guid + "\nv" + mod.info.version;
		}

		public void ClearInfo()
		{
			((Behaviour)icon).enabled = false;
			((TMP_Text)descriptionText).text = "";
			((TMP_Text)nameText).text = "";
			nameTooltip.textToShow = "";
			((TMP_Text)extraInfoText).text = "";
		}
	}
	public class ModListItem : MonoBehaviour
	{
		public delegate void ModSelectHandler(Mod mod);

		public Image icon;

		public TextMeshProUGUI nameText;

		public TextMeshProUGUI versionText;

		private Mod m_mod;

		public Mod Mod
		{
			get
			{
				return m_mod;
			}
			set
			{
				m_mod = value;
				((TMP_Text)nameText).text = m_mod.info.name;
				((TMP_Text)versionText).text = "v" + m_mod.info.version;
				icon.sprite = m_mod.info.icon;
			}
		}

		public event ModSelectHandler OnModSelected;

		public void OnClick()
		{
			this.OnModSelected?.Invoke(Mod);
		}
	}
	public class ModListPanel : MonoBehaviour
	{
		public GameObject container;

		public GameObject itemPrefab;

		public OptionListPanel optionListPanel;

		public ModInfoPanel modInfoPanel;

		public OptionInfoPanel optionInfoPanel;

		private void Awake()
		{
			foreach (Mod item in from m in ModMenuManager.mods
				orderby !m.HasAdvancedMetadata, m.info.name, m.info.guid
				select m)
			{
				ModListItem component = Object.Instantiate<GameObject>(itemPrefab, container.transform).GetComponent<ModListItem>();
				((Object)component).name = item.info.name;
				component.Mod = item;
				component.OnModSelected += SelectMod;
			}
		}

		private void SelectMod(Mod mod)
		{
			optionListPanel.ShowListFor(mod);
			optionInfoPanel.ClearInfo();
			modInfoPanel.ShowInfoFor(mod);
		}
	}
	public class ModMenu : MonoBehaviour
	{
		public ModListPanel modListPanel;

		private void Awake()
		{
			ModMenuManager.Init();
		}
	}
	public class OptionInfoPanel : MonoBehaviour
	{
		public TextMeshProUGUI nameText;

		public TextMeshProUGUI categoryText;

		public TextMeshProUGUI descriptionText;

		public Button resetButton;

		private void Awake()
		{
			ClearInfo();
		}

		public void PlayClickSound()
		{
			PauseManager.Instance.PlayMenuClip(PauseManager.Instance.releaseMenuClip);
		}

		public void ShowInfoFor(Option option)
		{
			ClearInfo();
			((TMP_Text)nameText).text = option.Name;
			((TMP_Text)descriptionText).text = option.Description;
			string section = option.Section;
			string name = option.BaseEntry.SettingType.Name;
			((TMP_Text)categoryText).text = section + " | " + name + " | Defaults to " + option.BaseEntry.DefaultValue;
			if (option.AcceptableValues != null)
			{
				TextMeshProUGUI obj = categoryText;
				((TMP_Text)obj).text = ((TMP_Text)obj).text + " | " + option.AcceptableValues.HumanizedString();
			}
		}

		public void ShowResetButtonFor(OptionController controller)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			((Component)resetButton).gameObject.SetActive(true);
			((UnityEvent)resetButton.onClick).AddListener((UnityAction)delegate
			{
				controller.ResetToDefault();
				controller.UpdateAppearance();
			});
		}

		public void ClearInfo()
		{
			((UnityEventBase)resetButton.onClick).RemoveAllListeners();
			((Component)resetButton).gameObject.SetActive(false);
			((TMP_Text)nameText).text = "";
			((TMP_Text)categoryText).text = "";
			((TMP_Text)descriptionText).text = "";
		}
	}
	public class OptionListPanel : MonoBehaviour
	{
		public GameObject container;

		public OptionInfoPanel infoPanel;

		private Dictionary<string, GameObject[]> m_optionCache = new Dictionary<string, GameObject[]>();

		private string m_currentEnabledGuid = "";

		private GameObject m_noOptionsText;

		private GameObject m_noOptionsSadFace;

		private void Awake()
		{
			m_noOptionsText = CreateHeader("No options found");
			m_noOptionsSadFace = CreateHeader(":c");
			((Object)m_noOptionsText).name = "No options found header";
			((Object)m_noOptionsSadFace).name = "No options found sad face";
			((TMP_Text)m_noOptionsSadFace.GetComponent<TextMeshProUGUI>()).fontSize = 24f;
			m_noOptionsText.SetActive(false);
			m_noOptionsSadFace.SetActive(false);
		}

		public void ShowListFor(Mod mod)
		{
			ClearList();
			m_currentEnabledGuid = mod.info.guid;
			if (m_optionCache.TryGetValue(m_currentEnabledGuid, out var value))
			{
				GameObject[] array = value;
				foreach (GameObject obj in array)
				{
					obj.SetActive(true);
					obj.GetComponent<OptionController>()?.UpdateAppearance();
				}
				return;
			}
			List<GameObject> list = new List<GameObject>();
			if (!mod.HasAnyConfigs)
			{
				list.Add(m_noOptionsText);
				list.Add(m_noOptionsSadFace);
				m_noOptionsText.SetActive(true);
				m_noOptionsSadFace.SetActive(true);
			}
			else
			{
				string text = "";
				foreach (Option option in mod.config)
				{
					if (option.Section != text)
					{
						GameObject val = CreateHeader(option.Section);
						((Object)val).name = mod.info.name + "/" + option.Section;
						list.Add(val);
					}
					text = option.Section;
					GameObject val2 = option.InstantiateOptionObject(container.transform);
					((Object)val2).name = mod.info.name + "/" + option.Section + "/" + option.Name;
					OptionController controller = val2.GetComponent<OptionController>();
					controller.SetOption(option);
					controller.OnOptionHovered += delegate
					{
						infoPanel.ShowInfoFor(option);
						infoPanel.ShowResetButtonFor(controller);
					};
					list.Add(val2);
				}
			}
			m_optionCache[m_currentEnabledGuid] = list.ToArray();
		}

		private GameObject CreateHeader(string text)
		{
			CategoryHeader component = Object.Instantiate<GameObject>(Assets.CategoryHeader, container.transform).GetComponent<CategoryHeader>();
			component.Text = text;
			return ((Component)component).gameObject;
		}

		private void ClearList()
		{
			if (m_optionCache.TryGetValue(m_currentEnabledGuid, out var value))
			{
				GameObject[] array = value;
				for (int i = 0; i < array.Length; i++)
				{
					array[i].SetActive(false);
				}
			}
		}
	}
	public class ShowTooltip : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public string textToShow;

		public void OnPointerEnter(PointerEventData eventData)
		{
			FloatingName.Instance.nameToShow = textToShow;
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			FloatingName.Instance.nameToShow = "";
		}
	}
}
namespace ModMenu.Behaviours.OptionControllers
{
	public class AcceptableListDropdownOptionController : OptionController
	{
		public TMP_Dropdown dropdown;

		private object[] m_optionValues;

		public void OnDropdownValueChanged(int index)
		{
			base.BaseOption.BoxedValue = m_optionValues[index];
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			dropdown.SetValueWithoutNotify(Array.IndexOf(m_optionValues, base.BaseOption.BoxedValue));
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			AcceptableValueBase acceptableValues = base.BaseOption.AcceptableValues;
			Type type = ((object)acceptableValues).GetType();
			m_optionValues = ((IEnumerable)type.GetProperty("AcceptableValues").GetValue(acceptableValues)).Cast<object>().ToArray();
			dropdown.ClearOptions();
			dropdown.AddOptions(m_optionValues.Select((object v) => v.ToString()).ToList());
			UpdateAppearance();
		}
	}
	public class BoolCheckboxOptionController : ValueOptionController<BoolOption, bool>
	{
		public Toggle toggle;

		public void OnCheckboxValueChanged(bool value)
		{
			base.Option.Value = value;
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			toggle.isOn = base.Option.Value;
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}
	}
	public class ColorOptionController : ValueOptionController<ColorOption, Color>
	{
		public TMP_InputField inputField;

		public Image preview;

		public void OnInputFieldEndEdit(string value)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Color value2 = default(Color);
			if (ColorUtility.TryParseHtmlString(value, ref value2))
			{
				base.Option.Value = value2;
			}
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			inputField.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGBA(base.Option.Value).ToLower());
			((Graphic)preview).color = base.Option.Value;
		}
	}
	public class EnumDropdownOptionController : OptionController
	{
		public TMP_Dropdown dropdown;

		private Type m_enumType;

		public void OnDropdownValueChanged(int index)
		{
			base.BaseOption.BoxedValue = index;
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			m_enumType = base.BaseOption.BaseEntry.SettingType;
			dropdown.ClearOptions();
			dropdown.AddOptions(Enum.GetNames(m_enumType).ToList());
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			dropdown.SetValueWithoutNotify((int)base.BaseOption.BoxedValue);
		}
	}
	public abstract class KeybindOptionController : OptionController
	{
		public TextMeshProUGUI buttonText;

		protected bool rebinding;

		protected KeyCode[] keysToCheck;

		public void OnRebindButtonPressed()
		{
			if (!rebinding)
			{
				StartRebinding();
			}
			else
			{
				StopRebinding();
			}
			UpdateAppearance();
		}

		public override void ResetToDefault()
		{
			base.ResetToDefault();
			StopRebinding();
		}

		public override void UpdateAppearance()
		{
			if (rebinding)
			{
				((TMP_Text)buttonText).text = "Cancel";
			}
			else
			{
				((TMP_Text)buttonText).text = base.BaseOption.BoxedValue.ToString();
			}
		}

		protected abstract void UpdateRebinding();

		protected void StartRebinding()
		{
			rebinding = true;
			PauseManagerPatch.currentlyRebindingContollers.Add(this);
			UpdateAppearance();
		}

		protected void StopRebinding()
		{
			rebinding = false;
			PauseManagerPatch.currentlyRebindingContollers.Remove(this);
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		private void Awake()
		{
			keysToCheck = UnityInput.Current.SupportedKeyCodes.Except((IEnumerable<KeyCode>)(object)new KeyCode[3]
			{
				(KeyCode)323,
				default(KeyCode),
				(KeyCode)27
			}).ToArray();
		}

		private void OnDisable()
		{
			StopRebinding();
		}

		private void Update()
		{
			if (rebinding)
			{
				UpdateRebinding();
			}
		}
	}
	public class KeyboardShortcutOptionController : KeybindOptionController
	{
		protected override void UpdateRebinding()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)27))
			{
				base.BaseOption.BoxedValue = KeyboardShortcut.Empty;
				StopRebinding();
				return;
			}
			KeyCode[] array = keysToCheck;
			foreach (KeyCode val in array)
			{
				if (Input.GetKeyUp(val))
				{
					base.BaseOption.BoxedValue = (object)new KeyboardShortcut(val, ((IEnumerable<KeyCode>)keysToCheck).Where((Func<KeyCode, bool>)Input.GetKey).ToArray());
					StopRebinding();
					break;
				}
			}
		}
	}
	public class KeyCodeOptionController : KeybindOptionController
	{
		protected override void UpdateRebinding()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			if (Input.GetKeyDown((KeyCode)27))
			{
				base.BaseOption.BoxedValue = (object)(KeyCode)0;
				StopRebinding();
				return;
			}
			KeyCode[] array = keysToCheck;
			foreach (KeyCode val in array)
			{
				if (Input.GetKeyUp(val))
				{
					base.BaseOption.BoxedValue = val;
					StopRebinding();
					break;
				}
			}
		}
	}
	public class NumericInputFieldOptionController : OptionController
	{
		public TMP_InputField inputField;

		private Type m_optionType;

		private bool m_isIntegralType;

		public void OnInputFieldEndEdit(string value)
		{
			try
			{
				object obj = Convert.ChangeType(value, m_optionType);
				if (obj != null)
				{
					base.BaseOption.BoxedValue = obj;
				}
			}
			catch (Exception ex) when (ex is OverflowException || ex is FormatException || ex is InvalidCastException)
			{
			}
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			m_optionType = base.BaseOption.BaseEntry.SettingType;
			m_isIntegralType = m_optionType.IsIntegral();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			inputField.SetTextWithoutNotify(m_isIntegralType ? base.BaseOption.BoxedValue.ToString() : $"{base.BaseOption.BoxedValue:F}");
		}
	}
	public class NumericSliderOptionController : OptionController
	{
		public Slider slider;

		public TMP_InputField inputField;

		private Type m_optionType;

		private bool m_isIntegralType;

		public void OnSliderValueChanged(float value)
		{
			object obj = Convert.ChangeType(value, m_optionType);
			if (obj != null)
			{
				base.BaseOption.BoxedValue = obj;
			}
			UpdateAppearance();
		}

		public void OnInputFieldEndEdit(string value)
		{
			try
			{
				object obj = Convert.ChangeType(value, m_optionType);
				if (obj != null)
				{
					base.BaseOption.BoxedValue = obj;
				}
			}
			catch (Exception ex) when (ex is OverflowException || ex is FormatException || ex is InvalidCastException)
			{
			}
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			m_optionType = base.BaseOption.BaseEntry.SettingType;
			m_isIntegralType = m_optionType.IsIntegral();
			AcceptableValueBase acceptableValues = base.BaseOption.AcceptableValues;
			Type type = ((object)acceptableValues).GetType();
			slider.minValue = Convert.ToSingle(type.GetProperty("MinValue").GetValue(acceptableValues));
			slider.maxValue = Convert.ToSingle(type.GetProperty("MaxValue").GetValue(acceptableValues));
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			slider.SetValueWithoutNotify(Convert.ToSingle(base.BaseOption.BoxedValue));
			inputField.SetTextWithoutNotify(m_isIntegralType ? base.BaseOption.BoxedValue.ToString() : $"{base.BaseOption.BoxedValue:F}");
		}
	}
	public abstract class OptionController : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public delegate void OptionHoverHandler();

		public TextMeshProUGUI nameText;

		protected Option BaseOption { get; set; }

		public event OptionHoverHandler OnOptionHovered;

		public event OptionHoverHandler OnOptionUnhovered;

		public virtual void ResetToDefault()
		{
			BaseOption.ResetToDefault();
		}

		public void SetOption(Option option)
		{
			BaseOption = option;
			OnSetOption();
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			this.OnOptionHovered?.Invoke();
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			this.OnOptionUnhovered?.Invoke();
		}

		protected virtual void OnSetOption()
		{
			((TMP_Text)nameText).text = BaseOption.Name;
		}

		public abstract void UpdateAppearance();
	}
	public abstract class ValueOptionController<T, TValue> : OptionController where T : ValueOption<TValue>
	{
		protected T Option => base.BaseOption as T;
	}
	public class QuaternionOptionController : ValueOptionController<QuaternionOption, Quaternion>
	{
		public TMP_InputField xInputField;

		public TMP_InputField yInputField;

		public TMP_InputField zInputField;

		public TMP_InputField wInputField;

		public void OnInputFieldEndEdit(string value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			float num = base.Option.Value.x;
			float num2 = base.Option.Value.y;
			float num3 = base.Option.Value.z;
			float num4 = base.Option.Value.w;
			if (float.TryParse(xInputField.text, out var result))
			{
				num = result;
			}
			if (float.TryParse(yInputField.text, out var result2))
			{
				num2 = result2;
			}
			if (float.TryParse(zInputField.text, out var result3))
			{
				num3 = result3;
			}
			if (float.TryParse(wInputField.text, out var result4))
			{
				num4 = result4;
			}
			base.Option.Value = new Quaternion(num, num2, num3, num4);
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			//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_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_005c: 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_0084: 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)
			xInputField.SetTextWithoutNotify(base.Option.Value.x.ToString("F"));
			yInputField.SetTextWithoutNotify(base.Option.Value.y.ToString("F"));
			zInputField.SetTextWithoutNotify(base.Option.Value.z.ToString("F"));
			wInputField.SetTextWithoutNotify(base.Option.Value.w.ToString("F"));
		}
	}
	public class StringInputFieldOptionController : ValueOptionController<StringInputFieldOption, string>
	{
		public TMP_InputField inputField;

		public void OnInputFieldEndEdit(string value)
		{
			base.Option.Value = value;
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			inputField.SetTextWithoutNotify(base.Option.Value);
		}
	}
	public class Vector2OptionController : ValueOptionController<Vector2Option, Vector2>
	{
		public TMP_InputField xInputField;

		public TMP_InputField yInputField;

		public void OnInputFieldEndEdit(string value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			float num = base.Option.Value.x;
			float num2 = base.Option.Value.y;
			if (float.TryParse(xInputField.text, out var result))
			{
				num = result;
			}
			if (float.TryParse(yInputField.text, out var result2))
			{
				num2 = result2;
			}
			base.Option.Value = new Vector2(num, num2);
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			//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_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)
			xInputField.SetTextWithoutNotify(base.Option.Value.x.ToString("F"));
			yInputField.SetTextWithoutNotify(base.Option.Value.y.ToString("F"));
		}
	}
	public class Vector3OptionController : ValueOptionController<Vector3Option, Vector3>
	{
		public TMP_InputField xInputField;

		public TMP_InputField yInputField;

		public TMP_InputField zInputField;

		public void OnInputFieldEndEdit(string value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			float num = base.Option.Value.x;
			float num2 = base.Option.Value.y;
			float num3 = base.Option.Value.z;
			if (float.TryParse(xInputField.text, out var result))
			{
				num = result;
			}
			if (float.TryParse(yInputField.text, out var result2))
			{
				num2 = result2;
			}
			if (float.TryParse(zInputField.text, out var result3))
			{
				num3 = result3;
			}
			base.Option.Value = new Vector3(num, num2, num3);
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			//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_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_005c: 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)
			xInputField.SetTextWithoutNotify(base.Option.Value.x.ToString("F"));
			yInputField.SetTextWithoutNotify(base.Option.Value.y.ToString("F"));
			zInputField.SetTextWithoutNotify(base.Option.Value.z.ToString("F"));
		}
	}
	public class Vector4OptionController : ValueOptionController<Vector4Option, Vector4>
	{
		public TMP_InputField xInputField;

		public TMP_InputField yInputField;

		public TMP_InputField zInputField;

		public TMP_InputField wInputField;

		public void OnInputFieldEndEdit(string value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			float num = base.Option.Value.x;
			float num2 = base.Option.Value.y;
			float num3 = base.Option.Value.z;
			float num4 = base.Option.Value.w;
			if (float.TryParse(xInputField.text, out var result))
			{
				num = result;
			}
			if (float.TryParse(yInputField.text, out var result2))
			{
				num2 = result2;
			}
			if (float.TryParse(zInputField.text, out var result3))
			{
				num3 = result3;
			}
			if (float.TryParse(wInputField.text, out var result4))
			{
				num4 = result4;
			}
			base.Option.Value = new Vector4(num, num2, num3, num4);
			UpdateAppearance();
		}

		protected override void OnSetOption()
		{
			base.OnSetOption();
			UpdateAppearance();
		}

		public override void UpdateAppearance()
		{
			//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_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_005c: 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_0084: 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)
			xInputField.SetTextWithoutNotify(base.Option.Value.x.ToString("F"));
			yInputField.SetTextWithoutNotify(base.Option.Value.y.ToString("F"));
			zInputField.SetTextWithoutNotify(base.Option.Value.z.ToString("F"));
			wInputField.SetTextWithoutNotify(base.Option.Value.w.ToString("F"));
		}
	}
}