Decompiled source of ColdFixer v0.1.4

ColdFixer.dll

Decompiled 7 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.RegularExpressions;
using System.Threading.Tasks;
using System.Xml;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using ColdFixer.Asset;
using ColdFixer.Config;
using ColdFixer.Patch;
using ColdFixer.Util;
using Dissonance;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("ColdFixer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ColdFixer")]
[assembly: AssemblyTitle("ColdFixer")]
[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 ColdFixer
{
	public static class PluginInfo
	{
		public const string GUID = "hexkivo.ColdFixer";

		public const string NAME = "ColdFixer";

		public const string VERSION = "0.1.4";
	}
	[BepInPlugin("hexkivo.ColdFixer", "ColdFixer", "0.1.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("hexkivo.ColdFixer");

		public bool isInputUtils = false;

		internal static ManualLogSource Log = Logger.CreateLogSource("hexkivo.ColdFixer");

		private static bool MenuLoaded = false;

		public static Plugin? Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			if (Chainloader.PluginInfos.Values.Any((PluginInfo p) => p.Metadata.GUID == "ainavt.lc.lethalconfig"))
			{
				LogInfo("Lethalconfig Founded");
				Setting.isLethalConfig = true;
			}
			try
			{
				Loader.LoadAll();
				Setting.BindAll();
				((BaseUnityPlugin)this).Config.SettingChanged += delegate(object sender, SettingChangedEventArgs e)
				{
					LogInfo($"Config [{e.ChangedSetting.Definition.Key}] set to [{e.ChangedSetting.BoxedValue}]");
				};
				if (Intro.SKIP_SPLASH.Value)
				{
					SceneManager.sceneLoaded += delegate(Scene scene, LoadSceneMode _)
					{
						switch (((Scene)(ref scene)).name)
						{
						case "InitScene":
						case "InitSceneLaunchOptions":
						case "MainMenu":
							MenuLoaded = true;
							break;
						}
					};
					Task.Run(delegate
					{
						while (!MenuLoaded)
						{
							SplashScreen.Stop((StopBehavior)0);
						}
					});
				}
				harmony.PatchAll();
				Log.LogInfo((object)"Plugin Load Complete");
			}
			catch (Exception ex)
			{
				LogError(ex.Message);
			}
		}

		internal static void LogInfo(object data)
		{
			Log.LogInfo(data);
		}

		internal static void LogError(object data)
		{
			Log.LogError(data);
		}

		internal static void LogWarning(object data)
		{
			Log.LogWarning(data);
		}

		internal static void LogFatal(object data)
		{
			Log.LogFatal(data);
		}

		internal static void LogDebug(object data)
		{
			Log.LogDebug(data);
		}
	}
}
namespace ColdFixer.Asset
{
	internal static class Font
	{
		public static TMP_FontAsset? Normal;

		public static TMP_FontAsset? Transmit;

		public static void Load()
		{
			AssetBundle val = Loader.LoadAssetBundle("Font");
			Normal = val.LoadAsset<TMP_FontAsset>("Normal");
			Transmit = val.LoadAsset<TMP_FontAsset>("Transmit");
			Plugin.LogInfo("[Font] Font assets loaded");
		}
	}
	internal static class ToggleMute
	{
		public static Sprite IconSprite;

		public static void Load()
		{
			IconSprite = Loader.LoadAssetBundle("ToggleMute").LoadAsset<Sprite>("icon");
			Plugin.LogInfo("[ToggleMute] gameobject loaded");
		}
	}
}
namespace ColdFixer.Patch
{
	[HarmonyPatch]
	internal static class Chat
	{
		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPrefix]
		private static void Update(PlayerControllerB __instance)
		{
			if (Game.isControlling(__instance) && HUDManager.Instance.chatTextField.isFocused)
			{
				HUDManager.Instance.Chat.targetAlpha = 1f;
				__instance.isTypingChat = true;
			}
		}
	}
	[HarmonyPatch]
	internal static class DeathCause
	{
		[HarmonyPatch(typeof(HUDManager), "UpdateBoxesSpectateUI")]
		[HarmonyPostfix]
		private static void UpdateBoxesSpectateUI(HUDManager __instance, ref Dictionary<Animator, PlayerControllerB> ___spectatingPlayerBoxes)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			if (!ColdFixer.Config.DeathCause.SPECTATE_DEATH_CAUSE.Value)
			{
				return;
			}
			PlayerControllerB playerScript;
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				playerScript = StartOfRound.Instance.allPlayerScripts[i];
				if (___spectatingPlayerBoxes.ContainsValue(playerScript))
				{
					Func<KeyValuePair<Animator, PlayerControllerB>, bool> predicate = (KeyValuePair<Animator, PlayerControllerB> x) => (Object)(object)x.Value == (Object)(object)playerScript;
					GameObject gameObject = ((Component)___spectatingPlayerBoxes.FirstOrDefault<KeyValuePair<Animator, PlayerControllerB>>(predicate).Key).gameObject;
					CauseOfDeath causeOfDeath = playerScript.causeOfDeath;
					TextMeshProUGUI val = gameObject.GetComponentsInChildren<TextMeshProUGUI>()[1];
					((TMP_Text)val).enableWordWrapping = false;
					((TMP_Text)val).text = string.Format(Translation.Translate("DEATH_CAUSE") + ": " + Translation.Translate(((object)(CauseOfDeath)(ref causeOfDeath)).ToString()));
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class FontFallback
	{
		private static Regex NormalRegex = new Regex("^(b|DialogueText|3270.*)$");

		private static Regex TransmitRegex = new Regex("^edunline.*$");

		[HarmonyPatch(typeof(TMP_FontAsset), "Awake")]
		[HarmonyPrefix]
		private static void Awake(TMP_FontAsset __instance)
		{
			string name = ((Object)__instance).name;
			if (NormalRegex.IsMatch(name))
			{
				if (!ColdFixer.Config.FontFallback.NORMAL_FONT_FALLBACK.Value)
				{
					__instance.characterLookupTable.Clear();
					__instance.atlasPopulationMode = (AtlasPopulationMode)0;
				}
				if ((Object)(object)Font.Normal != (Object)null && !__instance.fallbackFontAssetTable.Contains(Font.Normal))
				{
					__instance.fallbackFontAssetTable.Add(Font.Normal);
				}
			}
			else if (TransmitRegex.IsMatch(name))
			{
				if (!ColdFixer.Config.FontFallback.TRANSMIT_FONT_FALLBACK.Value)
				{
					__instance.characterLookupTable.Clear();
					__instance.atlasPopulationMode = (AtlasPopulationMode)0;
				}
				if ((Object)(object)Font.Transmit != (Object)null && !__instance.fallbackFontAssetTable.Contains(Font.Transmit))
				{
					__instance.fallbackFontAssetTable.Add(Font.Transmit);
				}
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void font(TMP_FontAsset value)
		{
			Awake(value);
		}

		[HarmonyPatch(typeof(TextMeshProUGUI), "Awake")]
		[HarmonyPrefix]
		private static void Awake(TextMeshProUGUI __instance)
		{
			if (!((Object)(object)((TMP_Text)__instance).font == (Object)null))
			{
				Awake(((TMP_Text)__instance).font);
			}
		}

		[HarmonyPatch(typeof(HUDManager), "OnEnable")]
		[HarmonyPostfix]
		private static void OnEnable()
		{
			((UnityEvent<string>)(object)HUDManager.Instance.chatTextField.onSubmit).AddListener((UnityAction<string>)OnSubmitChat);
		}

		[HarmonyPatch(typeof(HUDManager), "OnDisable")]
		[HarmonyPostfix]
		private static void OnDisable()
		{
			((UnityEvent<string>)(object)HUDManager.Instance.chatTextField.onSubmit).RemoveListener((UnityAction<string>)OnSubmitChat);
		}

		[HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")]
		[HarmonyPrefix]
		private static void SubmitChat_performed(ref bool __runOriginal)
		{
			__runOriginal = false;
		}

		private static void OnSubmitChat(string ChatString)
		{
			//IL_0064: 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)
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if (!string.IsNullOrEmpty(ChatString) && ChatString.Length < 50)
			{
				HUDManager.Instance.AddTextToChatOnServer(ChatString, (int)localPlayerController.playerClientId);
			}
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled && Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) > 24.4f && (!GameNetworkManager.Instance.localPlayerController.holdingWalkieTalkie || !StartOfRound.Instance.allPlayerScripts[i].holdingWalkieTalkie))
				{
					HUDManager.Instance.playerCouldRecieveTextChatAnimator.SetTrigger("ping");
					break;
				}
			}
			localPlayerController.isTypingChat = false;
			HUDManager.Instance.chatTextField.text = "";
			EventSystem.current.SetSelectedGameObject((GameObject)null);
			HUDManager.Instance.PingHUDElement(HUDManager.Instance.Chat, 2f, 1f, 0.2f);
			((Behaviour)HUDManager.Instance.typingIndicator).enabled = false;
		}
	}
	[HarmonyPatch]
	internal static class FOV
	{
		private static readonly Vector3 OriginalVisorScale = new Vector3(0.36f, 0.49f, 0.49f);

		[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
		[HarmonyPostfix]
		private static void Awake(PlayerControllerB __instance)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			if (ColdFixer.Config.FOV.HIDE_VISOR.Value)
			{
				__instance.localVisor.localScale = new Vector3(0f, 0f, 0f);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		private static void Update(PlayerControllerB __instance, ref float ___targetFOV, ref Camera ___gameplayCamera, ref Transform ___localVisor)
		{
			//IL_001b: 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)
			if (Game.isControlling(__instance))
			{
				__instance.localVisor.position = __instance.localVisor.position + new Vector3(0f, 0f, -0.06f);
				if (__instance.inTerminalMenu)
				{
					___targetFOV = ColdFixer.Config.FOV.FOV_TERMINAL.Value;
				}
				else if (__instance.IsInspectingItem)
				{
					___targetFOV = 46f;
				}
				else if (__instance.isSprinting)
				{
					___targetFOV = ColdFixer.Config.FOV.FOV_SPRINT.Value;
				}
				else
				{
					___targetFOV = ColdFixer.Config.FOV.FOV_NORMAL.Value;
				}
				___gameplayCamera.fieldOfView = Mathf.Lerp(___gameplayCamera.fieldOfView, ___targetFOV, 6f * Time.deltaTime);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
		[HarmonyPostfix]
		private static void LateUpdate(PlayerControllerB __instance, ref Transform ___localVisor)
		{
			//IL_0004: 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_0047: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			Transform obj = ___localVisor;
			obj.localPosition += ___localVisor.rotation * new Vector3(0f, 0.06f * (1f - TanDeg(30f) / TanDeg((float)ColdFixer.Config.FOV.FOV_NORMAL.Value / 2f)), 0f);
		}

		private static float TanDeg(float x)
		{
			return Mathf.Tan(x / 180f * MathF.PI);
		}

		public static void ConfigChanged(object? sender, EventArgs? e)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			Transform val = GameNetworkManager.Instance?.localPlayerController?.localVisor;
			if (!((Object)(object)val == (Object)null))
			{
				if (ColdFixer.Config.FOV.HIDE_VISOR.Value)
				{
					val.localScale = new Vector3(0f, 0f, 0f);
				}
				else
				{
					val.localScale = OriginalVisorScale;
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class Grabbability
	{
		[HarmonyPatch(typeof(GrabbableObject), "Start")]
		[HarmonyPostfix]
		private static void Start(GrabbableObject __instance)
		{
			if (ColdFixer.Config.Grabbability.GRAB_BEFORE_START.Value)
			{
				__instance.itemProperties.canBeGrabbedBeforeGameStart = true;
			}
		}
	}
	[HarmonyPatch]
	internal static class IntroBlocker
	{
		[HarmonyPatch(typeof(InitializeGame), "Start")]
		[HarmonyPrefix]
		private static void Start(ref bool __runOriginal)
		{
			if (Intro.SKIP_BOOTING_ANIMATION.Value)
			{
				__runOriginal = false;
				SceneManager.LoadScene("MainMenu");
			}
		}

		[HarmonyPatch(typeof(PreInitSceneScript), "Start")]
		[HarmonyPostfix]
		private static void Start()
		{
			IngamePlayerSettings instance = IngamePlayerSettings.Instance;
			if (instance != null)
			{
				instance.SetPlayerFinishedLaunchOptions();
			}
		}

		[HarmonyPatch(typeof(PreInitSceneScript), "SkipToFinalSetting")]
		[HarmonyPostfix]
		private static void SkipToFinalSetting(PreInitSceneScript __instance, ref bool ___choseLaunchOption)
		{
			if (Intro.PRESELECTED_MODE.Value == Intro.ModeOption.Online || Intro.PRESELECTED_MODE.Value == Intro.ModeOption.Local)
			{
				CollectionExtensions.Do<GameObject>((IEnumerable<GameObject>)__instance.LaunchSettingsPanels, (Action<GameObject>)delegate(GameObject panel)
				{
					panel.SetActive(false);
				});
				__instance.currentLaunchSettingPanel = 0;
				((TMP_Text)__instance.headerText).text = "";
				((Component)__instance.blackTransition).gameObject.SetActive(false);
				__instance.continueButton.gameObject.SetActive(false);
				___choseLaunchOption = true;
				__instance.mainAudio.PlayOneShot(__instance.selectSFX);
				string text = ((Intro.PRESELECTED_MODE.Value == Intro.ModeOption.Online) ? "InitScene" : "InitSceneLANMode");
				SceneManager.LoadScene(text);
			}
		}

		[HarmonyPatch(typeof(MenuManager), "DisplayMenuNotification")]
		[HarmonyPrefix]
		private static void DisplayMenuNotification(string notificationText, string buttonText, ref bool __runOriginal)
		{
			if (Intro.BLOCK_OFFLINE_WARNING.Value && notificationText.StartsWith("Could not connect"))
			{
				__runOriginal = false;
			}
		}

		[HarmonyPatch(typeof(MenuManager), "Start")]
		[HarmonyPostfix]
		private static void Start(MenuManager __instance)
		{
			MenuManager __instance2 = __instance;
			((MonoBehaviour)__instance2).StartCoroutine(Menu());
			IEnumerator Menu()
			{
				yield return (object)new WaitForSeconds(0f);
				if (Intro.REMOVE_CREDITS_BUTTON.Value)
				{
					GameObject obj = GameObject.Find("MenuContainer");
					object obj2;
					if (obj == null)
					{
						obj2 = null;
					}
					else
					{
						Transform transform = obj.transform;
						obj2 = ((transform != null) ? (from b in ((Component)transform.Find("MainButtons")).GetComponentsInChildren<Button>(true)
							select ((Component)b).gameObject) : null);
					}
					IEnumerable<GameObject> buttons = (IEnumerable<GameObject>)obj2;
					GameObject CreditsButton = buttons.First((GameObject button) => ((Object)button).name == "Credits");
					CreditsButton.SetActive(false);
					Rect rect = CreditsButton.GetComponent<RectTransform>().rect;
					float CreditsHeight = ((Rect)(ref rect)).height * 1.3f;
					CollectionExtensions.Do<GameObject>(buttons, (Action<GameObject>)delegate(GameObject button)
					{
						//IL_0024: 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_0050: 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)
						//IL_006a: Unknown result type (might be due to invalid IL or missing references)
						if (Object.op_Implicit((Object)(object)button) && !((Object)(object)button == (Object)(object)CreditsButton) && button.transform.localPosition.y > CreditsButton.transform.localPosition.y)
						{
							Transform transform2 = button.transform;
							transform2.localPosition -= new Vector3(0f, CreditsHeight, 0f);
						}
					});
				}
				if (Intro.BLOCK_NEWS.Value)
				{
					GameObject newsPanel = __instance2.NewsPanel;
					if (newsPanel != null)
					{
						newsPanel.SetActive(false);
					}
				}
				if (Intro.BLOCK_LAN_WARNING.Value)
				{
					GameObject lanWarningContainer = __instance2.lanWarningContainer;
					if (lanWarningContainer != null)
					{
						lanWarningContainer.SetActive(false);
					}
				}
				TextMeshProUGUI launchedInLanModeText = __instance2.launchedInLanModeText;
				GameObject lanModeText = ((launchedInLanModeText != null) ? ((Component)launchedInLanModeText).gameObject : null);
				if (Object.op_Implicit((Object)(object)lanModeText))
				{
					lanModeText.SetActive(false);
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class ItemHotkey
	{
		[HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")]
		[HarmonyPostfix]
		public static void KillPlayer(ref GrabbableObject ___pocketedFlashlight)
		{
			___pocketedFlashlight = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		public static void Update(PlayerControllerB __instance, ref GrabbableObject ___currentlyHeldObjectServer, ref GrabbableObject ___pocketedFlashlight)
		{
			if (!ColdFixer.Config.ItemHotkey.HOTKEY_FLASHLIGHT.Value || !Game.isControlling(__instance) || __instance.inTerminalMenu || __instance.isTypingChat || !Application.isFocused)
			{
				return;
			}
			if (___currentlyHeldObjectServer is FlashlightItem && (Object)(object)___currentlyHeldObjectServer != (Object)(object)___pocketedFlashlight)
			{
				___pocketedFlashlight = ___currentlyHeldObjectServer;
			}
			if ((Object)(object)___pocketedFlashlight == (Object)null || !InputSetting.instance.FlashLightKey.triggered || !(___pocketedFlashlight is FlashlightItem) || !___pocketedFlashlight.isHeld)
			{
				return;
			}
			___pocketedFlashlight.UseItemOnClient(true);
			if (!(___currentlyHeldObjectServer is FlashlightItem))
			{
				GrabbableObject obj = ___pocketedFlashlight;
				((Behaviour)((FlashlightItem)((obj is FlashlightItem) ? obj : null)).flashlightBulbGlow).enabled = false;
				GrabbableObject obj2 = ___pocketedFlashlight;
				((Behaviour)((FlashlightItem)((obj2 is FlashlightItem) ? obj2 : null)).flashlightBulb).enabled = false;
				GrabbableObject obj3 = ___pocketedFlashlight;
				if (((obj3 is FlashlightItem) ? obj3 : null).isBeingUsed)
				{
					((Behaviour)__instance.helmetLight).enabled = true;
					GrabbableObject obj4 = ___pocketedFlashlight;
					((FlashlightItem)((obj4 is FlashlightItem) ? obj4 : null)).usingPlayerHelmetLight = true;
					GrabbableObject obj5 = ___pocketedFlashlight;
					((FlashlightItem)((obj5 is FlashlightItem) ? obj5 : null)).PocketFlashlightServerRpc(true);
				}
				else
				{
					((Behaviour)__instance.helmetLight).enabled = false;
					GrabbableObject obj6 = ___pocketedFlashlight;
					((FlashlightItem)((obj6 is FlashlightItem) ? obj6 : null)).usingPlayerHelmetLight = false;
					GrabbableObject obj7 = ___pocketedFlashlight;
					((FlashlightItem)((obj7 is FlashlightItem) ? obj7 : null)).PocketFlashlightServerRpc(false);
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		public static void Update(PlayerControllerB __instance, ref GrabbableObject ___currentlyHeldObjectServer)
		{
			if (!ColdFixer.Config.ItemHotkey.HOTKEY_WALKIE_TALKIE.Value || !Game.isControlling(__instance) || __instance.inTerminalMenu || __instance.isTypingChat || ShipBuildModeManager.Instance.InBuildMode || !Application.isFocused)
			{
				return;
			}
			GrabbableObject val = null;
			for (int i = 0; i < __instance.ItemSlots.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)__instance.ItemSlots[i]) && __instance.ItemSlots[i] is WalkieTalkie && __instance.ItemSlots[i].isBeingUsed)
				{
					val = __instance.ItemSlots[i];
					break;
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			if (InputSetting.instance.WalkieTalkieKey.WasPressedThisFrame())
			{
				if (___currentlyHeldObjectServer is WalkieTalkie)
				{
					___currentlyHeldObjectServer.UseItemOnClient(true);
				}
				else if ((Object)(object)val != (Object)null)
				{
					val.UseItemOnClient(true);
				}
			}
			if (InputSetting.instance.WalkieTalkieKey.WasReleasedThisFrame())
			{
				if (___currentlyHeldObjectServer is WalkieTalkie)
				{
					___currentlyHeldObjectServer.UseItemOnClient(false);
				}
				else if ((Object)(object)val != (Object)null)
				{
					val.UseItemOnClient(false);
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class Lookdown
	{
		[HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")]
		[HarmonyPrefix]
		private static void CalculateNormalLookingInput(Vector2 inputVector, PlayerControllerB __instance, ref bool __runOriginal, ref float ___cameraUp, ref bool ___smoothLookEnabledLastFrame)
		{
			//IL_0032: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			if (ColdFixer.Config.Lookdown.LOOKDOWN_FIX.Value)
			{
				__runOriginal = false;
				if (___smoothLookEnabledLastFrame)
				{
					___smoothLookEnabledLastFrame = false;
				}
				if (__instance.inShockingMinigame)
				{
					inputVector.x = Mathf.Clamp(inputVector.x, -15f, 15f);
					inputVector.y = Mathf.Clamp(inputVector.y, -15f, 15f);
					__instance.turnCompass.Rotate(new Vector3(0f, inputVector.x, 0f));
				}
				else if (__instance.jetpackControls)
				{
					__instance.jetpackTurnCompass.Rotate(new Vector3(0f, inputVector.x, 0f), (Space)1);
				}
				else
				{
					__instance.thisPlayerBody.Rotate(new Vector3(0f, inputVector.x, 0f), (Space)1);
				}
				___cameraUp -= inputVector.y;
				___cameraUp = Mathf.Clamp(___cameraUp, -80f, 80f);
				((Component)__instance.gameplayCamera).transform.localEulerAngles = new Vector3(___cameraUp, ((Component)__instance.gameplayCamera).transform.localEulerAngles.y, ((Component)__instance.gameplayCamera).transform.localEulerAngles.z);
				__instance.playerHudUIContainer.Rotate(new Vector3(inputVector.y / 4f, (0f - inputVector.x) / 8f, 0f) * Mathf.Clamp(Time.deltaTime * 15f, 0.02f, 4f));
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")]
		[HarmonyPrefix]
		private static void CalculateSmoothLookingInput(Vector2 inputVector, PlayerControllerB __instance, ref bool __runOriginal, ref float ___cameraUp, ref bool ___smoothLookEnabledLastFrame)
		{
			//IL_005e: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: 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)
			if (ColdFixer.Config.Lookdown.LOOKDOWN_FIX.Value)
			{
				__runOriginal = false;
				if (!___smoothLookEnabledLastFrame)
				{
					___smoothLookEnabledLastFrame = true;
					__instance.smoothLookTurnCompass.rotation = ((Component)__instance.gameplayCamera).transform.rotation;
					__instance.smoothLookTurnCompass.SetParent((Transform)null);
				}
				__instance.smoothLookTurnCompass.Rotate(new Vector3(0f, inputVector.x, 0f), (Space)1);
				___cameraUp -= inputVector.y;
				___cameraUp = Mathf.Clamp(___cameraUp, -80f, 80f);
				__instance.smoothLookTurnCompass.localEulerAngles = new Vector3(___cameraUp, __instance.smoothLookTurnCompass.localEulerAngles.y, __instance.smoothLookTurnCompass.localEulerAngles.z);
				__instance.smoothLookTurnCompass.eulerAngles = new Vector3(__instance.smoothLookTurnCompass.eulerAngles.x, __instance.smoothLookTurnCompass.eulerAngles.y, ((Component)__instance.thisPlayerBody).transform.eulerAngles.z);
				__instance.thisPlayerBody.eulerAngles = new Vector3(__instance.thisPlayerBody.eulerAngles.x, Mathf.LerpAngle(__instance.thisPlayerBody.eulerAngles.y, __instance.smoothLookTurnCompass.eulerAngles.y, __instance.smoothLookMultiplier * Time.deltaTime), __instance.thisPlayerBody.eulerAngles.z);
				((Component)__instance.gameplayCamera).transform.localEulerAngles = new Vector3(Mathf.LerpAngle(((Component)__instance.gameplayCamera).transform.localEulerAngles.x, ___cameraUp, __instance.smoothLookMultiplier * Time.deltaTime), ((Component)__instance.gameplayCamera).transform.localEulerAngles.y, ((Component)__instance.gameplayCamera).transform.localEulerAngles.z);
			}
		}
	}
	[HarmonyPatch]
	internal static class Movement
	{
		private static float yPos;

		[HarmonyPatch(typeof(PlayerControllerB), "PlayerJump")]
		[HarmonyPrefix]
		private static void PlayerJump(PlayerControllerB __instance, ref bool __runOriginal, ref IEnumerator __result)
		{
			PlayerControllerB __instance2 = __instance;
			if (ColdFixer.Config.Movement.NO_JUMP_DELAY.Value)
			{
				__runOriginal = false;
				__result = ReplacedRoutine();
			}
			IEnumerator ReplacedRoutine()
			{
				__instance2.playerBodyAnimator.SetBool("Jumping", true);
				yield return (object)new WaitForSeconds(0f);
				__instance2.fallValue = __instance2.jumpForce;
				__instance2.fallValueUncapped = __instance2.jumpForce;
				yield return (object)new WaitForSeconds(0f);
				__instance2.isJumping = false;
				__instance2.isFallingFromJump = true;
				yield return (object)new WaitUntil((Func<bool>)(() => __instance2.thisController.isGrounded));
				__instance2.playerBodyAnimator.SetBool("Jumping", false);
				__instance2.isFallingFromJump = false;
				__instance2.PlayerHitGroundEffects();
				__instance2.jumpCoroutine = null;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPrefix]
		private static void Update(PlayerControllerB __instance)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			yPos = ((Component)__instance.thisPlayerBody).transform.position.y;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		private static void Update(PlayerControllerB __instance, ref float ___climbSpeed)
		{
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			if (!Game.isControlling(__instance) || !__instance.inSpecialInteractAnimation || __instance.inShockingMinigame || StartOfRound.Instance.suckingPlayersOutOfShip || !__instance.isClimbingLadder)
			{
				return;
			}
			if (ColdFixer.Config.Movement.SPRINT_ON_LADDER.Value)
			{
				if (__instance.isSprinting)
				{
					___climbSpeed = Mathf.Lerp(___climbSpeed, 6f, Time.deltaTime);
				}
				else
				{
					___climbSpeed = Mathf.Lerp(___climbSpeed, 4f, Time.deltaTime);
				}
			}
			else
			{
				___climbSpeed = 4f;
				__instance.isSprinting = false;
			}
			if (ColdFixer.Config.Movement.AUTO_LADDER_UNSNAP.Value && __instance.moveInputVector.y != 0f && yPos == ((Component)__instance.thisPlayerBody).transform.position.y)
			{
				__instance.CancelSpecialTriggerAnimations();
			}
		}
	}
	[HarmonyPatch]
	internal static class Nameplate
	{
		private class SpeakingIndicator : MonoBehaviour
		{
			private PlayerControllerB? player;

			private GameObject? canvasItem;

			private CanvasGroup? canvasItemAlpha;

			private static Dictionary<PlayerControllerB, SpeakingIndicator> speakingIndicators = new Dictionary<PlayerControllerB, SpeakingIndicator>();

			private static Texture2D speakingIconTexture = null;

			private static Texture2D GetSpeakingIconTexture()
			{
				if ((Object)(object)speakingIconTexture != (Object)null)
				{
					return speakingIconTexture;
				}
				return GameObject.Find("PTTIcon").GetComponent<Image>().sprite.texture;
			}

			public static SpeakingIndicator GetSpeakingIndicator(PlayerControllerB player)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Expected O, but got Unknown
				speakingIndicators.TryGetValue(player, out SpeakingIndicator value);
				if ((Object)(object)value == (Object)null)
				{
					GameObject val = new GameObject("SpeakingIndicator");
					val.SetActive(false);
					value = val.AddComponent<SpeakingIndicator>();
					value.player = player;
					((Component)value).transform.SetParent(((Component)player).transform, false);
					speakingIndicators.Add(player, value);
					val.SetActive(true);
				}
				return value;
			}

			private void Awake()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_0076: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
				canvasItem = new GameObject("SpeakingIndicatorCanvasItem");
				canvasItem.transform.SetParent(player.usernameBillboard, false);
				canvasItem.AddComponent<CanvasRenderer>();
				canvasItemAlpha = canvasItem.AddComponent<CanvasGroup>();
				canvasItemAlpha.alpha = 0f;
				canvasItem.transform.localPosition = new Vector3(0f, 60f, 0f);
				Image val = canvasItem.AddComponent<Image>();
				val.sprite = Sprite.Create(GetSpeakingIconTexture(), new Rect(0f, 0f, 260f, 280f), new Vector2(130f, 140f), 100f);
			}

			private void Update()
			{
				VoicePlayerState voicePlayerState = player.voicePlayerState;
				if (voicePlayerState != null)
				{
					float num = Mathf.Clamp(voicePlayerState.Amplitude * 35f, 0f, 1f);
					if (ColdFixer.Config.VoiceHUD.VOICE_HUD_DYNAMIC_OPACITY.Value)
					{
						if (num > 0.01f)
						{
							canvasItemAlpha.alpha = Mathf.Lerp(canvasItemAlpha.alpha, num, Mathf.Exp((0f - Time.deltaTime) * 100f));
						}
						else
						{
							canvasItemAlpha.alpha = Mathf.Lerp(canvasItemAlpha.alpha, num, Mathf.Exp((0f - Time.deltaTime) * 50f));
						}
					}
					else if (num > 0.05f)
					{
						canvasItemAlpha.alpha = 1f;
					}
					else if (num < 0.01f)
					{
						canvasItemAlpha.alpha = 0f;
					}
				}
				canvasItemAlpha.alpha = Math.Min(canvasItemAlpha.alpha, player.usernameAlpha.alpha);
				if (((NetworkBehaviour)player).IsOwner)
				{
					canvasItemAlpha.alpha = 0f;
				}
				if (!ColdFixer.Config.Nameplate.NAMEPLATE_VOICE_INDICATOR.Value)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}

			private void OnDestroy()
			{
				speakingIndicators.Remove(player);
				Object.Destroy((Object)(object)canvasItem);
			}
		}

		[HarmonyPatch(typeof(HUDManager), "UpdateSpectateBoxSpeakerIcons")]
		[HarmonyPostfix]
		private static void UpdateSpectateBoxSpeakerIcons(HUDManager __instance, ref Dictionary<Animator, PlayerControllerB> ___spectatingPlayerBoxes)
		{
			int num = Animator.StringToHash("speaking");
			foreach (KeyValuePair<Animator, PlayerControllerB> ___spectatingPlayerBox in ___spectatingPlayerBoxes)
			{
				if (!((NetworkBehaviour)___spectatingPlayerBox.Value).IsOwner)
				{
					continue;
				}
				if (!(IngamePlayerSettings.Instance?.settings?.pushToTalk).GetValueOrDefault())
				{
					break;
				}
				PlayerInput playerInput = IngamePlayerSettings.Instance.playerInput;
				bool? obj;
				if (playerInput == null)
				{
					obj = null;
				}
				else
				{
					InputActionAsset actions = playerInput.actions;
					if (actions == null)
					{
						obj = null;
					}
					else
					{
						InputAction obj2 = actions.FindAction("VoiceButton", false);
						obj = ((obj2 != null) ? new bool?(obj2.IsPressed()) : null);
					}
				}
				bool? flag = obj;
				bool valueOrDefault = flag.GetValueOrDefault();
				___spectatingPlayerBox.Key.SetBool("speaking", valueOrDefault);
				break;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		private static void Update(PlayerControllerB __instance)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			((TMP_Text)__instance.usernameBillboardText).text = __instance.playerUsername;
			if (ColdFixer.Config.Nameplate.NAMEPLATE_VOICE_INDICATOR.Value)
			{
				SpeakingIndicator.GetSpeakingIndicator(__instance);
			}
			__instance.usernameBillboard.position = new Vector3(__instance.playerGlobalHead.position.x, __instance.playerGlobalHead.position.y + 0.55f, __instance.playerGlobalHead.position.z);
			if ((Object)(object)__instance == (Object)(object)StartOfRound.Instance?.localPlayerController)
			{
				__instance.usernameAlpha.alpha = 0f;
			}
			else
			{
				if (!((Object)(object)StartOfRound.Instance?.localPlayerController != (Object)null))
				{
					return;
				}
				float num = Vector3.Distance(((Component)StartOfRound.Instance.localPlayerController.gameplayCamera).transform.position, __instance.usernameBillboard.position);
				if (num < (float)ColdFixer.Config.Nameplate.NAMEPLATE_DISTANCE.Value)
				{
					if (ColdFixer.Config.Nameplate.NAMEPLATE_DYNAMIC_OPACITY.Value)
					{
						__instance.usernameAlpha.alpha = 1f - num / (float)ColdFixer.Config.Nameplate.NAMEPLATE_DISTANCE.Value;
					}
					else
					{
						__instance.usernameAlpha.alpha = 1f;
					}
					((Behaviour)__instance.usernameBillboardText).enabled = true;
					((Component)__instance.usernameCanvas).gameObject.SetActive(true);
				}
				float num2 = 1f;
				if (ColdFixer.Config.Nameplate.NAMEPLATE_DYNAMIC_SCALING.Value)
				{
					num2 = 1f + Math.Max(0f, (num - 4f) * 0.11f);
					__instance.usernameBillboard.localScale = num2 * new Vector3(-0.0025f, 0.0025f, 0.0025f);
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class SignalTranslatorText
	{
		[HarmonyPatch(typeof(HUDManager), "DisplaySignalTranslatorMessage")]
		[HarmonyPrefix]
		private static void DisplaySignalTranslatorMessage(ref bool __runOriginal, ref IEnumerator __result, Animator ___signalTranslatorAnimator, AudioSource ___UIAudio, TextMeshProUGUI ___signalTranslatorText, string signalMessage, int seed, SignalTranslator signalTranslator)
		{
			Animator ___signalTranslatorAnimator2 = ___signalTranslatorAnimator;
			SignalTranslator signalTranslator2 = signalTranslator;
			AudioSource ___UIAudio2 = ___UIAudio;
			string signalMessage2 = signalMessage;
			TextMeshProUGUI ___signalTranslatorText2 = ___signalTranslatorText;
			__runOriginal = false;
			__result = ReplacedRoutine();
			IEnumerator ReplacedRoutine()
			{
				Random signalMessageRandom = new Random(seed + StartOfRound.Instance.randomMapSeed);
				___signalTranslatorAnimator2.SetBool("transmitting", true);
				signalTranslator2.localAudio.Play();
				___UIAudio2.PlayOneShot(signalTranslator2.startTransmissionSFX, 1f);
				string trimedMessage = signalMessage2.Trim();
				((TMP_Text)___signalTranslatorText2).text = "<#00000000>" + trimedMessage + "</color>";
				yield return (object)new WaitForSeconds(1.21f);
				for (int i = 1; i <= trimedMessage.Length; i++)
				{
					if ((Object)(object)signalTranslator2 == (Object)null)
					{
						break;
					}
					if (!((Component)signalTranslator2).gameObject.activeSelf)
					{
						break;
					}
					___UIAudio2.PlayOneShot(signalTranslator2.typeTextClips[Random.Range(0, signalTranslator2.typeTextClips.Length)]);
					((TMP_Text)___signalTranslatorText2).text = trimedMessage.Substring(0, i) + "<#00000000>" + trimedMessage.Substring(i) + "</color>";
					float num = Mathf.Min((float)signalMessageRandom.Next(-1, 4) * 0.5f, 0f);
					if (!ColdFixer.Config.SignalTranslatorText.TRANSMIT_FAST.Value)
					{
						yield return (object)new WaitForSeconds(0.7f + num);
					}
					else
					{
						yield return (object)new WaitForSeconds(0.1f);
					}
				}
				if ((Object)(object)signalTranslator2 != (Object)null)
				{
					___UIAudio2.PlayOneShot(signalTranslator2.finishTypingSFX);
					signalTranslator2.localAudio.Stop();
				}
				if (!ColdFixer.Config.SignalTranslatorText.TRANSMIT_FAST.Value)
				{
					yield return (object)new WaitForSeconds(0.5f);
				}
				else
				{
					yield return (object)new WaitForSeconds(2f);
				}
				___signalTranslatorAnimator2.SetBool("transmitting", false);
			}
		}

		[HarmonyPatch(typeof(HUDManager), "Awake")]
		[HarmonyPostfix]
		private static void Awake(TextMeshProUGUI ___signalTranslatorText)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0032: 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)
			//IL_005a: 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_0082: 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_00b9: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			Transform parent = ((TMP_Text)___signalTranslatorText).transform.parent;
			RectTransform val = (RectTransform)parent.GetChild(1);
			RectTransform val2 = (RectTransform)parent.GetChild(2);
			val.anchorMin = new Vector2(0f, 0.5f);
			val.anchorMax = new Vector2(1f, 0.5f);
			val.sizeDelta = new Vector2(0f, val.sizeDelta.y);
			TextMeshProUGUI component = ((Component)val).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).margin = new Vector4(0f, 0f, val.anchoredPosition.x * 2f, 0f);
			((TMP_Text)component).alignment = (TextAlignmentOptions)258;
			val2.anchorMin = new Vector2(0f, 0.5f);
			val2.anchorMax = new Vector2(1f, 0.5f);
			val2.sizeDelta = new Vector2(0f, val2.sizeDelta.y);
			TextMeshProUGUI component2 = ((Component)val2).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component2).margin = new Vector4(0f, 0f, val2.anchoredPosition.x * 2f, 0f);
			((TMP_Text)component2).alignment = (TextAlignmentOptions)258;
			TextAlign(null, null);
		}

		public static void TextAlign(object? sender, EventArgs? e)
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			TextMeshProUGUI val = HUDManager.Instance?.signalTranslatorText;
			if (!((Object)(object)val == (Object)null))
			{
				if (ColdFixer.Config.SignalTranslatorText.TRANSMIT_ALIGN.Value)
				{
					((TMP_Text)val).rectTransform.anchorMin = new Vector2(0f, 0.5f);
					((TMP_Text)val).rectTransform.anchorMax = new Vector2(1f, 0.5f);
					((TMP_Text)val).rectTransform.anchoredPosition = new Vector2(0f, ((TMP_Text)val).rectTransform.anchoredPosition.y);
					((TMP_Text)val).rectTransform.sizeDelta = new Vector2(0f, ((TMP_Text)val).rectTransform.sizeDelta.y);
					((TMP_Text)val).alignment = (TextAlignmentOptions)258;
				}
				else
				{
					((TMP_Text)val).rectTransform.anchorMin = new Vector2(0.5f, 0.5f);
					((TMP_Text)val).rectTransform.anchorMax = new Vector2(0.5f, 0.5f);
					((TMP_Text)val).rectTransform.anchoredPosition = new Vector2(44.8f, ((TMP_Text)val).rectTransform.anchoredPosition.y);
					((TMP_Text)val).rectTransform.sizeDelta = new Vector2(603.4f, ((TMP_Text)val).rectTransform.sizeDelta.y);
					((TMP_Text)val).alignment = (TextAlignmentOptions)257;
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class ToggleMute
	{
		private static GameObject MuteIcon;

		[HarmonyPatch(typeof(HUDManager), "Awake")]
		[HarmonyPostfix]
		private static void Awake()
		{
			//IL_0031: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			InputSetting.instance.ToggleMuteKey.performed += OnToggleMuteKeyPressed;
			Transform transform = new GameObject("ToggleMuteUI").transform;
			transform.SetParent(HUDManager.Instance.HUDContainer.transform.parent, false);
			Sprite iconSprite = ColdFixer.Asset.ToggleMute.IconSprite;
			HUDManager instance = HUDManager.Instance;
			MuteIcon = Tool.AddHUD("ToggleMuteIcon", iconSprite, (instance != null) ? instance.HUDContainer.transform : null);
			MuteIcon.transform.SetParent(transform, false);
			MuteIcon.transform.localPosition = new Vector3(-245f, 195f, 0f);
			MuteIcon.transform.localScale = new Vector3(0.28f, 0.28f, 0.28f);
			MuteIcon.SetActive(false);
		}

		[HarmonyPatch(typeof(HUDManager), "Update")]
		[HarmonyPostfix]
		private static void Update()
		{
			if ((Object)(object)MuteIcon != (Object)null && Object.op_Implicit((Object)(object)IngamePlayerSettings.Instance))
			{
				MuteIcon.SetActive(!IngamePlayerSettings.Instance.settings.micEnabled);
			}
		}

		[HarmonyPatch(typeof(HUDManager), "UpdateSpectateBoxSpeakerIcons")]
		[HarmonyPostfix]
		private static void UpdateSpectateBoxSpeakerIcons(ref HUDManager __instance, ref Dictionary<Animator, PlayerControllerB> ___spectatingPlayerBoxes)
		{
			KeyValuePair<Animator, PlayerControllerB> keyValuePair = ___spectatingPlayerBoxes.FirstOrDefault((KeyValuePair<Animator, PlayerControllerB> x) => (Object)(object)x.Value == (Object)(object)GameNetworkManager.Instance.localPlayerController);
			if (StartOfRound.Instance.voiceChatModule.IsMuted)
			{
				keyValuePair.Key.SetBool("speaking", false);
			}
		}

		private static void OnToggleMuteKeyPressed(CallbackContext ctx)
		{
			if (!ColdFixer.Config.ToggleMute.TOGGLE_MUTE.Value || !((CallbackContext)(ref ctx)).performed || !Object.op_Implicit((Object)(object)IngamePlayerSettings.Instance) || !Object.op_Implicit((Object)(object)StartOfRound.Instance) || !Object.op_Implicit((Object)(object)StartOfRound.Instance.voiceChatModule) || !Application.isFocused || !Object.op_Implicit((Object)(object)GameNetworkManager.Instance))
			{
				return;
			}
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if (!Object.op_Implicit((Object)(object)localPlayerController) || ColdFixer.Config.ToggleMute.TOGGLE_MUTE_IN_TERMINAL.Value || (!localPlayerController.inTerminalMenu && !localPlayerController.isTypingChat))
			{
				IngamePlayerSettings.Instance.settings.micEnabled = !IngamePlayerSettings.Instance.settings.micEnabled;
				IngamePlayerSettings.Instance.SetMicrophoneEnabled();
				SettingsOption val = Object.FindObjectsOfType<SettingsOption>(true).ToList().Find((SettingsOption x) => ((Object)x).name == "SpeakerButton");
				val.ToggleEnabledImage(4);
			}
		}
	}
	[HarmonyPatch]
	internal static class UnlockView
	{
		[HarmonyPatch(typeof(Terminal), "BeginUsingTerminal")]
		[HarmonyPostfix]
		private static void BeginUsingTerminal()
		{
			PlayerControllerB local;
			if (ColdFixer.Config.UnlockView.UNLOCK_TERMINAL_VIEW.Value)
			{
				local = GameNetworkManager.Instance.localPlayerController;
				((MonoBehaviour)local).StartCoroutine(RestoreCamera());
			}
			IEnumerator RestoreCamera()
			{
				do
				{
					local.cameraUp = Mathf.Lerp(local.cameraUp, 0f, 5f * Time.deltaTime);
					yield return (object)new WaitForSeconds(Time.deltaTime);
				}
				while (Mathf.Abs(local.cameraUp) > 5f);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPrefix]
		private static void Update(PlayerControllerB __instance, ref float ___cameraUp, ref Camera ___gameplayCamera)
		{
			//IL_0063: 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)
			//IL_00c1: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			if (ColdFixer.Config.UnlockView.UNLOCK_TERMINAL_VIEW.Value)
			{
				if (__instance.inSpecialInteractAnimation && !__instance.isClimbingLadder && !__instance.inShockingMinigame && __instance.inTerminalMenu)
				{
					___cameraUp /= 1f - 5f * Time.deltaTime;
					((Component)___gameplayCamera).transform.localEulerAngles = new Vector3(___cameraUp, ((Component)___gameplayCamera).transform.localEulerAngles.y, ((Component)___gameplayCamera).transform.localEulerAngles.z);
				}
				if (Game.isControlling(__instance) && !__instance.inSpecialInteractAnimation && !__instance.inTerminalMenu && !__instance.isClimbingLadder)
				{
					float num = CorAngle(((Component)___gameplayCamera).transform.localEulerAngles.y);
					num = Mathf.Lerp(num, 0f, 5f * Time.deltaTime);
					((Component)___gameplayCamera).transform.localEulerAngles = new Vector3(___cameraUp, num, ((Component)___gameplayCamera).transform.localEulerAngles.z);
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		private static void Update(PlayerControllerB __instance, ref Camera ___gameplayCamera, ref float ___targetFOV)
		{
			if (Game.isControlling(__instance) && __instance.inTerminalMenu)
			{
				___targetFOV = 66f;
				___gameplayCamera.fieldOfView = Mathf.Lerp(___gameplayCamera.fieldOfView, ___targetFOV, 6f * Time.deltaTime);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "PlayerLookInput")]
		[HarmonyPrefix]
		private static void PlayerLookInput(ref PlayerControllerB __instance, ref bool __runOriginal, ref float ___cameraUp, ref Camera ___gameplayCamera)
		{
			//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_007d: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			if (!ColdFixer.Config.UnlockView.UNLOCK_TERMINAL_VIEW.Value)
			{
				return;
			}
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if (Game.isControlling(__instance) && __instance.inTerminalMenu && !__instance.isPlayerDead && __instance.isPlayerControlled && !__instance.quickMenuManager.isMenuOpen)
			{
				__runOriginal = false;
				MovementActions movement = localPlayerController.playerActions.Movement;
				Vector2 val = ((MovementActions)(ref movement)).Look.ReadValue<Vector2>() * 0.008f * (float)IngamePlayerSettings.Instance.settings.lookSensitivity;
				val.x = Mathf.Clamp(val.x, -15f, 15f);
				val.y = Mathf.Clamp(val.y, -15f, 15f);
				float num = CorAngle(((Component)___gameplayCamera).transform.localEulerAngles.y);
				num += val.x;
				if (num > 90f)
				{
					num = Mathf.Lerp(num, 90f, 5f * Time.deltaTime);
				}
				else if (num < -90f)
				{
					num = Mathf.Lerp(num, -90f, 5f * Time.deltaTime);
				}
				num = Mathf.Clamp(num, -150f, 150f);
				___cameraUp -= val.y;
				___cameraUp = Mathf.Clamp(___cameraUp, -80f, 80f);
				((Component)___gameplayCamera).transform.localEulerAngles = new Vector3(___cameraUp, num, ((Component)___gameplayCamera).transform.localEulerAngles.z);
			}
		}

		private static float CorAngle(float angle)
		{
			return (angle > 180f) ? (angle - 360f) : angle;
		}
	}
	[HarmonyPatch]
	internal static class VoiceHUD
	{
		[HarmonyPatch(typeof(HUDManager), "Update")]
		[HarmonyPostfix]
		private static void Update()
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			Settings settings = IngamePlayerSettings.Instance.settings;
			if (!ColdFixer.Config.VoiceHUD.VOICE_HUD.Value || !settings.micEnabled || settings.pushToTalk || !Object.op_Implicit((Object)(object)StartOfRound.Instance.voiceChatModule))
			{
				return;
			}
			VoicePlayerState val = StartOfRound.Instance.voiceChatModule.FindPlayer(StartOfRound.Instance.voiceChatModule.LocalPlayerName);
			if (val.IsSpeaking)
			{
				float num = Mathf.Clamp(val.Amplitude * 35f, 0f, 1f);
				if (ColdFixer.Config.VoiceHUD.VOICE_HUD_DYNAMIC_OPACITY.Value)
				{
					((Graphic)HUDManager.Instance.PTTIcon).color = new Color(1f, 1f, 1f, num);
				}
				((Behaviour)HUDManager.Instance.PTTIcon).enabled = num > 0.01f;
			}
		}

		public static void ConfigChanged(object? sender, EventArgs? e)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if ((!ColdFixer.Config.VoiceHUD.VOICE_HUD.Value || !ColdFixer.Config.VoiceHUD.VOICE_HUD_DYNAMIC_OPACITY.Value) && Object.op_Implicit((Object)(object)HUDManager.Instance))
			{
				((Graphic)HUDManager.Instance.PTTIcon).color = Color.white;
			}
		}
	}
}
namespace ColdFixer.Util
{
	public static class Loader
	{
		static Loader()
		{
			Translation.Load();
			ColdFixer.Asset.ToggleMute.Load();
			Font.Load();
		}

		public static void LoadAll()
		{
		}

		public static string GetAssemblyName()
		{
			string? fullName = Assembly.GetExecutingAssembly().FullName;
			return ((fullName != null) ? fullName.Split(',')[0] : null) ?? "";
		}

		public static AssetBundle LoadAssetBundle(string name)
		{
			string name2 = GetAssemblyName() + ".Asset." + name;
			using Stream stream = Assembly.GetExecutingAssembly()?.GetManifestResourceStream(name2);
			return AssetBundle.LoadFromStream(stream);
		}

		public static XmlDocument LoadXML(string name)
		{
			string name2 = GetAssemblyName() + ".Asset." + name + ".xml";
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name2);
			string xml = ((stream != null) ? (new StreamReader(stream).ReadToEnd() ?? string.Empty) : string.Empty);
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.LoadXml(xml);
			return xmlDocument;
		}
	}
	public static class Game
	{
		public static bool isControlling(PlayerControllerB player)
		{
			if ((Object)(object)player == (Object)null)
			{
				return false;
			}
			return (((NetworkBehaviour)player).IsOwner && player.isPlayerControlled && (!((NetworkBehaviour)player).IsServer || player.isHostPlayerObject)) || player.isTestingPlayer;
		}

		public static bool isPlayer(PlayerControllerB player)
		{
			if ((Object)(object)player == (Object)null)
			{
				return false;
			}
			return (Object)(object)GameNetworkManager.Instance?.localPlayerController == (Object)(object)player;
		}
	}
	public static class Tool
	{
		public static object GetField<InstanceType>(InstanceType obj, string field)
		{
			return AccessTools.Field(typeof(InstanceType), field).GetValue(obj);
		}

		public static FieldType GetField<InstanceType, FieldType>(InstanceType obj, string field)
		{
			return (FieldType)AccessTools.Field(typeof(InstanceType), field).GetValue(obj);
		}

		public static void SetField<InstanceType, FieldType>(InstanceType obj, string field, FieldType temp)
		{
			AccessTools.Field(typeof(InstanceType), field).SetValue(obj, temp);
		}

		public static object InvokeMethod<InstanceType>(InstanceType obj, string method, object[]? parameter = null)
		{
			return AccessTools.Method(typeof(InstanceType), method, (Type[])null, (Type[])null).Invoke(obj, parameter);
		}

		public static GameObject AddHUD(string name, Transform? parent = null, bool WorldPositionStays = false)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			if ((Object)(object)parent == (Object)null)
			{
				parent = HUDManager.Instance.HUDContainer.transform;
			}
			val.transform.SetParent(parent, WorldPositionStays);
			return val;
		}

		public static GameObject AddHUD(string name, Sprite sprite, Transform? parent = null, bool WorldPositionStays = false)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			if ((Object)(object)parent == (Object)null)
			{
				HUDManager instance = HUDManager.Instance;
				object obj;
				if (instance == null)
				{
					obj = null;
				}
				else
				{
					GameObject hUDContainer = instance.HUDContainer;
					obj = ((hUDContainer != null) ? hUDContainer.transform : null);
				}
				parent = (Transform?)obj;
			}
			val.AddComponent<Image>().sprite = sprite;
			val.transform.SetParent(parent, WorldPositionStays);
			return val;
		}
	}
	public static class Translation
	{
		public static Dictionary<string, XmlDocument> LanguageData = new Dictionary<string, XmlDocument>();

		public static string CurrentLangage()
		{
			return Setting.Language?.Value.ToString() ?? string.Empty;
		}

		public static void Load()
		{
			try
			{
				string[] names = Enum.GetNames(typeof(Setting.LanguageOption));
				foreach (string text in names)
				{
					LanguageData.Add(text, Loader.LoadXML(text));
					Plugin.LogInfo("Language pack loaded: " + text + ".xml");
				}
				Plugin.LogInfo("Language data load complete");
			}
			catch
			{
				throw;
			}
		}

		public static string Translate(string name, bool isDesc = false)
		{
			string key = Setting.Language?.Value.ToString() ?? "Korean";
			if (isDesc)
			{
				name += "_DESC";
			}
			return LanguageData[key].GetElementById(name)?.InnerText ?? string.Empty;
		}
	}
}
namespace ColdFixer.Config
{
	public static class Setting
	{
		public enum LanguageOption
		{
			English,
			Korean
		}

		public static ConfigEntry<LanguageOption> Language;

		public static bool isLethalConfig;

		public static void BindAll()
		{
			Language = Bind("SECTION_GENERAL", "LANGUAGE", LanguageOption.Korean, null, null, RequireRestart: true);
			DeathCause.bind();
			FontFallback.bind();
			FOV.bind();
			Grabbability.bind();
			Intro.bind();
			ItemHotkey.bind();
			Lookdown.bind();
			Movement.bind();
			Nameplate.bind();
			SignalTranslatorText.bind();
			ToggleMute.bind();
			UnlockView.bind();
			VoiceHUD.bind();
		}

		public static ConfigEntry<T> Bind<T>(string Section, string Key, T defaultValue, object? min = null, object? max = null, bool RequireRestart = false, float step = 0f)
		{
			//IL_0092: 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_00af: Expected O, but got Unknown
			//IL_00af: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_0120: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0188: Expected O, but got Unknown
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Expected O, but got Unknown
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Expected O, but got Unknown
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Expected O, but got Unknown
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Expected O, but got Unknown
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Expected O, but got Unknown
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Expected O, but got Unknown
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Expected O, but got Unknown
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Expected O, but got Unknown
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Expected O, but got Unknown
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Expected O, but got Unknown
			try
			{
				if ((Object)(object)Plugin.Instance == (Object)null)
				{
					throw new Exception("Plugin is not Constructed");
				}
				if ((min != null && typeof(T) != min.GetType()) || (max != null && typeof(T) != max.GetType()))
				{
					throw new ArgumentException("INVALID MIN OR MAX VALUE TYPE");
				}
				bool flag = false;
				if (min != null && max != null)
				{
					flag = true;
				}
				ConfigEntry<T> val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)null, Array.Empty<object>()));
				if (flag)
				{
					if (typeof(T).IsEquivalentTo(typeof(int)))
					{
						val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)(object)new AcceptableValueRange<int>((int)min, (int)max), Array.Empty<object>()));
					}
					else if (typeof(T).IsEquivalentTo(typeof(float)))
					{
						val = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<T>(new ConfigDefinition(Translation.Translate(Section), Translation.Translate(Key)), defaultValue, new ConfigDescription(Translation.Translate(Key, isDesc: true), (AcceptableValueBase)(object)new AcceptableValueRange<float>((float)min, (float)max), Array.Empty<object>()));
					}
				}
				if (isLethalConfig)
				{
					if (typeof(T).IsEquivalentTo(typeof(int)))
					{
						if (flag)
						{
							ConfigEntry<int> obj = val as ConfigEntry<int>;
							IntSliderOptions val2 = new IntSliderOptions();
							((BaseRangeOptions<int>)val2).Min = (int)min;
							((BaseRangeOptions<int>)val2).Max = (int)max;
							((BaseOptions)val2).RequiresRestart = RequireRestart;
							LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(obj, val2));
						}
						else
						{
							LethalConfigManager.AddConfigItem((BaseConfigItem)new IntInputFieldConfigItem(val as ConfigEntry<int>, RequireRestart));
						}
					}
					else if (typeof(T).IsEquivalentTo(typeof(float)))
					{
						if (flag)
						{
							if (step > 0f)
							{
								ConfigEntry<float> obj2 = val as ConfigEntry<float>;
								FloatStepSliderOptions val3 = new FloatStepSliderOptions();
								((BaseRangeOptions<float>)val3).Min = (float)min;
								((BaseRangeOptions<float>)val3).Max = (float)max;
								val3.Step = step;
								((BaseOptions)val3).RequiresRestart = RequireRestart;
								LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatStepSliderConfigItem(obj2, val3));
							}
							else
							{
								ConfigEntry<float> obj3 = val as ConfigEntry<float>;
								FloatSliderOptions val4 = new FloatSliderOptions();
								((BaseRangeOptions<float>)val4).Min = (float)min;
								((BaseRangeOptions<float>)val4).Max = (float)max;
								((BaseOptions)val4).RequiresRestart = RequireRestart;
								LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatSliderConfigItem(obj3, val4));
							}
						}
						else
						{
							LethalConfigManager.AddConfigItem((BaseConfigItem)new FloatInputFieldConfigItem(val as ConfigEntry<float>, RequireRestart));
						}
					}
					else if (typeof(T).IsEquivalentTo(typeof(bool)))
					{
						LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(val as ConfigEntry<bool>, RequireRestart));
					}
					else if (typeof(T).IsEquivalentTo(typeof(string)))
					{
						LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(val as ConfigEntry<string>, RequireRestart));
					}
					else if (typeof(T).IsEnum)
					{
						Type settingType = ((ConfigEntryBase)val).SettingType;
						Type type = typeof(EnumDropDownConfigItem<>).MakeGenericType(settingType);
						object obj4 = Activator.CreateInstance(type, val, RequireRestart);
						LethalConfigManager.AddConfigItem((BaseConfigItem)obj4);
					}
				}
				return val;
			}
			catch (Exception ex)
			{
				Plugin.LogError(ex.StackTrace);
				throw ex;
			}
		}
	}
	public class InputSetting : LcInputActions
	{
		public static InputSetting instance = new InputSetting();

		[InputAction("<Keyboard>/m", Name = "Toggle Mute")]
		public InputAction ToggleMuteKey { get; set; }

		[InputAction("<Keyboard>/f", Name = "Flashlight")]
		public InputAction FlashLightKey { get; set; }

		[InputAction("<Keyboard>/r", Name = "Wakie-Talkie")]
		public InputAction WalkieTalkieKey { get; set; }
	}
	internal static class DeathCause
	{
		public static ConfigEntry<bool>? SPECTATE_DEATH_CAUSE;

		public static void bind()
		{
			SPECTATE_DEATH_CAUSE = Setting.Bind("SECTION_COMMUNICATION", "SPECTATE_DEATH_CAUSE", defaultValue: false);
		}
	}
	internal static class FontFallback
	{
		public static ConfigEntry<bool>? NORMAL_FONT_FALLBACK;

		public static ConfigEntry<bool>? TRANSMIT_FONT_FALLBACK;

		public static void bind()
		{
			NORMAL_FONT_FALLBACK = Setting.Bind("SECTION_FONT", "NORMAL_FONT_FALLBACK", defaultValue: true);
			TRANSMIT_FONT_FALLBACK = Setting.Bind("SECTION_FONT", "TRANSMIT_FONT_FALLBACK", defaultValue: true);
		}
	}
	internal static class FOV
	{
		public static ConfigEntry<int>? FOV_NORMAL;

		public static ConfigEntry<int>? FOV_TERMINAL;

		public static ConfigEntry<int>? FOV_SPRINT;

		public static ConfigEntry<bool>? HIDE_VISOR;

		public static void bind()
		{
			FOV_NORMAL = Setting.Bind("SECTION_SIGHT", "FOV_NORMAL", 66, 30, 120);
			FOV_TERMINAL = Setting.Bind("SECTION_SIGHT", "FOV_TERMINAL", 60, 30, 120);
			FOV_SPRINT = Setting.Bind("SECTION_SIGHT", "FOV_SPRINT", 68, 30, 120);
			HIDE_VISOR = Setting.Bind("SECTION_SIGHT", "HIDE_VISOR", defaultValue: false);
			HIDE_VISOR.SettingChanged += ColdFixer.Patch.FOV.ConfigChanged;
		}
	}
	internal static class Grabbability
	{
		public static ConfigEntry<bool>? GRAB_BEFORE_START;

		public static void bind()
		{
			GRAB_BEFORE_START = Setting.Bind("SECTION_ACTION", "GRAB_BEFORE_START", defaultValue: true);
		}
	}
	internal static class Intro
	{
		public enum ModeOption
		{
			None,
			Online,
			Local
		}

		public static ConfigEntry<bool>? SKIP_SPLASH;

		public static ConfigEntry<bool>? SKIP_BOOTING_ANIMATION;

		public static ConfigEntry<ModeOption>? PRESELECTED_MODE;

		public static ConfigEntry<bool>? BLOCK_NEWS;

		public static ConfigEntry<bool>? BLOCK_LAN_WARNING;

		public static ConfigEntry<bool>? BLOCK_OFFLINE_WARNING;

		public static ConfigEntry<bool>? REMOVE_CREDITS_BUTTON;

		public static void bind()
		{
			SKIP_SPLASH = Setting.Bind("SECTION_INTRO", "SKIP_SPLASH", defaultValue: false);
			SKIP_BOOTING_ANIMATION = Setting.Bind("SECTION_INTRO", "SKIP_BOOTING_ANIMATION", defaultValue: false);
			PRESELECTED_MODE = Setting.Bind("SECTION_INTRO", "PRESELECTED_MODE", ModeOption.None);
			BLOCK_NEWS = Setting.Bind("SECTION_INTRO", "BLOCK_NEWS", defaultValue: false);
			BLOCK_LAN_WARNING = Setting.Bind("SECTION_INTRO", "BLOCK_LAN_WARNING", defaultValue: false);
			BLOCK_OFFLINE_WARNING = Setting.Bind("SECTION_INTRO", "BLOCK_OFFLINE_WARNING", defaultValue: false);
			REMOVE_CREDITS_BUTTON = Setting.Bind("SECTION_INTRO", "REMOVE_CREDITS_BUTTON", defaultValue: false);
		}
	}
	internal static class ItemHotkey
	{
		public static ConfigEntry<bool>? HOTKEY_FLASHLIGHT;

		public static ConfigEntry<bool>? HOTKEY_WALKIE_TALKIE;

		public static void bind()
		{
			HOTKEY_FLASHLIGHT = Setting.Bind("SECTION_HOTKEY", "HOTKEY_FLASHLIGHT", defaultValue: false);
			HOTKEY_WALKIE_TALKIE = Setting.Bind("SECTION_HOTKEY", "HOTKEY_WALKIE_TALKIE", defaultValue: false);
		}
	}
	internal static class Lookdown
	{
		public static ConfigEntry<bool>? LOOKDOWN_FIX;

		public static void bind()
		{
			LOOKDOWN_FIX = Setting.Bind("SECTION_SIGHT", "LOOKDOWN_FIX", defaultValue: true);
		}
	}
	internal static class Movement
	{
		public static ConfigEntry<bool>? NO_JUMP_DELAY;

		public static ConfigEntry<bool>? SPRINT_ON_LADDER;

		public static ConfigEntry<bool>? AUTO_LADDER_UNSNAP;

		public static void bind()
		{
			NO_JUMP_DELAY = Setting.Bind("SECTION_ACTION", "NO_JUMP_DELAY", defaultValue: false);
			SPRINT_ON_LADDER = Setting.Bind("SECTION_ACTION", "SPRINT_ON_LADDER", defaultValue: false);
			AUTO_LADDER_UNSNAP = Setting.Bind("SECTION_ACTION", "AUTO_LADDER_UNSNAP", defaultValue: false);
		}
	}
	internal static class Nameplate
	{
		public static ConfigEntry<int>? NAMEPLATE_DISTANCE;

		public static ConfigEntry<bool>? NAMEPLATE_DYNAMIC_SCALING;

		public static ConfigEntry<bool>? NAMEPLATE_DYNAMIC_OPACITY;

		public static ConfigEntry<bool>? NAMEPLATE_VOICE_INDICATOR;

		public static void bind()
		{
			NAMEPLATE_DISTANCE = Setting.Bind("SECTION_COMMUNICATION", "NAMEPLATE_DISTANCE", 20, 0, 40);
			NAMEPLATE_DYNAMIC_SCALING = Setting.Bind("SECTION_COMMUNICATION", "NAMEPLATE_DYNAMIC_SCALING", defaultValue: false);
			NAMEPLATE_DYNAMIC_OPACITY = Setting.Bind("SECTION_COMMUNICATION", "NAMEPLATE_DYNAMIC_OPACITY", defaultValue: false);
			NAMEPLATE_VOICE_INDICATOR = Setting.Bind("SECTION_COMMUNICATION", "NAMEPLATE_VOICE_INDICATOR", defaultValue: false);
		}
	}
	internal static class SignalTranslatorText
	{
		public static ConfigEntry<bool>? TRANSMIT_ALIGN;

		public static ConfigEntry<bool>? TRANSMIT_FAST;

		public static void bind()
		{
			TRANSMIT_ALIGN = Setting.Bind("SECTION_FONT", "TRANSMIT_ALIGN", defaultValue: false);
			TRANSMIT_FAST = Setting.Bind("SECTION_FONT", "TRANSMIT_FAST", defaultValue: false);
			TRANSMIT_ALIGN.SettingChanged += ColdFixer.Patch.SignalTranslatorText.TextAlign;
		}
	}
	internal static class ToggleMute
	{
		public static ConfigEntry<bool>? TOGGLE_MUTE;

		public static ConfigEntry<bool>? TOGGLE_MUTE_IN_TERMINAL;

		public static void bind()
		{
			TOGGLE_MUTE = Setting.Bind("SECTION_HOTKEY", "TOGGLE_MUTE", defaultValue: false);
			TOGGLE_MUTE_IN_TERMINAL = Setting.Bind("SECTION_HOTKEY", "TOGGLE_MUTE_IN_TERMINAL", defaultValue: false);
		}
	}
	internal static class UnlockView
	{
		public static ConfigEntry<bool>? UNLOCK_TERMINAL_VIEW;

		public static void bind()
		{
			UNLOCK_TERMINAL_VIEW = Setting.Bind("SECTION_SIGHT", "UNLOCK_TERMINAL_VIEW", defaultValue: false);
		}
	}
	internal static class VoiceHUD
	{
		public static ConfigEntry<bool>? VOICE_HUD;

		public static ConfigEntry<bool>? VOICE_HUD_DYNAMIC_OPACITY;

		public static void bind()
		{
			VOICE_HUD = Setting.Bind("SECTION_COMMUNICATION", "VOICE_HUD", defaultValue: false);
			VOICE_HUD_DYNAMIC_OPACITY = Setting.Bind("SECTION_COMMUNICATION", "VOICE_HUD_DYNAMIC_OPACITY", defaultValue: false);
			VOICE_HUD.SettingChanged += ColdFixer.Patch.VoiceHUD.ConfigChanged;
			VOICE_HUD_DYNAMIC_OPACITY.SettingChanged += ColdFixer.Patch.VoiceHUD.ConfigChanged;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}