Decompiled source of VohnsQualityOfLifePack v1.0.0

BepInEx/plugins/FlipMods-FasterItemDropship/FasterItemDropship.dll

Decompiled 9 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FasterItemDropship")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("Mod made by flipf17")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FasterItemDropship")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a5a250fd-b706-48b9-9be9-da360fd939dc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FasterItemDropship
{
	public static class ConfigSettings
	{
		public static ConfigEntry<int> dropshipDeliveryTime;

		public static ConfigEntry<int> dropshipMaxStayDuration;

		public static ConfigEntry<int> dropshipLeaveAfterSecondsOpenDoors;

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			dropshipDeliveryTime = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "DeliveryTime", 10, "How long it takes (in seconds) for the item dropship to arrive.");
			dropshipMaxStayDuration = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "MaxLandDuration", 40, "The max duration (in seconds) the item dropship will stay.");
			dropshipLeaveAfterSecondsOpenDoors = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FasterItemDropship", "LeaveAfterSecondsOpenDoors", 3, "How long (in seconds) the item dropship will stay for after opening its doors.");
		}
	}
	[BepInPlugin("FlipMods.FasterItemDropship", "FasterItemDropship", "1.2.1")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		public static Plugin instance;

		private void Awake()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			instance = this;
			ConfigSettings.BindConfigSettings();
			_harmony = new Harmony("FasterItemDropship");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"FasterItemDropship loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.FasterItemDropship";

		public const string PLUGIN_NAME = "FasterItemDropship";

		public const string PLUGIN_VERSION = "1.2.1";
	}
}
namespace FasterItemDropship.Patches
{
	[HarmonyPatch]
	internal class FasterItemDropshipPatcher
	{
		private static Terminal terminalScript;

		private static StartOfRound playersManager;

		private static List<int> itemsToDeliver;

		private static List<int> orderedItemsFromTerminal;

		[HarmonyPatch(typeof(ItemDropship), "Start")]
		[HarmonyPrefix]
		public static void InitializeDropship(ItemDropship __instance)
		{
			playersManager = Object.FindObjectOfType<StartOfRound>();
			terminalScript = Object.FindObjectOfType<Terminal>();
			itemsToDeliver = (List<int>)Traverse.Create((object)__instance).Field("itemsToDeliver").GetValue();
		}

		[HarmonyPatch(typeof(Terminal), "Start")]
		[HarmonyPrefix]
		public static void InitializeTerminal(Terminal __instance)
		{
			orderedItemsFromTerminal = __instance.orderedItemsFromTerminal;
		}

		[HarmonyPatch(typeof(ItemDropship), "Update")]
		[HarmonyPrefix]
		public static void DropshipUpdate(ItemDropship __instance)
		{
			if (((NetworkBehaviour)__instance).IsServer && !__instance.deliveringOrder && terminalScript.orderedItemsFromTerminal.Count > 0 && !playersManager.shipHasLanded)
			{
				__instance.shipTimer += Time.deltaTime;
			}
		}

		[HarmonyPatch(typeof(ItemDropship), "Update")]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4)
				{
					if ((float)list[i].operand == 20f)
					{
						list[i].operand = (float)ConfigSettings.dropshipMaxStayDuration.Value;
					}
					else if ((float)list[i].operand == 40f)
					{
						list[i].operand = (float)(ConfigSettings.dropshipMaxStayDuration.Value + ConfigSettings.dropshipDeliveryTime.Value);
					}
					else if ((float)list[i].operand == 30f)
					{
						list[i].operand = (float)ConfigSettings.dropshipMaxStayDuration.Value;
						break;
					}
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(ItemDropship), "OpenShipDoorsOnServer")]
		[HarmonyPostfix]
		public static void OnOpenShipDoors(ItemDropship __instance)
		{
			if (((NetworkBehaviour)__instance).IsServer)
			{
				__instance.shipTimer = Mathf.Max(__instance.shipTimer, (float)(ConfigSettings.dropshipMaxStayDuration.Value - ConfigSettings.dropshipLeaveAfterSecondsOpenDoors.Value));
			}
		}

		[HarmonyPatch(typeof(ItemDropship), "ShipLandedAnimationEvent")]
		[HarmonyPrefix]
		public static void AddLateItemsServer(ItemDropship __instance)
		{
			if (((NetworkBehaviour)__instance).IsServer && !__instance.shipLanded && !__instance.shipDoorsOpened)
			{
				while (orderedItemsFromTerminal.Count > 0 && itemsToDeliver.Count < 12)
				{
					itemsToDeliver.Add(orderedItemsFromTerminal[0]);
					orderedItemsFromTerminal.RemoveAt(0);
				}
			}
		}
	}
}

BepInEx/plugins/FlipMods-LetMeLookDown/LetMeLookDown.dll

Decompiled 9 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LetMeLookDown")]
[assembly: AssemblyDescription("Mod made by flipf17")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LetMeLookDown")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a9c88d54-8f01-44a7-be0d-bd61d38aadcb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LetMeLookDown
{
	[BepInPlugin("FlipMods.LetMeLookDown", "LetMeLookDown", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		private static Plugin instance;

		public static float maxAngle = 80f;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			_harmony = new Harmony("LetMeLookDown");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"LetMeLookDown mod loaded");
			instance = this;
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.LetMeLookDown";

		public const string PLUGIN_NAME = "LetMeLookDown";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}
namespace LetMeLookDown.Patches
{
	[HarmonyPatch]
	internal class AdjustSmoothLookingPatcher
	{
		[HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f)
				{
					list[i].operand = Plugin.maxAngle;
					break;
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch]
	internal class AdjustNormalLookingPatcher
	{
		[HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 60f)
				{
					list[i].operand = Plugin.maxAngle;
					break;
				}
			}
			return list.AsEnumerable();
		}
	}
}

BepInEx/plugins/tinyhoot-ShipLoot/ShipLoot/ShipLoot.dll

Decompiled 9 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ShipLoot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ShipLoot")]
[assembly: AssemblyCopyright("Copyright © tinyhoot 2023")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ShipLoot
{
	[BepInPlugin("com.github.tinyhoot.ShipLoot", "ShipLoot", "1.0")]
	internal class ShipLoot : BaseUnityPlugin
	{
		public const string GUID = "com.github.tinyhoot.ShipLoot";

		public const string NAME = "ShipLoot";

		public const string VERSION = "1.0";

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			new Harmony("com.github.tinyhoot.ShipLoot").PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace ShipLoot.Patches
{
	[HarmonyPatch]
	internal class HudManagerPatcher
	{
		private static GameObject _totalCounter;

		private static TextMeshProUGUI _textMesh;

		private static float _displayTimeLeft;

		private const float DisplayTime = 5f;

		[HarmonyPrefix]
		[HarmonyPatch(typeof(HUDManager), "PingScan_performed")]
		private static void OnScan(HUDManager __instance, CallbackContext context)
		{
			if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed && __instance.CanPlayerScan() && !(__instance.playerPingingScan > -0.5f) && (StartOfRound.Instance.inShipPhase || GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom))
			{
				if (!Object.op_Implicit((Object)(object)_totalCounter))
				{
					CopyValueCounter();
				}
				float num = CalculateLootValue();
				((TMP_Text)_textMesh).text = $"SHIP: ${num:F0}";
				_displayTimeLeft = 5f;
				if (!_totalCounter.activeSelf)
				{
					((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ShipLootCoroutine());
				}
			}
		}

		private static IEnumerator ShipLootCoroutine()
		{
			_totalCounter.SetActive(true);
			while (_displayTimeLeft > 0f)
			{
				float displayTimeLeft = _displayTimeLeft;
				_displayTimeLeft = 0f;
				yield return (object)new WaitForSeconds(displayTimeLeft);
			}
			_totalCounter.SetActive(false);
		}

		private static float CalculateLootValue()
		{
			List<GrabbableObject> list = (from obj in GameObject.Find("/Environment/HangarShip").GetComponentsInChildren<GrabbableObject>()
				where ((Object)obj).name != "ClipboardManual" && ((Object)obj).name != "StickyNoteItem"
				select obj).ToList();
			ShipLoot.Log.LogDebug((object)"Calculating total ship scrap value.");
			CollectionExtensions.Do<GrabbableObject>((IEnumerable<GrabbableObject>)list, (Action<GrabbableObject>)delegate(GrabbableObject scrap)
			{
				ShipLoot.Log.LogDebug((object)$"{((Object)scrap).name} - ${scrap.scrapValue}");
			});
			return list.Sum((GrabbableObject scrap) => scrap.scrapValue);
		}

		private static void CopyValueCounter()
		{
			//IL_0066: 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)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/Systems/UI/Canvas/IngamePlayerHUD/BottomMiddle/ValueCounter");
			if (!Object.op_Implicit((Object)(object)val))
			{
				ShipLoot.Log.LogError((object)"Failed to find ValueCounter object to copy!");
			}
			_totalCounter = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent, false);
			_totalCounter.transform.Translate(0f, 1f, 0f);
			Vector3 localPosition = _totalCounter.transform.localPosition;
			_totalCounter.transform.localPosition = new Vector3(localPosition.x + 50f, -50f, localPosition.z);
			_textMesh = _totalCounter.GetComponentInChildren<TextMeshProUGUI>();
		}
	}
}

BepInEx/plugins/Rozebud-FOV_Adjust/FovAdjust.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FovAdjust")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FovAdjust")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dfb6681a-9f25-4737-a7fe-10b3c23f65b3")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FovAdjust;

[BepInPlugin("Rozebud.FovAdjust", "FOV Adjust", "1.1.1")]
public class FovAdjustBase : BaseUnityPlugin
{
	private const string modGUID = "Rozebud.FovAdjust";

	private const string modName = "FOV Adjust";

	private const string modVer = "1.1.1";

	private readonly Harmony harmony = new Harmony("Rozebud.FovAdjust");

	private static FovAdjustBase Instance;

	public static ManualLogSource log;

	public static ConfigEntry<float> configFov;

	public static ConfigEntry<bool> configHideVisor;

	public static bool inDebugMode;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		log = Logger.CreateLogSource("Rozebud.FovAdjust");
		log.LogInfo((object)"Starting.");
		configFov = ((BaseUnityPlugin)this).Config.Bind<float>("General", "fov", 66f, "Change the field of view of the camera. Clamped from 66 to 130 for my sanity. Also keep in mind that this is vertical FOV.");
		configHideVisor = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "hideVisor", false, "Changes whether the first person visor is visible.");
		PlayerControllerBPatches.newTargetFovBase = Mathf.Clamp(configFov.Value, 66f, 130f);
		PlayerControllerBPatches.hideVisor = configHideVisor.Value;
		log.LogInfo((object)"Configs DONE!");
		PlayerControllerBPatches.calculateVisorStuff();
		harmony.PatchAll(typeof(PlayerControllerBPatches));
		harmony.PatchAll(typeof(HUDManagerPatches));
		log.LogInfo((object)"All FOV Adjust patches have loaded successfully.");
	}
}
public class PlayerControllerBPatches
{
	public static float newTargetFovBase = 66f;

	private static float prefixCamFov = 0f;

	public static bool hideVisor = false;

	private static Vector3 visorScale;

	public static Vector3 visorScaleBottom = new Vector3(0.68f, 0.8f, 0.95f);

	public static Vector3 visorScaleTop = new Vector3(0.68f, 0.35f, 0.99f);

	public static float linToSinLerp = 0.6f;

	public static float visorScaleTopRefFOV = 130f;

	[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
	[HarmonyPostfix]
	private static void Awake_Postfix(PlayerControllerB __instance)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		if (!filterPlayerControllers(__instance))
		{
			__instance.localVisor.localScale = visorScale;
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyPrefix]
	private static void Update_Prefix(PlayerControllerB __instance)
	{
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		if (filterPlayerControllers(__instance))
		{
			return;
		}
		prefixCamFov = __instance.gameplayCamera.fieldOfView;
		if (FovAdjustBase.inDebugMode)
		{
			if (((ButtonControl)Keyboard.current.minusKey).wasPressedThisFrame)
			{
				visorScale.x -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.equalsKey).wasPressedThisFrame)
			{
				visorScale.x += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			if (((ButtonControl)Keyboard.current.leftBracketKey).wasPressedThisFrame)
			{
				visorScale.y -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.rightBracketKey).wasPressedThisFrame)
			{
				visorScale.y += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			if (((ButtonControl)Keyboard.current.semicolonKey).wasPressedThisFrame)
			{
				visorScale.z -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.quoteKey).wasPressedThisFrame)
			{
				visorScale.z += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
		}
		if (__instance.localVisor.localScale != visorScale)
		{
			__instance.localVisor.localScale = visorScale;
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyPostfix]
	private static void Update_Postfix(PlayerControllerB __instance)
	{
		if (!filterPlayerControllers(__instance))
		{
			float num = newTargetFovBase;
			if (__instance.inTerminalMenu)
			{
				num = 60f;
			}
			else if (__instance.IsInspectingItem)
			{
				num = 46f;
			}
			else if (__instance.isSprinting)
			{
				num *= 1.03f;
			}
			__instance.gameplayCamera.fieldOfView = Mathf.Lerp(prefixCamFov, num, 6f * Time.deltaTime);
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
	[HarmonyPostfix]
	private static void LateUpdate_Postfix(PlayerControllerB __instance)
	{
		//IL_0033: 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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: 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)
		if (!filterPlayerControllers(__instance) && (newTargetFovBase > 66f || FovAdjustBase.inDebugMode))
		{
			__instance.localVisor.position = __instance.localVisor.position + __instance.localVisor.rotation * new Vector3(0f, 0f, -0.06f);
		}
	}

	private static float easeOutSine(float x)
	{
		return Mathf.Sin(x * (float)Math.PI / 2f);
	}

	public static void calculateVisorStuff()
	{
		//IL_001a: 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_0093: 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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		if (hideVisor)
		{
			visorScale = new Vector3(0f, 0f, 0f);
		}
		else if (newTargetFovBase > 66f || FovAdjustBase.inDebugMode)
		{
			float num = (newTargetFovBase - 66f) / (visorScaleTopRefFOV - 66f);
			num = Mathf.Lerp(num, easeOutSine(num), linToSinLerp);
			visorScale = Vector3.LerpUnclamped(visorScaleBottom, visorScaleTop, num);
		}
		else
		{
			visorScale = new Vector3(0.36f, 0.49f, 0.49f);
		}
	}

	private static bool filterPlayerControllers(PlayerControllerB player)
	{
		return !((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || (((NetworkBehaviour)player).IsServer && !player.isHostPlayerObject && !player.isTestingPlayer);
	}
}
public class HUDManagerPatches
{
	[HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")]
	[HarmonyPrefix]
	public static bool SubmitChat_performed_Prefix(HUDManager __instance)
	{
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: 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_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		string text = __instance.chatTextField.text;
		if (text.StartsWith("/fov"))
		{
			string[] array = text.Split(new char[1] { ' ' });
			if (array.Length > 1 && float.TryParse(array[1], out var result))
			{
				result = Mathf.Clamp(result, 66f, 130f);
				PlayerControllerBPatches.newTargetFovBase = result;
				if (!FovAdjustBase.inDebugMode)
				{
					PlayerControllerBPatches.calculateVisorStuff();
				}
			}
		}
		else if (text.StartsWith("/toggleVisor"))
		{
			PlayerControllerBPatches.hideVisor = !PlayerControllerBPatches.hideVisor;
			PlayerControllerBPatches.calculateVisorStuff();
		}
		else if (text.StartsWith("/recalcVisor") && FovAdjustBase.inDebugMode)
		{
			PlayerControllerBPatches.calculateVisorStuff();
		}
		else if (text.StartsWith("/setScaleBottom") && FovAdjustBase.inDebugMode)
		{
			string[] array2 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleBottom = new Vector3(float.Parse(array2[1]), float.Parse(array2[2]), float.Parse(array2[3]));
		}
		else if (text.StartsWith("/setScaleTop") && FovAdjustBase.inDebugMode)
		{
			string[] array3 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleTop = new Vector3(float.Parse(array3[1]), float.Parse(array3[2]), float.Parse(array3[3]));
		}
		else if (text.StartsWith("/setSinAmount") && FovAdjustBase.inDebugMode)
		{
			string[] array4 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.linToSinLerp = float.Parse(array4[1]);
		}
		else if (text.StartsWith("/setTopRef") && FovAdjustBase.inDebugMode)
		{
			string[] array5 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleTopRefFOV = float.Parse(array5[1]);
		}
		else
		{
			if (!text.StartsWith("/gimmeMyValues") || !FovAdjustBase.inDebugMode)
			{
				return true;
			}
			ManualLogSource log = FovAdjustBase.log;
			Vector3 val = PlayerControllerBPatches.visorScaleBottom;
			log.LogMessage((object)("visorScaleBottom: " + ((object)(Vector3)(ref val)).ToString()));
			ManualLogSource log2 = FovAdjustBase.log;
			val = PlayerControllerBPatches.visorScaleTop;
			log2.LogMessage((object)("visorScaleTop: " + ((object)(Vector3)(ref val)).ToString()));
			FovAdjustBase.log.LogMessage((object)("linToSinLerp: " + PlayerControllerBPatches.linToSinLerp));
			FovAdjustBase.log.LogMessage((object)("visorScaleTopRefFOV: " + PlayerControllerBPatches.visorScaleTopRefFOV));
		}
		__instance.localPlayer = GameNetworkManager.Instance.localPlayerController;
		__instance.localPlayer.isTypingChat = false;
		__instance.chatTextField.text = "";
		EventSystem.current.SetSelectedGameObject((GameObject)null);
		((Behaviour)__instance.typingIndicator).enabled = false;
		return false;
	}
}

BepInEx/plugins/Renegades-FlashlightToggle/FlashlightToggle.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Control")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f52c854f4eaa270088fff99ac87504ddad49aa16")]
[assembly: AssemblyProduct("Control")]
[assembly: AssemblyTitle("Control")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 Control
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Control";

		public const string PLUGIN_NAME = "Control";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace Flashlight
{
	public class FlashButton : LcInputActions
	{
		[InputAction("<Keyboard>/f", Name = "Flashlight")]
		public InputAction FlashKey { get; set; }
	}
	[BepInPlugin("rr.Flashlight", "Flashlight", "1.5.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource logSource;

		internal static FlashButton InputActionInstance = new FlashButton();

		private Harmony _harmony = new Harmony("Flashlight");

		private void Awake()
		{
			_harmony.PatchAll(typeof(Plugin));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"------Flashlight done.------");
			logSource = ((BaseUnityPlugin)this).Logger;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")]
		[HarmonyPostfix]
		public static void ClearFlashlight(PlayerControllerB __instance)
		{
			__instance.pocketedFlashlight = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		public static void ReadInput(PlayerControllerB __instance)
		{
			if (((!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || (((NetworkBehaviour)__instance).IsServer && !__instance.isHostPlayerObject)) && !__instance.isTestingPlayer) || __instance.inTerminalMenu || __instance.isTypingChat || !Application.isFocused)
			{
				return;
			}
			if (__instance.currentlyHeldObjectServer is FlashlightItem && (Object)(object)__instance.currentlyHeldObjectServer != (Object)(object)__instance.pocketedFlashlight)
			{
				__instance.pocketedFlashlight = __instance.currentlyHeldObjectServer;
			}
			if ((Object)(object)__instance.pocketedFlashlight == (Object)null || !InputActionInstance.FlashKey.triggered || !(__instance.pocketedFlashlight is FlashlightItem) || !__instance.pocketedFlashlight.isHeld)
			{
				return;
			}
			try
			{
				__instance.pocketedFlashlight.UseItemOnClient(true);
				if (!(__instance.currentlyHeldObjectServer is FlashlightItem))
				{
					GrabbableObject pocketedFlashlight = __instance.pocketedFlashlight;
					((Behaviour)((FlashlightItem)((pocketedFlashlight is FlashlightItem) ? pocketedFlashlight : null)).flashlightBulbGlow).enabled = false;
					GrabbableObject pocketedFlashlight2 = __instance.pocketedFlashlight;
					((Behaviour)((FlashlightItem)((pocketedFlashlight2 is FlashlightItem) ? pocketedFlashlight2 : null)).flashlightBulb).enabled = false;
					GrabbableObject pocketedFlashlight3 = __instance.pocketedFlashlight;
					if (((pocketedFlashlight3 is FlashlightItem) ? pocketedFlashlight3 : null).isBeingUsed)
					{
						((Behaviour)__instance.helmetLight).enabled = true;
						GrabbableObject pocketedFlashlight4 = __instance.pocketedFlashlight;
						((FlashlightItem)((pocketedFlashlight4 is FlashlightItem) ? pocketedFlashlight4 : null)).usingPlayerHelmetLight = true;
						GrabbableObject pocketedFlashlight5 = __instance.pocketedFlashlight;
						((FlashlightItem)((pocketedFlashlight5 is FlashlightItem) ? pocketedFlashlight5 : null)).PocketFlashlightServerRpc(true);
					}
					else
					{
						((Behaviour)__instance.helmetLight).enabled = false;
						GrabbableObject pocketedFlashlight6 = __instance.pocketedFlashlight;
						((FlashlightItem)((pocketedFlashlight6 is FlashlightItem) ? pocketedFlashlight6 : null)).usingPlayerHelmetLight = false;
						GrabbableObject pocketedFlashlight7 = __instance.pocketedFlashlight;
						((FlashlightItem)((pocketedFlashlight7 is FlashlightItem) ? pocketedFlashlight7 : null)).PocketFlashlightServerRpc(false);
					}
				}
			}
			catch
			{
			}
		}
	}
}

BepInEx/plugins/Jamil-Corporate_Restructure/CorporateRestructure.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using CorporateRestructure.Component;
using CorporateRestructure.Patch;
using GameNetcodeStuff;
using HarmonyLib;
using TMPro;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CorporateRestructure")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CorporateRestructure")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("91760104-3647-46D9-988A-6D5B72EA80C6")]
[assembly: AssemblyFileVersion("1.0.6")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.6.0")]
namespace CorporateRestructure
{
	[BepInPlugin("jamil.corporate_restructure", "Corporate Restructure", "1.0.6")]
	public class CorporateRestructure : BaseUnityPlugin
	{
		private readonly Harmony _harmony = new Harmony("jamil.corporate_restructure");

		public static ConfigFile config;

		public static CorporateRestructure Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Corporate Restructure -> loading");
				Instance = this;
				config = ((BaseUnityPlugin)this).Config;
				CorporateConfig.Initialize();
				Instance.Patch();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Corporate Restructure -> complete");
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Corporate Restructure -> Awoke a second time?");
			}
		}

		private void Patch()
		{
			Instance._harmony.PatchAll(typeof(MonitorPatch));
			Instance._harmony.PatchAll(typeof(WeatherPatch));
		}
	}
	public class CorporateConfig
	{
		public const string Guid = "jamil.corporate_restructure";

		public const string Name = "Corporate Restructure";

		public const string Version = "1.0.6";

		public static ConfigEntry<bool> HideWeather { get; private set; }

		public static void Initialize()
		{
			HideWeather = CorporateRestructure.config.Bind<bool>("General", "HideWeather", false, "Disables Weather from the navigation screen, and Terminal");
		}
	}
}
namespace CorporateRestructure.Patch
{
	internal class DevPatch
	{
	}
	internal class MonitorPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		private static void Initialize()
		{
			InitializeMonitorCluster();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "ReviveDeadPlayers")]
		private static void PlayerHasRevivedServerRpc()
		{
			LootMonitor.UpdateMonitor();
			CreditMonitor.UpdateMonitor();
			DayMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(HUDManager), "ApplyPenalty")]
		private static void ApplyPenalty()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(DepositItemsDesk), "SellAndDisplayItemProfits")]
		private static void SellLoot()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TimeOfDay), "SyncNewProfitQuotaClientRpc")]
		private static void OvertimeBonus()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesClientRpc")]
		private static void RefreshLootForClientOnStart()
		{
			LootMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		private static void OnPlayerConenct()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TimeOfDay), "MoveTimeOfDay")]
		private static void RefreshClock()
		{
			TimeMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")]
		private static void RefreshLootOnPickupClient(bool grabValidated, NetworkObjectReference grabbedObject)
		{
			NetworkObject val = default(NetworkObject);
			if (((NetworkObjectReference)(ref grabbedObject)).TryGet(ref val, (NetworkManager)null))
			{
				GrabbableObject componentInChildren = ((Component)val).gameObject.GetComponentInChildren<GrabbableObject>();
				if (componentInChildren.isInShipRoom | componentInChildren.isInElevator)
				{
					LootMonitor.UpdateMonitor();
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "ThrowObjectClientRpc")]
		private static void RefreshLootOnThrowClient(bool droppedInElevator, bool droppedInShipRoom, Vector3 targetFloorPosition, NetworkObjectReference grabbedObject)
		{
			if (droppedInShipRoom || droppedInElevator)
			{
				LootMonitor.UpdateMonitor();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "ChangeLevelClientRpc")]
		private static void SwitchPlanets()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Terminal), "SyncGroupCreditsClientRpc")]
		private static void RefreshMoney()
		{
			CreditMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "EndOfGameClientRpc")]
		private static void RefreshDay()
		{
			DayMonitor.UpdateMonitor();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "StartGame")]
		private static void StartGame()
		{
			DayMonitor.UpdateMonitor();
		}

		private static void InitializeMonitorCluster()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Expected O, but got Unknown
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Expected O, but got Unknown
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: 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)
			GameObject val = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)/MainContainer" ?? "");
			GameObject val2 = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)/MainContainer" + "/HeaderText");
			Object.Destroy((Object)(object)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)/MainContainer" + "/BG"));
			GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)/MainContainer" + "/HeaderText (1)");
			Object.Destroy((Object)(object)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)/MainContainer" + "/BG (1)"));
			GameObject val3 = new GameObject("lootMonitor");
			val3.transform.parent = val.transform;
			val3.transform.position = val.transform.position;
			val3.transform.localPosition = val.transform.localPosition;
			val3.transform.localScale = Vector3.one;
			val3.transform.rotation = Quaternion.Euler(Vector3.zero);
			GameObject obj = Object.Instantiate<GameObject>(val2, val3.transform);
			((Object)obj).name = "lootMonitorText";
			obj.transform.localPosition = new Vector3(-95f, 450f, 220f);
			obj.transform.rotation = Quaternion.Euler(new Vector3(-20f, 90f, 0f));
			obj.AddComponent<LootMonitor>();
			GameObject val4 = new GameObject("timeMonitor");
			val4.transform.parent = val.transform;
			val4.transform.position = val.transform.position;
			val4.transform.localPosition = val.transform.localPosition;
			val4.transform.localScale = Vector3.one;
			val4.transform.rotation = Quaternion.Euler(Vector3.zero);
			GameObject obj2 = Object.Instantiate<GameObject>(val2, val4.transform);
			((Object)obj2).name = "timeMonitorText";
			obj2.transform.localPosition = new Vector3(-95f, 450f, -250f);
			obj2.transform.rotation = Quaternion.Euler(new Vector3(-20f, 90f, 0f));
			obj2.AddComponent<TimeMonitor>();
			GameObject val5 = new GameObject("creditMonitor");
			val5.transform.parent = val.transform;
			val5.transform.position = val.transform.position;
			val5.transform.localPosition = val.transform.localPosition;
			val5.transform.localScale = Vector3.one;
			val5.transform.rotation = Quaternion.Euler(Vector3.zero);
			GameObject obj3 = Object.Instantiate<GameObject>(val2, val5.transform);
			((Object)obj3).name = "creditMonitorText";
			obj3.transform.localPosition = new Vector3(-198f, 450f, -750f);
			obj3.transform.rotation = Quaternion.Euler(new Vector3(-20f, 117f, 0f));
			obj3.AddComponent<CreditMonitor>();
			GameObject val6 = new GameObject("dayMonitor");
			val6.transform.parent = val.transform;
			val6.transform.position = val.transform.position;
			val6.transform.localPosition = val.transform.localPosition;
			val6.transform.localScale = Vector3.one;
			val6.transform.rotation = Quaternion.Euler(Vector3.zero);
			GameObject obj4 = Object.Instantiate<GameObject>(val2, val6.transform);
			((Object)obj4).name = "dayMonitorText";
			obj4.transform.localPosition = new Vector3(-413f, 450f, -1185f);
			obj4.transform.rotation = Quaternion.Euler(new Vector3(-21f, 117f, 0f));
			obj4.AddComponent<DayMonitor>();
		}
	}
	internal class WeatherPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "SetMapScreenInfoToCurrentLevel")]
		private static void ColorWeather(ref TextMeshProUGUI ___screenLevelDescription, ref SelectableLevel ___currentLevel)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("Orbiting: " + ___currentLevel.PlanetName + "\n");
			stringBuilder.Append("Weather: " + FormatWeather(___currentLevel.currentWeather) + "\n");
			stringBuilder.Append(___currentLevel.LevelDescription ?? "");
			((TMP_Text)___screenLevelDescription).text = stringBuilder.ToString();
		}

		private static string FormatWeather(LevelWeatherType currentWeather)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected I4, but got Unknown
			string text = "FFFFFF";
			if (CorporateConfig.HideWeather.Value)
			{
				return "<color=#" + text + ">UNKNOWN</color>";
			}
			switch (currentWeather - -1)
			{
			case 0:
			case 1:
				text = "69FF6B";
				break;
			case 2:
			case 4:
				text = "FFDC00";
				break;
			case 3:
			case 5:
				text = "FF9300";
				break;
			case 6:
				text = "FF0000";
				break;
			}
			return "<color=#" + text + ">" + ((object)(LevelWeatherType)(ref currentWeather)).ToString() + "</color>";
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Terminal), "TextPostProcess")]
		private static string HideWeatherConditions(string __result)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (CorporateConfig.HideWeather.Value)
			{
				foreach (LevelWeatherType value in Enum.GetValues(typeof(LevelWeatherType)))
				{
					LevelWeatherType val = value;
					__result = __result.Replace("(" + ((object)(LevelWeatherType)(ref val)).ToString() + ")", "");
				}
			}
			return __result;
		}
	}
}
namespace CorporateRestructure.Component
{
	public class DayMonitor : MonoBehaviour
	{
		private static StartOfRound _startOfRound;

		private static TextMeshProUGUI _textMesh;

		private static EndOfGameStats _stats;

		public void Start()
		{
			_startOfRound = StartOfRound.Instance;
			_textMesh = ((Component)this).GetComponent<TextMeshProUGUI>();
			_stats = _startOfRound.gameStats;
			if (!((NetworkBehaviour)_startOfRound).IsHost)
			{
				((TMP_Text)_textMesh).text = "DAY:\n?";
			}
			else
			{
				UpdateMonitor();
			}
		}

		public static void UpdateMonitor()
		{
			((TMP_Text)_textMesh).text = $"DAY:\n{_stats.daysSpent}";
		}
	}
	public class LootMonitor : MonoBehaviour
	{
		private static LootMonitor _lootMonitor;

		private static TextMeshProUGUI _textMesh;

		private static GameObject _ship;

		public void Start()
		{
			_lootMonitor = this;
			_textMesh = ((Component)this).GetComponent<TextMeshProUGUI>();
			((TMP_Text)_textMesh).text = "LOOT:\n$NaN";
			_ship = GameObject.Find("/Environment/HangarShip");
			UpdateMonitor();
		}

		public static void UpdateMonitor()
		{
			float num = Calculate();
			((TMP_Text)_textMesh).text = $"LOOT:\n${num}";
		}

		private static float Calculate()
		{
			return (from x in _ship.GetComponentsInChildren<GrabbableObject>()
				where x.itemProperties.isScrap && !x.isPocketed && !x.isHeld
				select x).Sum((GrabbableObject x) => x.scrapValue);
		}
	}
	public class CreditMonitor : MonoBehaviour
	{
		private static Terminal _terminal;

		private static TextMeshProUGUI _textMesh;

		public void Start()
		{
			_terminal = Object.FindObjectOfType<Terminal>();
			_textMesh = ((Component)this).GetComponent<TextMeshProUGUI>();
			UpdateMonitor();
		}

		public static void UpdateMonitor()
		{
			((TMP_Text)_textMesh).text = $"CREDITS:\n${_terminal.groupCredits}";
		}
	}
	public class TimeMonitor : MonoBehaviour
	{
		private static TextMeshProUGUI _textMesh;

		private static TextMeshProUGUI _timeMesh;

		public void Start()
		{
			_textMesh = ((Component)this).GetComponent<TextMeshProUGUI>();
			_timeMesh = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD/ProfitQuota/Container/Box/TimeNumber").GetComponent<TextMeshProUGUI>();
			((TMP_Text)_textMesh).text = "TIME:\n7:30\nAM";
		}

		public static void UpdateMonitor()
		{
			((TMP_Text)_textMesh).text = "TIME:\n" + ((TMP_Text)_timeMesh).text;
		}
	}
}

BepInEx/plugins/AinaVT-LethalConfig/LethalConfig/LethalConfig.dll

