Decompiled source of ExtraKeybinds v1.0.0

ExtraKeybinds.dll

Decompiled a day ago
using System;
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 BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using UnityEngine;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("ExtraKeybinds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Extra Keybinds")]
[assembly: AssemblyTitle("ExtraKeybinds")]
[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 ExtraKeybinds
{
	[BepInPlugin("ExtraKeybinds", "Extra Keybinds", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		private static readonly string[] NonGameplay = new string[6] { "Intro", "Bootstrap", "Main Menu", "Level 2-S", "Intermission1", "Intermission2" };

		public static bool Enabled;

		public static KeyCode RedrawKeyCode = (KeyCode)0;

		public static KeyCode SmartPunchKeyCode = (KeyCode)0;

		public static int SmartPunchWindowMS = 250;

		public static bool smartPunchPressed = false;

		private static float smartPunchPressedTime = 0f;

		private static bool smartPunched = false;

		public static bool IsGameplayScene()
		{
			return SceneHelper.CurrentScene != null && !NonGameplay.Contains(SceneHelper.CurrentScene);
		}

		private void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			PluginConfig.ExtraKeybindsConfig();
			Harmony val = new Harmony("ExtraKeybinds");
			val.PatchAll();
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin ExtraKeybinds is loaded!");
		}

		public void Update()
		{
			//IL_002e: 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)
			if (!IsGameplayScene() || !Enabled)
			{
				return;
			}
			FistControl instance = MonoSingleton<FistControl>.Instance;
			if (!MonoSingleton<OptionsManager>.Instance.paused && Input.GetKeyDown(RedrawKeyCode) && (Object)(object)MonoSingleton<GunControl>.Instance.currentWeapon != (Object)null && !instance.shopping)
			{
				MonoSingleton<GunControl>.Instance.ForceWeapon(MonoSingleton<GunControl>.Instance.currentWeapon, true);
			}
			if (!instance.shopping && !MonoSingleton<OptionsManager>.Instance.paused && instance.activated && !GameStateManager.Instance.PlayerInputLocked)
			{
				bool flag = UpdateKeyPressTime(SmartPunchKeyCode, ref smartPunchPressed, ref smartPunchPressedTime);
				if (flag && smartPunchPressedTime <= (float)SmartPunchWindowMS)
				{
					PerformPunch(instance, 0);
				}
				else if (smartPunchPressedTime > (float)SmartPunchWindowMS && !smartPunched)
				{
					smartPunched = true;
					PerformPunch(instance, 1);
				}
				if (flag)
				{
					smartPunched = false;
					smartPunchPressedTime = 0f;
				}
			}
		}

		public void LateUpdate()
		{
			if (!IsGameplayScene() || !Enabled)
			{
				return;
			}
			FistControl instance = MonoSingleton<FistControl>.Instance;
			if (instance.shopping || MonoSingleton<OptionsManager>.Instance.paused)
			{
				return;
			}
			try
			{
				FieldInfo field = ((object)instance.currentPunch).GetType().GetField("holdingInput", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field != null)
				{
					field.SetValue(instance.currentPunch, (bool)field.GetValue(instance.currentPunch) || smartPunchPressed);
				}
			}
			catch (Exception ex)
			{
				Logger.LogWarning((object)("Could not access field holdingInput of Punch currentPunch: " + ex));
			}
		}

		private static void PerformPunch(FistControl fistControl, int varNum)
		{
			if (!(fistControl.fistCooldown <= 0f))
			{
				return;
			}
			try
			{
				FieldInfo field = ((object)fistControl).GetType().GetField("currentVarNum", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field != null && ((int)field.GetValue(fistControl) == varNum || fistControl.ForceArm(varNum, false)))
				{
					fistControl.currentPunch.PunchStart();
				}
			}
			catch (Exception ex)
			{
				Logger.LogWarning((object)("Could not access field currentVarNum of FistControl: " + ex));
			}
		}

		public static bool UpdateKeyPressTime(KeyCode key, ref bool pressed, ref float pressTime)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.unscaledDeltaTime * 1000f;
			if (pressed)
			{
				pressTime += num;
			}
			if (Input.GetKeyDown(key) && !pressed)
			{
				pressed = true;
				pressTime = 0f;
			}
			else if (Input.GetKeyUp(key) & pressed)
			{
				pressed = false;
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(Punch), "BlastCheck")]
	public class SmartPunchKB
	{
		public static bool Prefix()
		{
			//IL_008f: 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_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_00b2: 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_00c7: 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_0177: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.smartPunchPressed)
			{
				Punch currentPunch = MonoSingleton<FistControl>.Instance.currentPunch;
				try
				{
					FieldInfo field = ((object)currentPunch).GetType().GetField("holdingInput", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field != null)
					{
						field.SetValue(currentPunch, false);
					}
				}
				catch (Exception ex)
				{
					Plugin.Logger.LogWarning((object)("Could not access field holdingInput of Punch punchInstance: " + ex));
				}
				currentPunch.anim.SetTrigger("PunchBlast");
				Vector3 val = MonoSingleton<CameraController>.Instance.GetDefaultPos() + ((Component)MonoSingleton<CameraController>.Instance).transform.forward * 2f;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(MonoSingleton<CameraController>.Instance.GetDefaultPos(), ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val2, 2f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)2))))
				{
					try
					{
						FieldInfo field2 = ((object)currentPunch).GetType().GetField("camObj", BindingFlags.Instance | BindingFlags.NonPublic);
						if (field2 != null)
						{
							GameObject val3 = (GameObject)field2.GetValue(currentPunch);
							val = ((RaycastHit)(ref val2)).point - val3.transform.forward * 0.1f;
						}
					}
					catch (Exception ex2)
					{
						Plugin.Logger.LogWarning((object)("Could not access field camObj of Punch punchInstance: " + ex2));
					}
				}
				Object.Instantiate<GameObject>(currentPunch.blastWave, val, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation);
				return false;
			}
			return true;
		}
	}
	public class PluginConfig
	{
		public enum KeyEnum
		{
			None,
			Backspace,
			Tab,
			Escape,
			Space,
			UpArrow,
			DownArrow,
			RightArrow,
			LeftArrow,
			A,
			B,
			C,
			D,
			E,
			F,
			G,
			H,
			I,
			J,
			K,
			L,
			M,
			N,
			O,
			P,
			Q,
			R,
			S,
			T,
			U,
			V,
			W,
			X,
			Y,
			Z,
			Alpha1,
			Alpha2,
			Alpha3,
			Alpha4,
			Alpha5,
			Alpha6,
			Alpha7,
			Alpha8,
			Alpha9,
			Alpha0,
			CapsLock,
			RightShift,
			LeftShift,
			RightControl,
			LeftControl,
			RightAlt,
			LeftAlt,
			Mouse1,
			Mouse2,
			Mouse3,
			Mouse4,
			Mouse5,
			Mouse6,
			Mouse7,
			BackQuote,
			EqualsSign,
			Minus,
			LeftBracket,
			RightBracket,
			Semicolon,
			Quote,
			Comma,
			Period,
			Slash,
			Backslash,
			Numlock,
			KeypadDivide,
			KeypadMultiply,
			KeypadMinus,
			KeypadPlus,
			KeypadEnter,
			KeypadPeriod,
			Keypad0,
			Keypad1,
			Keypad2,
			Keypad3,
			Keypad4,
			Keypad5,
			Keypad6,
			Keypad7,
			Keypad8,
			Keypad9,
			Home,
			End,
			PageUp,
			PageDown,
			Enter,
			F1,
			F2,
			F3,
			F4,
			F5,
			F6,
			F7,
			F8,
			F9,
			F10,
			F11,
			F12,
			F13,
			F14,
			F15
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static EnumValueChangeEventDelegate<KeyEnum> <>9__3_1;

			public static EnumValueChangeEventDelegate<KeyEnum> <>9__3_2;

			public static IntValueChangeEventDelegate <>9__3_3;

			internal void <ExtraKeybindsConfig>b__3_1(EnumValueChangeEvent<KeyEnum> e)
			{
				//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)
				Plugin.RedrawKeyCode = ConvertKeyEnumToKeyCode(e.value);
			}

			internal void <ExtraKeybindsConfig>b__3_2(EnumValueChangeEvent<KeyEnum> e)
			{
				//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)
				Plugin.SmartPunchKeyCode = ConvertKeyEnumToKeyCode(e.value);
			}

			internal void <ExtraKeybindsConfig>b__3_3(IntValueChangeEvent e)
			{
				Plugin.SmartPunchWindowMS = e.value;
			}
		}

		public static string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";

		public static KeyCode ConvertKeyEnumToKeyCode(KeyEnum value)
		{
			//IL_001a: 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_0f0a: 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_007c: 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_00c6: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: 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)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_054d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_0648: Unknown result type (might be due to invalid IL or missing references)
			//IL_066e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0694: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0706: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_079e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_089c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0905: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_094b: Unknown result type (might be due to invalid IL or missing references)
			//IL_096e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0991: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0caf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ebd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f03: Unknown result type (might be due to invalid IL or missing references)
			if (value.Equals(KeyEnum.Backspace))
			{
				return (KeyCode)8;
			}
			if (value.Equals(KeyEnum.Tab))
			{
				return (KeyCode)9;
			}
			if (value.Equals(KeyEnum.Escape))
			{
				return (KeyCode)27;
			}
			if (value.Equals(KeyEnum.Space))
			{
				return (KeyCode)32;
			}
			if (value.Equals(KeyEnum.UpArrow))
			{
				return (KeyCode)273;
			}
			if (value.Equals(KeyEnum.DownArrow))
			{
				return (KeyCode)274;
			}
			if (value.Equals(KeyEnum.RightArrow))
			{
				return (KeyCode)275;
			}
			if (value.Equals(KeyEnum.LeftArrow))
			{
				return (KeyCode)276;
			}
			if (value.Equals(KeyEnum.A))
			{
				return (KeyCode)97;
			}
			if (value.Equals(KeyEnum.B))
			{
				return (KeyCode)98;
			}
			if (value.Equals(KeyEnum.C))
			{
				return (KeyCode)99;
			}
			if (value.Equals(KeyEnum.D))
			{
				return (KeyCode)100;
			}
			if (value.Equals(KeyEnum.E))
			{
				return (KeyCode)101;
			}
			if (value.Equals(KeyEnum.F))
			{
				return (KeyCode)102;
			}
			if (value.Equals(KeyEnum.G))
			{
				return (KeyCode)103;
			}
			if (value.Equals(KeyEnum.H))
			{
				return (KeyCode)104;
			}
			if (value.Equals(KeyEnum.I))
			{
				return (KeyCode)105;
			}
			if (value.Equals(KeyEnum.J))
			{
				return (KeyCode)106;
			}
			if (value.Equals(KeyEnum.K))
			{
				return (KeyCode)107;
			}
			if (value.Equals(KeyEnum.L))
			{
				return (KeyCode)108;
			}
			if (value.Equals(KeyEnum.M))
			{
				return (KeyCode)109;
			}
			if (value.Equals(KeyEnum.N))
			{
				return (KeyCode)110;
			}
			if (value.Equals(KeyEnum.O))
			{
				return (KeyCode)111;
			}
			if (value.Equals(KeyEnum.P))
			{
				return (KeyCode)112;
			}
			if (value.Equals(KeyEnum.Q))
			{
				return (KeyCode)113;
			}
			if (value.Equals(KeyEnum.R))
			{
				return (KeyCode)114;
			}
			if (value.Equals(KeyEnum.S))
			{
				return (KeyCode)115;
			}
			if (value.Equals(KeyEnum.T))
			{
				return (KeyCode)116;
			}
			if (value.Equals(KeyEnum.U))
			{
				return (KeyCode)117;
			}
			if (value.Equals(KeyEnum.V))
			{
				return (KeyCode)118;
			}
			if (value.Equals(KeyEnum.W))
			{
				return (KeyCode)119;
			}
			if (value.Equals(KeyEnum.X))
			{
				return (KeyCode)120;
			}
			if (value.Equals(KeyEnum.Y))
			{
				return (KeyCode)121;
			}
			if (value.Equals(KeyEnum.Z))
			{
				return (KeyCode)122;
			}
			if (value.Equals(KeyEnum.Alpha1))
			{
				return (KeyCode)49;
			}
			if (value.Equals(KeyEnum.Alpha2))
			{
				return (KeyCode)50;
			}
			if (value.Equals(KeyEnum.Alpha3))
			{
				return (KeyCode)51;
			}
			if (value.Equals(KeyEnum.Alpha4))
			{
				return (KeyCode)52;
			}
			if (value.Equals(KeyEnum.Alpha5))
			{
				return (KeyCode)53;
			}
			if (value.Equals(KeyEnum.Alpha6))
			{
				return (KeyCode)54;
			}
			if (value.Equals(KeyEnum.Alpha7))
			{
				return (KeyCode)55;
			}
			if (value.Equals(KeyEnum.Alpha8))
			{
				return (KeyCode)56;
			}
			if (value.Equals(KeyEnum.Alpha9))
			{
				return (KeyCode)57;
			}
			if (value.Equals(KeyEnum.Alpha0))
			{
				return (KeyCode)48;
			}
			if (value.Equals(KeyEnum.CapsLock))
			{
				return (KeyCode)301;
			}
			if (value.Equals(KeyEnum.RightShift))
			{
				return (KeyCode)303;
			}
			if (value.Equals(KeyEnum.LeftShift))
			{
				return (KeyCode)304;
			}
			if (value.Equals(KeyEnum.RightControl))
			{
				return (KeyCode)305;
			}
			if (value.Equals(KeyEnum.LeftControl))
			{
				return (KeyCode)306;
			}
			if (value.Equals(KeyEnum.RightAlt))
			{
				return (KeyCode)307;
			}
			if (value.Equals(KeyEnum.LeftAlt))
			{
				return (KeyCode)308;
			}
			if (value.Equals(KeyEnum.Mouse1))
			{
				return (KeyCode)323;
			}
			if (value.Equals(KeyEnum.Mouse2))
			{
				return (KeyCode)324;
			}
			if (value.Equals(KeyEnum.Mouse3))
			{
				return (KeyCode)325;
			}
			if (value.Equals(KeyEnum.Mouse4))
			{
				return (KeyCode)326;
			}
			if (value.Equals(KeyEnum.Mouse5))
			{
				return (KeyCode)327;
			}
			if (value.Equals(KeyEnum.Mouse6))
			{
				return (KeyCode)328;
			}
			if (value.Equals(KeyEnum.Mouse7))
			{
				return (KeyCode)329;
			}
			if (value.Equals(KeyEnum.BackQuote))
			{
				return (KeyCode)96;
			}
			if (value.Equals(KeyEnum.EqualsSign))
			{
				return (KeyCode)61;
			}
			if (value.Equals(KeyEnum.Minus))
			{
				return (KeyCode)45;
			}
			if (value.Equals(KeyEnum.LeftBracket))
			{
				return (KeyCode)91;
			}
			if (value.Equals(KeyEnum.RightBracket))
			{
				return (KeyCode)93;
			}
			if (value.Equals(KeyEnum.Semicolon))
			{
				return (KeyCode)59;
			}
			if (value.Equals(KeyEnum.Quote))
			{
				return (KeyCode)39;
			}
			if (value.Equals(KeyEnum.Comma))
			{
				return (KeyCode)44;
			}
			if (value.Equals(KeyEnum.Period))
			{
				return (KeyCode)46;
			}
			if (value.Equals(KeyEnum.Slash))
			{
				return (KeyCode)47;
			}
			if (value.Equals(KeyEnum.Backslash))
			{
				return (KeyCode)92;
			}
			if (value.Equals(KeyEnum.Numlock))
			{
				return (KeyCode)300;
			}
			if (value.Equals(KeyEnum.KeypadDivide))
			{
				return (KeyCode)267;
			}
			if (value.Equals(KeyEnum.KeypadMultiply))
			{
				return (KeyCode)268;
			}
			if (value.Equals(KeyEnum.KeypadMinus))
			{
				return (KeyCode)269;
			}
			if (value.Equals(KeyEnum.KeypadPlus))
			{
				return (KeyCode)270;
			}
			if (value.Equals(KeyEnum.KeypadEnter))
			{
				return (KeyCode)271;
			}
			if (value.Equals(KeyEnum.KeypadPeriod))
			{
				return (KeyCode)266;
			}
			if (value.Equals(KeyEnum.Keypad0))
			{
				return (KeyCode)256;
			}
			if (value.Equals(KeyEnum.Keypad1))
			{
				return (KeyCode)257;
			}
			if (value.Equals(KeyEnum.Keypad2))
			{
				return (KeyCode)258;
			}
			if (value.Equals(KeyEnum.Keypad3))
			{
				return (KeyCode)259;
			}
			if (value.Equals(KeyEnum.Keypad4))
			{
				return (KeyCode)260;
			}
			if (value.Equals(KeyEnum.Keypad5))
			{
				return (KeyCode)261;
			}
			if (value.Equals(KeyEnum.Keypad6))
			{
				return (KeyCode)262;
			}
			if (value.Equals(KeyEnum.Keypad7))
			{
				return (KeyCode)263;
			}
			if (value.Equals(KeyEnum.Keypad8))
			{
				return (KeyCode)264;
			}
			if (value.Equals(KeyEnum.Keypad9))
			{
				return (KeyCode)265;
			}
			if (value.Equals(KeyEnum.Home))
			{
				return (KeyCode)278;
			}
			if (value.Equals(KeyEnum.End))
			{
				return (KeyCode)279;
			}
			if (value.Equals(KeyEnum.PageUp))
			{
				return (KeyCode)280;
			}
			if (value.Equals(KeyEnum.PageDown))
			{
				return (KeyCode)281;
			}
			if (value.Equals(KeyEnum.Enter))
			{
				return (KeyCode)13;
			}
			if (value.Equals(KeyEnum.F1))
			{
				return (KeyCode)282;
			}
			if (value.Equals(KeyEnum.F2))
			{
				return (KeyCode)283;
			}
			if (value.Equals(KeyEnum.F3))
			{
				return (KeyCode)284;
			}
			if (value.Equals(KeyEnum.F4))
			{
				return (KeyCode)285;
			}
			if (value.Equals(KeyEnum.F5))
			{
				return (KeyCode)286;
			}
			if (value.Equals(KeyEnum.F6))
			{
				return (KeyCode)287;
			}
			if (value.Equals(KeyEnum.F7))
			{
				return (KeyCode)288;
			}
			if (value.Equals(KeyEnum.F8))
			{
				return (KeyCode)289;
			}
			if (value.Equals(KeyEnum.F9))
			{
				return (KeyCode)290;
			}
			if (value.Equals(KeyEnum.F10))
			{
				return (KeyCode)291;
			}
			if (value.Equals(KeyEnum.F11))
			{
				return (KeyCode)292;
			}
			if (value.Equals(KeyEnum.F12))
			{
				return (KeyCode)293;
			}
			if (value.Equals(KeyEnum.F13))
			{
				return (KeyCode)294;
			}
			if (value.Equals(KeyEnum.F14))
			{
				return (KeyCode)295;
			}
			if (value.Equals(KeyEnum.F15))
			{
				return (KeyCode)296;
			}
			return (KeyCode)0;
		}

		public static void ExtraKeybindsConfig()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_015f: 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_016a: Expected O, but got Unknown
			PluginConfigurator val = PluginConfigurator.Create("Extra Keybinds Config", "ExtraKeybindsConfig");
			val.SetIconWithURL(Path.Combine(DefaultParentFolder, "icon.png") ?? "");
			BoolField val2 = new BoolField(val.rootPanel, "Mod Enabled", "enabled", true);
			ConfigDivision division = new ConfigDivision(val.rootPanel, "division");
			val2.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				Plugin.Enabled = e.value;
				((ConfigField)division).interactable = e.value;
			};
			Plugin.Enabled = val2.value;
			EnumField<KeyEnum> val3 = new EnumField<KeyEnum>((ConfigPanel)(object)division, "Redraw Weapon Keybind", "redrawKey", KeyEnum.None);
			SetDisplayNames(val3);
			val3.onValueChange += delegate(EnumValueChangeEvent<KeyEnum> e)
			{
				//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)
				Plugin.RedrawKeyCode = ConvertKeyEnumToKeyCode(e.value);
			};
			Plugin.RedrawKeyCode = ConvertKeyEnumToKeyCode(val3.value);
			EnumField<KeyEnum> val4 = new EnumField<KeyEnum>((ConfigPanel)(object)division, "Smart Punch Keybind", "smartPunchKey", KeyEnum.None);
			SetDisplayNames(val4);
			val4.onValueChange += delegate(EnumValueChangeEvent<KeyEnum> e)
			{
				//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)
				Plugin.SmartPunchKeyCode = ConvertKeyEnumToKeyCode(e.value);
			};
			Plugin.SmartPunchKeyCode = ConvertKeyEnumToKeyCode(val4.value);
			IntField val5 = new IntField((ConfigPanel)(object)division, "Smart Punch Window (Miliseconds)", "smartPunchMS", 250);
			object obj = <>c.<>9__3_3;
			if (obj == null)
			{
				IntValueChangeEventDelegate val6 = delegate(IntValueChangeEvent e)
				{
					Plugin.SmartPunchWindowMS = e.value;
				};
				<>c.<>9__3_3 = val6;
				obj = (object)val6;
			}
			val5.onValueChange += (IntValueChangeEventDelegate)obj;
			Plugin.SmartPunchWindowMS = val5.value;
		}

		private static void SetDisplayNames(EnumField<KeyEnum> field)
		{
			field.SetEnumDisplayName(KeyEnum.Minus, "-");
			field.SetEnumDisplayName(KeyEnum.EqualsSign, "=");
			field.SetEnumDisplayName(KeyEnum.LeftBracket, "[");
			field.SetEnumDisplayName(KeyEnum.RightBracket, "]");
			field.SetEnumDisplayName(KeyEnum.CapsLock, "Caps Lock");
			field.SetEnumDisplayName(KeyEnum.LeftShift, "Left Shift");
			field.SetEnumDisplayName(KeyEnum.RightShift, "Right Shift");
			field.SetEnumDisplayName(KeyEnum.LeftControl, "Left Control");
			field.SetEnumDisplayName(KeyEnum.RightControl, "Right Control");
			field.SetEnumDisplayName(KeyEnum.LeftAlt, "Left Alt");
			field.SetEnumDisplayName(KeyEnum.RightAlt, "Right Alt");
			field.SetEnumDisplayName(KeyEnum.BackQuote, "`");
			field.SetEnumDisplayName(KeyEnum.Quote, "'");
			field.SetEnumDisplayName(KeyEnum.Semicolon, ";");
			field.SetEnumDisplayName(KeyEnum.Slash, "/");
			field.SetEnumDisplayName(KeyEnum.Backslash, "\\");
			field.SetEnumDisplayName(KeyEnum.Keypad0, "Keypad 0");
			field.SetEnumDisplayName(KeyEnum.Keypad1, "Keypad 1");
			field.SetEnumDisplayName(KeyEnum.Keypad2, "Keypad 2");
			field.SetEnumDisplayName(KeyEnum.Keypad3, "Keypad 3");
			field.SetEnumDisplayName(KeyEnum.Keypad4, "Keypad 4");
			field.SetEnumDisplayName(KeyEnum.Keypad5, "Keypad 5");
			field.SetEnumDisplayName(KeyEnum.Keypad6, "Keypad 6");
			field.SetEnumDisplayName(KeyEnum.Keypad7, "Keypad 7");
			field.SetEnumDisplayName(KeyEnum.Keypad8, "Keypad 8");
			field.SetEnumDisplayName(KeyEnum.Keypad9, "Keypad 9");
			field.SetEnumDisplayName(KeyEnum.KeypadDivide, "Keypad /");
			field.SetEnumDisplayName(KeyEnum.KeypadMultiply, "Keypad *");
			field.SetEnumDisplayName(KeyEnum.KeypadPlus, "Keypad Plus");
			field.SetEnumDisplayName(KeyEnum.KeypadMinus, "Keypad Minus");
			field.SetEnumDisplayName(KeyEnum.KeypadEnter, "Keypad Enter");
			field.SetEnumDisplayName(KeyEnum.KeypadPeriod, "Keypad .");
			field.SetEnumDisplayName(KeyEnum.Period, ".");
			field.SetEnumDisplayName(KeyEnum.Comma, ",");
			field.SetEnumDisplayName(KeyEnum.PageUp, "Page Up");
			field.SetEnumDisplayName(KeyEnum.PageDown, "Page Down");
			field.SetEnumDisplayName(KeyEnum.UpArrow, "Up Arrow");
			field.SetEnumDisplayName(KeyEnum.DownArrow, "Down Arrow");
			field.SetEnumDisplayName(KeyEnum.LeftArrow, "Left Arrow");
			field.SetEnumDisplayName(KeyEnum.RightArrow, "Right Arrow");
			field.SetEnumDisplayName(KeyEnum.Alpha0, "0");
			field.SetEnumDisplayName(KeyEnum.Alpha1, "1");
			field.SetEnumDisplayName(KeyEnum.Alpha2, "2");
			field.SetEnumDisplayName(KeyEnum.Alpha3, "3");
			field.SetEnumDisplayName(KeyEnum.Alpha4, "4");
			field.SetEnumDisplayName(KeyEnum.Alpha5, "5");
			field.SetEnumDisplayName(KeyEnum.Alpha6, "6");
			field.SetEnumDisplayName(KeyEnum.Alpha7, "7");
			field.SetEnumDisplayName(KeyEnum.Alpha8, "8");
			field.SetEnumDisplayName(KeyEnum.Alpha9, "9");
			field.SetEnumDisplayName(KeyEnum.Mouse1, "Mouse 1");
			field.SetEnumDisplayName(KeyEnum.Mouse2, "Mouse 2");
			field.SetEnumDisplayName(KeyEnum.Mouse3, "Mouse 3");
			field.SetEnumDisplayName(KeyEnum.Mouse4, "Mouse 4");
			field.SetEnumDisplayName(KeyEnum.Mouse5, "Mouse 5");
			field.SetEnumDisplayName(KeyEnum.Mouse6, "Mouse 6");
			field.SetEnumDisplayName(KeyEnum.Mouse7, "Mouse 7");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "ExtraKeybinds";

		public const string PLUGIN_NAME = "Extra Keybinds";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}