Decompiled 9 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
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 HarmonyLib;
using LethalConfig.AutoConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalConfig.Mods;
using LethalConfig.MonoBehaviours;
using LethalConfig.MonoBehaviours.Components;
using LethalConfig.MonoBehaviours.Managers;
using LethalConfig.Settings;
using LethalConfig.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: AssemblyVersion("0.0.0.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[3641]
		{
			0, 0, 0, 2, 0, 0, 0, 49, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 65, 117, 116, 111, 67, 111,
			110, 102, 105, 103, 92, 65, 117, 116, 111, 67,
			111, 110, 102, 105, 103, 71, 101, 110, 101, 114,
			97, 116, 111, 114, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 45, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 65, 117, 116, 111, 67, 111, 110, 102, 105,
			103, 92, 67, 111, 110, 102, 105, 103, 69, 110,
			116, 114, 121, 80, 97, 116, 104, 46, 99, 115,
			0, 0, 0, 2, 0, 0, 0, 45, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 115, 92, 66, 97, 115, 101,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			53, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 92, 66,
			111, 111, 108, 67, 104, 101, 99, 107, 66, 111,
			120, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 53, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 115, 92,
			69, 110, 117, 109, 68, 114, 111, 112, 68, 111,
			119, 110, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 56, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 115,
			92, 70, 108, 111, 97, 116, 73, 110, 112, 117,
			116, 70, 105, 101, 108, 100, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 52, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 67, 111, 110, 102, 105, 103, 73,
			116, 101, 109, 115, 92, 70, 108, 111, 97, 116,
			83, 108, 105, 100, 101, 114, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 56, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 67, 111, 110, 102, 105, 103, 73,
			116, 101, 109, 115, 92, 70, 108, 111, 97, 116,
			83, 116, 101, 112, 83, 108, 105, 100, 101, 114,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			54, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 92, 71,
			101, 110, 101, 114, 105, 99, 66, 117, 116, 116,
			111, 110, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 54, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 115,
			92, 73, 110, 116, 73, 110, 112, 117, 116, 70,
			105, 101, 108, 100, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 50, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 115, 92, 73, 110, 116, 83, 108, 105, 100,
			101, 114, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 50, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 115,
			92, 79, 112, 116, 105, 111, 110, 115, 92, 66,
			97, 115, 101, 79, 112, 116, 105, 111, 110, 115,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			55, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 92, 79,
			112, 116, 105, 111, 110, 115, 92, 66, 97, 115,
			101, 82, 97, 110, 103, 101, 79, 112, 116, 105,
			111, 110, 115, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 58, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			115, 92, 79, 112, 116, 105, 111, 110, 115, 92,
			66, 111, 111, 108, 67, 104, 101, 99, 107, 66,
			111, 120, 79, 112, 116, 105, 111, 110, 115, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 54,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 92, 79, 112,
			116, 105, 111, 110, 115, 92, 67, 97, 110, 77,
			111, 100, 105, 102, 121, 82, 101, 115, 117, 108,
			116, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 58, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 115, 92,
			79, 112, 116, 105, 111, 110, 115, 92, 69, 110,
			117, 109, 68, 114, 111, 112, 68, 111, 119, 110,
			79, 112, 116, 105, 111, 110, 115, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 61, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 115, 92, 79, 112, 116, 105,
			111, 110, 115, 92, 70, 108, 111, 97, 116, 73,
			110, 112, 117, 116, 70, 105, 101, 108, 100, 79,
			112, 116, 105, 111, 110, 115, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 57, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 67, 111, 110, 102, 105, 103, 73,
			116, 101, 109, 115, 92, 79, 112, 116, 105, 111,
			110, 115, 92, 70, 108, 111, 97, 116, 83, 108,
			105, 100, 101, 114, 79, 112, 116, 105, 111, 110,
			115, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 61, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 115, 92,
			79, 112, 116, 105, 111, 110, 115, 92, 70, 108,
			111, 97, 116, 83, 116, 101, 112, 83, 108, 105,
			100, 101, 114, 79, 112, 116, 105, 111, 110, 115,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			59, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 92, 79,
			112, 116, 105, 111, 110, 115, 92, 71, 101, 110,
			101, 114, 105, 99, 66, 117, 116, 116, 111, 110,
			79, 112, 116, 105, 111, 110, 115, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 59, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 115, 92, 79, 112, 116, 105,
			111, 110, 115, 92, 73, 110, 116, 73, 110, 112,
			117, 116, 70, 105, 101, 108, 100, 79, 112, 116,
			105, 111, 110, 115, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 55, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 115, 92, 79, 112, 116, 105, 111, 110, 115,
			92, 73, 110, 116, 83, 108, 105, 100, 101, 114,
			79, 112, 116, 105, 111, 110, 115, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 60, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 115, 92, 79, 112, 116, 105,
			111, 110, 115, 92, 84, 101, 120, 116, 73, 110,
			112, 117, 116, 70, 105, 101, 108, 100, 79, 112,
			116, 105, 111, 110, 115, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 55, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 115, 92, 84, 101, 120, 116, 73, 110,
			112, 117, 116, 70, 105, 101, 108, 100, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 38, 92,
			65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 77, 97, 110,
			97, 103, 101, 114, 46, 99, 115, 0, 0, 0,
			2, 0, 0, 0, 37, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 80, 108, 117, 103, 105, 110, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 27,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 77, 111, 100, 115,
			92, 77, 111, 100, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 31, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 77, 111, 100, 115, 92, 77, 111, 100, 73,
			110, 102, 111, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 44, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			77, 111, 100, 115, 92, 84, 104, 117, 110, 100,
			101, 114, 115, 116, 111, 114, 101, 77, 97, 110,
			105, 102, 101, 115, 116, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 67, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 77, 111, 110, 111, 66, 101, 104, 97,
			118, 105, 111, 117, 114, 115, 92, 67, 111, 109,
			112, 111, 110, 101, 110, 116, 115, 92, 66, 111,
			111, 108, 67, 104, 101, 99, 107, 66, 111, 120,
			67, 111, 110, 116, 114, 111, 108, 108, 101, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			67, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 92, 67, 111, 109, 112, 111, 110, 101, 110,
			116, 115, 92, 69, 110, 117, 109, 68, 114, 111,
			112, 68, 111, 119, 110, 67, 111, 110, 116, 114,
			111, 108, 108, 101, 114, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 70, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 77, 111, 110, 111, 66, 101, 104, 97,
			118, 105, 111, 117, 114, 115, 92, 67, 111, 109,
			112, 111, 110, 101, 110, 116, 115, 92, 70, 108,
			111, 97, 116, 73, 110, 112, 117, 116, 70, 105,
			101, 108, 100, 67, 111, 110, 116, 114, 111, 108,
			108, 101, 114, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 66, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			77, 111, 110, 111, 66, 101, 104, 97, 118, 105,
			111, 117, 114, 115, 92, 67, 111, 109, 112, 111,
			110, 101, 110, 116, 115, 92, 70, 108, 111, 97,
			116, 83, 108, 105, 100, 101, 114, 67, 111, 110,
			116, 114, 111, 108, 108, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 70, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 67,
			111, 109, 112, 111, 110, 101, 110, 116, 115, 92,
			70, 108, 111, 97, 116, 83, 116, 101, 112, 83,
			108, 105, 100, 101, 114, 67, 111, 110, 116, 114,
			111, 108, 108, 101, 114, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 68, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 77, 111, 110, 111, 66, 101, 104, 97,
			118, 105, 111, 117, 114, 115, 92, 67, 111, 109,
			112, 111, 110, 101, 110, 116, 115, 92, 71, 101,
			110, 101, 114, 105, 99, 66, 117, 116, 116, 111,
			110, 67, 111, 110, 116, 114, 111, 108, 108, 101,
			114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 68, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 92, 67, 111, 109, 112, 111, 110, 101,
			110, 116, 115, 92, 73, 110, 116, 73, 110, 112,
			117, 116, 70, 105, 101, 108, 100, 67, 111, 110,
			116, 114, 111, 108, 108, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 64, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 67,
			111, 109, 112, 111, 110, 101, 110, 116, 115, 92,
			73, 110, 116, 83, 108, 105, 100, 101, 114, 67,
			111, 110, 116, 114, 111, 108, 108, 101, 114, 46,
			99, 115, 0, 0, 0, 2, 0, 0, 0, 64,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 77, 111, 110, 111,
			66, 101, 104, 97, 118, 105, 111, 117, 114, 115,
			92, 67, 111, 109, 112, 111, 110, 101, 110, 116,
			115, 92, 77, 111, 100, 67, 111, 110, 102, 105,
			103, 67, 111, 110, 116, 114, 111, 108, 108, 101,
			114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 69, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 92, 67, 111, 109, 112, 111, 110, 101,
			110, 116, 115, 92, 84, 101, 120, 116, 73, 110,
			112, 117, 116, 70, 105, 101, 108, 100, 67, 111,
			110, 116, 114, 111, 108, 108, 101, 114, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 47, 92,
			65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 77, 111, 110, 111, 66,
			101, 104, 97, 118, 105, 111, 117, 114, 115, 92,
			67, 111, 110, 102, 105, 103, 73, 110, 102, 111,
			66, 111, 120, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 44, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			77, 111, 110, 111, 66, 101, 104, 97, 118, 105,
			111, 117, 114, 115, 92, 67, 111, 110, 102, 105,
			103, 76, 105, 115, 116, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 44, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 77, 111, 110, 111, 66, 101, 104, 97,
			118, 105, 111, 117, 114, 115, 92, 67, 111, 110,
			102, 105, 103, 77, 101, 110, 117, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 56, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 67,
			111, 110, 102, 105, 103, 77, 101, 110, 117, 78,
			111, 116, 105, 102, 105, 99, 97, 116, 105, 111,
			110, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 48, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 92, 68, 101, 115, 99, 114, 105, 112,
			116, 105, 111, 110, 66, 111, 120, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 65, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 77,
			97, 110, 97, 103, 101, 114, 115, 92, 67, 111,
			110, 102, 105, 103, 77, 101, 110, 117, 65, 117,
			100, 105, 111, 77, 97, 110, 97, 103, 101, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			60, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 92, 77, 97, 110, 97, 103, 101, 114, 115,
			92, 67, 111, 110, 102, 105, 103, 77, 101, 110,
			117, 77, 97, 110, 97, 103, 101, 114, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 44, 92,
			65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 77, 111, 110, 111, 66,
			101, 104, 97, 118, 105, 111, 117, 114, 115, 92,
			77, 111, 100, 73, 110, 102, 111, 66, 111, 120,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 92, 77, 111, 100, 76, 105, 115, 116, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 45,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 77, 111, 110, 111,
			66, 101, 104, 97, 118, 105, 111, 117, 114, 115,
			92, 77, 111, 100, 76, 105, 115, 116, 73, 116,
			101, 109, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 47, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
			111, 110, 111, 66, 101, 104, 97, 118, 105, 111,
			117, 114, 115, 92, 83, 101, 99, 116, 105, 111,
			110, 72, 101, 97, 100, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 41, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 84,
			111, 111, 108, 116, 105, 112, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 47, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 77, 111, 110, 111, 66, 101, 104,
			97, 118, 105, 111, 117, 114, 115, 92, 84, 111,
			111, 108, 116, 105, 112, 83, 121, 115, 116, 101,
			109, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 48, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 92, 84, 111, 111, 108, 116, 105, 112,
			84, 114, 105, 103, 103, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 46, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 92, 86,
			101, 114, 115, 105, 111, 110, 76, 97, 98, 101,
			108, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 45, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 80, 97,
			116, 99, 104, 101, 115, 92, 77, 101, 110, 117,
			77, 97, 110, 97, 103, 101, 114, 80, 97, 116,
			99, 104, 101, 115, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 50, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 80, 97, 116, 99, 104, 101, 115, 92, 81,
			117, 105, 99, 107, 77, 101, 110, 117, 77, 97,
			110, 97, 103, 101, 114, 80, 97, 116, 99, 104,
			101, 115, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 43, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
			116, 105, 108, 115, 92, 65, 115, 115, 101, 109,
			98, 108, 121, 69, 120, 116, 101, 110, 115, 105,
			111, 110, 115, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 31, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			85, 116, 105, 108, 115, 92, 65, 115, 115, 101,
			116, 115, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 33, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
			116, 105, 108, 115, 92, 76, 111, 103, 85, 116,
			105, 108, 115, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 35, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			85, 116, 105, 108, 115, 92, 77, 101, 110, 117,
			115, 85, 116, 105, 108, 115, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 34, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 85, 116, 105, 108, 115, 92, 80,
			97, 116, 104, 85, 116, 105, 108, 115, 46, 99,
			115
		};
		result.TypesData = new byte[3298]
		{
			0, 0, 0, 0, 43, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 46, 65, 117,
			116, 111, 67, 111, 110, 102, 105, 103, 124, 65,
			117, 116, 111, 67, 111, 110, 102, 105, 103, 71,
			101, 110, 101, 114, 97, 116, 111, 114, 0, 0,
			0, 0, 58, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 65, 117, 116, 111,
			67, 111, 110, 102, 105, 103, 46, 65, 117, 116,
			111, 67, 111, 110, 102, 105, 103, 71, 101, 110,
			101, 114, 97, 116, 111, 114, 124, 65, 117, 116,
			111, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 0, 0, 0, 0, 39, 76, 101, 116, 104,
			97, 108, 67, 111, 110, 102, 105, 103, 46, 65,
			117, 116, 111, 67, 111, 110, 102, 105, 103, 124,
			67, 111, 110, 102, 105, 103, 69, 110, 116, 114,
			121, 80, 97, 116, 104, 0, 0, 0, 0, 39,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 46, 67, 111, 110, 102, 105, 103, 73,
			116, 101, 109, 115, 124, 66, 97, 115, 101, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 0,
			0, 0, 0, 44, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 124, 66,
			97, 115, 101, 86, 97, 108, 117, 101, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 0, 0,
			0, 0, 47, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 124, 66, 111,
			111, 108, 67, 104, 101, 99, 107, 66, 111, 120,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			0, 0, 0, 0, 47, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 46, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 115, 124,
			69, 110, 117, 109, 68, 114, 111, 112, 68, 111,
			119, 110, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 0, 0, 0, 0, 50, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 46,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			115, 124, 70, 108, 111, 97, 116, 73, 110, 112,
			117, 116, 70, 105, 101, 108, 100, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 0, 0, 0,
			0, 46, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 46, 67, 111, 110, 102, 105,
			103, 73, 116, 101, 109, 115, 124, 70, 108, 111,
			97, 116, 83, 108, 105, 100, 101, 114, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 0, 0,
			0, 0, 50, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 124, 70, 108,
			111, 97, 116, 83, 116, 101, 112, 83, 108, 105,
			100, 101, 114, 67, 111, 110, 102, 105, 103, 73,
			116, 101, 109, 0, 0, 0, 0, 48, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 115, 124, 71, 101, 110, 101, 114, 105, 99,
			66, 117, 116, 116, 111, 110, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 0, 0, 0, 0,
			48, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 46, 67, 111, 110, 102, 105, 103,
			73, 116, 101, 109, 115, 124, 73, 110, 116, 73,
			110, 112, 117, 116, 70, 105, 101, 108, 100, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 0,
			0, 0, 0, 44, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 115, 124, 73,
			110, 116, 83, 108, 105, 100, 101, 114, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 0, 0,
			0, 0, 44, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 46, 79, 112,
			116, 105, 111, 110, 115, 124, 66, 97, 115, 101,
			79, 112, 116, 105, 111, 110, 115, 0, 0, 0,
			0, 49, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 46, 67, 111, 110, 102, 105,
			103, 73, 116, 101, 109, 115, 46, 79, 112, 116,
			105, 111, 110, 115, 124, 66, 97, 115, 101, 82,
			97, 110, 103, 101, 79, 112, 116, 105, 111, 110,
			115, 0, 0, 0, 0, 52, 76, 101, 116, 104,
			97, 108, 67, 111, 110, 102, 105, 103, 46, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 115,
			46, 79, 112, 116, 105, 111, 110, 115, 124, 66,
			111, 111, 108, 67, 104, 101, 99, 107, 66, 111,
			120, 79, 112, 116, 105, 111, 110, 115, 0, 0,
			0, 0, 48, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 46, 79, 112,
			116, 105, 111, 110, 115, 124, 67, 97, 110, 77,
			111, 100, 105, 102, 121, 82, 101, 115, 117, 108,
			116, 0, 0, 0, 0, 52, 76, 101, 116, 104,
			97, 108, 67, 111, 110, 102, 105, 103, 46, 67,
			111, 110, 102, 105, 103, 73, 116, 101, 109, 115,
			46, 79, 112, 116, 105, 111, 110, 115, 124, 69,
			110, 117, 109, 68, 114, 111, 112, 68, 111, 119,
			110, 79, 112, 116, 105, 111, 110, 115, 0, 0,
			0, 0, 55, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 46, 79, 112,
			116, 105, 111, 110, 115, 124, 70, 108, 111, 97,
			116, 73, 110, 112, 117, 116, 70, 105, 101, 108,
			100, 79, 112, 116, 105, 111, 110, 115, 0, 0,
			0, 0, 51, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 67, 111, 110, 102,
			105, 103, 73, 116, 101, 109, 115, 46, 79, 112,
			116, 105, 111, 110, 115, 124, 70, 108, 111, 97,
			116, 83, 108, 105, 100, 101, 114, 79, 112, 116,
			105, 111, 110, 115, 0, 0, 0, 0, 55, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 115, 46, 79, 112, 116, 105, 111, 110,
			115, 124, 70, 108, 111, 97, 116, 83, 116, 101,
			112, 83, 108, 105, 100, 101, 114, 79, 112, 116,
			105, 111, 110, 115, 0, 0, 0, 0, 53, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 115, 46, 79, 112, 116, 105, 111, 110,
			115, 124, 71, 101, 110, 101, 114, 105, 99, 66,
			117, 116, 116, 111, 110, 79, 112, 116, 105, 111,
			110, 115, 0, 0, 0, 0, 53, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 46,
			67, 111, 110, 102, 105, 103, 73, 116, 101, 109,
			115, 46, 79, 112, 116, 105, 111, 110, 115, 124,
			73, 110, 116, 73, 110, 112, 117, 116, 70, 105,
			101, 108, 100, 79, 112, 116, 105, 111, 110, 115,
			0, 0, 0, 0, 49, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 46, 67, 111,
			110, 102, 105, 103, 73, 116, 101, 109, 115, 46,
			79, 112, 116, 105, 111, 110, 115, 124, 73, 110,
			116, 83, 108, 105, 100, 101, 114, 79, 112, 116,
			105, 111, 110, 115, 0, 0, 0, 0, 54, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 67, 111, 110, 102, 105, 103, 73, 116,
			101, 109, 115, 46, 79, 112, 116, 105, 111, 110,
			115, 124, 84, 101, 120, 116, 73, 110, 112, 117,
			116, 70, 105, 101, 108, 100, 79, 112, 116, 105,
			111, 110, 115, 0, 0, 0, 0, 49, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 67, 111, 110, 102, 105, 103, 73, 116, 101,
			109, 115, 124, 84, 101, 120, 116, 73, 110, 112,
			117, 116, 70, 105, 101, 108, 100, 67, 111, 110,
			102, 105, 103, 73, 116, 101, 109, 0, 0, 0,
			0, 32, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 124, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 77, 97, 110,
			97, 103, 101, 114, 0, 0, 0, 0, 23, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 124, 80, 108, 117, 103, 105, 110, 73, 110,
			102, 111, 0, 0, 0, 0, 31, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 124,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 80, 108, 117, 103, 105, 110, 0, 0,
			0, 0, 21, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 77, 111, 100, 115,
			124, 77, 111, 100, 0, 0, 0, 0, 25, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 77, 111, 100, 115, 124, 77, 111, 100,
			73, 110, 102, 111, 0, 0, 0, 0, 38, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 77, 111, 100, 115, 124, 84, 104, 117,
			110, 100, 101, 114, 115, 116, 111, 114, 101, 77,
			97, 110, 105, 102, 101, 115, 116, 0, 0, 0,
			0, 61, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 46, 77, 111, 110, 111, 66,
			101, 104, 97, 118, 105, 111, 117, 114, 115, 46,
			67, 111, 109, 112, 111, 110, 101, 110, 116, 115,
			124, 66, 111, 111, 108, 67, 104, 101, 99, 107,
			66, 111, 120, 67, 111, 110, 116, 114, 111, 108,
			108, 101, 114, 0, 0, 0, 0, 61, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 46, 67, 111, 109, 112,
			111, 110, 101, 110, 116, 115, 124, 69, 110, 117,
			109, 68, 114, 111, 112, 68, 111, 119, 110, 67,
			111, 110, 116, 114, 111, 108, 108, 101, 114, 0,
			0, 0, 0, 64, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 46, 67, 111, 109, 112, 111, 110, 101, 110,
			116, 115, 124, 70, 108, 111, 97, 116, 73, 110,
			112, 117, 116, 70, 105, 101, 108, 100, 67, 111,
			110, 116, 114, 111, 108, 108, 101, 114, 0, 0,
			0, 0, 60, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 77, 111, 110, 111,
			66, 101, 104, 97, 118, 105, 111, 117, 114, 115,
			46, 67, 111, 109, 112, 111, 110, 101, 110, 116,
			115, 124, 70, 108, 111, 97, 116, 83, 108, 105,
			100, 101, 114, 67, 111, 110, 116, 114, 111, 108,
			108, 101, 114, 0, 0, 0, 0, 64, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 46, 67, 111, 109, 112,
			111, 110, 101, 110, 116, 115, 124, 70, 108, 111,
			97, 116, 83, 116, 101, 112, 83, 108, 105, 100,
			101, 114, 67, 111, 110, 116, 114, 111, 108, 108,
			101, 114, 0, 0, 0, 0, 62, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 46,
			77, 111, 110, 111, 66, 101, 104, 97, 118, 105,
			111, 117, 114, 115, 46, 67, 111, 109, 112, 111,
			110, 101, 110, 116, 115, 124, 71, 101, 110, 101,
			114, 105, 99, 66, 117, 116, 116, 111, 110, 67,
			111, 110, 116, 114, 111, 108, 108, 101, 114, 0,
			0, 0, 0, 62, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 46, 67, 111, 109, 112, 111, 110, 101, 110,
			116, 115, 124, 73, 110, 116, 73, 110, 112, 117,
			116, 70, 105, 101, 108, 100, 67, 111, 110, 116,
			114, 111, 108, 108, 101, 114, 0, 0, 0, 0,
			58, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 46, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 46, 67,
			111, 109, 112, 111, 110, 101, 110, 116, 115, 124,
			73, 110, 116, 83, 108, 105, 100, 101, 114, 67,
			111, 110, 116, 114, 111, 108, 108, 101, 114, 1,
			0, 0, 0, 58, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 46, 67, 111, 109, 112, 111, 110, 101, 110,
			116, 115, 124, 77, 111, 100, 67, 111, 110, 102,
			105, 103, 67, 111, 110, 116, 114, 111, 108, 108,
			101, 114, 1, 0, 0, 0, 58, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 46,
			77, 111, 110, 111, 66, 101, 104, 97, 118, 105,
			111, 117, 114, 115, 46, 67, 111, 109, 112, 111,
			110, 101, 110, 116, 115, 124, 77, 111, 100, 67,
			111, 110, 102, 105, 103, 67, 111, 110, 116, 114,
			111, 108, 108, 101, 114, 0, 0, 0, 0, 63,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 46, 77, 111, 110, 111, 66, 101, 104,
			97, 118, 105, 111, 117, 114, 115, 46, 67, 111,
			109, 112, 111, 110, 101, 110, 116, 115, 124, 84,
			101, 120, 116, 73, 110, 112, 117, 116, 70, 105,
			101, 108, 100, 67, 111, 110, 116, 114, 111, 108,
			108, 101, 114, 0, 0, 0, 0, 41, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 124, 67, 111, 110, 102,
			105, 103, 73, 110, 102, 111, 66, 111, 120, 0,
			0, 0, 0, 38, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 124, 67, 111, 110, 102, 105, 103, 76, 105,
			115, 116, 0, 0, 0, 0, 38, 76, 101, 116,
			104, 97, 108, 67, 111, 110, 102, 105, 103, 46,
			77, 111, 110, 111, 66, 101, 104, 97, 118, 105,
			111, 117, 114, 115, 124, 67, 111, 110, 102, 105,
			103, 77, 101, 110, 117, 0, 0, 0, 0, 50,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 46, 77, 111, 110, 111, 66, 101, 104,
			97, 118, 105, 111, 117, 114, 115, 124, 67, 111,
			110, 102, 105, 103, 77, 101, 110, 117, 78, 111,
			116, 105, 102, 105, 99, 97, 116, 105, 111, 110,
			0, 0, 0, 0, 42, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 46, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 124, 68, 101, 115, 99, 114, 105, 112,
			116, 105, 111, 110, 66, 111, 120, 0, 0, 0,
			0, 59, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 46, 77, 111, 110, 111, 66,
			101, 104, 97, 118, 105, 111, 117, 114, 115, 46,
			77, 97, 110, 97, 103, 101, 114, 115, 124, 67,
			111, 110, 102, 105, 103, 77, 101, 110, 117, 65,
			117, 100, 105, 111, 77, 97, 110, 97, 103, 101,
			114, 0, 0, 0, 0, 54, 76, 101, 116, 104,
			97, 108, 67, 111, 110, 102, 105, 103, 46, 77,
			111, 110, 111, 66, 101, 104, 97, 118, 105, 111,
			117, 114, 115, 46, 77, 97, 110, 97, 103, 101,
			114, 115, 124, 67, 111, 110, 102, 105, 103, 77,
			101, 110, 117, 77, 97, 110, 97, 103, 101, 114,
			0, 0, 0, 0, 38, 76, 101, 116, 104, 97,
			108, 67, 111, 110, 102, 105, 103, 46, 77, 111,
			110, 111, 66, 101, 104, 97, 118, 105, 111, 117,
			114, 115, 124, 77, 111, 100, 73, 110, 102, 111,
			66, 111, 120, 0, 0, 0, 0, 35, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 124, 77, 111, 100, 76,
			105, 115, 116, 0, 0, 0, 0, 39, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 124, 77, 111, 100, 76,
			105, 115, 116, 73, 116, 101, 109, 0, 0, 0,
			0, 41, 76, 101, 116, 104, 97, 108, 67, 111,
			110, 102, 105, 103, 46, 77, 111, 110, 111, 66,
			101, 104, 97, 118, 105, 111, 117, 114, 115, 124,
			83, 101, 99, 116, 105, 111, 110, 72, 101, 97,
			100, 101, 114, 0, 0, 0, 0, 35, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 124, 84, 111, 111, 108,
			116, 105, 112, 0, 0, 0, 0, 41, 76, 101,
			116, 104, 97, 108, 67, 111, 110, 102, 105, 103,
			46, 77, 111, 110, 111, 66, 101, 104, 97, 118,
			105, 111, 117, 114, 115, 124, 84, 111, 111, 108,
			116, 105, 112, 83, 121, 115, 116, 101, 109, 0,
			0, 0, 0, 42, 76, 101, 116, 104, 97, 108,
			67, 111, 110, 102, 105, 103, 46, 77, 111, 110,
			111, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			115, 124, 84, 111, 111, 108, 116, 105, 112, 84,
			114, 105, 103, 103, 101, 114, 0, 0, 0, 0,
			40, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 46, 77, 111, 110, 111, 66, 101,
			104, 97, 118, 105, 111, 117, 114, 115, 124, 86,
			101, 114, 115, 105, 111, 110, 76, 97, 98, 101,
			108, 0, 0, 0, 0, 39, 76, 101, 116, 104,
			97, 108, 67, 111, 110, 102, 105, 103, 46, 80,
			97, 116, 99, 104, 101, 115, 124, 77, 101, 110,
			117, 77, 97, 110, 97, 103, 101, 114, 80, 97,
			116, 99, 104, 101, 115, 0, 0, 0, 0, 44,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 46, 80, 97, 116, 99, 104, 101, 115,
			124, 81, 117, 105, 99, 107, 77, 101, 110, 117,
			77, 97, 110, 97, 103, 101, 114, 80, 97, 116,
			99, 104, 101, 115, 0, 0, 0, 0, 37, 76,
			101, 116, 104, 97, 108, 67, 111, 110, 102, 105,
			103, 46, 85, 116, 105, 108, 115, 124, 65, 115,
			115, 101, 109, 98, 108, 121, 69, 120, 116, 101,
			110, 115, 105, 111, 110, 115, 0, 0, 0, 0,
			25, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 46, 85, 116, 105, 108, 115, 124,
			65, 115, 115, 101, 116, 115, 0, 0, 0, 0,
			27, 76, 101, 116, 104, 97, 108, 67, 111, 110,
			102, 105, 103, 46, 85, 116, 105, 108, 115, 124,
			76, 111, 103, 85, 116, 105, 108, 115, 0, 0,
			0, 0, 32, 76, 101, 116, 104, 97, 108, 67,
			111, 110, 102, 105, 103, 46, 83, 101, 116, 116,
			105, 110, 103, 115, 124, 77, 101, 110, 117, 115,
			85, 116, 105, 108, 115, 0, 0, 0, 0, 28,
			76, 101, 116, 104, 97, 108, 67, 111, 110, 102,
			105, 103, 46, 85, 116, 105, 108, 115, 124, 80,
			97, 116, 104, 85, 116, 105, 108, 115
		};
		result.TotalFiles = 61;
		result.TotalTypes = 65;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace LethalConfig
{
	public static class LethalConfigManager
	{
		private static bool hasGeneratedMissingConfigs = false;

		internal static Dictionary<string, Mod> Mods { get; private set; } = new Dictionary<string, Mod>();


		private static Dictionary<Mod, Assembly> ModToAssemblyMap { get; set; } = new Dictionary<Mod, Assembly>();


		internal static void AutoGenerateMissingConfigsIfNeeded()
		{
			if (hasGeneratedMissingConfigs)
			{
				return;
			}
			Mod[] second = Mods.Values.ToArray();
			IEnumerable<BaseConfigItem> existingConfigsFlat = Mods.SelectMany((KeyValuePair<string, Mod> kv) => kv.Value.configItems);
			AutoConfigGenerator.AutoConfigItem[] array = AutoConfigGenerator.AutoGenerateConfigs();
			Dictionary<Mod, IEnumerable<BaseConfigItem>> dictionary = (from c in array
				group c.ConfigItem by ModForAssembly(c.Assembly) into kv
				where kv.Key != null
				select kv).SelectMany((IGrouping<Mod, BaseConfigItem> kv) => from c in kv.Select(delegate(BaseConfigItem c)
				{
					c.Owner = kv.Key;
					return c;
				})
				where !kv.Key.entriesToSkipAutoGen.Any((ConfigEntryPath path) => path.Matches(c))
				where existingConfigsFlat.FirstOrDefault((BaseConfigItem ec) => c.IsSameConfig(ec)) == null
				group c by c.Owner).ToDictionary((IGrouping<Mod, BaseConfigItem> kv) => kv.Key, (IGrouping<Mod, BaseConfigItem> kv) => kv.Select((BaseConfigItem c) => c));
			Mod[] array2 = dictionary.Keys.Except(second).ToArray();
			Mod[] array3 = array2;
			foreach (Mod obj in array3)
			{
				obj.IsAutoGenerated = true;
				obj.modInfo.Description += "\n*This mod entry was automatically generated as it does not use LethalConfig directly.";
			}
			foreach (KeyValuePair<Mod, IEnumerable<BaseConfigItem>> item in dictionary)
			{
				Assembly valueOrDefault = ModToAssemblyMap.GetValueOrDefault(item.Key);
				if (!(valueOrDefault != null))
				{
					continue;
				}
				foreach (BaseConfigItem item2 in item.Value)
				{
					AddConfigItemForAssembly(item2, valueOrDefault);
				}
			}
			LogUtils.LogInfo($"Generated {array2.Count()} mod entries.");
			LogUtils.LogInfo($"Generated {array.Length} configs, of which {dictionary.SelectMany((KeyValuePair<Mod, IEnumerable<BaseConfigItem>> kv) => kv.Value).Count()} were missing and registered.");
			hasGeneratedMissingConfigs = true;
		}

		public static void AddConfigItem(BaseConfigItem configItem)
		{
			if (AddConfigItemForAssembly(configItem, Assembly.GetCallingAssembly()))
			{
				LogUtils.LogInfo($"Registered config \"{configItem}\"");
			}
		}

		private static bool AddConfigItemForAssembly(BaseConfigItem configItem, Assembly assembly)
		{
			Mod mod = ModForAssembly(assembly);
			if (mod == null)
			{
				LogUtils.LogWarning("Mod for assembly not found.");
				return false;
			}
			configItem.Owner = mod;
			if (mod.configItems.Where((BaseConfigItem c) => c.IsSameConfig(configItem)).Count() > 0)
			{
				LogUtils.LogWarning($"Ignoring duplicated config \"{configItem}\"");
				return false;
			}
			mod.AddConfigItem(configItem);
			return true;
		}

		private static Mod ModForAssembly(Assembly assembly)
		{
			if (assembly.TryGetModInfo(out var modInfo))
			{
				if (Mods.TryGetValue(modInfo.GUID, out var value))
				{
					return value;
				}
				Mod mod = new Mod(modInfo);
				Mods.Add(modInfo.GUID, mod);
				ModToAssemblyMap.Add(mod, assembly);
				return mod;
			}
			return null;
		}

		public static void SetModIcon(Sprite sprite)
		{
			if (!((Object)(object)sprite == (Object)null))
			{
				Mod mod = ModForAssembly(Assembly.GetCallingAssembly());
				if (mod != null)
				{
					mod.modInfo.Icon = sprite;
				}
			}
		}

		public static void SetModDescription(string description)
		{
			if (description != null)
			{
				Mod mod = ModForAssembly(Assembly.GetCallingAssembly());
				if (mod != null)
				{
					mod.modInfo.Description = description;
				}
			}
		}

		public static void SkipAutoGenFor(string configSection)
		{
			ModForAssembly(Assembly.GetCallingAssembly())?.entriesToSkipAutoGen.Add(new ConfigEntryPath(configSection, "*"));
		}

		public static void SkipAutoGenFor(ConfigEntryBase configEntryBase)
		{
			ModForAssembly(Assembly.GetCallingAssembly())?.entriesToSkipAutoGen.Add(new ConfigEntryPath(configEntryBase.Definition.Section, configEntryBase.Definition.Key));
		}

		public static void SkipAutoGen()
		{
			ModForAssembly(Assembly.GetCallingAssembly())?.entriesToSkipAutoGen.Add(new ConfigEntryPath("*", "*"));
		}
	}
	internal static class PluginInfo
	{
		public const string Guid = "ainavt.lc.lethalconfig";

		public const string Name = "LethalConfig";

		public const string Version = "1.3.4";
	}
	[BepInPlugin("ainavt.lc.lethalconfig", "LethalConfig", "1.3.4")]
	internal class LethalConfigPlugin : BaseUnityPlugin
	{
		private enum TestEnum
		{
			None,
			First,
			Second
		}

		private static LethalConfigPlugin instance;

		private static Harmony harmony;

		private void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			LogUtils.Init("ainavt.lc.lethalconfig");
			Assets.Init();
			harmony = new Harmony("ainavt.lc.lethalconfig");
			harmony.PatchAll();
			CreateExampleConfigs();
			LogUtils.LogInfo("LethalConfig loaded!");
		}

		private void CreateExampleConfigs()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			ConfigEntry<int> configEntry = ((BaseUnityPlugin)this).Config.Bind<int>("Example", "Int Slider", 30, new ConfigDescription("This is an integer slider. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			ConfigEntry<float> configEntry2 = ((BaseUnityPlugin)this).Config.Bind<float>("Example", "Float Slider", 0f, new ConfigDescription("This is a float slider. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>()));
			ConfigEntry<float> configEntry3 = ((BaseUnityPlugin)this).Config.Bind<float>("Example", "Float Step Slider", 0f, new ConfigDescription("This is a float step slider. It set values in increments. You can also type a value in the input field to the right of the slider.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>()));
			ConfigEntry<bool> configEntry4 = ((BaseUnityPlugin)this).Config.Bind<bool>("Example", "Bool Checkbox", false, new ConfigDescription("This is a bool checkbox.", (AcceptableValueBase)null, Array.Empty<object>()));
			ConfigEntry<TestEnum> configEntry5 = ((BaseUnityPlugin)this).Config.Bind<TestEnum>("Example", "Enum Dropdown", TestEnum.None, new ConfigDescription("This is a enum dropdown.", (AcceptableValueBase)null, Array.Empty<object>()));
			ConfigEntry<string> configEntry6 = ((BaseUnityPlugin)this).Config.Bind<string>("Example", "Text Input", "Example", "This is a text input field. It can have a limit of characters too.");
			ConfigEntry<int> configEntry7 = ((BaseUnityPlugin)this).Config.Bind<int>("Example", "Int Input", 50, "This is an integer input field.");
			ConfigEntry<float> configEntry8 = ((BaseUnityPlugin)this).Config.Bind<float>("Example", "Float Input", 0.5f, "This is a float input field.");
			LethalConfigManager.AddConfigItem(new IntSliderConfigItem(configEntry, requiresRestart: false));
			LethalConfigManager.AddConfigItem(new FloatSliderConfigItem(configEntry2, requiresRestart: false));
			LethalConfigManager.AddConfigItem(new FloatStepSliderConfigItem(configEntry3, new FloatStepSliderOptions
			{
				Step = 0.1f,
				RequiresRestart = false,
				Min = -1f,
				Max = 1f
			}));
			LethalConfigManager.AddConfigItem(new BoolCheckBoxConfigItem(configEntry4, requiresRestart: false));
			LethalConfigManager.AddConfigItem(new EnumDropDownConfigItem<TestEnum>(configEntry5, requiresRestart: false));
			LethalConfigManager.AddConfigItem(new TextInputFieldConfigItem(configEntry6, requiresRestart: false));
			LethalConfigManager.AddConfigItem(new GenericButtonConfigItem("Example", "Button", "This is a test button with a callback", "Open", delegate
			{
				ConfigMenuManager.Instance?.DisplayNotification("Buttons can be used to open custom menus or other things.", "OK");
			}));
			LethalConfigManager.AddConfigItem(new IntInputFieldConfigItem(configEntry7, new IntInputFieldOptions
			{
				Max = 150
			}));
			LethalConfigManager.AddConfigItem(new FloatInputFieldConfigItem(configEntry8, new FloatInputFieldOptions
			{
				Max = 2.5f
			}));
		}
	}
}
namespace LethalConfig.Settings
{
	internal static class MenusUtils
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__0_0;

			public static UnityAction <>9__0_1;

			public static Func<Button, GameObject> <>9__0_2;

			public static Func<GameObject, RectTransform> <>9__0_4;

			public static Func<RectTransform, float> <>9__0_5;

			public static Func<float, float, float> <>9__0_6;

			internal void <InjectMenu>b__0_0()
			{
				ConfigMenuManager.Instance.ShowConfigMenu();
			}

			internal void <InjectMenu>b__0_1()
			{
				ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
			}

			internal GameObject <InjectMenu>b__0_2(Button b)
			{
				return ((Component)b).gameObject;
			}

			internal RectTransform <InjectMenu>b__0_4(GameObject b)
			{
				Transform transform = b.transform;
				return (RectTransform)(object)((transform is RectTransform) ? transform : null);
			}

			internal float <InjectMenu>b__0_5(RectTransform t)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return t.anchoredPosition.y;
			}

			internal float <InjectMenu>b__0_6(float y1, float y2)
			{
				return Mathf.Abs(y2 - y1);
			}
		}

		internal static void InjectMenu(Transform parentTransform, Transform mainButtonsTransform, GameObject quitButton)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			//IL_0272: 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_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = Object.Instantiate<GameObject>(Assets.ConfigMenuManagerPrefab);
			obj.transform.SetParent(parentTransform);
			obj.transform.localPosition = Vector3.zero;
			GameObject obj2 = Object.Instantiate<GameObject>(Assets.ConfigMenuPrefab);
			obj2.transform.SetParent(parentTransform, false);
			obj2.transform.localPosition = Vector3.zero;
			obj2.transform.localScale = Vector3.one;
			obj2.transform.localRotation = Quaternion.identity;
			obj2.SetActive(false);
			GameObject obj3 = Object.Instantiate<GameObject>(Assets.ConfigMenuNotificationPrefab);
			obj3.transform.SetParent(parentTransform, false);
			obj3.transform.localPosition = Vector3.zero;
			obj3.transform.localScale = Vector3.one;
			obj3.transform.localRotation = Quaternion.identity;
			obj3.SetActive(false);
			GameObject clonedButton = Object.Instantiate<GameObject>(quitButton, mainButtonsTransform);
			((UnityEventBase)clonedButton.GetComponent<Button>().onClick).RemoveAllListeners();
			clonedButton.GetComponent<Button>().onClick = new ButtonClickedEvent();
			ButtonClickedEvent onClick = clonedButton.GetComponent<Button>().onClick;
			object obj4 = <>c.<>9__0_0;
			if (obj4 == null)
			{
				UnityAction val = delegate
				{
					ConfigMenuManager.Instance.ShowConfigMenu();
				};
				<>c.<>9__0_0 = val;
				obj4 = (object)val;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj4);
			ButtonClickedEvent onClick2 = clonedButton.GetComponent<Button>().onClick;
			object obj5 = <>c.<>9__0_1;
			if (obj5 == null)
			{
				UnityAction val2 = delegate
				{
					ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
				};
				<>c.<>9__0_1 = val2;
				obj5 = (object)val2;
			}
			((UnityEvent)onClick2).AddListener((UnityAction)obj5);
			((TMP_Text)clonedButton.GetComponentInChildren<TextMeshProUGUI>()).text = "> LethalConfig";
			IEnumerable<GameObject> source = from b in ((Component)mainButtonsTransform).GetComponentsInChildren<Button>()
				select ((Component)b).gameObject;
			IEnumerable<float> enumerable = from t in source.Where((GameObject b) => (Object)(object)b != (Object)(object)clonedButton).Select(delegate(GameObject b)
				{
					Transform transform = b.transform;
					return (RectTransform)(object)((transform is RectTransform) ? transform : null);
				})
				select t.anchoredPosition.y;
			float num = enumerable.Zip(enumerable.Skip(1), (float y1, float y2) => Mathf.Abs(y2 - y1)).Min();
			foreach (GameObject item in source.Where((GameObject g) => (Object)(object)g != (Object)(object)quitButton))
			{
				RectTransform component = item.GetComponent<RectTransform>();
				component.anchoredPosition += new Vector2(0f, num);
			}
			clonedButton.GetComponent<RectTransform>().anchoredPosition = quitButton.GetComponent<RectTransform>().anchoredPosition + new Vector2(0f, num);
		}
	}
}
namespace LethalConfig.Utils
{
	internal static class AssemblyExtensions
	{
		internal static bool TryGetModInfo(this Assembly assembly, out ModInfo modInfo)
		{
			modInfo = new ModInfo();
			BepInPlugin val = assembly.FindPluginAttribute();
			if (val == null)
			{
				return false;
			}
			modInfo.Name = val.Name;
			modInfo.GUID = val.GUID;
			modInfo.Version = val.Version.ToString();
			return true;
		}

		internal static BepInPlugin FindPluginAttribute(this Assembly assembly)
		{
			Type[] array;
			try
			{
				array = assembly.GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				array = ex.Types.Where((Type t) => t != null).ToArray();
			}
			Type[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				BepInPlugin customAttribute = ((MemberInfo)array2[i]).GetCustomAttribute<BepInPlugin>();
				if (customAttribute != null)
				{
					return customAttribute;
				}
			}
			return null;
		}
	}
	internal static class Assets
	{
		private static AssetBundle assetBundle;

		internal static GameObject ConfigMenuManagerPrefab;

		internal static GameObject ConfigMenuNotificationPrefab;

		internal static GameObject ConfigMenuPrefab;

		internal static GameObject ModListItemPrefab;

		internal static GameObject SectionHeaderPrefab;

		internal static GameObject IntSliderPrefab;

		internal static GameObject FloatSliderPrefab;

		internal static GameObject FloatStepSliderPrefab;

		internal static GameObject BoolCheckBoxPrefab;

		internal static GameObject EnumDropDownPrefab;

		internal static GameObject TextInputFieldPrefab;

		internal static GameObject IntInputFieldPrefab;

		internal static GameObject FloatInputFieldPrefab;

		internal static GameObject GenericButtonPrefab;

		internal static Sprite DefaultModIcon;

		internal static Sprite LethalConfigModIcon;

		internal static void Init()
		{
			assetBundle = AssetBundle.LoadFromFile(PathUtils.PathForResourceInAssembly("ainavt_lethalconfig"));
			if ((Object)(object)assetBundle == (Object)null)
			{
				LogUtils.LogError("Failed to load LethalConfig bundle.");
				return;
			}
			LoadAsset<GameObject>("prefabs/ConfigMenuManager.prefab", out ConfigMenuManagerPrefab);
			LoadAsset<GameObject>("prefabs/ConfigMenuNotification.prefab", out ConfigMenuNotificationPrefab);
			LoadAsset<GameObject>("prefabs/ConfigMenu.prefab", out ConfigMenuPrefab);
			LoadAsset<GameObject>("prefabs/ModListItem.prefab", out ModListItemPrefab);
			LoadAsset<GameObject>("prefabs/components/SectionHeader.prefab", out SectionHeaderPrefab);
			LoadAsset<GameObject>("prefabs/components/IntSliderItem.prefab", out IntSliderPrefab);
			LoadAsset<GameObject>("prefabs/components/FloatSliderItem.prefab", out FloatSliderPrefab);
			LoadAsset<GameObject>("prefabs/components/FloatStepSliderItem.prefab", out FloatStepSliderPrefab);
			LoadAsset<GameObject>("prefabs/components/BoolCheckBoxItem.prefab", out BoolCheckBoxPrefab);
			LoadAsset<GameObject>("prefabs/components/EnumDropDownItem.prefab", out EnumDropDownPrefab);
			LoadAsset<GameObject>("prefabs/components/TextInputFieldItem.prefab", out TextInputFieldPrefab);
			LoadAsset<GameObject>("prefabs/components/IntInputFieldItem.prefab", out IntInputFieldPrefab);
			LoadAsset<GameObject>("prefabs/components/FloatInputFieldItem.prefab", out FloatInputFieldPrefab);
			LoadAsset<GameObject>("prefabs/components/GenericButtonItem.prefab", out GenericButtonPrefab);
			LoadAsset<Sprite>("sprite/unknown-icon.png", out DefaultModIcon);
			LoadAsset<Sprite>("icon.png", out LethalConfigModIcon);
			LogUtils.LogInfo("Finished loading assets.");
		}

		private static void LoadAsset<T>(string assetName, out T asset) where T : Object
		{
			string text = "Assets/" + assetName;
			asset = assetBundle.LoadAsset<T>(text);
			if ((Object)(object)asset == (Object)null)
			{
				LogUtils.LogError("Failed to load asset (" + text + ")");
			}
		}
	}
	internal static class LogUtils
	{
		private static Dictionary<Assembly, ManualLogSource> logSources = new Dictionary<Assembly, ManualLogSource>();

		public static void Init(string pluginGuid)
		{
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			if (!logSources.ContainsKey(callingAssembly))
			{
				logSources.Add(callingAssembly, Logger.CreateLogSource(pluginGuid));
			}
		}

		public static void LogInfo(string message)
		{
			logSources[Assembly.GetCallingAssembly()].LogInfo((object)message);
		}

		public static void LogWarning(string message)
		{
			logSources[Assembly.GetCallingAssembly()].LogWarning((object)message);
		}

		public static void LogError(string message)
		{
			logSources[Assembly.GetCallingAssembly()].LogError((object)message);
		}

		public static void LogFatal(string message)
		{
			logSources[Assembly.GetCallingAssembly()].LogFatal((object)message);
		}
	}
	internal static class PathUtils
	{
		public static string PathForResourceInAssembly(string resourceName, Assembly assembly = null)
		{
			return Path.Combine(Path.GetDirectoryName((assembly ?? Assembly.GetCallingAssembly()).Location), resourceName);
		}
	}
}
namespace LethalConfig.Patches
{
	[HarmonyPatch(typeof(MenuManager))]
	internal class MenuManagerPatches
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void StartPostFix(MenuManager __instance)
		{
			((MonoBehaviour)__instance).StartCoroutine(DelayedMainMenuInjection());
		}

		private static IEnumerator DelayedMainMenuInjection()
		{
			yield return (object)new WaitForSeconds(0f);
			InjectToMainMenu();
		}

		private static void InjectToMainMenu()
		{
			LogUtils.LogInfo("Injecting mod config menu into main menu...");
			GameObject val = GameObject.Find("MenuContainer");
			Transform val2 = ((val != null) ? val.transform.Find("MainButtons") : null);
			object obj;
			if (val2 == null)
			{
				obj = null;
			}
			else
			{
				Transform obj2 = val2.Find("QuitButton");
				obj = ((obj2 != null) ? ((Component)obj2).gameObject : null);
			}
			GameObject val3 = (GameObject)obj;
			if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null) && !((Object)(object)val3 == (Object)null))
			{
				MenusUtils.InjectMenu(val.transform, val2, val3);
			}
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager))]
	internal class QuickMenuManagerPatches
	{
		[HarmonyPatch("CloseQuickMenuPanels")]
		[HarmonyPostfix]
		public static void CloseQuickMenuPanelsPostFix(QuickMenuManager __instance)
		{
			ConfigMenu componentInChildren = ((Component)__instance.menuContainer.transform).GetComponentInChildren<ConfigMenu>(true);
			ConfigMenuNotification componentInChildren2 = ((Component)__instance.menuContainer.transform).GetComponentInChildren<ConfigMenuNotification>(true);
			componentInChildren?.Close(animated: false);
			componentInChildren2?.Close(animated: false);
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void StartPostFix(QuickMenuManager __instance)
		{
			LogUtils.LogInfo("Injecting mod config menu into quick menu...");
			GameObject menuContainer = __instance.menuContainer;
			Transform val = ((menuContainer != null) ? menuContainer.transform.Find("MainButtons") : null);
			GameObject val2 = ((val != null) ? ((Component)val.Find("Quit")).gameObject : null);
			if (!((Object)(object)menuContainer == (Object)null) && !((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null))
			{
				MenusUtils.InjectMenu(menuContainer.transform, val, val2);
			}
		}
	}
}
namespace LethalConfig.MonoBehaviours
{
	internal class ConfigInfoBox : MonoBehaviour
	{
		public TextMeshProUGUI configInfoText;

		public void SetConfigInfo(string configInfo)
		{
			((TMP_Text)configInfoText).text = configInfo;
		}
	}
	internal class ConfigList : MonoBehaviour
	{
		public GameObject listContainerObject;

		public DescriptionBox descriptionBox;

		internal void LoadConfigsForMod(Mod mod)
		{
			//IL_0079: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: 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)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			ClearConfigList();
			foreach (IGrouping<string, BaseConfigItem> item in from c in mod.configItems
				group c by c.Section)
			{
				GameObject obj = Object.Instantiate<GameObject>(Assets.SectionHeaderPrefab);
				obj.GetComponent<SectionHeader>().SetSectionName(item.Key);
				obj.transform.SetParent(listContainerObject.transform);
				obj.transform.localPosition = Vector3.zero;
				obj.transform.localScale = Vector3.one;
				obj.transform.localRotation = Quaternion.identity;
				foreach (BaseConfigItem item2 in item)
				{
					GameObject val = item2.CreateGameObjectForConfig();
					ModConfigController controller = val.GetComponent<ModConfigController>();
					if (!controller.SetConfigItem(item2))
					{
						Object.DestroyImmediate((Object)(object)val.gameObject);
						return;
					}
					val.transform.SetParent(listContainerObject.transform);
					val.transform.localPosition = Vector3.zero;
					val.transform.localScale = Vector3.one;
					val.transform.localRotation = Quaternion.identity;
					controller.OnHoverEnter += delegate
					{
						descriptionBox.ShowConfigInfo(controller.GetDescription());
						ConfigMenuManager.Instance.menuAudio.PlayHoverSFX();
					};
				}
			}
		}

		private void ClearConfigList()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			foreach (Transform item in listContainerObject.transform)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
		}
	}
	internal class ConfigMenu : MonoBehaviour
	{
		public ConfigList configList;

		public Animator menuAnimator;

		private void Awake()
		{
			LethalConfigManager.AutoGenerateMissingConfigsIfNeeded();
		}

		public void Open()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = menuAnimator.GetCurrentAnimatorStateInfo(0);
			if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuNormal") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuAppear"))
			{
				((Component)this).gameObject.SetActive(true);
				menuAnimator.SetTrigger("Open");
				((Component)this).transform.SetAsLastSibling();
			}
		}

		public void Close(bool animated = true)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = menuAnimator.GetCurrentAnimatorStateInfo(0);
			if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuClosed") || ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("ConfigMenuDisappear"))
			{
				return;
			}
			foreach (BaseConfigItem item in LethalConfigManager.Mods.SelectMany((KeyValuePair<string, Mod> m) => m.Value.configItems))
			{
				item.CancelChanges();
			}
			UpdateAppearanceOfCurrentComponents();
			if (!animated)
			{
				((Component)this).gameObject.SetActive(false);
				menuAnimator.SetTrigger("ForceClose");
			}
			else
			{
				menuAnimator.SetTrigger("Close");
			}
		}

		public void OnCloseAnimationEnd()
		{
			((Component)this).gameObject.SetActive(false);
		}

		public void OnCancelButtonClicked()
		{
			Close();
			ConfigMenuManager.Instance.menuAudio.PlayCancelSFX();
		}

		public void OnApplyButtonClicked()
		{
			List<BaseConfigItem> list = (from c in LethalConfigManager.Mods.SelectMany((KeyValuePair<string, Mod> m) => m.Value.configItems)
				where c.HasValueChanged
				select c).ToList();
			List<BaseConfigItem> list2 = list.Where((BaseConfigItem c) => c.RequiresRestart).ToList();
			foreach (BaseConfigItem item in list)
			{
				item.ApplyChanges();
			}
			UpdateAppearanceOfCurrentComponents();
			ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
			LogUtils.LogInfo($"Saved config values for {list.Count} items.");
			LogUtils.LogInfo($"Modified {list2.Count} item(s) that requires a restart.");
			if (list2.Count > 0)
			{
				ConfigMenuManager.Instance.DisplayNotification("Some of the modified settings may require a restart to take effect.", "OK");
			}
		}

		private void UpdateAppearanceOfCurrentComponents()
		{
			ModConfigController[] componentsInChildren = ((Component)configList).GetComponentsInChildren<ModConfigController>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].UpdateAppearance();
			}
		}
	}
	internal class ConfigMenuNotification : MonoBehaviour
	{
		public TextMeshProUGUI messageTextComponent;

		public TextMeshProUGUI buttonTextComponent;

		public Animator notificationAnimator;

		public void SetNotificationContent(string text, string button)
		{
			((TMP_Text)messageTextComponent).text = text;
			((TMP_Text)buttonTextComponent).text = "[" + button + "]";
		}

		public void Open()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = notificationAnimator.GetCurrentAnimatorStateInfo(0);
			if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationNormal") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationAppear"))
			{
				((Component)this).gameObject.SetActive(true);
				notificationAnimator.SetTrigger("Open");
				((Component)this).transform.SetAsLastSibling();
			}
		}

		public void Close(bool animated = true)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			AnimatorStateInfo currentAnimatorStateInfo = notificationAnimator.GetCurrentAnimatorStateInfo(0);
			if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationClosed") && !((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("NotificationDisappear"))
			{
				if (!animated)
				{
					((Component)this).gameObject.SetActive(false);
					notificationAnimator.SetTrigger("ForceClose");
				}
				else
				{
					notificationAnimator.SetTrigger("Close");
				}
			}
		}

		public void OnButtonClick()
		{
			Close();
			ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
		}

		public void OnCloseAnimationEnd()
		{
			((Component)this).gameObject.SetActive(false);
		}
	}
	internal class DescriptionBox : MonoBehaviour
	{
		public ModInfoBox modInfoBox;

		public ConfigInfoBox configInfoBox;

		private void Awake()
		{
			((Component)modInfoBox).gameObject.SetActive(false);
			((Component)configInfoBox).gameObject.SetActive(false);
		}

		public void ShowConfigInfo(string configInfo)
		{
			((Component)configInfoBox).gameObject.SetActive(true);
			configInfoBox.SetConfigInfo(configInfo);
			HideModInfo();
		}

		public void HideConfigInfo()
		{
			((Component)configInfoBox).gameObject.SetActive(false);
		}

		public void ShowModInfo(Mod mod)
		{
			((Component)modInfoBox).gameObject.SetActive(true);
			modInfoBox.SetModInfo(mod);
			HideConfigInfo();
		}

		public void HideModInfo()
		{
			((Component)modInfoBox).gameObject.SetActive(false);
		}
	}
	internal class ModInfoBox : MonoBehaviour
	{
		public Image modIconImage;

		public TextMeshProUGUI modInfoText;

		public void SetModInfo(Mod mod)
		{
			modIconImage.sprite = mod.modInfo.Icon;
			_ = $"{mod.modInfo}";
			((TMP_Text)modInfoText).text = $"{mod.modInfo}";
		}
	}
	internal class ModList : MonoBehaviour
	{
		public GameObject modItemPrefab;

		public GameObject listContainerObject;

		public ConfigList configList;

		public DescriptionBox descriptionBox;

		private List<ModListItem> _items;

		private void Awake()
		{
			_items = new List<ModListItem>();
			BuildModList();
		}

		private void BuildModList()
		{
			//IL_0024: 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_0118: 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)
			_items.Clear();
			foreach (Transform item in listContainerObject.transform)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
			foreach (Mod mod in from m in LethalConfigManager.Mods.Values
				orderby m.modInfo.GUID != "ainavt.lc.lethalconfig", m.IsAutoGenerated, m.modInfo.Name
				select m)
			{
				GameObject val = Object.Instantiate<GameObject>(modItemPrefab, listContainerObject.transform);
				val.transform.localScale = Vector3.one;
				val.transform.localPosition = Vector3.zero;
				val.transform.localRotation = Quaternion.identity;
				ModListItem component = val.GetComponent<ModListItem>();
				component.mod = mod;
				component.modSelected += ModSelected;
				component.OnHoverEnter += delegate
				{
					descriptionBox.ShowModInfo(mod);
					ConfigMenuManager.Instance.menuAudio.PlayHoverSFX();
				};
				component.OnHoverExit += delegate
				{
					descriptionBox.HideModInfo();
				};
				_items.Add(val.GetComponent<ModListItem>());
			}
		}

		private void ModSelected(Mod mod)
		{
			ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
			configList.LoadConfigsForMod(mod);
			_items.First((ModListItem i) => i.mod == mod).SetSelected(selected: true);
			foreach (ModListItem item in _items.Where((ModListItem i) => i.mod != mod))
			{
				item.SetSelected(selected: false);
			}
		}
	}
	internal class ModListItem : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public delegate void OnHoverHandler();

		internal delegate void ModSelectedHandler(Mod mod);

		public TextMeshProUGUI textMesh;

		public GameObject selectedBorder;

		public Image modIcon;

		private Mod _mod;

		internal Mod mod
		{
			get
			{
				return _mod;
			}
			set
			{
				_mod = value;
				((TMP_Text)textMesh).text = _mod.modInfo.Name;
				modIcon.sprite = _mod.modInfo.Icon;
			}
		}

		public event OnHoverHandler OnHoverEnter;

		public event OnHoverHandler OnHoverExit;

		internal event ModSelectedHandler modSelected;

		public void OnClick()
		{
			this.modSelected(_mod);
		}

		public void SetSelected(bool selected)
		{
			selectedBorder.SetActive(selected);
		}

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

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

		public string GetDescription()
		{
			return _mod.modInfo.Name + "\n" + _mod.modInfo.GUID + "\n" + _mod.modInfo.Version;
		}
	}
	internal class SectionHeader : MonoBehaviour
	{
		public TextMeshProUGUI textMesh;

		public void SetSectionName(string sectionName)
		{
			((TMP_Text)textMesh).text = "[" + sectionName + "]";
		}
	}
	internal class Tooltip : MonoBehaviour
	{
		public TextMeshProUGUI textComponent;

		private RectTransform rectTransform;

		private Camera uiCamera;

		public void SetText(string text)
		{
			((TMP_Text)textComponent).text = text;
		}

		public void SetTarget(GameObject gameObject)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.position = gameObject.transform.position;
		}
	}
	internal class TooltipSystem : MonoBehaviour
	{
		private static TooltipSystem instance;

		public Tooltip tooltip;

		private void Awake()
		{
			instance = this;
		}

		public static void Show(string content, GameObject target)
		{
			if (!((Object)(object)instance == (Object)null))
			{
				((Component)instance.tooltip).gameObject.SetActive(true);
				instance.tooltip.SetText(content);
				instance.tooltip.SetTarget(target);
			}
		}

		public static void Hide()
		{
			if (!((Object)(object)instance == (Object)null))
			{
				((Component)instance.tooltip).gameObject.SetActive(false);
			}
		}
	}
	internal class TooltipTrigger : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public string tooltipText;

		public void OnPointerEnter(PointerEventData eventData)
		{
			TooltipSystem.Show(tooltipText, ((Component)this).gameObject);
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			TooltipSystem.Hide();
		}
	}
	internal class VersionLabel : MonoBehaviour
	{
		private void Start()
		{
			((TMP_Text)((Component)this).GetComponent<TextMeshProUGUI>()).text = "LethalConfig v1.3.4";
		}
	}
}
namespace LethalConfig.MonoBehaviours.Managers
{
	internal class ConfigMenuAudioManager : MonoBehaviour
	{
		public AudioClip confirmSFX;

		public AudioClip cancelSFX;

		public AudioClip selectSFX;

		public AudioClip hoverSFX;

		public AudioClip changeValueSFX;

		public AudioSource audioSource;

		public void PlayConfirmSFX()
		{
			audioSource.PlayOneShot(confirmSFX);
		}

		public void PlayCancelSFX()
		{
			audioSource.PlayOneShot(cancelSFX);
		}

		public void PlayHoverSFX()
		{
			audioSource.PlayOneShot(hoverSFX);
		}

		public void PlaySelectSFX()
		{
			audioSource.PlayOneShot(selectSFX);
		}

		public void PlayChangeValueSFX()
		{
			audioSource.PlayOneShot(changeValueSFX);
		}
	}
	internal class ConfigMenuManager : MonoBehaviour
	{
		public ConfigMenuAudioManager menuAudio;

		public static ConfigMenuManager Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
		}

		private void OnDestroy()
		{
			Instance = null;
		}

		public void ShowConfigMenu()
		{
			Object.FindObjectOfType<ConfigMenu>(true)?.Open();
		}

		public void DisplayNotification(string message, string button)
		{
			ConfigMenuNotification configMenuNotification = Object.FindObjectOfType<ConfigMenuNotification>(true);
			if ((Object)(object)configMenuNotification == (Object)null)
			{
				LogUtils.LogWarning("Notification object not found");
				return;
			}
			configMenuNotification.SetNotificationContent(message, button);
			configMenuNotification.Open();
			EventSystem.current.SetSelectedGameObject(((Component)((Component)configMenuNotification).GetComponentInChildren<Button>()).gameObject);
		}
	}
}
namespace LethalConfig.MonoBehaviours.Components
{
	internal class BoolCheckBoxController : ModConfigController<BoolCheckBoxConfigItem, bool>
	{
		public Toggle toggleComponent;

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			toggleComponent.SetIsOnWithoutNotify(base.ConfigItem.CurrentValue);
		}

		protected override void OnSetConfigItem()
		{
			toggleComponent.SetIsOnWithoutNotify(base.ConfigItem.CurrentValue);
			UpdateAppearance();
		}

		public void OnCheckBoxValueChanged(bool value)
		{
			base.ConfigItem.CurrentValue = value;
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}
	}
	internal class EnumDropDownController : ModConfigController
	{
		public TMP_Dropdown dropdownComponent;

		private Type _enumType;

		private List<string> _enumNames = new List<string>();

		public override string GetDescription()
		{
			return base.GetDescription() + "\n\nDefault: " + Enum.GetName(_enumType, baseConfigItem.BoxedDefaultValue);
		}

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			int valueWithoutNotify = _enumNames.FindIndex((string e) => e == Enum.GetName(_enumType, baseConfigItem.CurrentBoxedValue));
			dropdownComponent.SetValueWithoutNotify(valueWithoutNotify);
		}

		protected override void OnSetConfigItem()
		{
			_enumType = baseConfigItem.BaseConfigEntry.SettingType;
			_enumNames = Enum.GetNames(_enumType).ToList();
			dropdownComponent.ClearOptions();
			dropdownComponent.AddOptions(_enumNames);
			int valueWithoutNotify = _enumNames.FindIndex((string e) => e == Enum.GetName(_enumType, baseConfigItem.CurrentBoxedValue));
			dropdownComponent.SetValueWithoutNotify(valueWithoutNotify);
			UpdateAppearance();
		}

		public void OnDropDownValueChanged(int index)
		{
			baseConfigItem.CurrentBoxedValue = Enum.Parse(_enumType, _enumNames[index]);
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}
	}
	internal class FloatInputFieldController : ModConfigController<FloatInputFieldConfigItem, float>
	{
		public TMP_InputField textInputField;

		public override string GetDescription()
		{
			string text = base.GetDescription();
			if (base.ConfigItem.MinValue != float.MinValue)
			{
				text += $"\nMin: {base.ConfigItem.MinValue:0.0#}";
			}
			if (base.ConfigItem.MaxValue != float.MaxValue)
			{
				text += $"\nMax: {base.ConfigItem.MaxValue:0.0#}";
			}
			return text;
		}

		protected override void OnSetConfigItem()
		{
			textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}");
			UpdateAppearance();
		}

		public void OnInputFieldEndEdit(string value)
		{
			if (float.TryParse(value, out var result))
			{
				base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue);
			}
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateAppearance();
			textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}");
			((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero;
		}
	}
	internal class FloatSliderController : ModConfigController<FloatSliderConfigItem, float>
	{
		public Slider sliderComponent;

		public TMP_InputField valueInputField;

		public override string GetDescription()
		{
			return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue:0.0#}\nMax: {base.ConfigItem.MaxValue:0.0#}";
		}

		protected override void OnSetConfigItem()
		{
			sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue);
			sliderComponent.maxValue = base.ConfigItem.MaxValue;
			sliderComponent.minValue = base.ConfigItem.MinValue;
			UpdateAppearance();
		}

		public void OnSliderValueChanged(float value)
		{
			base.ConfigItem.CurrentValue = value;
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public void OnInputFieldEndEdit(string value)
		{
			if (float.TryParse(value, out var result))
			{
				base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue);
			}
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue);
			valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue:0.0#}");
		}
	}
	internal class FloatStepSliderController : ModConfigController<FloatStepSliderConfigItem, float>
	{
		public Slider sliderComponent;

		public TMP_InputField valueInputField;

		public override string GetDescription()
		{
			return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue:0.0#}\nMax: {base.ConfigItem.MaxValue:0.0#}";
		}

		protected override void OnSetConfigItem()
		{
			sliderComponent.SetValueWithoutNotify(base.ConfigItem.CurrentValue);
			int num = (int)MathF.Ceiling((base.ConfigItem.MaxValue - base.ConfigItem.MinValue) / MathF.Max(base.ConfigItem.Step, float.Epsilon));
			sliderComponent.maxValue = num;
			sliderComponent.minValue = 0f;
			sliderComponent.wholeNumbers = true;
			UpdateAppearance();
		}

		public void OnSliderValueChanged(float value)
		{
			base.ConfigItem.CurrentValue = MathF.Round(base.ConfigItem.MinValue + base.ConfigItem.Step * (float)(int)value, 4);
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public void OnInputFieldEndEdit(string value)
		{
			if (float.TryParse(value, out var result))
			{
				base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue);
			}
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			sliderComponent.SetValueWithoutNotify((base.ConfigItem.CurrentValue - base.ConfigItem.MinValue) / MathF.Max(base.ConfigItem.Step, float.Epsilon));
			valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue:0.0#}");
		}
	}
	internal class GenericButtonController : ModConfigController
	{
		public TextMeshProUGUI buttonTextComponent;

		private GenericButtonConfigItem ConfigItem => baseConfigItem as GenericButtonConfigItem;

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			((TMP_Text)buttonTextComponent).text = ConfigItem?.ButtonOptions?.ButtonText ?? "Button";
		}

		protected override void OnSetConfigItem()
		{
			UpdateAppearance();
		}

		public void OnButtonClicked()
		{
			ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
			ConfigItem?.ButtonOptions?.ButtonHandler?.Invoke();
		}
	}
	internal class IntInputFieldController : ModConfigController<IntInputFieldConfigItem, int>
	{
		public TMP_InputField textInputField;

		public override string GetDescription()
		{
			string text = base.GetDescription();
			if (base.ConfigItem.MinValue != int.MinValue)
			{
				text += $"\nMin: {base.ConfigItem.MinValue}";
			}
			if (base.ConfigItem.MaxValue != int.MaxValue)
			{
				text += $"\nMax: {base.ConfigItem.MaxValue}";
			}
			return text;
		}

		protected override void OnSetConfigItem()
		{
			textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}");
			UpdateAppearance();
		}

		public void OnInputFieldEndEdit(string value)
		{
			if (int.TryParse(value, out var result))
			{
				base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue);
			}
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateAppearance();
			textInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}");
			((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero;
		}
	}
	internal class IntSliderController : ModConfigController<IntSliderConfigItem, int>
	{
		public Slider sliderComponent;

		public TMP_InputField valueInputField;

		public override string GetDescription()
		{
			return $"{base.GetDescription()}\nMin: {base.ConfigItem.MinValue}\nMax: {base.ConfigItem.MaxValue}";
		}

		protected override void OnSetConfigItem()
		{
			sliderComponent.SetValueWithoutNotify((float)base.ConfigItem.CurrentValue);
			sliderComponent.maxValue = base.ConfigItem.MaxValue;
			sliderComponent.minValue = base.ConfigItem.MinValue;
			UpdateAppearance();
		}

		public void OnSliderValueChanged(float value)
		{
			base.ConfigItem.CurrentValue = (int)value;
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public void OnInputFieldEndEdit(string value)
		{
			if (int.TryParse(value, out var result))
			{
				base.ConfigItem.CurrentValue = Math.Clamp(result, base.ConfigItem.MinValue, base.ConfigItem.MaxValue);
			}
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			base.UpdateAppearance();
			sliderComponent.SetValueWithoutNotify((float)base.ConfigItem.CurrentValue);
			valueInputField.SetTextWithoutNotify($"{base.ConfigItem.CurrentValue}");
		}
	}
	internal abstract class ModConfigController : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public delegate void OnHoverHandler();

		private readonly List<Selectable> _selectables = new List<Selectable>();

		protected BaseConfigItem baseConfigItem;

		protected bool isOnSetup;

		public TextMeshProUGUI nameTextComponent;

		public TooltipTrigger tooltipTrigger;

		protected CanModifyResult CanModify
		{
			get
			{
				if (baseConfigItem.Options.CanModifyCallback == null)
				{
					return true;
				}
				return baseConfigItem.Options.CanModifyCallback();
			}
		}

		public event OnHoverHandler OnHoverEnter;

		public event OnHoverHandler OnHoverExit;

		protected virtual void Awake()
		{
			((Behaviour)tooltipTrigger).enabled = false;
			if (_selectables.Count <= 0)
			{
				_selectables.AddRange(((Component)this).GetComponentsInChildren<Selectable>());
			}
		}

		public virtual bool SetConfigItem(BaseConfigItem configItem)
		{
			baseConfigItem = configItem;
			isOnSetup = true;
			OnSetConfigItem();
			isOnSetup = false;
			if (baseConfigItem.Options.CanModifyCallback != null)
			{
				tooltipTrigger.tooltipText = "<b>Modifying this entry is currently disabled:</b>\n<b>" + CanModify.Reason + "</b>";
			}
			return true;
		}

		protected abstract void OnSetConfigItem();

		public virtual void UpdateAppearance()
		{
			((TMP_Text)nameTextComponent).text = (baseConfigItem.HasValueChanged ? "* " : "") + baseConfigItem.Name;
			CanModifyResult canModify = CanModify;
			foreach (Selectable selectable in _selectables)
			{
				selectable.interactable = canModify;
			}
			((Behaviour)tooltipTrigger).enabled = !canModify;
		}

		public virtual void ResetToDefault()
		{
			ConfigMenuManager.Instance.menuAudio.PlayConfirmSFX();
			baseConfigItem.ChangeToDefault();
			UpdateAppearance();
		}

		public virtual string GetDescription()
		{
			string text = "<b>" + baseConfigItem.Name + "</b>";
			if (baseConfigItem.IsAutoGenerated)
			{
				text += "\n\n<b>*This config entry was automatically generated and may require a restart*</b>";
			}
			else if (baseConfigItem.RequiresRestart)
			{
				text += "\n\n<b>*REQUIRES RESTART*</b>";
			}
			return text + "\n\n" + baseConfigItem.Description;
		}

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

		public void OnPointerExit(PointerEventData eventData)
		{
			this.OnHoverExit?.Invoke();
		}
	}
	internal abstract class ModConfigController<T, V> : ModConfigController where T : BaseValueConfigItem<V>
	{
		public T ConfigItem => (T)baseConfigItem;

		public override string GetDescription()
		{
			return $"{base.GetDescription()}\n\nDefault: {ConfigItem.Defaultvalue}";
		}

		public override bool SetConfigItem(BaseConfigItem configItem)
		{
			if (!(configItem is T))
			{
				LogUtils.LogError("Expected config item of type " + typeof(T).Name + ", but got " + configItem.GetType().Name + " instead.");
				return false;
			}
			return base.SetConfigItem(configItem);
		}
	}
	internal class TextInputFieldController : ModConfigController<TextInputFieldConfigItem, string>
	{
		public TMP_InputField textInputField;

		protected override void OnSetConfigItem()
		{
			textInputField.SetTextWithoutNotify(base.ConfigItem.CurrentValue);
			UpdateAppearance();
		}

		public void OnInputFieldEndEdit(string value)
		{
			base.ConfigItem.CurrentValue = value;
			UpdateAppearance();
			ConfigMenuManager.Instance.menuAudio.PlayChangeValueSFX();
		}

		public override void UpdateAppearance()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateAppearance();
			textInputField.SetTextWithoutNotify(base.ConfigItem.CurrentValue);
			((Transform)textInputField.textComponent.rectTransform).localPosition = Vector3.zero;
		}
	}
}
namespace LethalConfig.Mods
{
	internal class Mod
	{
		public ModInfo modInfo;

		public bool IsAutoGenerated;

		public List<BaseConfigItem> configItems;

		public List<ConfigEntryPath> entriesToSkipAutoGen;

		internal Mod(ModInfo modInfo)
		{
			configItems = new List<BaseConfigItem>();
			entriesToSkipAutoGen = new List<ConfigEntryPath>();
			this.modInfo = modInfo;
			TryResolveIconAndDesc();
		}

		internal void TryResolveIconAndDesc()
		{
			if (modInfo.TryGetPluginInfo(out var pluginInfo))
			{
				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 iconPath = Directory.EnumerateFiles(text, "icon.png", SearchOption.AllDirectories).FirstOrDefault();
					LoadIcon(iconPath);
					string manifestPath = Directory.EnumerateFiles(text, "manifest.json", SearchOption.AllDirectories).FirstOrDefault();
					LoadDesc(manifestPath);
				}
			}
		}

		private void LoadIcon(string iconPath)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (iconPath != null)
				{
					Texture2D val = new Texture2D(256, 256);
					if (ImageConversion.LoadImage(val, File.ReadAllBytes(iconPath)))
					{
						modInfo.Icon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
					}
				}
			}
			catch
			{
			}
		}

		private void LoadDesc(string manifestPath)
		{
			try
			{
				if (manifestPath != null)
				{
					ThunderstoreManifest thunderstoreManifest = JsonConvert.DeserializeObject<ThunderstoreManifest>(File.ReadAllText(manifestPath));
					if (thunderstoreManifest != null)
					{
						modInfo.Description = thunderstoreManifest.Description;
					}
				}
			}
			catch
			{
			}
		}

		internal void AddConfigItem(BaseConfigItem item)
		{
			configItems.Add(item);
		}
	}
	internal class ModInfo
	{
		internal string Name { get; set; }

		internal string GUID { get; set; }

		internal string Version { get; set; }

		internal string Description { get; set; } = "";


		internal Sprite Icon { get; set; } = Assets.DefaultModIcon;


		public override string ToString()
		{
			return "<b>" + Name + "</b>\n" + GUID + "\nv" + Version + "\n\n" + Description;
		}

		public bool TryGetPluginInfo(out PluginInfo pluginInfo)
		{
			return Chainloader.PluginInfos.TryGetValue(GUID, out pluginInfo);
		}
	}
	internal class ThunderstoreManifest
	{
		[JsonProperty("name")]
		public string Name { get; set; }

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

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

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

		[JsonProperty("dependencies")]
		public IList<string> Dependencies { get; set; }
	}
}
namespace LethalConfig.ConfigItems
{
	public abstract class BaseConfigItem
	{
		internal ConfigEntryBase BaseConfigEntry { get; private set; }

		internal BaseOptions Options { get; }

		internal bool RequiresRestart => Options.RequiresRestart;

		internal Mod Owner { get; set; }

		internal bool IsAutoGenerated { get; set; }

		private string UnderlyingSection
		{
			get
			{
				ConfigEntryBase baseConfigEntry = BaseConfigEntry;
				return ((baseConfigEntry != null) ? baseConfigEntry.Definition.Section : null) ?? string.Empty;
			}
		}

		private string UnderlyingName
		{
			get
			{
				ConfigEntryBase baseConfigEntry = BaseConfigEntry;
				return ((baseConfigEntry != null) ? baseConfigEntry.Definition.Key : null) ?? string.Empty;
			}
		}

		private string UnderlyingDescription
		{
			get
			{
				ConfigEntryBase baseConfigEntry = BaseConfigEntry;
				return ((baseConfigEntry != null) ? baseConfigEntry.Description.Description : null) ?? string.Empty;
			}
		}

		internal string Section => Options.Section ?? UnderlyingSection;

		internal string Name => Options.Name ?? UnderlyingName;

		internal string Description => Options.Description ?? UnderlyingDescription;

		internal object CurrentBoxedValue { get; set; }

		internal object OriginalBoxedValue
		{
			get
			{
				ConfigEntryBase baseConfigEntry = BaseConfigEntry;
				if (baseConfigEntry == null)
				{
					return null;
				}
				return baseConfigEntry.BoxedValue;
			}
		}

		internal object BoxedDefaultValue
		{
			get
			{
				ConfigEntryBase baseConfigEntry = BaseConfigEntry;
				if (baseConfigEntry == null)
				{
					return null;
				}
				return baseConfigEntry.DefaultValue;
			}
		}

		internal bool HasValueChanged
		{
			get
			{
				object currentBoxedValue = CurrentBoxedValue;
				if (currentBoxedValue == null)
				{
					return false;
				}
				return !currentBoxedValue.Equals(OriginalBoxedValue);
			}
		}

		internal abstract GameObject CreateGameObjectForConfig();

		internal void ApplyChanges()
		{
			if (BaseConfigEntry != null)
			{
				BaseConfigEntry.BoxedValue = CurrentBoxedValue;
			}
		}

		internal void CancelChanges()
		{
			CurrentBoxedValue = OriginalBoxedValue;
		}

		internal void ChangeToDefault()
		{
			CurrentBoxedValue = BoxedDefaultValue;
		}

		internal BaseConfigItem(BaseOptions options)
			: this(null, options)
		{
		}

		internal BaseConfigItem(ConfigEntryBase configEntry, BaseOptions options)
		{
			BaseConfigEntry = configEntry;
			Options = options;
			CurrentBoxedValue = OriginalBoxedValue;
		}

		internal bool IsSameConfig(BaseConfigItem configItem)
		{
			bool num = configItem.UnderlyingSection == UnderlyingSection;
			bool flag = configItem.UnderlyingName == UnderlyingName;
			bool flag2 = configItem.Owner.modInfo.GUID == Owner.modInfo.GUID;
			return num && flag && flag2;
		}
	}
	public abstract class BaseValueConfigItem<T> : BaseConfigItem
	{
		internal ConfigEntry<T> ConfigEntry => (ConfigEntry<T>)(object)base.BaseConfigEntry;

		internal T CurrentValue
		{
			get
			{
				return (T)base.CurrentBoxedValue;
			}
			set
			{
				base.CurrentBoxedValue = value;
			}
		}

		internal T OriginalValue => ConfigEntry.Value;

		internal T Defaultvalue => (T)((ConfigEntryBase)ConfigEntry).DefaultValue;

		internal BaseValueConfigItem(ConfigEntry<T> configEntry, BaseOptions options)
			: base((ConfigEntryBase)(object)configEntry, options)
		{
			CurrentValue = OriginalValue;
		}

		public override string ToString()
		{
			return base.Owner.modInfo.Name + "/" + ((ConfigEntryBase)ConfigEntry).Definition.Section + "/" + ((ConfigEntryBase)ConfigEntry).Definition.Key;
		}
	}
	public class BoolCheckBoxConfigItem : BaseValueConfigItem<bool>
	{
		public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry, bool requiresRestart)
			: this(configEntry, new BoolCheckBoxOptions
			{
				RequiresRestart = requiresRestart
			})
		{
		}

		public BoolCheckBoxConfigItem(ConfigEntry<bool> configEntry, BoolCheckBoxOptions options)
			: base(configEntry, (BaseOptions)options)
		{
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.BoolCheckBoxPrefab);
		}
	}
	public class EnumDropDownConfigItem<T> : BaseValueConfigItem<T> where T : Enum
	{
		public EnumDropDownConfigItem(ConfigEntry<T> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public EnumDropDownConfigItem(ConfigEntry<T> configEntry, bool requiresRestart)
			: this(configEntry, new EnumDropDownOptions
			{
				RequiresRestart = requiresRestart
			})
		{
		}

		public EnumDropDownConfigItem(ConfigEntry<T> configEntry, EnumDropDownOptions options)
			: base(configEntry, (BaseOptions)options)
		{
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.EnumDropDownPrefab);
		}
	}
	public sealed class FloatInputFieldConfigItem : BaseValueConfigItem<float>
	{
		internal float MaxValue { get; private set; }

		internal float MinValue { get; private set; }

		public FloatInputFieldConfigItem(ConfigEntry<float> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public FloatInputFieldConfigItem(ConfigEntry<float> configEntry, bool requiresRestart)
			: this(configEntry, GetDefaultOptions(configEntry, requiresRestart))
		{
		}

		public FloatInputFieldConfigItem(ConfigEntry<float> configEntry, FloatInputFieldOptions options)
			: base(configEntry, (BaseOptions)options)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			MinValue = (options.IsMinSet ? options.Min : ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? 0f));
			MaxValue = (options.IsMaxSet ? options.Max : ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? 1f));
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.FloatInputFieldPrefab);
		}

		private static FloatInputFieldOptions GetDefaultOptions(ConfigEntry<float> configEntry, bool requiresRestart = true)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			return new FloatInputFieldOptions
			{
				Min = ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? float.MinValue),
				Max = ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? float.MaxValue),
				RequiresRestart = requiresRestart
			};
		}
	}
	public sealed class FloatSliderConfigItem : BaseValueConfigItem<float>
	{
		internal float MaxValue { get; private set; }

		internal float MinValue { get; private set; }

		public FloatSliderConfigItem(ConfigEntry<float> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public FloatSliderConfigItem(ConfigEntry<float> configEntry, bool requiresRestart)
			: this(configEntry, GetDefaultOptions(configEntry, requiresRestart))
		{
		}

		public FloatSliderConfigItem(ConfigEntry<float> configEntry, FloatSliderOptions options)
			: base(configEntry, (BaseOptions)options)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			MinValue = (options.IsMinSet ? options.Min : ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? 0f));
			MaxValue = (options.IsMaxSet ? options.Max : ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? 1f));
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.FloatSliderPrefab);
		}

		private static FloatSliderOptions GetDefaultOptions(ConfigEntry<float> configEntry, bool requiresRestart = true)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			return new FloatSliderOptions
			{
				Min = ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? 0f),
				Max = ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? 1f),
				RequiresRestart = requiresRestart
			};
		}
	}
	public sealed class FloatStepSliderConfigItem : BaseValueConfigItem<float>
	{
		internal float MaxValue { get; private set; }

		internal float MinValue { get; private set; }

		internal float Step { get; private set; }

		public FloatStepSliderConfigItem(ConfigEntry<float> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public FloatStepSliderConfigItem(ConfigEntry<float> configEntry, bool requiresRestart)
			: this(configEntry, GetDefaultOptions(configEntry, requiresRestart))
		{
		}

		public FloatStepSliderConfigItem(ConfigEntry<float> configEntry, FloatStepSliderOptions options)
			: base(configEntry, (BaseOptions)options)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			MinValue = (options.IsMinSet ? options.Min : ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? 0f));
			MaxValue = (options.IsMaxSet ? options.Max : ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? 1f));
			Step = options.Step;
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.FloatStepSliderPrefab);
		}

		private static FloatStepSliderOptions GetDefaultOptions(ConfigEntry<float> configEntry, bool requiresRestart = true)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			return new FloatStepSliderOptions
			{
				Min = ((acceptableValues as AcceptableValueRange<float>)?.MinValue ?? 0f),
				Max = ((acceptableValues as AcceptableValueRange<float>)?.MaxValue ?? 1f),
				Step = 0.1f,
				RequiresRestart = requiresRestart
			};
		}
	}
	public class GenericButtonConfigItem : BaseConfigItem
	{
		public GenericButtonOptions ButtonOptions => base.Options as GenericButtonOptions;

		public GenericButtonConfigItem(string section, string name, string description, string buttonText, GenericButtonOptions.GenericButtonHandler buttonHandler)
			: base(new GenericButtonOptions
			{
				Section = section,
				Name = name,
				Description = description,
				ButtonText = buttonText,
				ButtonHandler = buttonHandler,
				RequiresRestart = false
			})
		{
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.GenericButtonPrefab);
		}
	}
	public sealed class IntInputFieldConfigItem : BaseValueConfigItem<int>
	{
		internal int MaxValue { get; private set; }

		internal int MinValue { get; private set; }

		public IntInputFieldConfigItem(ConfigEntry<int> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public IntInputFieldConfigItem(ConfigEntry<int> configEntry, bool requiresRestart)
			: this(configEntry, GetDefaultOptions(configEntry, requiresRestart))
		{
		}

		public IntInputFieldConfigItem(ConfigEntry<int> configEntry, IntInputFieldOptions options)
			: base(configEntry, (BaseOptions)options)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			MinValue = (options.IsMinSet ? options.Min : ((acceptableValues as AcceptableValueRange<int>)?.MinValue ?? 0));
			MaxValue = (options.IsMaxSet ? options.Max : ((acceptableValues as AcceptableValueRange<int>)?.MaxValue ?? 100));
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(Assets.IntInputFieldPrefab);
		}

		private static IntInputFieldOptions GetDefaultOptions(ConfigEntry<int> configEntry, bool requiresRestart = true)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			return new IntInputFieldOptions
			{
				Min = ((acceptableValues as AcceptableValueRange<int>)?.MinValue ?? int.MinValue),
				Max = ((acceptableValues as AcceptableValueRange<int>)?.MaxValue ?? int.MaxValue),
				RequiresRestart = requiresRestart
			};
		}
	}
	public sealed class IntSliderConfigItem : BaseValueConfigItem<int>
	{
		internal int MaxValue { get; private set; }

		internal int MinValue { get; private set; }

		public IntSliderConfigItem(ConfigEntry<int> configEntry)
			: this(configEntry, requiresRestart: true)
		{
		}

		public IntSliderConfigItem(ConfigEntry<int> configEntry, bool requiresRestart)
			: this(configEntry, GetDefaultOptions(configEntry, requiresRestart))
		{
		}

		public IntSliderConfigItem(ConfigEntry<int> configEntry, IntSliderOptions options)
			: base(configEntry, (BaseOptions)options)
		{
			AcceptableValueBase acceptableValues = ((ConfigEntryBase)configEntry).Description.AcceptableValues;
			MinValue = (options.IsMinSet ? options.Min : ((acceptableValues as AcceptableValueRange<int>)?.MinValue ?? 0));
			MaxValue = (options.IsMaxSet ? options.Max : ((acceptableValues as AcceptableValueRange<int>)?.MaxValue ?? 100));
		}

		internal override GameObject CreateGameObjectForConfig()
		{
			return Object.Instantiate<GameObject>(A

BepInEx/plugins/Drakorle-MoreItems/MoreItems.dll

Decompiled 9 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreItems.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MoreItems")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("MoreItems")]
[assembly: AssemblyTitle("MoreItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 MoreItems
{
	[BepInPlugin("MoreItems", "MoreItems", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("MoreItems");

		private void Awake()
		{
			try
			{
				harmony.PatchAll(typeof(GameNetworkManagerPatch));
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin MoreItems is loaded!");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)("Plugin MoreItems failed to load and threw an exception:\n" + ex.Message));
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "MoreItems";

		public const string PLUGIN_NAME = "MoreItems";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}
namespace MoreItems.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatch
	{
		private const int newMaxItemCapacity = 999;

		[HarmonyPatch("SaveItemsInShip")]
		[HarmonyPrefix]
		private static void IncreaseShipItemCapacity()
		{
			StartOfRound.Instance.maxShipItemCapacity = 999;
			Logger.CreateLogSource("MoreItems").LogInfo((object)$"Maximum amount of items that can be saved set to {999} just before saving.");
		}
	}
}

BepInEx/plugins/Sligili-HDLethalCompany/HDLethalCompany.dll

Decompiled 9 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HDLethalCompany.Patch;
using HDLethalCompany.Tools;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HDLethalCompanyRemake")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HDLethalCompanyRemake")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7f379bc1-1fd4-4c72-9247-a181862eec6b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HDLethalCompany
{
	[BepInPlugin("HDLethalCompany", "HDLethalCompany-Sligili", "1.5.6")]
	public class HDLethalCompanyInitialization : BaseUnityPlugin
	{
		private static ConfigEntry<float> config_ResMult;

		private static ConfigEntry<bool> config_EnablePostProcessing;

		private static ConfigEntry<bool> config_EnableFog;

		private static ConfigEntry<bool> config_EnableAntialiasing;

		private static ConfigEntry<bool> config_EnableResolution;

		private static ConfigEntry<bool> config_EnableFoliage;

		private static ConfigEntry<int> config_FogQuality;

		private static ConfigEntry<int> config_TextureQuality;

		private static ConfigEntry<int> config_LOD;

		private static ConfigEntry<int> config_ShadowmapQuality;

		private Harmony _harmony;

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"HDLethalCompany loaded");
			ConfigFile();
			GraphicsPatch.assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "HDLethalCompany/hdlethalcompany"));
			_harmony = new Harmony("HDLethalCompany");
			_harmony.PatchAll(typeof(GraphicsPatch));
		}

		private void ConfigFile()
		{
			config_ResMult = ((BaseUnityPlugin)this).Config.Bind<float>("RESOLUTION", "Value", 2.233f, "Resolution Scale Multiplier - <EXAMPLES -> | 1.000 = 860x520p | 2.233 =~ 1920x1080p | 2.977 = 2560x1440p | 4.465 = 3840x2060p > - The UI scanned elements have slightly incorrect offsets after 3.000");
			config_EnableResolution = ((BaseUnityPlugin)this).Config.Bind<bool>("RESOLUTION", "EnableRes", true, "Resolution Fix - In case you wanna use another resolution mod or apply any widescreen mod while keeping the graphics settings");
			config_EnableAntialiasing = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableAA", false, "Anti-Aliasing (Unity's SMAA)");
			config_EnablePostProcessing = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnablePP", true, "Post-Processing (Color grading)");
			config_TextureQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "TextureQuality", 3, "Texture Resolution Quality - <PRESETS -> | 0 = VERY LOW (1/8) | 1 = LOW (1/4) | 2 = MEDIUM (1/2) | 3 = HIGH (1/1 VANILLA) >");
			config_FogQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "FogQuality", 1, "Volumetric Fog Quality - <PRESETS -> | 0 = VERY LOW | 1 = VANILLA FOG | 2 = MEDIUM | 3 = HIGH >");
			config_EnableFog = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableFOG", true, "Volumetric Fog Toggle - Use this as a last resource in case lowering the fog quality is not enough to get decent performance");
			config_LOD = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "LOD", 1, "Level Of Detail - <PRESETS -> | 0 = LOW (HALF DISTANCE) | 1 = VANILLA | 2 = HIGH (TWICE THE DISTANCE) >");
			config_ShadowmapQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "ShadowQuality", 3, "Shadows Resolution - <PRESETS -> 0 = VERY LOW (SHADOWS DISABLED)| 1 = LOW (256) | 2 = MEDIUM (1024) | 3 = VANILLA (2048) > - Shadowmap max resolution");
			config_EnableFoliage = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableF", true, "Foliage Toggle - If the game camera should or not render bushes/grass (trees won't be affected)");
			GraphicsPatch.m_enableFoliage = config_EnableFoliage.Value;
			GraphicsPatch.m_enableResolutionFix = config_EnableResolution.Value;
			GraphicsPatch.m_setShadowQuality = config_ShadowmapQuality.Value;
			GraphicsPatch.m_setLOD = config_LOD.Value;
			GraphicsPatch.m_setTextureResolution = config_TextureQuality.Value;
			GraphicsPatch.m_setFogQuality = config_FogQuality.Value;
			GraphicsPatch.multiplier = config_ResMult.Value;
			GraphicsPatch.anchorOffsetZ = 0.123f * config_ResMult.Value + 0.877f;
			GraphicsPatch.m_widthResolution = 860f * config_ResMult.Value;
			GraphicsPatch.m_heightResolution = 520f * config_ResMult.Value;
			GraphicsPatch.m_enableAntiAliasing = config_EnableAntialiasing.Value;
			GraphicsPatch.m_enableFog = config_EnableFog.Value;
			GraphicsPatch.m_enablePostProcessing = config_EnablePostProcessing.Value;
		}
	}
	public static class PluginInfo
	{
		public const string Guid = "HDLethalCompany";

		public const string Name = "HDLethalCompany-Sligili";

		public const string Ver = "1.5.6";
	}
}
namespace HDLethalCompany.Tools
{
	public class Reflection
	{
		public static object GetInstanceField(Type type, object instance, string fieldName)
		{
			BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
			FieldInfo field = type.GetField(fieldName, bindingAttr);
			return field.GetValue(instance);
		}

		public static object CallMethod(object instance, string methodName, params object[] args)
		{
			MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
			if (method != null)
			{
				return method.Invoke(instance, args);
			}
			return null;
		}
	}
}
namespace HDLethalCompany.Patch
{
	internal class GraphicsPatch
	{
		public static bool m_enablePostProcessing;

		public static bool m_enableFog;

		public static bool m_enableAntiAliasing;

		public static bool m_enableResolutionFix;

		public static bool m_enableFoliage = true;

		public static int m_setFogQuality;

		public static int m_setTextureResolution;

		public static int m_setLOD;

		public static int m_setShadowQuality;

		private static HDRenderPipelineAsset myAsset;

		public static AssetBundle assetBundle;

		public static float anchorOffsetX = 439.48f;

		public static float anchorOffsetY = 244.8f;

		public static float anchorOffsetZ;

		public static float multiplier;

		public static float m_widthResolution;

		public static float m_heightResolution;

		[HarmonyPatch(typeof(PlayerControllerB), "Start")]
		[HarmonyPrefix]
		private static void StartPrefix(PlayerControllerB __instance)
		{
			//IL_0080: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(HDAdditionalCameraData));
			foreach (Object obj in array)
			{
				HDAdditionalCameraData val = (HDAdditionalCameraData)(object)((obj is HDAdditionalCameraData) ? obj : null);
				if (!(((Object)((Component)val).gameObject).name == "MapCamera"))
				{
					val.customRenderingSettings = true;
					ToggleCustomPass(val, m_enablePostProcessing);
					SetLevelOfDetail(val);
					ToggleVolumetricFog(val, m_enableFog);
					if (!m_enableFoliage)
					{
						LayerMask val2 = LayerMask.op_Implicit(((Component)val).GetComponent<Camera>().cullingMask);
						val2 = LayerMask.op_Implicit(LayerMask.op_Implicit(val2) & -1025);
						((Component)val).GetComponent<Camera>().cullingMask = LayerMask.op_Implicit(val2);
					}
					SetShadowQuality(assetBundle, val);
					if (!(((Object)((Component)val).gameObject).name == "SecurityCamera") && !(((Object)((Component)val).gameObject).name == "ShipCamera"))
					{
						SetAntiAliasing(val);
					}
				}
			}
			array = null;
			SetTextureQuality();
			SetFogQuality();
			if (m_enableResolutionFix && multiplier != 1f)
			{
				int width = (int)Math.Round(m_widthResolution, 0);
				int height = (int)Math.Round(m_heightResolution, 0);
				((Texture)__instance.gameplayCamera.targetTexture).width = width;
				((Texture)__instance.gameplayCamera.targetTexture).height = height;
			}
		}

		[HarmonyPatch(typeof(RoundManager), "GenerateNewFloor")]
		[HarmonyPrefix]
		private static void RoundPostFix()
		{
			SetFogQuality();
			if (m_setLOD == 0)
			{
				RemoveLodFromGameObject("CatwalkStairs");
			}
		}

		[HarmonyPatch(typeof(HUDManager), "UpdateScanNodes")]
		[HarmonyPostfix]
		private static void UpdateScanNodesPostfix(PlayerControllerB playerScript, HUDManager __instance)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: 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_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			if (anchorOffsetZ > 1.238f)
			{
				anchorOffsetZ = 1.238f;
			}
			if (!m_enableResolutionFix || multiplier == 1f)
			{
				return;
			}
			Vector3 zero = Vector3.zero;
			bool flag = false;
			for (int i = 0; i < __instance.scanElements.Length; i++)
			{
				if ((Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).Count > 0 && (Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).TryGetValue(__instance.scanElements[i], out var value) && (Object)(object)value != (Object)null)
				{
					try
					{
						if ((bool)Reflection.CallMethod(__instance, "NodeIsNotVisible", value, i))
						{
							continue;
						}
						if (!((Component)__instance.scanElements[i]).gameObject.activeSelf)
						{
							((Component)__instance.scanElements[i]).gameObject.SetActive(true);
							((Component)__instance.scanElements[i]).GetComponent<Animator>().SetInteger("colorNumber", value.nodeType);
							if (value.creatureScanID != -1)
							{
								Traverse.Create((object)__instance).Method("AttemptScanNewCreature", new object[1] { value.creatureScanID });
							}
						}
						goto IL_0186;
					}
					catch (Exception arg)
					{
						Debug.LogError((object)$"Error in updatescanNodes A: {arg}");
						goto IL_0186;
					}
				}
				(Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).Remove(__instance.scanElements[i]);
				((Component)__instance.scanElements[i]).gameObject.SetActive(false);
				continue;
				IL_0186:
				try
				{
					Traverse.Create((object)__instance).Field("scanElementText").SetValue((object)((Component)__instance.scanElements[i]).gameObject.GetComponentsInChildren<TextMeshProUGUI>());
					if ((Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[]).Length > 1)
					{
						((TMP_Text)(Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[])[0]).text = value.headerText;
						((TMP_Text)(Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[])[1]).text = value.subText;
					}
					if (value.nodeType == 2)
					{
						flag = true;
					}
					zero = playerScript.gameplayCamera.WorldToScreenPoint(((Component)value).transform.position);
					((Transform)__instance.scanElements[i]).position = new Vector3(((Transform)__instance.scanElements[i]).position.x, ((Transform)__instance.scanElements[i]).position.y, 12.17f * anchorOffsetZ);
					__instance.scanElements[i].anchoredPosition = Vector2.op_Implicit(new Vector3(zero.x - anchorOffsetX * multiplier, zero.y - anchorOffsetY * multiplier));
					if (!(multiplier > 3f))
					{
						((Transform)__instance.scanElements[i]).localScale = new Vector3(multiplier, multiplier, multiplier);
					}
					else
					{
						((Transform)__instance.scanElements[i]).localScale = new Vector3(3f, 3f, 3f);
					}
				}
				catch (Exception arg2)
				{
					Debug.LogError((object)$"Error in updatescannodes B: {arg2}");
				}
			}
			try
			{
				if (!flag)
				{
					__instance.totalScrapScanned = 0;
					Traverse.Create((object)__instance).Field("totalScrapScannedDisplayNum").SetValue((object)0);
					Traverse.Create((object)__instance).Field("addToDisplayTotalInterval").SetValue((object)0.35f);
				}
				__instance.scanInfoAnimator.SetBool("display", (int)Reflection.GetInstanceField(typeof(HUDManager), __instance, "scannedScrapNum") >= 2 && flag);
			}
			catch (Exception arg3)
			{
				Debug.LogError((object)$"Error in updatescannodes C: {arg3}");
			}
		}

		public static void SetShadowQuality(AssetBundle assetBundle, HDAdditionalCameraData cameraData)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)assetBundle == (Object)null)
			{
				Debug.LogError((object)"HDLETHALCOMPANY: Something is wrong with the Asset Bundle - Null");
				return;
			}
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[20u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)20, (m_setShadowQuality != 0) ? true : false);
			myAsset = (HDRenderPipelineAsset)((m_setShadowQuality != 1) ? ((m_setShadowQuality != 2) ? ((object)(HDRenderPipelineAsset)QualitySettings.renderPipeline) : ((object)(myAsset = assetBundle.LoadAsset<HDRenderPipelineAsset>("Assets/HDLethalCompany/MediumShadowsAsset.asset")))) : (myAsset = assetBundle.LoadAsset<HDRenderPipelineAsset>("Assets/HDLethalCompany/VeryLowShadowsAsset.asset")));
			QualitySettings.renderPipeline = (RenderPipelineAsset)(object)myAsset;
		}

		public static void SetLevelOfDetail(HDAdditionalCameraData cameraData)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			if (m_setLOD != 1)
			{
				((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[60u] = true;
				((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[61u] = true;
				((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)60, true);
				((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)61, true);
				cameraData.renderingPathCustomFrameSettings.lodBiasMode = (LODBiasMode)2;
				cameraData.renderingPathCustomFrameSettings.lodBias = ((m_setLOD == 0) ? 0.6f : 2.3f);
				if (m_setLOD == 0 && ((Component)cameraData).GetComponent<Camera>().farClipPlane > 180f)
				{
					((Component)cameraData).GetComponent<Camera>().farClipPlane = 170f;
				}
			}
		}

		public static void SetTextureQuality()
		{
			if (m_setTextureResolution < 3)
			{
				int globalTextureMipmapLimit = 3 - m_setTextureResolution;
				QualitySettings.globalTextureMipmapLimit = globalTextureMipmapLimit;
			}
		}

		public static void SetAntiAliasing(HDAdditionalCameraData cameraData)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (m_enableAntiAliasing)
			{
				cameraData.antialiasing = (AntialiasingMode)3;
			}
		}

		public static void ToggleCustomPass(HDAdditionalCameraData cameraData, bool enable)
		{
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[6u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)6, enable);
		}

		public static void ToggleVolumetricFog(HDAdditionalCameraData cameraData, bool enable)
		{
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[28u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)28, enable);
		}

		public static void SetFogQuality()
		{
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(Volume));
			if (array.Length == 0)
			{
				Debug.LogError((object)"No volumes found");
				return;
			}
			Fog val2 = default(Fog);
			foreach (Object obj in array)
			{
				Volume val = (Volume)(object)((obj is Volume) ? obj : null);
				if (val.sharedProfile.TryGet<Fog>(ref val2))
				{
					((VolumeParameter<int>)(object)((VolumeComponentWithQuality)val2).quality).Override(3);
					switch (m_setFogQuality)
					{
					case -1:
						val2.volumetricFogBudget = 0.05f;
						val2.resolutionDepthRatio = 0.5f;
						break;
					case 0:
						val2.volumetricFogBudget = 0.05f;
						val2.resolutionDepthRatio = 0.5f;
						break;
					case 2:
						val2.volumetricFogBudget = 0.333f;
						val2.resolutionDepthRatio = 0.666f;
						break;
					case 3:
						val2.volumetricFogBudget = 0.666f;
						val2.resolutionDepthRatio = 0.5f;
						break;
					}
				}
			}
		}

		public static void RemoveLodFromGameObject(string name)
		{
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(LODGroup));
			foreach (Object obj in array)
			{
				LODGroup val = (LODGroup)(object)((obj is LODGroup) ? obj : null);
				if (((Object)((Component)val).gameObject).name == name)
				{
					val.enabled = false;
				}
			}
		}
	}
}

BepInEx/plugins/FlipMods-HotbarPlus/HotbarPlus.dll

Decompiled 9 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using HotbarPlus.Config;
using HotbarPlus.Input;
using HotbarPlus.Patches;
using LethalCompanyInputUtils.Api;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
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: AssemblyTitle("HotbarPlus")]
[assembly: AssemblyDescription("Mod made by flipf17.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HotbarPlus")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fab060f0-b006-42ea-ba6f-473f4850c587")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HotbarPlus
{
	[HarmonyPatch]
	public class SyncManager
	{
		private static PlayerControllerB localPlayerController;

		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		[HarmonyPostfix]
		public static void ResetValues()
		{
			ConfigSync.isSynced = false;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void Init(PlayerControllerB __instance)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance)
			{
				localPlayerController = __instance;
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlus-OnHotbarSlotChangeClientRpc", new HandleNamedMessageDelegate(OnHotbarSlotChangeClientRpc));
				if (NetworkManager.Singleton.IsServer)
				{
					NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlus-OnHotbarSlotChangeServerRpc", new HandleNamedMessageDelegate(OnHotbarSlotChangeServerRpc));
				}
			}
		}

		private static void SendHotbarSlotChange(int hotbarSlot)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsClient)
			{
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1);
				Plugin.Log("Sending hotbar swap slot: " + hotbarSlot);
				((FastBufferWriter)(ref val)).WriteValue<int>(ref hotbarSlot, default(ForPrimitives));
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("HotbarPlus-OnHotbarSlotChangeServerRpc", 0uL, val, (NetworkDelivery)3);
			}
		}

		private static void OnHotbarSlotChangeServerRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsServer)
			{
				int num = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving request for hotbar swap. Slot: " + num + " ClientId: " + clientId);
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(12, (Allocator)2, -1);
				((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives));
				((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(ref clientId, default(ForPrimitives));
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("HotbarPlus-OnHotbarSlotChangeClientRpc", val, (NetworkDelivery)3);
			}
		}

		private static void OnHotbarSlotChangeClientRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_002e: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkManager.Singleton.IsClient)
			{
				return;
			}
			if (((FastBufferReader)(ref reader)).TryBeginRead(12))
			{
				int hotbarSlot = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref hotbarSlot, default(ForPrimitives));
				ulong num = default(ulong);
				((FastBufferReader)(ref reader)).ReadValue<ulong>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving update for hotbar swap. Slot: " + hotbarSlot + " ClientId: " + num);
				if (num == localPlayerController.actualClientId || UpdateClientHotbarSlot(num, hotbarSlot))
				{
					return;
				}
				Plugin.Log("Failed to receive hotbar swap index from Client: " + num);
			}
			Plugin.Log("Failed to receive hotbar swap index from Client");
		}

		private static bool UpdateClientHotbarSlot(ulong clientId, int hotbarSlot)
		{
			Plugin.Log("Updating hotbar slot: " + hotbarSlot + " ClientId: " + clientId);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (StartOfRound.Instance.allPlayerScripts[i].actualClientId == clientId)
				{
					CallSwitchToItemSlotMethod(StartOfRound.Instance.allPlayerScripts[i], hotbarSlot);
					return true;
				}
			}
			return false;
		}

		public static void SwapHotbarSlot(int hotbarIndex)
		{
			if (hotbarIndex < PlayerPatcher.targetHotbarSize)
			{
				SendHotbarSlotChange(hotbarIndex);
				CallSwitchToItemSlotMethod(localPlayerController, hotbarIndex);
			}
		}

		private static void CallSwitchToItemSlotMethod(PlayerControllerB playerController, int hotbarIndex)
		{
			if (hotbarIndex < PlayerPatcher.targetHotbarSize && playerController.currentItemSlot != hotbarIndex)
			{
				if ((Object)(object)playerController == (Object)(object)localPlayerController)
				{
					ShipBuildModeManager.Instance.CancelBuildMode(true);
					playerController.playerBodyAnimator.SetBool("GrabValidated", false);
				}
				MethodInfo method = ((object)playerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
				method.Invoke(playerController, new object[2] { hotbarIndex, null });
				PlayerPatcher.SetTimeSinceSwitchingSlots(playerController, 0f);
				if ((Object)(object)playerController.currentlyHeldObjectServer != (Object)null)
				{
					((Component)playerController.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(playerController.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f);
				}
			}
		}
	}
	[BepInPlugin("FlipMods.HotbarPlus", "HotbarPlus", "1.5.7")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		private Harmony _harmony;

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			instance = this;
			_harmony = new Harmony("HotbarPlus");
			ConfigSettings.BindConfigSettings();
			Keybinds.InitKeybinds();
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"HotbarPlus loaded");
		}

		public static bool IsModLoaded(string guid)
		{
			return Chainloader.PluginInfos.ContainsKey(guid);
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}

		public static void LogError(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogError((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.HotbarPlus";

		public const string PLUGIN_NAME = "HotbarPlus";

		public const string PLUGIN_VERSION = "1.5.7";
	}
}
namespace HotbarPlus.Patches
{
	[HarmonyPatch]
	public class HUDPatcher
	{
		public static float hotbarSlotSize = 40f;

		public static void ResizeHotbarSlotsHUD()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: 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_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			List<Image> list = new List<Image>(HUDManager.Instance.itemSlotIconFrames);
			List<Image> list2 = new List<Image>(HUDManager.Instance.itemSlotIcons);
			float num = (hotbarSlotSize + ConfigSettings.overrideHotbarSpacing.Value) * ConfigSettings.overrideHotbarHudSize.Value;
			float num2 = ((Graphic)list[0]).rectTransform.anchoredPosition.y + 36f * ((ConfigSettings.overrideHotbarHudSize.Value - 1f) / 2f);
			Vector3 eulerAngles = ((Transform)((Graphic)list[0]).rectTransform).eulerAngles;
			Vector3 eulerAngles2 = ((Transform)((Graphic)list2[0]).rectTransform).eulerAngles;
			for (int i = 0; i < Mathf.Max(PlayerPatcher.targetHotbarSize, PlayerPatcher.initialHotbarSize); i++)
			{
				if (i >= PlayerPatcher.targetHotbarSize)
				{
					Object.Destroy((Object)(object)list[PlayerPatcher.targetHotbarSize]);
					Object.Destroy((Object)(object)list2[PlayerPatcher.targetHotbarSize]);
					list.RemoveAt(PlayerPatcher.targetHotbarSize);
					list2.RemoveAt(PlayerPatcher.targetHotbarSize);
					continue;
				}
				if (i >= PlayerPatcher.initialHotbarSize)
				{
					list.Insert(i, Object.Instantiate<Image>(list[i - 1], ((Component)list[0]).transform.parent));
					((Component)list[i]).transform.SetSiblingIndex(((Component)list[i - 1]).transform.GetSiblingIndex() + 1);
					list2.Insert(i, ((Component)((Component)list[i]).transform.GetChild(0)).GetComponent<Image>());
				}
				((Object)list[i]).name = $"Slot{i}";
				((Graphic)list[i]).rectTransform.anchoredPosition = Vector2.up * num2;
				((Transform)((Graphic)list[i]).rectTransform).eulerAngles = eulerAngles;
				((Object)list2[i]).name = "Icon";
				((Transform)((Graphic)list2[i]).rectTransform).eulerAngles = eulerAngles2;
			}
			float num3 = num * (float)(PlayerPatcher.targetHotbarSize - 1);
			float num4 = num3 / 2f;
			for (int j = 0; j < PlayerPatcher.targetHotbarSize; j++)
			{
				float num5 = (float)j * num - num4;
				((Graphic)list[j]).rectTransform.anchoredPosition = new Vector2(num5, num2);
				RectTransform rectTransform = ((Graphic)list[j]).rectTransform;
				rectTransform.sizeDelta *= ConfigSettings.overrideHotbarHudSize.Value;
				RectTransform rectTransform2 = ((Graphic)list2[j]).rectTransform;
				rectTransform2.sizeDelta *= ConfigSettings.overrideHotbarHudSize.Value;
			}
			HUDManager.Instance.itemSlotIconFrames = list.ToArray();
			HUDManager.Instance.itemSlotIcons = list2.ToArray();
		}

		[HarmonyPatch(typeof(HUDManager), "PingHUDElement")]
		[HarmonyPrefix]
		public static void PingHUDElement(HUDElement element, ref float startAlpha, ref float endAlpha, HUDManager __instance)
		{
			if (element != __instance.Inventory || endAlpha != 0.13f)
			{
				return;
			}
			if (startAlpha == 0.13f && StartOfRound.Instance.localPlayerController.twoHanded)
			{
				endAlpha = 1f;
				return;
			}
			endAlpha = Mathf.Clamp(ConfigSettings.overrideFadeHudAlpha.Value, 0f, 1f);
			if (startAlpha == 0.13f)
			{
				startAlpha = endAlpha;
			}
		}
	}
	[HarmonyPatch]
	public class PlayerPatcher
	{
		public static PlayerControllerB localPlayerController;

		public static int initialHotbarSize = -1;

		public static int postInitialHotbarSize = -1;

		public static int targetHotbarSize = -1;

		public static int newHotbarSize = -1;

		public static float timeDroppedItem;

		[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
		[HarmonyPostfix]
		public static void GetInitialHotbarSize(PlayerControllerB __instance)
		{
			if (initialHotbarSize == -1)
			{
				initialHotbarSize = __instance.ItemSlots.Length;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void InitializeLocalPlayer(PlayerControllerB __instance)
		{
			localPlayerController = __instance;
			((Component)HUDManager.Instance.itemSlotIconFrames[Mathf.Max(__instance.currentItemSlot, 0)]).GetComponent<Animator>().SetBool("selectedSlot", true);
			HUDManager.Instance.PingHUDElement(HUDManager.Instance.Inventory, 0.1f, 0.13f, 0.13f);
		}

		public static void ResizeInventory()
		{
			postInitialHotbarSize = localPlayerController.ItemSlots.Length;
			targetHotbarSize = Mathf.Clamp(ConfigSync.instance.hotbarSize, 0, 10);
			newHotbarSize = Mathf.Clamp(ConfigSync.instance.hotbarSize + (postInitialHotbarSize - initialHotbarSize), 0, 10);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i];
				val.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[newHotbarSize];
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyPrefix]
		public static bool PreventItemSwapWhileDroppingItem(PlayerControllerB __instance)
		{
			return true;
		}

		public static int CallGetNextItemSlot(PlayerControllerB __instance, bool forward, int index)
		{
			int currentItemSlot = __instance.currentItemSlot;
			__instance.currentItemSlot = index;
			MethodInfo method = ((object)__instance).GetType().GetMethod("NextItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
			index = (int)method.Invoke(__instance, new object[1] { forward });
			__instance.currentItemSlot = currentItemSlot;
			return index;
		}

		public static void CallSwitchToItemSlot(PlayerControllerB __instance, int index, GrabbableObject fillSlotWithItem = null)
		{
			MethodInfo method = ((object)__instance).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
			method.Invoke(__instance, new object[2] { index, fillSlotWithItem });
			SetTimeSinceSwitchingSlots(__instance, 0f);
		}

		public static float GetTimeSinceSwitchingSlots(PlayerControllerB playerController)
		{
			return (float)Traverse.Create((object)playerController).Field("timeSinceSwitchingSlots").GetValue();
		}

		public static void SetTimeSinceSwitchingSlots(PlayerControllerB playerController, float value)
		{
			Traverse.Create((object)playerController).Field("timeSinceSwitchingSlots").SetValue((object)value);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchSwitchItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (!ConfigSettings.disableFasterHotbarSwapping.Value)
			{
				for (int i = 0; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.3f)
					{
						list[i].operand = ConfigSettings.minSwapItemInterval;
						break;
					}
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchActivateItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (!ConfigSettings.disableFasterItemActivate.Value)
			{
				for (int i = 0; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.075f)
					{
						list[i].operand = ConfigSettings.minActivateItemInterval;
						break;
					}
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Discard_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchDiscardItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (!ConfigSettings.disableFasterItemDropping.Value)
			{
				for (int i = 0; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.2f)
					{
						list[i].operand = ConfigSettings.minDiscardItemInterval;
					}
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Interact_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchInteractInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.2f)
				{
					list[i].operand = ConfigSettings.minInteractInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "PerformEmote")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchPerformEmoteInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.5f)
				{
					list[i].operand = ConfigSettings.minUseEmoteInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> InvertHotbarScrollDirection(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (ConfigSettings.invertHotbarScrollDirectionConfig.Value)
			{
				for (int i = 1; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ble_Un && list[i - 1].opcode == OpCodes.Ldc_R4 && (float)list[i - 1].operand == 0f)
					{
						list[i].opcode = OpCodes.Bge_Un;
						break;
					}
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch]
	public class QuickDrop
	{
		public static float timeDroppedItem;

		public static bool droppingItem;

		public static PlayerControllerB localPlayerController => StartOfRound.Instance?.localPlayerController;

		[HarmonyPatch(typeof(PlayerControllerB), "DiscardHeldObject")]
		[HarmonyPostfix]
		public static void PerformQuickDiscard(PlayerControllerB __instance)
		{
			if ((Object)(object)__instance != (Object)(object)localPlayerController || !ConfigSettings.useItemQuickDropConfig.Value || !ConfigSync.isSynced)
			{
				return;
			}
			localPlayerController.playerBodyAnimator.SetBool("cancelGrab", false);
			int num;
			for (num = PlayerPatcher.CallGetNextItemSlot(__instance, forward: true, __instance.currentItemSlot); num != __instance.currentItemSlot; num = PlayerPatcher.CallGetNextItemSlot(__instance, forward: true, num))
			{
				GrabbableObject val = __instance.ItemSlots[num];
				if ((Object)(object)val != (Object)null)
				{
					break;
				}
			}
			if (num != __instance.currentItemSlot)
			{
				droppingItem = true;
				PlayerPatcher.SetTimeSinceSwitchingSlots(__instance, 0f);
				__instance.playerBodyAnimator.ResetTrigger("SwitchHoldAnimation");
				((MonoBehaviour)__instance).StartCoroutine(SwitchToItemSlotAfterDelay(__instance, num));
			}
		}

		private static IEnumerator SwitchToItemSlotAfterDelay(PlayerControllerB __instance, int slot)
		{
			if (!ConfigSettings.disableFasterHotbarSwapping.Value)
			{
				_ = ConfigSettings.minSwapItemInterval;
			}
			timeDroppedItem = Time.time;
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)__instance.currentlyHeldObjectServer == (Object)null));
			_ = Time.time - timeDroppedItem;
			SyncManager.SwapHotbarSlot(slot);
			droppingItem = false;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyPrefix]
		public static bool PreventItemSwappingDroppingItem(CallbackContext context, PlayerControllerB __instance)
		{
			if ((Object)(object)__instance == (Object)(object)localPlayerController && droppingItem)
			{
				return false;
			}
			return true;
		}
	}
}
namespace HotbarPlus.Input
{
	internal class IngameKeybinds : LcInputActions
	{
		internal static IngameKeybinds Instance = new IngameKeybinds();

		[InputAction("<Keyboard>/1", Name = "[HB+] Quick Slot 1")]
		public InputAction QuickHotbarSlotHotkey1 { get; set; }

		[InputAction("<Keyboard>/2", Name = "[HB+] Quick Slot 2")]
		public InputAction QuickHotbarSlotHotkey2 { get; set; }

		[InputAction("<Keyboard>/3", Name = "[HB+] Quick Slot 3")]
		public InputAction QuickHotbarSlotHotkey3 { get; set; }

		[InputAction("<Keyboard>/4", Name = "[HB+] Quick Slot 4")]
		public InputAction QuickHotbarSlotHotkey4 { get; set; }

		[InputAction("<Keyboard>/5", Name = "[HB+] Quick Slot 5")]
		public InputAction QuickHotbarSlotHotkey5 { get; set; }

		[InputAction("<Keyboard>/6", Name = "[HB+] Quick Slot 6")]
		public InputAction QuickHotbarSlotHotkey6 { get; set; }

		internal static InputActionAsset GetAsset()
		{
			return ((LcInputActions)Instance).Asset;
		}
	}
	internal class InputUtilsCompat
	{
		internal static InputActionAsset Asset => IngameKeybinds.GetAsset();

		internal static bool Enabled => Plugin.IsModLoaded("com.rune580.LethalCompanyInputUtils");

		public static InputAction QuickHotbarSlotHotkey1 => IngameKeybinds.Instance.QuickHotbarSlotHotkey1;

		public static InputAction QuickHotbarSlotHotkey2 => IngameKeybinds.Instance.QuickHotbarSlotHotkey2;

		public static InputAction QuickHotbarSlotHotkey3 => IngameKeybinds.Instance.QuickHotbarSlotHotkey3;

		public static InputAction QuickHotbarSlotHotkey4 => IngameKeybinds.Instance.QuickHotbarSlotHotkey4;

		public static InputAction QuickHotbarSlotHotkey5 => IngameKeybinds.Instance.QuickHotbarSlotHotkey5;

		public static InputAction QuickHotbarSlotHotkey6 => IngameKeybinds.Instance.QuickHotbarSlotHotkey6;
	}
	[HarmonyPatch]
	public class Keybinds
	{
		private static bool setHotbarSize;

		public static InputActionAsset Asset;

		public static InputActionMap ActionMap;

		public static InputAction quickHotbarSlotHotkey1;

		public static InputAction quickHotbarSlotHotkey2;

		public static InputAction quickHotbarSlotHotkey3;

		public static InputAction quickHotbarSlotHotkey4;

		public static InputAction quickHotbarSlotHotkey5;

		public static InputAction quickHotbarSlotHotkey6;

		private static PlayerControllerB localPlayerController => StartOfRound.Instance?.localPlayerController;

		public static void InitKeybinds()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			setHotbarSize = false;
			if (ConfigSettings.useHotbarNumberHotkeysConfig.Value)
			{
				if (InputUtilsCompat.Enabled)
				{
					Asset = InputUtilsCompat.Asset;
					quickHotbarSlotHotkey1 = InputUtilsCompat.QuickHotbarSlotHotkey1;
					quickHotbarSlotHotkey2 = InputUtilsCompat.QuickHotbarSlotHotkey2;
					quickHotbarSlotHotkey3 = InputUtilsCompat.QuickHotbarSlotHotkey3;
					quickHotbarSlotHotkey4 = InputUtilsCompat.QuickHotbarSlotHotkey4;
					quickHotbarSlotHotkey5 = InputUtilsCompat.QuickHotbarSlotHotkey5;
					quickHotbarSlotHotkey6 = InputUtilsCompat.QuickHotbarSlotHotkey6;
				}
				else
				{
					Asset = new InputActionAsset();
					ActionMap = new InputActionMap("HotbarPlus");
					quickHotbarSlotHotkey1 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 1", (InputActionType)0, "<Keyboard>/1", "Press", (string)null, (string)null, (string)null);
					quickHotbarSlotHotkey2 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 2", (InputActionType)0, "<Keyboard>/2", "Press", (string)null, (string)null, (string)null);
					quickHotbarSlotHotkey3 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 3", (InputActionType)0, "<Keyboard>/3", "Press", (string)null, (string)null, (string)null);
					quickHotbarSlotHotkey4 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 4", (InputActionType)0, "<Keyboard>/4", "Press", (string)null, (string)null, (string)null);
					quickHotbarSlotHotkey5 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 5", (InputActionType)0, "<Keyboard>/5", "Press", (string)null, (string)null, (string)null);
					quickHotbarSlotHotkey6 = InputActionSetupExtensions.AddAction(ActionMap, "[HB+] Quick Slot 6", (InputActionType)0, "<Keyboard>/6", "Press", (string)null, (string)null, (string)null);
					InputActionSetupExtensions.AddActionMap(Asset, ActionMap);
				}
			}
		}

		public static void OnSetHotbarSize()
		{
			setHotbarSize = true;
		}

		[HarmonyPatch(typeof(StartOfRound), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable()
		{
			if (ConfigSettings.useHotbarNumberHotkeysConfig.Value)
			{
				Asset.Enable();
				quickHotbarSlotHotkey1.performed += OnPressItemSlotHotkeyAction1;
				quickHotbarSlotHotkey2.performed += OnPressItemSlotHotkeyAction2;
				quickHotbarSlotHotkey3.performed += OnPressItemSlotHotkeyAction3;
				quickHotbarSlotHotkey4.performed += OnPressItemSlotHotkeyAction4;
				quickHotbarSlotHotkey5.performed += OnPressItemSlotHotkeyAction5;
				quickHotbarSlotHotkey6.performed += OnPressItemSlotHotkeyAction6;
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			if (ConfigSettings.useHotbarNumberHotkeysConfig.Value)
			{
				Asset.Disable();
				quickHotbarSlotHotkey1.performed -= OnPressItemSlotHotkeyAction1;
				quickHotbarSlotHotkey2.performed -= OnPressItemSlotHotkeyAction2;
				quickHotbarSlotHotkey3.performed -= OnPressItemSlotHotkeyAction3;
				quickHotbarSlotHotkey4.performed -= OnPressItemSlotHotkeyAction4;
				quickHotbarSlotHotkey5.performed -= OnPressItemSlotHotkeyAction5;
				quickHotbarSlotHotkey6.performed -= OnPressItemSlotHotkeyAction6;
			}
		}

		private static void OnPressItemSlotHotkeyAction1(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 0);
		}

		private static void OnPressItemSlotHotkeyAction2(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 1);
		}

		private static void OnPressItemSlotHotkeyAction3(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 2);
		}

		private static void OnPressItemSlotHotkeyAction4(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 3);
		}

		private static void OnPressItemSlotHotkeyAction5(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 4);
		}

		private static void OnPressItemSlotHotkeyAction6(CallbackContext context)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			OnPressItemSlotHotkeyAction(context, 5);
		}

		private static void OnPressItemSlotHotkeyAction(CallbackContext context, int slot)
		{
			if (ConfigSettings.useHotbarNumberHotkeysConfig.Value && setHotbarSize && !((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && localPlayerController.isPlayerControlled && slot >= 0 && slot < ConfigSync.instance.hotbarSize && ((CallbackContext)(ref context)).performed && !(bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue() && !localPlayerController.isTypingChat && !localPlayerController.inTerminalMenu && !localPlayerController.twoHanded && !(PlayerPatcher.GetTimeSinceSwitchingSlots(localPlayerController) < ((!ConfigSettings.disableFasterHotbarSwapping.Value) ? ConfigSettings.minSwapItemInterval : 0.3f)))
			{
				SyncManager.SwapHotbarSlot(slot);
			}
		}
	}
}
namespace HotbarPlus.Config
{
	public static class ConfigSettings
	{
		public static ConfigEntry<int> hotbarSizeConfig;

		public static ConfigEntry<bool> useHotbarNumberHotkeysConfig;

		public static ConfigEntry<bool> invertHotbarScrollDirectionConfig;

		public static ConfigEntry<float> overrideHotbarSpacing;

		public static ConfigEntry<float> overrideFadeHudAlpha;

		public static ConfigEntry<float> overrideHotbarHudSize;

		public static ConfigEntry<bool> useItemQuickDropConfig;

		public static ConfigEntry<bool> disableFasterHotbarSwapping;

		public static ConfigEntry<bool> disableFasterItemDropping;

		public static ConfigEntry<bool> disableFasterItemActivate;

		public static Dictionary<string, ConfigEntryBase> currentConfigEntries = new Dictionary<string, ConfigEntryBase>();

		public static float minSwapItemInterval = 0.05f;

		public static float minActivateItemInterval = 0.05f;

		public static float minDiscardItemInterval = 0.05f;

		public static float minInteractInterval = 0.05f;

		public static float minUseEmoteInterval = 0.25f;

		public static List<ConfigEntryBase> configEntries = new List<ConfigEntryBase>();

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			hotbarSizeConfig = AddConfigEntry<int>(((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Server-side", "HotbarSize", 4, "[Host only] The amount of hotbar slots player will have. This will sync with other clients who have the mod."));
			useHotbarNumberHotkeysConfig = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "UseHotbarNumberHotkeys", true, "Use the quick item selection numerical hotkeys."));
			invertHotbarScrollDirectionConfig = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "InvertHotbarScrollDirection", true, "Inverts the direction in which you scroll on the hotbar. Will not affect the terminal scrolling direction."));
			overrideHotbarSpacing = AddConfigEntry<float>(((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Client-side", "OverrideHotbarHudSpacing", 10f, "The spacing between each hotbar slot UI element. Not recommended to go below 0... But no one is stopping you."));
			overrideFadeHudAlpha = AddConfigEntry<float>(((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Client-side", "OverrideFadeHudAlpha", 0.13f, "Sets the alpha for when the hotbar hud fades. Default = 0.13 | Fade completely: 0 | Never fade: 1"));
			overrideHotbarHudSize = AddConfigEntry<float>(((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Client-side", "OverrideHotbarHudSize", 1f, "Scales the hotbar slot HUD elements by a multiplier. HUD spacing and position will be scaled/adjusted automatically."));
			useItemQuickDropConfig = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "UseItemQuickDropConfig", true, "If enabled, dropping an item will automatically swap to the next item for easier chain dropping. This may not work if the host does not have the mod. This is for stability reasons, and to help reduce de-sync."));
			disableFasterHotbarSwapping = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "UseDefaultItemSwapInterval", false, "If true, the interval (delay) between swapping items will not be reduced by this mod."));
			disableFasterItemDropping = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "UseDefaultItemDropInterval", false, "If true, the interval (delay) between dropping items will not be reduced by this mod."));
			disableFasterItemActivate = AddConfigEntry<bool>(((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Client-side", "UseDefaultItemActivateInterval", false, "If true, the interval (delay) between activating items will not be reduced by this mod."));
			TryRemoveOldConfigSettings();
			ConfigSync.BuildDefaultConfig();
		}

		public static ConfigEntry<T> AddConfigEntry<T>(ConfigEntry<T> configEntry)
		{
			currentConfigEntries.Add(((ConfigEntryBase)configEntry).Definition.Key, (ConfigEntryBase)(object)configEntry);
			return configEntry;
		}

		public static void TryRemoveOldConfigSettings()
		{
			HashSet<string> hashSet = new HashSet<string>();
			HashSet<string> hashSet2 = new HashSet<string>();
			foreach (ConfigEntryBase value in currentConfigEntries.Values)
			{
				hashSet.Add(value.Definition.Section);
				hashSet2.Add(value.Definition.Key);
			}
			try
			{
				Plugin.Log("Cleaning old config entries");
				ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config;
				string configFilePath = config.ConfigFilePath;
				if (!File.Exists(configFilePath))
				{
					return;
				}
				string text = File.ReadAllText(configFilePath);
				string[] array = File.ReadAllLines(configFilePath);
				string text2 = "";
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = array[i].Replace("\n", "");
					if (array[i].Length <= 0)
					{
						continue;
					}
					if (array[i].StartsWith("["))
					{
						if (text2 != "" && !hashSet.Contains(text2))
						{
							text2 = "[" + text2 + "]";
							int num = text.IndexOf(text2);
							int num2 = text.IndexOf(array[i]);
							text = text.Remove(num, num2 - num);
						}
						text2 = array[i].Replace("[", "").Replace("]", "").Trim();
					}
					else
					{
						if (!(text2 != ""))
						{
							continue;
						}
						if (i <= array.Length - 4 && array[i].StartsWith("##"))
						{
							int j;
							for (j = 1; i + j < array.Length && array[i + j].Length > 3; j++)
							{
							}
							if (hashSet.Contains(text2))
							{
								int num3 = array[i + j - 1].IndexOf("=");
								string item = array[i + j - 1].Substring(0, num3 - 1);
								if (!hashSet2.Contains(item))
								{
									int num4 = text.IndexOf(array[i]);
									int num5 = text.IndexOf(array[i + j - 1]) + array[i + j - 1].Length;
									text = text.Remove(num4, num5 - num4);
								}
							}
							i += j - 1;
						}
						else if (array[i].Length > 3)
						{
							text = text.Replace(array[i], "");
						}
					}
				}
				if (!hashSet.Contains(text2))
				{
					text2 = "[" + text2 + "]";
					int num6 = text.IndexOf(text2);
					text = text.Remove(num6, text.Length - num6);
				}
				while (text.Contains("\n\n\n"))
				{
					text = text.Replace("\n\n\n", "\n\n");
				}
				File.WriteAllText(configFilePath, text);
				config.Reload();
			}
			catch
			{
			}
		}
	}
	[HarmonyPatch]
	public class ConfigSync
	{
		public static ConfigSync defaultConfig;

		public static ConfigSync instance;

		public static PlayerControllerB localPlayerController;

		public static bool isSynced;

		public int hotbarSize = 4;

		public ConfigSync()
		{
			hotbarSize = ConfigSettings.hotbarSizeConfig.Value;
		}

		public static void BuildDefaultConfig()
		{
			defaultConfig = new ConfigSync();
		}

		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		[HarmonyPostfix]
		public static void ResetValues()
		{
			isSynced = false;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void InitializeLocalPlayer(PlayerControllerB __instance)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			localPlayerController = __instance;
			if (NetworkManager.Singleton.IsServer)
			{
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlusOnRequestConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSyncRequest));
				instance = defaultConfig;
				OnLocalClientConfigSync();
			}
			else
			{
				instance = new ConfigSync();
				instance.hotbarSize = 4;
				isSynced = false;
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlusOnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSync));
				RequestConfigSync();
			}
		}

		public static void RequestConfigSync()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsClient)
			{
				Plugin.Log("Sending config sync request to server.");
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("HotbarPlusOnRequestConfigSync", 0uL, new FastBufferWriter(0, (Allocator)2, -1), (NetworkDelivery)3);
			}
			else
			{
				Plugin.LogError("Failed to send config sync request.");
			}
		}

		public static void OnReceiveConfigSyncRequest(ulong clientId, FastBufferReader reader)
		{
			//IL_0048: 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)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsServer)
			{
				Plugin.Log("Receiving hotbar size sync request from client with id: " + clientId + ". Sending config sync to client.");
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1);
				((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref instance.hotbarSize, default(ForPrimitives));
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("HotbarPlusOnReceiveConfigSync", clientId, val, (NetworkDelivery)3);
			}
		}

		public static void OnReceiveConfigSync(ulong clientId, FastBufferReader reader)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Log("Receiving hotbar size sync from server.");
			int num = default(int);
			((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives));
			instance.hotbarSize = num;
			OnLocalClientConfigSync();
		}

		public static void OnLocalClientConfigSync()
		{
			isSynced = true;
			PlayerPatcher.ResizeInventory();
			HUDPatcher.ResizeHotbarSlotsHUD();
			Keybinds.OnSetHotbarSize();
		}
	}
}

BepInEx/plugins/Monkeytype-HideChat/HideChat.dll

Decompiled 9 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HideChat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HideChat")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fa900f4d-71b1-433a-ad23-a10fc53dc3d8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HideChat
{
	[BepInPlugin("Miodec.HideChat", "Hide Chat", "1.0.0")]
	public class HidePlayerNames : BaseUnityPlugin
	{
		private const string modGUID = "Miodec.HideChat";

		private const string modName = "Hide Chat";

		private const string modVersion = "1.0.0";

		private static HidePlayerNames Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Miodec.HideChat");
			mls.LogDebug((object)"hidechat is awake");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		}
	}
}
namespace HideChat.Patches
{
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		[HarmonyPatch("OpenMenu_performed")]
		[HarmonyPatch("SubmitChat_performed")]
		[HarmonyPatch("AddChatMessage")]
		[HarmonyPostfix]
		public static void FadeToNothing(ref HUDManager __instance)
		{
			__instance.PingHUDElement(__instance.Chat, 5f, 1f, 0f);
		}
	}
}

BepInEx/plugins/Pooble-LCBetterSaves/LCBetterSaves.dll

Decompiled 9 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using HarmonyLib;
using LCBetterSaves;
using LCBetterSaves.Properties;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LCBetterSaves")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Better save files for Lethal Company")]
[assembly: AssemblyFileVersion("1.7.3.0")]
[assembly: AssemblyInformationalVersion("1.7.3+a2dc06eb8878819ddec7c1fd8cd6bac050c25d3c")]
[assembly: AssemblyProduct("LCBetterSaves")]
[assembly: AssemblyTitle("LCBetterSaves")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.7.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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;
		}
	}
}
public class NewFileUISlot_BetterSaves : MonoBehaviour
{
	public Animator buttonAnimator;

	public Button button;

	public bool isSelected;

	public void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		buttonAnimator = ((Component)this).GetComponent<Animator>();
		button = ((Component)this).GetComponent<Button>();
		((UnityEvent)button.onClick).AddListener(new UnityAction(SetFileToThis));
	}

	public void SetFileToThis()
	{
		string currentSaveFileName = "LCSaveFile" + Plugin.newSaveFileNum;
		GameNetworkManager.Instance.currentSaveFileName = currentSaveFileName;
		GameNetworkManager.Instance.saveFileNum = Plugin.newSaveFileNum;
		SetButtonColorForAllFileSlots();
		isSelected = true;
		SetButtonColor();
	}

	public void SetButtonColorForAllFileSlots()
	{
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			saveFileUISlot_BetterSaves.SetButtonColor();
			saveFileUISlot_BetterSaves.deleteButton.SetActive(false);
			saveFileUISlot_BetterSaves.renameButton.SetActive(false);
		}
	}

	public void SetButtonColor()
	{
		buttonAnimator.SetBool("isPressed", isSelected);
	}
}
public class SaveFileUISlot_BetterSaves : MonoBehaviour
{
	public Animator buttonAnimator;

	public Button button;

	public TextMeshProUGUI fileStatsText;

	public int fileNum;

	public string fileString;

	public TextMeshProUGUI fileNotCompatibleAlert;

	public GameObject deleteButton;

	public GameObject renameButton;

	public void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		buttonAnimator = ((Component)this).GetComponent<Animator>();
		button = ((Component)this).GetComponent<Button>();
		((UnityEvent)button.onClick).AddListener(new UnityAction(SetFileToThis));
		fileStatsText = ((Component)((Component)this).transform.GetChild(2)).GetComponent<TextMeshProUGUI>();
		fileNotCompatibleAlert = ((Component)((Component)this).transform.GetChild(4)).GetComponent<TextMeshProUGUI>();
		deleteButton = ((Component)((Component)this).transform.GetChild(3)).gameObject;
	}

	public void Start()
	{
		UpdateStats();
	}

	private void OnEnable()
	{
		if (!Object.FindObjectOfType<MenuManager>().filesCompatible[fileNum])
		{
			((Behaviour)fileNotCompatibleAlert).enabled = true;
		}
	}

	public void UpdateStats()
	{
		try
		{
			if (ES3.FileExists(fileString))
			{
				int num = ES3.Load<int>("GroupCredits", fileString, 30);
				int num2 = ES3.Load<int>("Stats_DaysSpent", fileString, 0);
				((TMP_Text)fileStatsText).text = $"${num}\nDays: {num2}";
			}
			else
			{
				((TMP_Text)fileStatsText).text = "";
			}
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("Error updating stats: " + ex.Message));
		}
	}

	public void SetButtonColor()
	{
		buttonAnimator.SetBool("isPressed", GameNetworkManager.Instance.currentSaveFileName == fileString);
	}

	public void SetFileToThis()
	{
		Plugin.fileToModify = fileNum;
		GameNetworkManager.Instance.currentSaveFileName = fileString;
		GameNetworkManager.Instance.saveFileNum = fileNum;
		SetButtonColorForAllFileSlots();
	}

	public void SetButtonColorForAllFileSlots()
	{
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			saveFileUISlot_BetterSaves.SetButtonColor();
			saveFileUISlot_BetterSaves.deleteButton.SetActive((Object)(object)saveFileUISlot_BetterSaves == (Object)(object)this);
			saveFileUISlot_BetterSaves.renameButton.SetActive((Object)(object)saveFileUISlot_BetterSaves == (Object)(object)this);
		}
		NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = Object.FindObjectOfType<NewFileUISlot_BetterSaves>();
		newFileUISlot_BetterSaves.isSelected = false;
		newFileUISlot_BetterSaves.SetButtonColor();
	}
}
public class RenameFileButton_BetterSaves : MonoBehaviour
{
	public void RenameFile()
	{
		string text = $"LCSaveFile{Plugin.fileToModify}";
		string text2 = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/HostSettingsContainer/LobbyHostOptions/OptionsNormal/ServerNameField/Text Area/Text").GetComponent<TMP_Text>().text;
		if (ES3.FileExists(text))
		{
			ES3.Save<string>("Alias_BetterSaves", text2, text);
			Debug.Log((object)("Granted alias " + text2 + " to file " + text));
		}
		Plugin.RefreshNameFields();
	}
}
public class DeleteFileButton_BetterSaves : MonoBehaviour
{
	public int fileToDelete;

	public AudioClip deleteFileSFX;

	public TextMeshProUGUI deleteFileText;

	public void UpdateFileToDelete()
	{
		fileToDelete = Plugin.fileToModify;
		if (ES3.Load<string>("Alias_BetterSaves", $"LCSaveFile{fileToDelete}", "") != "")
		{
			((TMP_Text)deleteFileText).text = "Do you want to delete file (" + ES3.Load<string>("Alias_BetterSaves", $"LCSaveFile{fileToDelete}", "") + ")?";
		}
		else
		{
			((TMP_Text)deleteFileText).text = $"Do you want to delete File {fileToDelete + 1}?";
		}
	}

	public void DeleteFile()
	{
		string text = $"LCSaveFile{fileToDelete}";
		if (ES3.FileExists(text))
		{
			ES3.DeleteFile(text);
			Object.FindObjectOfType<MenuManager>().MenuAudio.PlayOneShot(deleteFileSFX);
		}
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>(true);
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			Debug.Log((object)$"Deleted {fileToDelete}");
			if (saveFileUISlot_BetterSaves.fileNum == fileToDelete)
			{
				((Behaviour)saveFileUISlot_BetterSaves.fileNotCompatibleAlert).enabled = false;
				Object.FindObjectOfType<MenuManager>().filesCompatible[fileToDelete] = true;
				if (ES3.FileExists($"LGU_{fileToDelete}.json"))
				{
					Debug.Log((object)("Deleting LGU file located at " + text));
					ES3.DeleteFile($"LGU_{fileToDelete}.json");
				}
			}
		}
		Plugin.InitializeBetterSaves();
	}
}
namespace LCBetterSaves
{
	[BepInPlugin("LCBetterSaves", "LCBetterSaves", "1.7.3")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony = new Harmony("BetterSaves");

		public static int fileToModify = -1;

		public static int newSaveFileNum;

		public static Sprite renameSprite;

		public static MenuManager menuManager;

		public static AudioClip deleteFileSFX;

		public static TextMeshProUGUI deleteFileText;

		public static float buttonBaseY;

		public void Awake()
		{
			_harmony.PatchAll(typeof(Plugin));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LCBetterSaves is loaded!");
		}

		[HarmonyPatch(typeof(MenuManager), "Start")]
		public static void Postfix(MenuManager __instance)
		{
			//IL_0047: 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)
			menuManager = __instance;
			if ((Object)(object)renameSprite == (Object)null)
			{
				AssetBundle val = AssetBundle.LoadFromMemory(Resources.lcbettersaves);
				Texture2D val2 = val.LoadAsset<Texture2D>("Assets/RenameSprite.png");
				renameSprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f));
			}
			InitializeBetterSaves();
		}

		public static void InitializeBetterSaves()
		{
			try
			{
				DestroyBetterSavesButtons();
				DestroyOriginalSaveButtons();
				UpdateTopText();
				CreateModdedDeleteFileButton();
				CreateBetterSaveButtons();
				UpdateFilesPanelRect(CountSaveFiles() + 1);
				GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
				val.SetActive(false);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("An error occurred during initialization: " + ex.Message));
			}
		}

		public static void DestroyBetterSavesButtons()
		{
			try
			{
				SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
				foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array)
				{
					Object.Destroy((Object)(object)((Component)saveFileUISlot_BetterSaves).gameObject);
				}
				NewFileUISlot_BetterSaves[] array2 = Object.FindObjectsOfType<NewFileUISlot_BetterSaves>();
				foreach (NewFileUISlot_BetterSaves newFileUISlot_BetterSaves in array2)
				{
					Object.Destroy((Object)(object)((Component)newFileUISlot_BetterSaves).gameObject);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while destroying better saves buttons: " + ex.Message));
			}
		}

		public static void UpdateTopText()
		{
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/EnterAName");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Panel label not found.");
			}
			else
			{
				((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = "BetterSaves";
			}
		}

		public static void CreateModdedDeleteFileButton()
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			GameObject val = GameObject.Find("Canvas/MenuContainer/DeleteFileConfirmation/Panel/Delete");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Delete file game object not found.");
				return;
			}
			if ((Object)(object)val.GetComponent<DeleteFileButton_BetterSaves>() != (Object)null)
			{
				Debug.LogWarning((object)"DeleteFileButton_BetterSaves component already exists on deleteFileGO");
				return;
			}
			DeleteFileButton component = val.GetComponent<DeleteFileButton>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogError((object)"DeleteFileButton component not found on deleteFileGO");
				return;
			}
			if ((Object)(object)deleteFileSFX == (Object)null)
			{
				deleteFileSFX = component.deleteFileSFX;
			}
			if ((Object)(object)deleteFileText == (Object)null)
			{
				deleteFileText = component.deleteFileText;
			}
			Object.Destroy((Object)(object)component);
			if ((Object)(object)val.GetComponent<DeleteFileButton_BetterSaves>() == (Object)null)
			{
				DeleteFileButton_BetterSaves deleteFileButton_BetterSaves = val.AddComponent<DeleteFileButton_BetterSaves>();
				deleteFileButton_BetterSaves.deleteFileSFX = deleteFileSFX;
				deleteFileButton_BetterSaves.deleteFileText = deleteFileText;
				Button component2 = val.GetComponent<Button>();
				if ((Object)(object)component2 != (Object)null)
				{
					((UnityEventBase)component2.onClick).RemoveAllListeners();
					((UnityEvent)component2.onClick).AddListener(new UnityAction(deleteFileButton_BetterSaves.DeleteFile));
				}
				else
				{
					Debug.LogError((object)"Button component not found on deleteFileGO");
				}
			}
			else
			{
				Debug.LogWarning((object)"DeleteFileButton_BetterSaves component already exists on deleteFileGO");
			}
		}

		public static void CreateBetterSaveButtons()
		{
			try
			{
				GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
				val.SetActive(true);
				int numSaves = CountSaveFiles();
				Debug.Log((object)("Positioning based on " + numSaves + " saves."));
				NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = CreateNewFileNode(numSaves);
				List<string> list = NormalizeFileNames();
				newSaveFileNum = list.Count + 1;
				menuManager.filesCompatible = new bool[16];
				for (int i = 0; i < menuManager.filesCompatible.Length; i++)
				{
					menuManager.filesCompatible[i] = true;
				}
				for (int j = 0; j < list.Count; j++)
				{
					CreateModdedSaveNode(int.Parse(list[j].Replace("LCSaveFile", "")), ((Component)newFileUISlot_BetterSaves).gameObject);
				}
				val.SetActive(false);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while refreshing save buttons: " + ex.Message));
			}
		}

		public static NewFileUISlot_BetterSaves CreateNewFileNode(int numSaves)
		{
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: 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_0161: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Original GameObject not found.");
				return null;
			}
			Transform parent = val.transform.parent;
			SaveFileUISlot component = val.GetComponent<SaveFileUISlot>();
			if ((Object)(object)component != (Object)null)
			{
				Object.Destroy((Object)(object)component);
			}
			GameObject val2 = Object.Instantiate<GameObject>(val, parent);
			((Object)val2).name = "NewFile";
			TMP_Text component2 = ((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.text = "New File";
				NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = val2.AddComponent<NewFileUISlot_BetterSaves>();
				if ((Object)(object)newFileUISlot_BetterSaves == (Object)null)
				{
					Debug.LogError((object)"Failed to add NewFileUISlot_BetterSaves component.");
					return null;
				}
				Transform child = val2.transform.GetChild(3);
				if ((Object)(object)child != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)child).gameObject);
					try
					{
						RectTransform component3 = val2.GetComponent<RectTransform>();
						if (!((Object)(object)component3 != (Object)null))
						{
							Debug.LogError((object)"RectTransform component not found.");
							return null;
						}
						float x = component3.anchoredPosition.x;
						if (buttonBaseY == 0f)
						{
							buttonBaseY = component3.anchoredPosition.y - component3.sizeDelta.y * 1.75f;
						}
						float num = buttonBaseY + component3.sizeDelta.y * (float)(numSaves + 1) / 2f;
						component3.anchoredPosition = new Vector2(x, num);
					}
					catch (Exception ex)
					{
						Debug.LogError((object)("Error setting anchored position: " + ex.Message));
						return null;
					}
					return newFileUISlot_BetterSaves;
				}
				Debug.LogError((object)"Delete button not found.");
				return null;
			}
			Debug.LogError((object)"Text component not found.");
			return null;
		}

		private static int CountSaveFiles()
		{
			int num = 0;
			string[] files = ES3.GetFiles();
			foreach (string text in files)
			{
				if (ES3.FileExists(text) && Regex.IsMatch(text, "^LCSaveFile\\d+$"))
				{
					num++;
				}
			}
			return num;
		}

		public static void DestroyOriginalSaveButtons()
		{
			Object.Destroy((Object)(object)GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File2"));
			Object.Destroy((Object)(object)GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File3"));
		}

		public static List<string> NormalizeFileNames()
		{
			List<string> list = new List<string>();
			List<string> list2 = new List<string>();
			string text = "PH";
			string format = "LGUTempFile{0}";
			string format2 = "LGU_{0}.json";
			string[] files = ES3.GetFiles();
			foreach (string text2 in files)
			{
				if (ES3.FileExists(text2) && Regex.IsMatch(text2, "^LCSaveFile\\d+$"))
				{
					Debug.Log((object)("Found file: " + text2));
					list.Add(text2);
					string text3 = string.Format(format2, text2.Substring("LCSaveFile".Length));
					if (ES3.FileExists(text3))
					{
						Debug.Log((object)("Found LGU file: " + text3));
						list2.Add(text3);
					}
					else
					{
						list2.Add(text);
					}
				}
			}
			list.Sort(delegate(string a, string b)
			{
				int num3 = int.Parse(a.Substring("LCSaveFile".Length));
				int value = int.Parse(b.Substring("LCSaveFile".Length));
				return num3.CompareTo(value);
			});
			int num = 1;
			foreach (string item in list)
			{
				string text4 = "TempFile" + num;
				ES3.RenameFile(item, text4);
				Debug.Log((object)("Renamed " + item + " to " + text4));
				num++;
			}
			num = 1;
			foreach (string item2 in list2)
			{
				if (item2 == text)
				{
					num++;
					continue;
				}
				string text5 = string.Format(format, num.ToString());
				ES3.RenameFile(item2, text5);
				Debug.Log((object)("Renamed " + item2 + " to " + text5));
				num++;
			}
			int num2 = 1;
			List<string> list3 = new List<string>();
			foreach (string item3 in list)
			{
				string text6 = "TempFile" + num2;
				string text7 = "LCSaveFile" + num2;
				if (ES3.FileExists(text6))
				{
					ES3.RenameFile(text6, text7);
					list3.Add(text7);
					Debug.Log((object)("Renamed " + text6 + " to " + text7));
				}
				else
				{
					Debug.Log((object)("Temporary file " + text6 + " not found. It might have been moved or deleted."));
				}
				num2++;
			}
			num2 = 1;
			foreach (string item4 in list2)
			{
				string text8 = string.Format(format, num2.ToString());
				string text9 = string.Format(format2, num2.ToString());
				if (item4 == text)
				{
					num2++;
					continue;
				}
				if (ES3.FileExists(text8))
				{
					ES3.RenameFile(text8, text9);
					list3.Add(text9);
					Debug.Log((object)("Renamed " + text8 + " to " + text9));
				}
				else
				{
					Debug.Log((object)("Temporary file " + text8 + " not found. It might have been moved or deleted."));
				}
				num2++;
			}
			return list3;
		}

		public static void CreateModdedSaveNode(int fileNum, GameObject newFileButton)
		{
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Original GameObject not found.");
				return;
			}
			Transform parent = val.transform.parent;
			GameObject val2 = Object.Instantiate<GameObject>(val, parent);
			((Object)val2).name = "File" + fileNum + "_BetterSaves";
			string text = ES3.Load<string>("Alias_BetterSaves", "LCSaveFile" + fileNum, "");
			if (text == "")
			{
				((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>().text = "File " + fileNum;
			}
			else
			{
				((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>().text = text;
			}
			val2.AddComponent<SaveFileUISlot_BetterSaves>();
			SaveFileUISlot_BetterSaves component = val2.GetComponent<SaveFileUISlot_BetterSaves>();
			if ((Object)(object)component != (Object)null)
			{
				component.fileNum = fileNum;
				component.fileString = "LCSaveFile" + fileNum;
				RectTransform component2 = val2.GetComponent<RectTransform>();
				if ((Object)(object)component2 != (Object)null)
				{
					float x = component2.anchoredPosition.x;
					float y = newFileButton.GetComponent<RectTransform>().anchoredPosition.y;
					float num = y - component2.sizeDelta.y * (float)fileNum;
					component2.anchoredPosition = new Vector2(x, num);
				}
				GameObject gameObject = ((Component)val2.transform.GetChild(3)).gameObject;
				DeleteFileButton_BetterSaves component3 = GameObject.Find("Canvas/MenuContainer/DeleteFileConfirmation/Panel/Delete").GetComponent<DeleteFileButton_BetterSaves>();
				((UnityEvent)gameObject.gameObject.GetComponent<Button>().onClick).AddListener(new UnityAction(component3.UpdateFileToDelete));
				gameObject.SetActive(false);
				component.renameButton = CreateRenameFileButton(val2);
			}
			else
			{
				Debug.LogError((object)"SaveFileUISlot_BetterSaves component not found on the cloned GameObject.");
				Object.Destroy((Object)(object)val2);
			}
		}

		public static GameObject CreateRenameFileButton(GameObject fileNode)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject gameObject = ((Component)fileNode.transform.GetChild(3)).gameObject;
				GameObject val = Object.Instantiate<GameObject>(gameObject, fileNode.transform);
				((Object)val).name = "RenameButton";
				val.GetComponent<Image>().sprite = renameSprite;
				Button component = val.GetComponent<Button>();
				component.onClick = new ButtonClickedEvent();
				val.AddComponent<RenameFileButton_BetterSaves>();
				RenameFileButton_BetterSaves component2 = val.GetComponent<RenameFileButton_BetterSaves>();
				if ((Object)(object)component2 != (Object)null)
				{
					((UnityEvent)component.onClick).AddListener(new UnityAction(component2.RenameFile));
				}
				else
				{
					Debug.LogError((object)"RenameFileButton_BetterSaves component not found on renameButton");
				}
				RectTransform component3 = val.GetComponent<RectTransform>();
				if ((Object)(object)component3 != (Object)null)
				{
					float num = ((Transform)component3).localPosition.x + 20f;
					float y = ((Transform)component3).localPosition.y;
					((Transform)component3).localPosition = Vector2.op_Implicit(new Vector2(num, y));
				}
				val.SetActive(false);
				return val;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while creating rename file button: " + ex.Message));
				return null;
			}
		}

		public static void UpdateFilesPanelRect(int numSaves)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject obj = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel");
				RectTransform val = ((obj != null) ? obj.GetComponent<RectTransform>() : null);
				if ((Object)(object)val == (Object)null)
				{
					throw new Exception("Failed to find FilesPanel RectTransform.");
				}
				Vector2 sizeDelta = val.sizeDelta;
				GameObject obj2 = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
				RectTransform val2 = ((obj2 != null) ? obj2.GetComponent<RectTransform>() : null);
				if ((Object)(object)val2 == (Object)null)
				{
					throw new Exception("Failed to find File1 RectTransform.");
				}
				float y = val2.sizeDelta.y;
				sizeDelta.y = y * (float)(numSaves + 3);
				val.sizeDelta = sizeDelta;
				GameObject val3 = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/ChallengeMoonButton");
				RectTransform component = val3.GetComponent<RectTransform>();
				if ((Object)(object)component != (Object)null)
				{
					component.anchorMin = new Vector2(0.5f, 0.05f);
					component.anchorMax = new Vector2(0.5f, 0.05f);
					component.pivot = new Vector2(0.5f, 0.05f);
					component.anchoredPosition = new Vector2(0f, 0f);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while updating files panel rect: " + ex.Message));
			}
		}

		public static void RefreshNameFields()
		{
			SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
			SaveFileUISlot_BetterSaves[] array2 = array;
			foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
			{
				string text = ES3.Load<string>("Alias_BetterSaves", saveFileUISlot_BetterSaves.fileString, "");
				if (text == "")
				{
					((Component)((Component)saveFileUISlot_BetterSaves).transform.GetChild(1)).GetComponent<TMP_Text>().text = "File " + (saveFileUISlot_BetterSaves.fileNum + 1);
				}
				else
				{
					((Component)((Component)saveFileUISlot_BetterSaves).transform.GetChild(1)).GetComponent<TMP_Text>().text = text;
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LCBetterSaves";

		public const string PLUGIN_NAME = "LCBetterSaves";

		public const string PLUGIN_VERSION = "1.7.3";
	}
}
namespace LCBetterSaves.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	public class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("LCBetterSaves.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		public static byte[] lcbettersaves
		{
			get
			{
				object @object = ResourceManager.GetObject("lcbettersaves", resourceCulture);
				return (byte[])@object;
			}
		}

		internal Resources()
		{
		}
	}
}

BepInEx/plugins/Rune580-LethalCompany_InputUtils/LethalCompanyInputUtils/LethalCompanyInputUtils.dll

Decompiled 9 months 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 System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalCompanyInputUtils.Components;
using LethalCompanyInputUtils.Components.Section;
using LethalCompanyInputUtils.Data;
using LethalCompanyInputUtils.Glyphs;
using LethalCompanyInputUtils.Utils;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalCompanyInputUtils")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e25eafebdb33608e9e35fcf8e0a62f57e662942d")]
[assembly: AssemblyProduct("LethalCompanyInputUtils")]
[assembly: AssemblyTitle("LethalCompanyInputUtils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
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 LethalCompanyInputUtils
{
	public static class LcInputActionApi
	{
		private static readonly Dictionary<string, LcInputActions> InputActionsMap = new Dictionary<string, LcInputActions>();

		internal static bool PrefabLoaded;

		internal static RemapContainerController? ContainerInstance;

		internal static IReadOnlyCollection<LcInputActions> InputActions => InputActionsMap.Values;

		internal static void LoadIntoUI(KepRemapPanel panel)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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)
			AdjustSizeAndPos(panel);
			LayoutElement val = EnsureLayoutElement(panel);
			panel.LoadKeybindsUI();
			float horizontalOffset = panel.horizontalOffset;
			Rect rect = ((Component)((Transform)panel.keyRemapContainer).parent).GetComponent<RectTransform>().rect;
			float num = Mathf.Floor(((Rect)(ref rect)).width / horizontalOffset);
			int count = panel.keySlots.Count;
			int num2 = NumberOfActualKeys(panel.keySlots);
			int num3 = count - num2;
			panel.maxVertical = (float)num2 / num + (float)num3;
			if (ContainerInstance != null && ContainerInstance.legacyButton != null)
			{
				((TMP_Text)((Component)ContainerInstance.legacyButton).GetComponentInChildren<TextMeshProUGUI>()).SetText($"> Show Legacy Controls ({num2} present)", true);
			}
			if (count == 0)
			{
				return;
			}
			val.minHeight = (panel.maxVertical + 1f) * panel.verticalOffset;
			int num4 = 0;
			int num5 = 0;
			foreach (GameObject keySlot in panel.keySlots)
			{
				if ((float)num5 > num)
				{
					num4++;
					num5 = 0;
				}
				keySlot.GetComponent<RectTransform>().anchoredPosition = new Vector2((float)num5 * panel.horizontalOffset, (float)num4 * (0f - panel.verticalOffset));
				if (keySlot.GetComponentInChildren<SettingsOption>() == null)
				{
					num5 = 0;
					num4++;
				}
				else
				{
					num5++;
				}
			}
		}

		public static bool RemapContainerVisible()
		{
			if (ContainerInstance == null)
			{
				return false;
			}
			return ContainerInstance.LayerShown > 0;
		}

		private static int NumberOfActualKeys(List<GameObject> keySlots)
		{
			int num = 0;
			foreach (GameObject keySlot in keySlots)
			{
				if (keySlot.GetComponentInChildren<SettingsOption>() != null)
				{
					num++;
				}
			}
			return num;
		}

		internal static void CloseContainerLayer()
		{
			if (ContainerInstance != null)
			{
				ContainerInstance.HideHighestLayer();
			}
		}

		private static void AdjustSizeAndPos(KepRemapPanel panel)
		{
			GameObject gameObject = ((Component)((Transform)panel.keyRemapContainer).parent).gameObject;
			if (gameObject.GetComponent<ContentSizeFitter>() == null)
			{
				panel.keyRemapContainer.SetPivotY(1f);
				panel.keyRemapContainer.SetAnchorMinY(1f);
				panel.keyRemapContainer.SetAnchorMaxY(1f);
				panel.keyRemapContainer.SetAnchoredPosY(0f);
				panel.keyRemapContainer.SetLocalPosY(0f);
				ContentSizeFitter obj = gameObject.AddComponent<ContentSizeFitter>();
				obj.horizontalFit = (FitMode)0;
				obj.verticalFit = (FitMode)1;
			}
		}

		private static LayoutElement EnsureLayoutElement(KepRemapPanel panel)
		{
			GameObject gameObject = ((Component)((Transform)panel.keyRemapContainer).parent).gameObject;
			LayoutElement component = gameObject.GetComponent<LayoutElement>();
			if (component != null)
			{
				return component;
			}
			return gameObject.AddComponent<LayoutElement>();
		}

		internal static void CalculateVerticalMaxForGamepad(KepRemapPanel panel)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			int num = panel.remappableKeys.Count((RemappableKey key) => key.gamepadOnly);
			float horizontalOffset = panel.horizontalOffset;
			Rect rect = ((Component)((Transform)panel.keyRemapContainer).parent).GetComponent<RectTransform>().rect;
			float num2 = Mathf.Floor(((Rect)(ref rect)).width / horizontalOffset);
			panel.maxVertical = (float)num / num2;
			LayoutElement obj = EnsureLayoutElement(panel);
			obj.minHeight += (panel.maxVertical + 3f) * panel.verticalOffset;
		}

		internal static void ResetLoadedInputActions()
		{
			PrefabLoaded = false;
			foreach (LcInputActions inputAction in InputActions)
			{
				inputAction.Loaded = false;
			}
		}

		internal static void RegisterInputActions(LcInputActions lcInputActions, InputActionMapBuilder builder)
		{
			if (!InputActionsMap.TryAdd(lcInputActions.Id, lcInputActions))
			{
				Logging.Warn("The mod [" + lcInputActions.Plugin.GUID + "] instantiated an Actions class [" + lcInputActions.GetType().Name + "] more than once!\n\t These classes should be treated as singletons!, do not instantiate more than once!");
			}
			else
			{
				lcInputActions.CreateInputActions(in builder);
				InputActionSetupExtensions.AddActionMap(lcInputActions.GetAsset(), builder.Build());
				lcInputActions.GetAsset().Enable();
				lcInputActions.OnAssetLoaded();
				lcInputActions.Load();
				lcInputActions.BuildActionRefs();
			}
		}

		internal static void DisableForRebind()
		{
			foreach (LcInputActions inputAction in InputActions)
			{
				if (inputAction.Enabled)
				{
					inputAction.Disable();
				}
			}
		}

		internal static void ReEnableFromRebind()
		{
			foreach (LcInputActions inputAction in InputActions)
			{
				if (inputAction.WasEnabled)
				{
					inputAction.Enable();
				}
			}
		}

		internal static void SaveOverrides()
		{
			foreach (LcInputActions inputAction in InputActions)
			{
				inputAction.Save();
			}
		}

		internal static void LoadOverrides()
		{
			foreach (LcInputActions inputAction in InputActions)
			{
				inputAction.Load();
			}
		}
	}
	[BepInPlugin("com.rune580.LethalCompanyInputUtils", "Lethal Company Input Utils", "0.6.1")]
	public class LethalCompanyInputUtilsPlugin : BaseUnityPlugin
	{
		public const string ModId = "com.rune580.LethalCompanyInputUtils";

		public const string ModName = "Lethal Company Input Utils";

		public const string ModVersion = "0.6.1";

		private Harmony? _harmony;

		private void Awake()
		{
			Logging.SetLogSource(((BaseUnityPlugin)this).Logger);
			_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.rune580.LethalCompanyInputUtils");
			SceneManager.activeSceneChanged += OnSceneChanged;
			InputSystem.onDeviceChange += OnDeviceChanged;
			LoadAssetBundles();
			ControllerGlyph.LoadGlyphs();
			FsUtils.EnsureControlsDir();
			RegisterExtendedMouseLayout();
			Logging.Info("InputUtils 0.6.1 has finished loading!");
		}

		private void LoadAssetBundles()
		{
			Assets.AddBundle("ui-assets");
		}

		private static void OnSceneChanged(Scene current, Scene next)
		{
			LcInputActionApi.ResetLoadedInputActions();
			CameraUtils.ClearUiCameraReference();
			BindsListController.OffsetCompensation = ((((Scene)(ref next)).name != "MainMenu") ? 20 : 0);
		}

		private static void OnDeviceChanged(InputDevice device, InputDeviceChange state)
		{
			RebindButton.ReloadGlyphs();
		}

		private static void RegisterExtendedMouseLayout()
		{
			InputSystem.RegisterLayoutOverride("{\n   \"name\": \"InputUtilsExtendedMouse\",\n   \"extend\": \"Mouse\",\n   \"controls\": [\n       {\n           \"name\": \"scroll/up\",\n           \"layout\": \"Button\",\n           \"useStateFrom\": \"scroll/up\",\n           \"format\": \"BIT\",\n           \"synthetic\": true\n       },\n       {\n           \"name\": \"scroll/down\",\n           \"layout\": \"Button\",\n           \"useStateFrom\": \"scroll/down\",\n           \"format\": \"BIT\",\n           \"synthetic\": true\n       },\n       {\n           \"name\": \"scroll/left\",\n           \"layout\": \"Button\",\n           \"useStateFrom\": \"scroll/left\",\n           \"format\": \"BIT\",\n           \"synthetic\": true\n       },\n       {\n           \"name\": \"scroll/right\",\n           \"layout\": \"Button\",\n           \"useStateFrom\": \"scroll/right\",\n           \"format\": \"BIT\",\n           \"synthetic\": true\n       }\n   ]\n}", (string)null);
			Logging.Info("Registered InputUtilsExtendedMouse Layout Override!");
		}
	}
}
namespace LethalCompanyInputUtils.Utils
{
	internal static class AssemblyUtils
	{
		public static BepInPlugin? GetBepInPlugin(this Assembly assembly)
		{
			foreach (Type validType in assembly.GetValidTypes())
			{
				BepInPlugin customAttribute = ((MemberInfo)validType).GetCustomAttribute<BepInPlugin>();
				if (customAttribute != null)
				{
					return customAttribute;
				}
			}
			return null;
		}

		public static IEnumerable<Type> GetValidTypes(this Assembly assembly)
		{
			try
			{
				return assembly.GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				return ex.Types.Where((Type type) => (object)type != null);
			}
		}
	}
	internal static class Assets
	{
		private static readonly List<AssetBundle> AssetBundles = new List<AssetBundle>();

		private static readonly Dictionary<string, int> AssetIndices = new Dictionary<string, int>();

		public static void AddBundle(string bundleName)
		{
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(FsUtils.AssetBundlesDir, bundleName));
			int count = AssetBundles.Count;
			AssetBundles.Add(val);
			string[] allAssetNames = val.GetAllAssetNames();
			for (int i = 0; i < allAssetNames.Length; i++)
			{
				string text = allAssetNames[i].ToLowerInvariant();
				if (text.StartsWith("assets/"))
				{
					string text2 = text;
					int length = "assets/".Length;
					text = text2.Substring(length, text2.Length - length);
				}
				AssetIndices[text] = count;
			}
		}

		public static T? Load<T>(string assetName) where T : Object
		{
			try
			{
				assetName = assetName.ToLowerInvariant();
				if (assetName.StartsWith("assets/"))
				{
					string text = assetName;
					int length = "assets/".Length;
					assetName = text.Substring(length, text.Length - length);
				}
				int index = AssetIndices[assetName];
				return AssetBundles[index].LoadAsset<T>("assets/" + assetName);
			}
			catch (Exception arg)
			{
				Logging.Error($"Couldn't load asset [{assetName}] exception: {arg}");
				return default(T);
			}
		}
	}
	internal static class CameraUtils
	{
		private static Camera? _uiCamera;

		public static Camera GetBestUiCamera()
		{
			//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)
			if (_uiCamera != null && Object.op_Implicit((Object)(object)_uiCamera))
			{
				return _uiCamera;
			}
			_uiCamera = null;
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "MainMenu")
			{
				GameObject val = ((IEnumerable<GameObject>)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "UICamera"));
				if (val == null)
				{
					Logging.Warn("Failed to find UICamera at MainMenu, falling back to Camera.current!");
					return Camera.current;
				}
				Camera component = val.GetComponent<Camera>();
				if (component == null)
				{
					Logging.Warn("Failed to find Camera component on UICamera, falling back to Camera.current!");
					return Camera.current;
				}
				_uiCamera = component;
			}
			else
			{
				GameObject val2 = ((IEnumerable<GameObject>)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "Systems"));
				if (val2 == null)
				{
					Logging.Warn("Failed to find UICamera in active scene, falling back to Camera.current!");
					return Camera.current;
				}
				Transform val3 = val2.transform.Find("UI/UICamera");
				if (val3 == null)
				{
					Logging.Warn("Failed to find UICamera at MainMenu, falling back to Camera.current!");
					return Camera.current;
				}
				Camera component2 = ((Component)val3).GetComponent<Camera>();
				if (component2 == null)
				{
					Logging.Warn("Failed to find Camera component on UICamera, falling back to Camera.current!");
					return Camera.current;
				}
				_uiCamera = component2;
			}
			return _uiCamera;
		}

		public static void ClearUiCameraReference()
		{
			_uiCamera = null;
		}
	}
	internal static class DebugUtils
	{
		public static string ToPrettyString<TKey, TValue>(this IDictionary<TKey, TValue> dictionary)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("{");
			using (IEnumerator<KeyValuePair<TKey, TValue>> enumerator = dictionary.GetEnumerator())
			{
				string[] obj;
				object obj3;
				for (; enumerator.MoveNext(); obj[3] = (string)obj3, obj[4] = "\",", stringBuilder.AppendLine(string.Concat(obj)))
				{
					enumerator.Current.Deconstruct(out var key, out var value);
					TKey val = key;
					TValue val2 = value;
					obj = new string[5] { "\t\"", null, null, null, null };
					ref TKey reference = ref val;
					key = default(TKey);
					object obj2;
					if (key == null)
					{
						key = reference;
						reference = ref key;
						if (key == null)
						{
							obj2 = null;
							goto IL_007c;
						}
					}
					obj2 = reference.ToString();
					goto IL_007c;
					IL_007c:
					obj[1] = (string)obj2;
					obj[2] = "\": \"";
					ref TValue reference2 = ref val2;
					value = default(TValue);
					if (value == null)
					{
						value = reference2;
						reference2 = ref value;
						if (value == null)
						{
							obj3 = null;
							continue;
						}
					}
					obj3 = reference2.ToString();
				}
			}
			stringBuilder.Remove(stringBuilder.Length - 1, 1);
			stringBuilder.AppendLine("}");
			return stringBuilder.ToString();
		}

		public static void DrawGizmoUiRectWorld(this RectTransform rectTransform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			float z = ((Transform)rectTransform).position.z;
			Rect val = rectTransform.UiBoundsWorld();
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(((Rect)(ref val)).min.x, ((Rect)(ref val)).min.y, z);
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(((Rect)(ref val)).min.x, ((Rect)(ref val)).max.y, z);
			Vector3 val4 = default(Vector3);
			((Vector3)(ref val4))..ctor(((Rect)(ref val)).max.x, ((Rect)(ref val)).max.y, z);
			Vector3 val5 = default(Vector3);
			((Vector3)(ref val5))..ctor(((Rect)(ref val)).max.x, ((Rect)(ref val)).min.y, z);
			Gizmos.DrawLine(val2, val3);
			Gizmos.DrawLine(val3, val4);
			Gizmos.DrawLine(val4, val5);
			Gizmos.DrawLine(val5, val2);
		}

		public static void DrawGizmoUiRect(this RectTransform rectTransform, Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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)
			//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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			float z = position.z;
			Rect val = rectTransform.UiBounds(position);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(((Rect)(ref val)).min.x, ((Rect)(ref val)).min.y, z);
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(((Rect)(ref val)).min.x, ((Rect)(ref val)).max.y, z);
			Vector3 val4 = default(Vector3);
			((Vector3)(ref val4))..ctor(((Rect)(ref val)).max.x, ((Rect)(ref val)).max.y, z);
			Vector3 val5 = default(Vector3);
			((Vector3)(ref val5))..ctor(((Rect)(ref val)).max.x, ((Rect)(ref val)).min.y, z);
			Gizmos.DrawLine(val2, val3);
			Gizmos.DrawLine(val3, val4);
			Gizmos.DrawLine(val4, val5);
			Gizmos.DrawLine(val5, val2);
		}

		public static void DrawGizmoRect(this Rect rect, Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			float z = position.z;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(((Rect)(ref rect)).min.x + position.x, ((Rect)(ref rect)).min.y + position.y, z);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(((Rect)(ref rect)).min.x + position.x, ((Rect)(ref rect)).max.y + position.y, z);
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(((Rect)(ref rect)).max.x + position.x, ((Rect)(ref rect)).max.y + position.y, z);
			Vector3 val4 = default(Vector3);
			((Vector3)(ref val4))..ctor(((Rect)(ref rect)).max.x + position.x, ((Rect)(ref rect)).min.y + position.y, z);
			Gizmos.DrawLine(val, val2);
			Gizmos.DrawLine(val2, val3);
			Gizmos.DrawLine(val3, val4);
			Gizmos.DrawLine(val4, val);
		}
	}
	internal static class DeconstructUtils
	{
		public static void Deconstruct(this Rect rect, out Vector2 min, out Vector2 max)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			min = new Vector2(((Rect)(ref rect)).xMin, ((Rect)(ref rect)).yMin);
			max = new Vector2(((Rect)(ref rect)).xMax, ((Rect)(ref rect)).yMax);
		}

		public static void Deconstruct(this Vector3 vector, out float x, out float y, out float z)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: 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)
			x = vector.x;
			y = vector.y;
			z = vector.z;
		}
	}
	internal static class FsUtils
	{
		private static string? _assetBundlesDir;

		public static string SaveDir { get; } = GetSaveDir();


		public static string Pre041ControlsDir { get; } = Path.Combine(Paths.BepInExRootPath, "controls");


		public static string ControlsDir { get; } = Path.Combine(Paths.ConfigPath, "controls");


		public static string AssetBundlesDir
		{
			get
			{
				if (_assetBundlesDir == null)
				{
					_assetBundlesDir = GetAssetBundlesDir();
				}
				if (string.IsNullOrEmpty(_assetBundlesDir))
				{
					string text = Chainloader.PluginInfos.ToPrettyString();
					Logging.Warn("InputUtils is loading in an invalid state!\n\tOne of the following mods may be the culprit:\n" + text);
					return "";
				}
				return _assetBundlesDir;
			}
		}

		private static string GetSaveDir()
		{
			string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
			return Path.Combine(folderPath, "AppData", "LocalLow", "ZeekerssRBLX", "Lethal Company");
		}

		public static void EnsureControlsDir()
		{
			if (!Directory.Exists(ControlsDir))
			{
				Directory.CreateDirectory(ControlsDir);
			}
		}

		private static string? GetAssetBundlesDir()
		{
			if (!Chainloader.PluginInfos.TryGetValue("com.rune580.LethalCompanyInputUtils", out var value))
			{
				return null;
			}
			string text = Path.Combine((Directory.GetParent(value.Location) ?? throw new NotSupportedException(BadInstallError())).FullName, "AssetBundles");
			if (!Directory.Exists(text))
			{
				throw new NotSupportedException(BadInstallError());
			}
			return text;
			static string BadInstallError()
			{
				Logging.Error("InputUtils can't find it's required AssetBundles! This will cause many issues!\nThis either means your mod manager incorrectly installed InputUtilsor if you've manually installed InputUtils, you've done so incorrectly. If you manually installed don't bother reporting the issue, I only provide support to people who use mod managers.");
				return "InputUtils can't find it's required AssetBundles! This will cause many issues!\nThis either means your mod manager incorrectly installed InputUtilsor if you've manually installed InputUtils, you've done so incorrectly. If you manually installed don't bother reporting the issue, I only provide support to people who use mod managers.";
			}
		}
	}
	internal static class Logging
	{
		private static ManualLogSource? _logSource;

		internal static void SetLogSource(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		public static void Error(object data)
		{
			Error(data.ToString());
		}

		public static void Warn(object data)
		{
			Warn(data.ToString());
		}

		public static void Info(object data)
		{
			Info(data.ToString());
		}

		public static void Error(string msg)
		{
			if (_logSource == null)
			{
				Debug.LogError((object)("[Lethal Company Input Utils] [Error] " + msg));
			}
			else
			{
				_logSource.LogError((object)msg);
			}
		}

		public static void Warn(string msg)
		{
			if (_logSource == null)
			{
				Debug.LogWarning((object)("[Lethal Company Input Utils] [Warning] " + msg));
			}
			else
			{
				_logSource.LogWarning((object)msg);
			}
		}

		public static void Info(string msg)
		{
			if (_logSource == null)
			{
				Debug.Log((object)("[Lethal Company Input Utils] [Info] " + msg));
			}
			else
			{
				_logSource.LogInfo((object)msg);
			}
		}
	}
	internal static class RectTransformExtensions
	{
		public static void SetLocalPosX(this RectTransform rectTransform, float x)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localPosition = ((Transform)rectTransform).localPosition;
			((Transform)rectTransform).localPosition = new Vector3(x, localPosition.y, localPosition.z);
		}

		public static void SetLocalPosY(this RectTransform rectTransform, float y)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localPosition = ((Transform)rectTransform).localPosition;
			((Transform)rectTransform).localPosition = new Vector3(localPosition.x, y, localPosition.z);
		}

		public static void SetPivotY(this RectTransform rectTransform, float y)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.pivot = new Vector2(rectTransform.pivot.x, y);
		}

		public static void SetAnchorMinY(this RectTransform rectTransform, float y)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.anchorMin = new Vector2(rectTransform.anchorMin.x, y);
		}

		public static void SetAnchorMaxY(this RectTransform rectTransform, float y)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.anchorMax = new Vector2(rectTransform.anchorMax.x, y);
		}

		public static void SetAnchoredPosX(this RectTransform rectTransform, float x)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.anchoredPosition = new Vector2(x, rectTransform.anchoredPosition.y);
		}

		public static void SetAnchoredPosY(this RectTransform rectTransform, float y)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, y);
		}

		public static void SetSizeDeltaX(this RectTransform rectTransform, float x)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			rectTransform.sizeDelta = new Vector2(x, rectTransform.sizeDelta.y);
		}

		public static Rect UiBoundsWorld(this RectTransform rectTransform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Transform)rectTransform).position;
			Rect rect = rectTransform.rect;
			Vector3 lossyScale = ((Transform)rectTransform).lossyScale;
			return new Rect(((Rect)(ref rect)).x * lossyScale.x + position.x, ((Rect)(ref rect)).y * lossyScale.y + position.y, ((Rect)(ref rect)).width * lossyScale.x, ((Rect)(ref rect)).height * lossyScale.y);
		}

		[Obsolete("Use GetRelativeRect")]
		public static Rect UiBounds(this RectTransform rectTransform, Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = rectTransform.rect;
			Vector3 lossyScale = ((Transform)rectTransform).lossyScale;
			return new Rect(((Rect)(ref rect)).x * lossyScale.x + position.x, ((Rect)(ref rect)).y * lossyScale.y + position.y, ((Rect)(ref rect)).width * lossyScale.x, ((Rect)(ref rect)).height * lossyScale.y);
		}

		public static Rect GetRelativeRect(this RectTransform rectTransform, RectTransform worldRectTransform)
		{
			//IL_0027: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			Camera bestUiCamera = CameraUtils.GetBestUiCamera();
			Vector3[] array = (Vector3[])(object)new Vector3[4];
			worldRectTransform.GetWorldCorners(array);
			Vector2[] array2 = (Vector2[])(object)new Vector2[4];
			for (int i = 0; i < array.Length; i++)
			{
				array2[i] = RectTransformUtility.WorldToScreenPoint(bestUiCamera, array[i]);
			}
			Vector2[] array3 = (Vector2[])(object)new Vector2[4];
			for (int j = 0; j < array2.Length; j++)
			{
				RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, array2[j], bestUiCamera, ref array3[j]);
			}
			Vector2 val = array3[0];
			Vector2 val2 = array3[0];
			Vector2[] array4 = array3;
			foreach (Vector2 val3 in array4)
			{
				val = Vector2.Min(val, val3);
				val2 = Vector2.Max(val2, val3);
			}
			Vector2 val4 = val2 - val;
			return new Rect(val.x, val.y, val4.x, val4.y);
		}

		public static Vector2 WorldToLocalPoint(this RectTransform rectTransform, Vector3 worldPoint)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			Camera bestUiCamera = CameraUtils.GetBestUiCamera();
			Vector2 val = RectTransformUtility.WorldToScreenPoint(bestUiCamera, worldPoint);
			Vector2 result = default(Vector2);
			RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, val, bestUiCamera, ref result);
			return result;
		}

		public static Vector2 WorldToLocalPoint(this RectTransform rectTransform, RectTransform other)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return rectTransform.WorldToLocalPoint(((Transform)other).position);
		}

		public static float WorldMaxY(this RectTransform rectTransform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Rect val = rectTransform.UiBoundsWorld();
			return ((Rect)(ref val)).max.y;
		}

		public static float WorldMinY(this RectTransform rectTransform)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Rect val = rectTransform.UiBoundsWorld();
			return ((Rect)(ref val)).min.y;
		}
	}
	internal static class RectUtils
	{
		public static Vector2 CenteredPos(this Rect rect)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			return ((Rect)(ref rect)).min + ((Rect)(ref rect)).size / 2f;
		}
	}
	internal static class RuntimeHelper
	{
		public static Vector3 LocalPositionRelativeTo(this Transform transform, Transform parent)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.zero;
			Transform val2 = transform;
			do
			{
				val += transform.localPosition;
				val2 = val2.parent;
			}
			while ((Object)(object)val2 != (Object)(object)parent);
			return val;
		}

		public static void DisableKeys(this IEnumerable<RemappableKey> keys)
		{
			foreach (RemappableKey key in keys)
			{
				key.currentInput.action.Disable();
			}
		}

		public static void EnableKeys(this IEnumerable<RemappableKey> keys)
		{
			foreach (RemappableKey key in keys)
			{
				key.currentInput.action.Enable();
			}
		}
	}
	internal static class VectorUtils
	{
		public static Vector3 Mul(this Vector3 left, Vector3 right)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(left.x * right.x, left.y * right.y, left.z * right.z);
		}
	}
}
namespace LethalCompanyInputUtils.Utils.Anim
{
	public interface ITweenValue
	{
		bool IgnoreTimeScale { get; }

		float Duration { get; }

		void TweenValue(float percentage);

		bool ValidTarget();
	}
	public class TweenRunner<T> where T : struct, ITweenValue
	{
		protected MonoBehaviour? CoroutineContainer;

		protected IEnumerator? Tween;

		private static IEnumerator Start(T tweenValue)
		{
			if (tweenValue.ValidTarget())
			{
				float elapsedTime = 0f;
				while (elapsedTime < tweenValue.Duration)
				{
					elapsedTime += (tweenValue.IgnoreTimeScale ? Time.unscaledDeltaTime : Time.deltaTime);
					float percentage = Mathf.Clamp01(elapsedTime / tweenValue.Duration);
					tweenValue.TweenValue(percentage);
					yield return null;
				}
				tweenValue.TweenValue(1f);
			}
		}

		public void Init(MonoBehaviour coroutineContainer)
		{
			CoroutineContainer = coroutineContainer;
		}

		public void StartTween(T tweenValue)
		{
			if (CoroutineContainer != null)
			{
				if (Tween != null)
				{
					CoroutineContainer.StopCoroutine(Tween);
					Tween = null;
				}
				if (!((Component)CoroutineContainer).gameObject.activeInHierarchy)
				{
					tweenValue.TweenValue(1f);
					return;
				}
				Tween = Start(tweenValue);
				CoroutineContainer.StartCoroutine(Tween);
			}
		}

		public void StopTween()
		{
			if (Tween != null && CoroutineContainer != null)
			{
				CoroutineContainer.StopCoroutine(Tween);
				Tween = null;
			}
		}
	}
}
namespace LethalCompanyInputUtils.Utils.Anim.TweenValues
{
	public struct Vector3Tween : ITweenValue
	{
		private class Vector3TweenCallback : UnityEvent<Vector3>
		{
		}

		private Vector3TweenCallback? _target;

		public float Duration { get; set; }

		public Vector3 StartValue { get; set; }

		public Vector3 TargetValue { get; set; }

		public bool IgnoreTimeScale { get; set; }

		public void TweenValue(float percentage)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (ValidTarget())
			{
				Vector3 val = Vector3.Lerp(StartValue, TargetValue, percentage);
				((UnityEvent<Vector3>)_target).Invoke(val);
			}
		}

		public void AddOnChangedCallback(UnityAction<Vector3> callback)
		{
			if (_target == null)
			{
				_target = new Vector3TweenCallback();
			}
			((UnityEvent<Vector3>)_target).AddListener(callback);
		}

		public bool ValidTarget()
		{
			return _target != null;
		}
	}
}
namespace LethalCompanyInputUtils.Patches
{
	public static class InGamePlayerSettingsPatches
	{
		[HarmonyPatch(typeof(IngamePlayerSettings), "SaveChangedSettings")]
		public static class SaveChangedSettingsPatch
		{
			public static void Prefix()
			{
				LcInputActionApi.SaveOverrides();
			}
		}

		[HarmonyPatch(typeof(IngamePlayerSettings), "DiscardChangedSettings")]
		public static class DiscardChangedSettingsPatch
		{
			public static void Prefix()
			{
				LcInputActionApi.LoadOverrides();
			}
		}
	}
	public static class InputControlPathPatches
	{
		[HarmonyPatch]
		public static class ToHumanReadableStringPatch
		{
			public static IEnumerable<MethodBase> TargetMethods()
			{
				return from method in AccessTools.GetDeclaredMethods(typeof(InputControlPath))
					where method.Name == "ToHumanReadableString" && method.ReturnType == typeof(string)
					select method;
			}

			public static void Postfix(ref string __result)
			{
				string text = __result;
				if ((text == "<InputUtils-Gamepad-Not-Bound>" || text == "<InputUtils-Kbm-Not-Bound>") ? true : false)
				{
					__result = "";
				}
			}
		}
	}
	public static class KeyRemapPanelPatches
	{
		[HarmonyPatch(typeof(KepRemapPanel), "OnEnable")]
		public static class LoadKeybindsUIPatch
		{
			[CompilerGenerated]
			private static class <>O
			{
				public static UnityAction <0>__CloseContainerLayer;
			}

			public static void Prefix(KepRemapPanel __instance)
			{
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Expected O, but got Unknown
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Expected O, but got Unknown
				//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_0182: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Expected O, but got Unknown
				//IL_023b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: Expected O, but got Unknown
				//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Expected O, but got Unknown
				LcInputActionApi.DisableForRebind();
				if (LcInputActionApi.PrefabLoaded && LcInputActionApi.ContainerInstance != null)
				{
					LcInputActionApi.ContainerInstance.baseGameKeys.DisableKeys();
					return;
				}
				GameObject val = Object.Instantiate<GameObject>(Assets.Load<GameObject>("Prefabs/InputUtilsRemapContainer.prefab"), ((Component)__instance).transform);
				GameObject val2 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("Prefabs/Legacy Holder.prefab"), ((Component)__instance).transform);
				if (val == null || val2 == null)
				{
					return;
				}
				Transform val3 = ((Component)__instance).transform.Find("Scroll View");
				if (val3 != null)
				{
					val3.SetParent(val2.transform);
					List<RemappableKey> remappableKeys = __instance.remappableKeys;
					__instance.remappableKeys = new List<RemappableKey>();
					val2.SetActive(false);
					GameObject gameObject = ((Component)((Component)__instance).transform.Find("Back")).gameObject;
					Button component = gameObject.GetComponent<Button>();
					GameObject obj = Object.Instantiate<GameObject>(gameObject, val2.transform, true);
					Object.DestroyImmediate((Object)(object)obj.GetComponentInChildren<SettingsOption>());
					Button component2 = obj.GetComponent<Button>();
					component2.onClick = new ButtonClickedEvent();
					ButtonClickedEvent onClick = component2.onClick;
					object obj2 = <>O.<0>__CloseContainerLayer;
					if (obj2 == null)
					{
						UnityAction val4 = LcInputActionApi.CloseContainerLayer;
						<>O.<0>__CloseContainerLayer = val4;
						obj2 = (object)val4;
					}
					((UnityEvent)onClick).AddListener((UnityAction)obj2);
					GameObject obj3 = Object.Instantiate<GameObject>(gameObject, gameObject.transform.parent);
					Object.DestroyImmediate((Object)(object)obj3.GetComponentInChildren<SettingsOption>());
					Button component3 = obj3.GetComponent<Button>();
					component3.onClick = new ButtonClickedEvent();
					RectTransform component4 = obj3.GetComponent<RectTransform>();
					component4.SetAnchoredPosY(component4.anchoredPosition.y + 25f);
					component4.SetSizeDeltaX(component4.sizeDelta.x + 180f);
					RectTransform component5 = ((Component)((Transform)component4).Find("SelectionHighlight")).GetComponent<RectTransform>();
					component5.SetSizeDeltaX(410f);
					component5.offsetMax = new Vector2(410f, component5.offsetMax.y);
					component5.offsetMin = new Vector2(0f, component5.offsetMin.y);
					RemapContainerController component6 = val.GetComponent<RemapContainerController>();
					component6.baseGameKeys = remappableKeys;
					component6.backButton = component;
					component6.legacyButton = component3;
					component6.legacyHolder = val2;
					component6.baseGameKeys.DisableKeys();
					((UnityEvent)component3.onClick).AddListener(new UnityAction(component6.ShowLegacyUi));
					component6.LoadUi();
					Button component7 = ((Component)((Component)__instance).transform.Find("SetDefault")).gameObject.GetComponent<Button>();
					((UnityEventBase)component7.onClick).RemoveAllListeners();
					((UnityEvent)component7.onClick).AddListener(new UnityAction(component6.OnSetToDefault));
					val2.transform.SetAsLastSibling();
					LcInputActionApi.PrefabLoaded = true;
				}
			}

			public static void Postfix(KepRemapPanel __instance)
			{
				LcInputActionApi.LoadIntoUI(__instance);
			}
		}

		[HarmonyPatch(typeof(KepRemapPanel), "OnDisable")]
		public static class UnloadKeybindsUIPatch
		{
			public static void Prefix()
			{
				if (LcInputActionApi.ContainerInstance != null)
				{
					LcInputActionApi.ContainerInstance.baseGameKeys.EnableKeys();
				}
			}
		}
	}
	public static class QuickMenuManagerPatches
	{
		[HarmonyPatch(typeof(QuickMenuManager), "CloseQuickMenu")]
		public static class OpenMenuPerformedPatch
		{
			public static bool Prefix(QuickMenuManager __instance)
			{
				if (LcInputActionApi.RemapContainerVisible() && __instance.isMenuOpen)
				{
					LcInputActionApi.CloseContainerLayer();
					return false;
				}
				return true;
			}
		}
	}
	public static class SettingsOptionPatches
	{
		[HarmonyPatch(typeof(SettingsOption), "SetBindingToCurrentSetting")]
		public static class SetBindingToCurrentSettingPatch
		{
			public static bool Prefix(SettingsOption __instance)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//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_002d: Unknown result type (might be due to invalid IL or missing references)
				if ((int)__instance.optionType != 6)
				{
					return true;
				}
				Enumerator<InputBinding> enumerator = __instance.rebindableAction.action.bindings.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						InputBinding current = enumerator.Current;
						if (__instance.gamepadOnlyRebinding)
						{
							if (!string.Equals(((InputBinding)(ref current)).effectivePath, "<InputUtils-Gamepad-Not-Bound>"))
							{
								continue;
							}
						}
						else if (!string.Equals(((InputBinding)(ref current)).effectivePath, "<InputUtils-Kbm-Not-Bound>"))
						{
							continue;
						}
						((TMP_Text)__instance.currentlyUsedKeyText).SetText("", true);
						return false;
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				return true;
			}
		}
	}
}
namespace LethalCompanyInputUtils.Glyphs
{
	[CreateAssetMenu]
	public class ControllerGlyph : ScriptableObject
	{
		public List<string> validGamepadTypes = new List<string>();

		public List<GlyphDef> glyphSet = new List<GlyphDef>();

		private readonly Dictionary<string, Sprite?> _glyphLut = new Dictionary<string, Sprite>();

		private static readonly List<ControllerGlyph> Instances = new List<ControllerGlyph>();

		private static bool _loaded;

		public static ControllerGlyph? MouseGlyphs { get; private set; }

		public bool IsCurrent
		{
			get
			{
				Gamepad current = Gamepad.current;
				if (current == null)
				{
					return false;
				}
				return validGamepadTypes.Any((string gamepadTypeName) => string.Equals(gamepadTypeName, ((object)current).GetType().Name));
			}
		}

		public Sprite this[string controlPath]
		{
			get
			{
				if (_glyphLut.Count == 0)
				{
					UpdateLut();
				}
				return _glyphLut.GetValueOrDefault(controlPath, null);
			}
		}

		public static ControllerGlyph? GetBestMatching()
		{
			if (Instances.Count == 0)
			{
				return null;
			}
			foreach (ControllerGlyph instance in Instances)
			{
				if (instance.IsCurrent)
				{
					return instance;
				}
			}
			return Instances[0];
		}

		internal static void LoadGlyphs()
		{
			if (!_loaded)
			{
				Assets.Load<ControllerGlyph>("controller glyphs/xbox series x glyphs.asset");
				Assets.Load<ControllerGlyph>("controller glyphs/dualsense glyphs.asset");
				MouseGlyphs = Assets.Load<ControllerGlyph>("controller glyphs/mouse glyphs.asset");
				_loaded = true;
			}
		}

		private void Awake()
		{
			if (!Instances.Contains(this))
			{
				Instances.Add(this);
			}
		}

		private void UpdateLut()
		{
			foreach (GlyphDef item in glyphSet)
			{
				_glyphLut[item.controlPath] = item.glyphSprite;
			}
		}

		private void OnDestroy()
		{
			if (Instances.Contains(this))
			{
				Instances.Remove(this);
			}
		}
	}
	[CreateAssetMenu]
	public class GlyphDef : ScriptableObject
	{
		public string controlPath = "";

		public Sprite? glyphSprite;
	}
}
namespace LethalCompanyInputUtils.Data
{
	[Serializable]
	public struct BindingOverride
	{
		public string? action;

		public string? origPath;

		public string? path;
	}
	[Serializable]
	public class BindingOverrides
	{
		public List<BindingOverride> overrides;

		private BindingOverrides()
		{
			overrides = new List<BindingOverride>();
		}

		public BindingOverrides(IEnumerable<InputBinding> bindings)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			overrides = new List<BindingOverride>();
			foreach (InputBinding binding in bindings)
			{
				InputBinding current = binding;
				if (((InputBinding)(ref current)).hasOverrides)
				{
					BindingOverride item = new BindingOverride
					{
						action = ((InputBinding)(ref current)).action,
						origPath = ((InputBinding)(ref current)).path,
						path = ((InputBinding)(ref current)).overridePath
					};
					overrides.Add(item);
				}
			}
		}

		public void LoadInto(InputActionAsset asset)
		{
			foreach (BindingOverride @override in overrides)
			{
				InputAction obj = asset.FindAction(@override.action, false);
				if (obj != null)
				{
					InputActionRebindingExtensions.ApplyBindingOverride(obj, @override.path, (string)null, @override.origPath);
				}
			}
		}

		public static BindingOverrides FromJson(string json)
		{
			BindingOverrides bindingOverrides = new BindingOverrides();
			JToken value = JsonConvert.DeserializeObject<JObject>(json).GetValue("overrides");
			bindingOverrides.overrides = value.ToObject<List<BindingOverride>>();
			return bindingOverrides;
		}
	}
}
namespace LethalCompanyInputUtils.Components
{
	[RequireComponent(typeof(RectTransform))]
	public class BindsListController : MonoBehaviour
	{
		public GameObject? sectionHeaderPrefab;

		public GameObject? sectionAnchorPrefab;

		public GameObject? rebindItemPrefab;

		public GameObject? spacerPrefab;

		public ScrollRect? scrollRect;

		public RectTransform? headerContainer;

		public UnityEvent<int> OnSectionChanged = new UnityEvent<int>();

		public static float OffsetCompensation;

		private RectTransform? _rectTransform;

		private RectTransform? _scrollRectTransform;

		private RectTransform? _content;

		private VerticalLayoutGroup? _verticalLayoutGroup;

		private int _currentSection;

		private float _sectionHeight;

		private float _spacing;

		private readonly List<SectionHeaderAnchor> _anchors = new List<SectionHeaderAnchor>();

		private void Awake()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			if (_rectTransform == null)
			{
				_rectTransform = ((Component)this).GetComponent<RectTransform>();
			}
			if (scrollRect == null)
			{
				scrollRect = ((Component)this).GetComponentInChildren<ScrollRect>();
			}
			if (_verticalLayoutGroup == null)
			{
				_verticalLayoutGroup = ((Component)scrollRect.content).GetComponent<VerticalLayoutGroup>();
			}
			_spacing = ((HorizontalOrVerticalLayoutGroup)_verticalLayoutGroup).spacing;
			if (sectionAnchorPrefab != null && rebindItemPrefab != null && spacerPrefab != null)
			{
				_sectionHeight = sectionAnchorPrefab.GetComponent<RectTransform>().sizeDelta.y;
				_scrollRectTransform = ((Component)scrollRect).GetComponent<RectTransform>();
				_content = scrollRect.content;
				if (headerContainer != null)
				{
					headerContainer.drivenByObject = (Object)(object)this;
					headerContainer.drivenProperties = (DrivenTransformProperties)3840;
					headerContainer.anchorMin = new Vector2(0f, 1f);
					headerContainer.anchorMax = Vector2.one;
					((UnityEvent<Vector2>)(object)scrollRect.onValueChanged).AddListener((UnityAction<Vector2>)OnScroll);
					OnScroll(Vector2.zero);
				}
			}
		}

		private void Start()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			OnScroll(Vector2.zero);
		}

		private void OnEnable()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			OnScroll(Vector2.zero);
		}

		public void JumpTo(int sectionIndex)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			if (_content == null || scrollRect == null || _scrollRectTransform == null)
			{
				return;
			}
			int count = _anchors.Count;
			if (sectionIndex < count && sectionIndex >= 0)
			{
				Canvas.ForceUpdateCanvases();
				scrollRect.StopMovement();
				if (sectionIndex == 0)
				{
					scrollRect.verticalNormalizedPosition = 1f;
				}
				else
				{
					SectionHeaderAnchor sectionHeaderAnchor = _anchors[sectionIndex];
					float y = Vector2.op_Implicit(((Transform)_scrollRectTransform).InverseTransformPoint(((Transform)_content).position) - ((Transform)_scrollRectTransform).InverseTransformPoint(((Transform)sectionHeaderAnchor.RectTransform).position)).y + _sectionHeight / 2f - _spacing;
					_content.SetAnchoredPosY(y);
				}
				if (_currentSection != sectionIndex)
				{
					OnSectionChanged.Invoke(sectionIndex);
				}
				_currentSection = sectionIndex;
			}
		}

		public void AddSection(string sectionName)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			if (((Behaviour)this).isActiveAndEnabled && sectionHeaderPrefab != null && sectionAnchorPrefab != null && scrollRect != null)
			{
				SectionHeaderAnchor component = Object.Instantiate<GameObject>(sectionAnchorPrefab, (Transform)(object)_content).GetComponent<SectionHeaderAnchor>();
				SectionHeader component2 = Object.Instantiate<GameObject>(sectionHeaderPrefab, (Transform)(object)headerContainer).GetComponent<SectionHeader>();
				RectTransform rectTransform = component2.RectTransform;
				rectTransform.drivenByObject = (Object)(object)this;
				rectTransform.drivenProperties = (DrivenTransformProperties)1286;
				rectTransform.anchorMin = new Vector2(0f, rectTransform.anchorMin.y);
				rectTransform.anchorMax = new Vector2(1f, rectTransform.anchorMax.y);
				component2.anchor = component;
				component.sectionHeader = component2;
				component2.SetText(sectionName);
				OnScroll(Vector2.zero);
				if (_anchors.Count == 0)
				{
					component.RectTransform.sizeDelta = default(Vector2);
				}
				_currentSection = _anchors.Count;
				_anchors.Add(component);
			}
		}

		public void AddBinds(RemappableKey? kbmKey, RemappableKey? gamepadKey, bool isBaseGame = false, string controlName = "")
		{
			if (((Behaviour)this).isActiveAndEnabled && rebindItemPrefab != null && scrollRect != null)
			{
				if (kbmKey != null && string.IsNullOrEmpty(controlName))
				{
					controlName = kbmKey.ControlName;
				}
				else if (gamepadKey != null && string.IsNullOrEmpty(controlName))
				{
					controlName = gamepadKey.ControlName;
				}
				Object.Instantiate<GameObject>(rebindItemPrefab, (Transform)(object)_content).GetComponent<RebindItem>().SetBind(controlName, kbmKey, gamepadKey, isBaseGame);
			}
		}

		public void AddFooter()
		{
			if (((Behaviour)this).isActiveAndEnabled && spacerPrefab != null)
			{
				Object.Instantiate<GameObject>(spacerPrefab, (Transform)(object)_content);
			}
		}

		private void OnScroll(Vector2 delta)
		{
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			if (_scrollRectTransform == null || headerContainer == null || _rectTransform == null)
			{
				return;
			}
			float maxY = GetMaxY(headerContainer);
			int num = -1;
			for (int i = 0; i < _anchors.Count; i++)
			{
				SectionHeaderAnchor sectionHeaderAnchor = _anchors[i];
				SectionHeader sectionHeader = sectionHeaderAnchor.sectionHeader;
				if (i == 0)
				{
					sectionHeader.RectTransform.SetLocalPosY(maxY - (_sectionHeight / 2f - _spacing));
					num = i;
					continue;
				}
				SectionHeader sectionHeader2 = _anchors[i - 1].sectionHeader;
				float num2 = CalculateHeaderRawYPos(sectionHeaderAnchor);
				sectionHeader.RectTransform.SetLocalPosY(num2);
				float num3 = GetMaxY(sectionHeader.RectTransform) + ((Transform)sectionHeader.RectTransform).localPosition.y;
				float num4 = GetMinY(sectionHeader2.RectTransform) + ((Transform)sectionHeader2.RectTransform).localPosition.y;
				if (num3 + _sectionHeight / 2f + _spacing >= num4)
				{
					sectionHeader2.RectTransform.SetLocalPosY(num2 + _sectionHeight);
				}
				if (num3 + _spacing / 2f >= maxY - _sectionHeight / 2f)
				{
					num = i;
					sectionHeader.RectTransform.SetLocalPosY(maxY - (_sectionHeight / 2f - _spacing));
				}
			}
			if (_currentSection != num)
			{
				OnSectionChanged.Invoke(num);
			}
			_currentSection = num;
		}

		private float CalculateHeaderRawYPos(SectionHeaderAnchor anchor)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			if (_content == null || headerContainer == null || _scrollRectTransform == null)
			{
				return 0f;
			}
			float num = GetMaxY(headerContainer) - GetMaxY(_scrollRectTransform);
			num += _sectionHeight / 2f;
			num -= OffsetCompensation;
			return ((Transform)anchor.RectTransform).localPosition.y - (num + 50f) + ((Transform)_content).localPosition.y;
		}

		private void OnDrawGizmos()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (_rectTransform != null && headerContainer != null)
			{
				Color color = Gizmos.color;
				_rectTransform.DrawGizmoUiRectWorld();
				Gizmos.color = color;
			}
		}

		private float GetMaxY(RectTransform element)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			if (_rectTransform == null)
			{
				_rectTransform = ((Component)this).GetComponent<RectTransform>();
			}
			Rect val = element.UiBounds(Vector3.zero);
			return ((Rect)(ref val)).max.y;
		}

		private float GetMinY(RectTransform element)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			if (_rectTransform == null)
			{
				_rectTransform = ((Component)this).GetComponent<RectTransform>();
			}
			Rect val = element.UiBounds(Vector3.zero);
			return ((Rect)(ref val)).min.y;
		}
	}
	public class RebindButton : MonoBehaviour
	{
		public Selectable? button;

		public TextMeshProUGUI? bindLabel;

		public Image? glyphLabel;

		public Image? notSupportedImage;

		public RebindIndicator? rebindIndicator;

		public Button? resetButton;

		public Button? removeButton;

		public float timeout = 5f;

		private RemappableKey? _key;

		private bool _isBaseGame;

		private RebindingOperation? _rebindingOperation;

		private bool _rebinding;

		private float _timeoutTimer;

		private static MethodInfo? _setChangesNotAppliedMethodInfo;

		private static readonly List<RebindButton> Instances = new List<RebindButton>();

		public void SetKey(RemappableKey? key, bool isBaseGame)
		{
			_key = key;
			_isBaseGame = isBaseGame;
			UpdateState();
		}

		public void UpdateState()
		{
			//IL_005a: 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)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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)
			if (bindLabel == null || glyphLabel == null || button == null || notSupportedImage == null || resetButton == null || removeButton == null)
			{
				return;
			}
			if (_key == null)
			{
				SetAsUnsupported();
				return;
			}
			int rebindingIndex = GetRebindingIndex();
			InputAction action = _key.currentInput.action;
			if (rebindingIndex >= action.bindings.Count)
			{
				SetAsUnsupported();
				return;
			}
			GameObject gameObject = ((Component)resetButton).gameObject;
			InputBinding val = action.bindings[rebindingIndex];
			gameObject.SetActive(((InputBinding)(ref val)).hasOverrides);
			val = action.bindings[rebindingIndex];
			string effectivePath = ((InputBinding)(ref val)).effectivePath;
			string bindPath = InputControlPath.ToHumanReadableString(effectivePath, (HumanReadableStringOptions)2, (InputControl)null);
			if (_key.gamepadOnly)
			{
				((TMP_Text)bindLabel).SetText("", true);
				if (effectivePath == "<InputUtils-Gamepad-Not-Bound>")
				{
					((Component)removeButton).gameObject.SetActive(false);
					((Behaviour)glyphLabel).enabled = false;
					return;
				}
				((Component)removeButton).gameObject.SetActive(true);
				ControllerGlyph bestMatching = ControllerGlyph.GetBestMatching();
				if (bestMatching == null)
				{
					((TMP_Text)bindLabel).SetText(effectivePath, true);
					((Behaviour)glyphLabel).enabled = false;
					return;
				}
				Sprite val2 = bestMatching[effectivePath];
				if (val2 == null)
				{
					((TMP_Text)bindLabel).SetText(effectivePath, true);
					((Behaviour)glyphLabel).enabled = false;
				}
				else
				{
					glyphLabel.sprite = val2;
					((Behaviour)glyphLabel).enabled = true;
				}
			}
			else
			{
				((Component)removeButton).gameObject.SetActive(!string.Equals(effectivePath, "<InputUtils-Kbm-Not-Bound>"));
				HandleKbmGlyphOrLabel(effectivePath, bindPath);
			}
		}

		private void HandleKbmGlyphOrLabel(string effectivePath, string bindPath)
		{
			if (bindLabel == null || glyphLabel == null)
			{
				return;
			}
			if (ControllerGlyph.MouseGlyphs != null)
			{
				Sprite val = ControllerGlyph.MouseGlyphs[effectivePath];
				if (val != null)
				{
					((TMP_Text)bindLabel).SetText("", true);
					glyphLabel.sprite = val;
					((Behaviour)glyphLabel).enabled = true;
					return;
				}
			}
			((Behaviour)glyphLabel).enabled = false;
			((TMP_Text)bindLabel).SetText(bindPath, true);
		}

		private void SetAsUnsupported()
		{
			if (button != null && bindLabel != null && glyphLabel != null && notSupportedImage != null && resetButton != null && removeButton != null)
			{
				button.interactable = false;
				button.targetGraphic.raycastTarget = false;
				((Behaviour)button.targetGraphic).enabled = false;
				((TMP_Text)bindLabel).SetText("", true);
				((Behaviour)glyphLabel).enabled = false;
				((Component)notSupportedImage).gameObject.SetActive(true);
				((Component)resetButton).gameObject.SetActive(false);
				((Component)removeButton).gameObject.SetActive(false);
			}
		}

		private int GetRebindingIndex()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if (_key == null)
			{
				return -1;
			}
			InputAction action = _key.currentInput.action;
			if (action.controls.Count == 0)
			{
				if (action.bindings.Count == 0)
				{
					return -1;
				}
				if (_key.gamepadOnly)
				{
					return 1;
				}
				return 0;
			}
			if (_key.rebindingIndex >= 0)
			{
				return _key.rebindingIndex;
			}
			return InputActionRebindingExtensions.GetBindingIndexForControl(action, action.controls[0]);
		}

		public void StartRebinding()
		{
			if (_key != null && bindLabel != null && glyphLabel != null && rebindIndicator != null && resetButton != null && removeButton != null)
			{
				int rebindingIndex = GetRebindingIndex();
				((Selectable)resetButton).interactable = false;
				((Selectable)removeButton).interactable = false;
				((Behaviour)glyphLabel).enabled = false;
				if (_key.gamepadOnly)
				{
					((Behaviour)rebindIndicator).enabled = true;
					RebindGamepad(_key.currentInput, rebindingIndex);
				}
				else
				{
					((TMP_Text)bindLabel).SetText("", true);
					((Behaviour)rebindIndicator).enabled = true;
					RebindKbm(_key.currentInput, rebindingIndex);
				}
				_timeoutTimer = timeout;
				_rebinding = true;
			}
		}

		private void FinishRebinding()
		{
			if (_key != null && rebindIndicator != null && resetButton != null && removeButton != null)
			{
				((Behaviour)rebindIndicator).enabled = false;
				_rebinding = false;
				if (_rebindingOperation != null)
				{
					_rebindingOperation = null;
				}
				((Selectable)resetButton).interactable = true;
				((Selectable)removeButton).interactable = true;
				UpdateState();
			}
		}

		public void ResetToDefault()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			FinishRebinding();
			if (_key == null)
			{
				return;
			}
			int rebindingIndex = GetRebindingIndex();
			InputAction action = _key.currentInput.action;
			InputBinding val = action.bindings[rebindingIndex];
			if (((InputBinding)(ref val)).hasOverrides)
			{
				InputActionRebindingExtensions.RemoveBindingOverride(action, rebindingIndex);
				if (_isBaseGame)
				{
					BaseGameUnsavedChanges();
				}
				MarkSettingsAsDirty();
				UpdateState();
			}
		}

		public void RemoveBind()
		{
			FinishRebinding();
			if (_key != null)
			{
				int rebindingIndex = GetRebindingIndex();
				InputActionRebindingExtensions.ApplyBindingOverride(_key.currentInput.action, rebindingIndex, _key.gamepadOnly ? "<InputUtils-Gamepad-Not-Bound>" : "<InputUtils-Kbm-Not-Bound>");
				if (_isBaseGame)
				{
					BaseGameUnsavedChanges();
				}
				MarkSettingsAsDirty();
				UpdateState();
			}
		}

		private void OnEnable()
		{
			Instances.Add(this);
			if (_key != null)
			{
				UpdateState();
			}
		}

		private void OnDisable()
		{
			FinishRebinding();
			Instances.Remove(this);
		}

		private void Update()
		{
			if (!_rebinding)
			{
				return;
			}
			_timeoutTimer -= Time.deltaTime;
			if (!(_timeoutTimer > 0f))
			{
				if (_rebindingOperation == null)
				{
					FinishRebinding();
					return;
				}
				_rebindingOperation.Cancel();
				FinishRebinding();
			}
		}

		private void RebindKbm(InputActionReference inputActionRef, int rebindIndex)
		{
			_rebindingOperation = InputActionRebindingExtensions.PerformInteractiveRebinding(inputActionRef.action, rebindIndex).OnMatchWaitForAnother(0.1f).WithControlsHavingToMatchPath("<Keyboard>")
				.WithControlsHavingToMatchPath("<Mouse>")
				.WithControlsHavingToMatchPath("<InputUtilsExtendedMouse>")
				.WithControlsExcluding("<Mouse>/scroll/y")
				.WithControlsExcluding("<Mouse>/scroll/x")
				.WithCancelingThrough("<Keyboard>/escape")
				.OnComplete((Action<RebindingOperation>)delegate(RebindingOperation operation)
				{
					OnRebindComplete(operation, this);
				})
				.OnCancel((Action<RebindingOperation>)delegate
				{
					FinishRebinding();
				})
				.Start();
		}

		private void RebindGamepad(InputActionReference inputActionRef, int rebindIndex)
		{
			_rebindingOperation = InputActionRebindingExtensions.PerformInteractiveRebinding(inputActionRef.action, rebindIndex).OnMatchWaitForAnother(0.1f).WithControlsHavingToMatchPath("<Gamepad>")
				.OnComplete((Action<RebindingOperation>)delegate(RebindingOperation operation)
				{
					OnRebindComplete(operation, this);
				})
				.Start();
		}

		private static void OnRebindComplete(RebindingOperation operation, RebindButton instance)
		{
			if (operation.completed)
			{
				if (instance._isBaseGame)
				{
					BaseGameUnsavedChanges();
				}
				MarkSettingsAsDirty();
				instance.FinishRebinding();
			}
		}

		private static void BaseGameUnsavedChanges()
		{
			IngamePlayerSettings.Instance.unsavedSettings.keyBindings = InputActionRebindingExtensions.SaveBindingOverridesAsJson((IInputActionCollection2)(object)IngamePlayerSettings.Instance.playerInput.actions);
		}

		private static void MarkSettingsAsDirty()
		{
			if ((object)_setChangesNotAppliedMethodInfo == null)
			{
				_setChangesNotAppliedMethodInfo = AccessTools.Method(typeof(IngamePlayerSettings), "SetChangesNotAppliedTextVisible", (Type[])null, (Type[])null);
			}
			_setChangesNotAppliedMethodInfo.Invoke(IngamePlayerSettings.Instance, new object[1] { true });
		}

		public static void ReloadGlyphs()
		{
			foreach (RebindButton instance in Instances)
			{
				instance.UpdateState();
			}
		}

		public static void ResetAllToDefaults()
		{
			foreach (RebindButton instance in Instances)
			{
				instance.ResetToDefault();
			}
		}
	}
	public class RebindIndicator : MonoBehaviour
	{
		public TextMeshProUGUI? label;

		public int maxTicks = 5;

		public float timeBetweenTicks = 1f;

		private int _ticks = 1;

		private float _timer;

		private void OnEnable()
		{
			_ticks = 1;
			_timer = timeBetweenTicks;
			((TMP_Text)label).SetText(GetText(), true);
		}

		private void OnDisable()
		{
			_ticks = 1;
			_timer = timeBetweenTicks;
			((TMP_Text)label).SetText("", true);
		}

		private void Update()
		{
			_timer -= Time.unscaledDeltaTime;
			if (!(_timer > 0f))
			{
				_ticks++;
				if (_ticks > maxTicks)
				{
					_ticks = 1;
				}
				((TMP_Text)label).SetText(GetText(), true);
				_timer = timeBetweenTicks;
			}
		}

		private string GetText()
		{
			string text = "";
			for (int i = 0; i < _ticks; i++)
			{
				text += ".";
			}
			return text;
		}
	}
	public class RebindItem : MonoBehaviour
	{
		public TextMeshProUGUI? controlNameLabel;

		public RebindButton? kbmButton;

		public RebindButton? gamepadButton;

		public void SetBind(string controlName, RemappableKey? kbmKey, RemappableKey? gamepadKey, bool isBaseGame = false)
		{
			if (controlNameLabel != null)
			{
				((TMP_Text)controlNameLabel).SetText(controlName, true);
				if (kbmButton != null)
				{
					kbmButton.SetKey(kbmKey, isBaseGame);
				}
				if (gamepadButton != null)
				{
					gamepadButton.SetKey(gamepadKey, isBaseGame);
				}
			}
		}
	}
	public class RemapContainerController : MonoBehaviour
	{
		public BindsListController? bindsList;

		public SectionListController? sectionList;

		public Button? backButton;

		public Button? legacyButton;

		public GameObject? legacyHolder;

		public List<RemappableKey> baseGameKeys = new List<RemappableKey>();

		internal int LayerShown;

		private void Awake()
		{
			if (bindsList == null)
			{
				bindsList = ((Component)this).GetComponentInChildren<BindsListController>();
			}
			if (sectionList == null)
			{
				sectionList = ((Component)this).GetComponentInChildren<SectionListController>();
			}
			bindsList.OnSectionChanged.AddListener((UnityAction<int>)HandleSectionChanged);
			LcInputActionApi.ContainerInstance = this;
		}

		public void JumpTo(int sectionIndex)
		{
			if (bindsList != null)
			{
				bindsList.JumpTo(sectionIndex);
			}
		}

		public void LoadUi()
		{
			GenerateBaseGameSection();
			GenerateApiSections();
			FinishUi();
		}

		private void GenerateBaseGameSection()
		{
			if (bindsList == null || sectionList == null)
			{
				return;
			}
			Dictionary<string, (RemappableKey, RemappableKey)> dictionary = new Dictionary<string, (RemappableKey, RemappableKey)>();
			string key;
			foreach (RemappableKey baseGameKey in baseGameKeys)
			{
				RemappableKey item = null;
				RemappableKey item2 = null;
				string text = baseGameKey.ControlName.ToLower();
				if (text.StartsWith("walk"))
				{
					key = text;
					text = "move" + key.Substring(4, key.Length - 4);
				}
				baseGameKey.ControlName = baseGameKey.ControlName.Replace("primary", "Primary");
				if (dictionary.TryGetValue(text, out var value))
				{
					if (baseGameKey.gamepadOnly)
					{
						(item, _) = value;
					}
					else
					{
						item2 = value.Item2;
					}
				}
				if (baseGameKey.gamepadOnly)
				{
					item2 = baseGameKey;
				}
				else
				{
					item = baseGameKey;
				}
				dictionary[text] = (item, item2);
			}
			bindsList.AddSection("Lethal Company");
			sectionList.AddSection("Lethal Company");
			foreach (KeyValuePair<string, (RemappableKey, RemappableKey)> item3 in dictionary)
			{
				item3.Deconstruct(out key, out var value2);
				var (kbmKey, gamepadKey) = value2;
				bindsList.AddBinds(kbmKey, gamepadKey, isBaseGame: true);
			}
		}

		public void OnSetToDefault()
		{
			RebindButton.ResetAllToDefaults();
		}

		public void HideHighestLayer()
		{
			if (backButton != null && legacyHolder != null)
			{
				if (LayerShown > 1)
				{
					legacyHolder.SetActive(false);
					LayerShown--;
				}
				else if (LayerShown > 0)
				{
					((UnityEvent)backButton.onClick).Invoke();
				}
			}
		}

		public void ShowLegacyUi()
		{
			if (((Behaviour)this).isActiveAndEnabled && legacyHolder != null)
			{
				legacyHolder.SetActive(true);
				LayerShown++;
			}
		}

		private void GenerateApiSections()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			if (bindsList == null || sectionList == null)
			{
				return;
			}
			foreach (IGrouping<string, LcInputActions> item in from lc in LcInputActionApi.InputActions
				group lc by lc.Plugin.Name)
			{
				bindsList.AddSection(item.Key);
				sectionList.AddSection(item.Key);
				foreach (LcInputActions item2 in item)
				{
					if (item2.Loaded)
					{
						continue;
					}
					foreach (InputActionReference actionRef in item2.ActionRefs)
					{
						InputBinding val = ((IEnumerable<InputBinding>)(object)actionRef.action.bindings).First();
						string name = ((InputBinding)(ref val)).name;
						RemappableKey kbmKey = new RemappableKey
						{
							ControlName = name,
							currentInput = actionRef,
							rebindingIndex = 0,
							gamepadOnly = false
						};
						RemappableKey gamepadKey = new RemappableKey
						{
							ControlName = name,
							currentInput = actionRef,
							rebindingIndex = 1,
							gamepadOnly = true
						};
						bindsList.AddBinds(kbmKey, gamepadKey);
					}
					item2.Loaded = true;
				}
			}
		}

		private void FinishUi()
		{
			if (bindsList != null)
			{
				bindsList.AddFooter();
				JumpTo(0);
			}
		}

		private void HandleSectionChanged(int sectionIndex)
		{
			if (sectionList != null && bindsList != null)
			{
				sectionList.SelectSection(sectionIndex);
			}
		}

		private void OnEnable()
		{
			JumpTo(0);
			LayerShown = 1;
		}

		private void OnDisable()
		{
			LcInputActionApi.ReEnableFromRebind();
			LayerShown = 0;
		}

		private void OnDestroy()
		{
			LcInputActionApi.ContainerInstance = null;
			LayerShown = 0;
		}
	}
}
namespace LethalCompanyInputUtils.Components.Section
{
	[RequireComponent(typeof(Button), typeof(RectTransform))]
	public class SectionEntry : MonoBehaviour
	{
		public TextMeshProUGUI? indicator;

		public TextMeshProUGUI? label;

		public Button? button;

		public int sectionIndex;

		public UnityEvent<int> OnEntrySelected = new UnityEvent<int>();

		private RectTransform? _rectTransform;

		public RectTransform RectTransform
		{
			get
			{
				if (_rectTransform == null)
				{
					_rectTransform = ((Component)this).GetComponent<RectTransform>();
				}
				return _rectTransform;
			}
		}

		private void Awake()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			if (button == null)
			{
				button = ((Component)this).GetComponent<Button>();
			}
			((UnityEvent)button.onClick).AddListener(new UnityAction(SelectEntry));
		}

		public void SetText(string text)
		{
			if (label != null)
			{
				((TMP_Text)label).SetText(text, true);
			}
		}

		public void SetIndicator(bool indicated)
		{
			if (indicator != null)
			{
				((Behaviour)indicator).enabled = indicated;
			}
		}

		private void SelectEntry()
		{
			OnEntrySelected.Invoke(sectionIndex);
		}
	}
	[RequireComponent(typeof(RectTransform))]
	public class SectionHeader : MonoBehaviour
	{
		public SectionHeaderAnchor? anchor;

		public TextMeshProUGUI? label;

		private RectTransform? _rectTransform;

		public RectTransform RectTransform
		{
			get
			{
				if (_rectTransform == null)
				{
					_rectTransform = ((Component)this).GetComponent<RectTransform>();
				}
				return _rectTransform;
			}
		}

		public void SetText(string text)
		{
			if (label != null)
			{
				((TMP_Text)label).SetText(text, true);
			}
		}
	}
	[RequireComponent(typeof(RectTransform))]
	public class SectionHeaderAnchor : MonoBehaviour
	{
		public SectionHeader? sectionHeader;

		private RectTransform? _rectTransform;

		public RectTransform RectTransform
		{
			get
			{
				if (_rectTransform == null)
				{
					_rectTransform = ((Component)this).GetComponent<RectTransform>();
				}
				return _rectTransform;
			}
		}

		private void Awake()
		{
			if (_rectTransform == null)
			{
				_rectTransform = ((Component)this).GetComponent<RectTransform>();
			}
		}
	}
	public class SectionListController : MonoBehaviour
	{
		public GameObject? sectionEntryPrefab;

		public ScrollRect? scrollRect;

		public RemapContainerController? remapContainer;

		private RectTransform? _viewport;

		private RectTransform? _content;

		private readonly List<SectionEntry> _sectionEntries = new List<SectionEntry>();

		private void Awake()
		{
			if (remapContainer == null)
			{
				remapContainer = ((Component)this).GetComponentInParent<RemapContainerController>();
			}
			if (scrollRect == null)
			{
				scrollRect = ((Component)this).GetComponentInChildren<ScrollRect>();
			}
			_viewport = scrollRect.viewport;
			_content = scrollRect.content;
		}

		public void AddSection(string sectionName)
		{
			if (_content != null && sectionEntryPrefab != null)
			{
				SectionEntry component = Object.Instantiate<GameObject>(sectionEntryPrefab, (Transform)(object)_content).GetComponent<SectionEntry>();
				component.SetText(sectionName);
				component.sectionIndex = _sectionEntries.Count;
				component.OnEntrySelected.AddListener((UnityAction<int>)OnSectionEntryPressed);
				_sectionEntries.Add(component);
			}
		}

		public void SelectSection(int sectionIndex)
		{
			int count = _sectionEntries.Count;
			if (sectionIndex >= count || sectionIndex < 0)
			{
				return;
			}
			foreach (SectionEntry sectionEntry2 in _sectionEntries)
			{
				sectionEntry2.SetIndicator(indicated: false);
			}
			SectionEntry sectionEntry = _sectionEntries[sectionIndex];
			sectionEntry.SetIndicator(indicated: true);
			if (scrollRect != null)
			{
				UpdateScrollPosToFit(sectionEntry);
			}
		}

		private void UpdateScrollPosToFit(SectionEntry sectionEntry)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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)
			if (_viewport == null || _content == null || scrollRect == null)
			{
				return;
			}
			RectTransform rectTransform = sectionEntry.RectTransform;
			float num = rectTransform.WorldMinY();
			float num2 = rectTransform.WorldMaxY();
			float num3 = _viewport.WorldMinY();
			float num4 = _viewport.WorldMaxY();
			if (!(num > num3) || !(num2 < num4))
			{
				scrollRect.StopMovement();
				float num5 = 0f;
				if (num2 > num4)
				{
					num5 = num4 - num2 - rectTransform.sizeDelta.y;
				}
				else if (num < num3)
				{
					num5 = num3 - num + rectTransform.sizeDelta.y;
				}
				float y = _content.anchoredPosition.y;
				_content.SetAnchoredPosY(y + num5);
			}
		}

		private void OnSectionEntryPressed(int sectionIndex)
		{
			if (remapContainer != null)
			{
				remapContainer.JumpTo(sectionIndex);
			}
		}
	}
}
namespace LethalCompanyInputUtils.Components.PopOvers
{
	[RequireComponent(typeof(RectTransform))]
	public class PopOver : MonoBehaviour
	{
		public enum Placement
		{
			Top,
			Bottom,
			Left,
			Right
		}

		public RectTransform? popOverLayer;

		public PopOverTextContainer? textContainer;

		public RectTransform? pivotPoint;

		public GameObject? background;

		public PopOverArrow? arrow;

		public CanvasGroup? canvasGroup;

		public float maxWidth = 300f;

		private RectTransform? _rectTransform;

		private RectTransform? _target;

		private Placement _placement;

		public void SetTarget(RectTransform target, Placement placement)
		{
			if (background != null && canvasGroup != null)
			{
				background.SetActive(true);
				_target = target;
				_placement = placement;
				SetPivot();
				SetArrow();
			}
		}

		public void ClearTarget()
		{
			if (background != null && canvasGroup != null)
			{
				canvasGroup.alpha = 0f;
				_target = null;
				background.SetActive(false);
			}
		}

		private void MoveTo(RectTransform target)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (pivotPoint != null)
			{
				Vector3 val = Vector2.op_Implicit(GetTargetPosition(target));
				Vector3 val2 = Vector2.op_Implicit(GetTargetPivotOffset(target));
				Vector3 val3 = Vector2.op_Implicit(GetLabelPivotOffset());
				Vector3 targetPos = val + val2 + val3;
				MovePopOverToTarget(targetPos);
				AdjustArrowPosToTarget(target);
			}
		}

		private void SetPivot()
		{
			//IL_0039: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if (pivotPoint != null)
			{
				RectTransform val = pivotPoint;
				val.pivot = (Vector2)(_placement switch
				{
					Placement.Top => new Vector2(0.5f, 0f), 
					Placement.Bottom => new Vector2(0.5f, 1f), 
					Placement.Left => new Vector2(1f, 0.5f), 
					Placement.Right => new Vector2(0f, 0.5f), 
					_ => throw new ArgumentOutOfRangeException(), 
				});
			}
		}

		private void SetArrow()
		{
			if (arrow != null)
			{
				switch (_placement)
				{
				case Placement.Top:
					arrow.PointToBottom();
					break;
				case Placement.Bottom:
					arrow.PointToTop();
					break;
				case Placement.Left:
					arrow.PointToRight();
					break;
				case Placement.Right:
					arrow.PointToLeft();
					break;
				default:
					throw new ArgumentOutOfRangeException();
				}
			}
		}

		private Vector2 GetTargetPosition(RectTransform target)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (popOverLayer == null)
			{
				return Vector2.zero;
			}
			return popOverLayer.WorldToLocalPoint(target);
		}

		private Vector2 GetTargetPivotOffset(RectTransform target)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			if (popOverLayer == null)
			{
				return Vector2.zero;
			}
			Rect relativeRect = popOverLayer.GetRelativeRect(target);
			return (Vector2)(_placement switch
			{
				Placement.Top => new Vector2(0f, 2f + ((Rect)(ref relativeRect)).height / 2f), 
				Placement.Bottom => new Vector2(0f, -2f + (0f - ((Rect)(ref relativeRect)).height) / 2f), 
				Placement.Left => new Vector2(-2f + (0f - ((Rect)(ref relativeRect)).width) / 2f, 0f), 
				Placement.Right => new Vector2(2f + ((Rect)(ref relativeRect)).width / 2f, 0f), 
				_ => throw new ArgumentOutOfRangeException(), 
			});
		}

		private Vector2 GetLabelPivotOffset()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (textContainer == null || textContainer.rectTransform == null || _rectTransform == null || popOverLayer == null)
			{
				return Vector2.zero;
			}
			Rect relativeRect = popOverLayer.GetRelativeRect(_rectTransform);
			Rect relativeRect2 = popOverLayer.GetRelativeRect(textContainer.rectTransform);
			return (Vector2)(_placement switch
			{
				Placement.Top => new Vector2(0f, 0f - (((Rect)(ref relativeRect)).height - ((Rect)(ref relativeRect2)).height) / 2f), 
				Placement.Bottom => new Vector2(0f, (((Rect)(ref relativeRect)).height - ((Rect)(ref relativeRect2)).height) / 2f), 
				Placement.Left => new Vector2((((Rect)(ref relativeRect)).width - ((Rect)(ref relativeRect2)).width) / 2f, 0f), 
				Placement.Right => new Vector2(0f - (((Rect)(ref relativeRect)).width - ((Rect)(ref relativeRect2)).width) / 2f, 0f), 
				_ => throw new ArgumentOutOfRangeException(), 
			});
		}

		private void MovePopOverToTarget(Vector3 targetPos)
		{
			//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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_003f: 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)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing refere