Decompiled source of NimbleKnees v0.1.0

plugins/shroudednight-NimbleKnees/NimbleKnees.dll

Decompiled 8 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Rewired;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("NimbleKnees")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Hold to crouch")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("NimbleKnees")]
[assembly: AssemblyTitle("NimbleKnees")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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 com.shroudednight.NimbleKnees
{
	[BepInPlugin("NimbleKnees", "NimbleKnees", "0.1.0")]
	public class Plugin : BasePlugin
	{
		[HarmonyPatch(typeof(Player), "GetButtonDown", new Type[] { typeof(string) })]
		public class Rewired_Player_PatchGetButtonDown
		{
			public static bool Prefix(Player __instance, ref string actionName, ref bool __result)
			{
				if (!"Crouch".Equals(actionName))
				{
					return true;
				}
				__result = __instance.GetButton("Crouch") != __instance.GetButtonPrev("Crouch");
				return false;
			}
		}

		public override void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				new Harmony("NimbleKnees").PatchAll();
			}
			catch (Exception value)
			{
				((BasePlugin)this).Log.FATAL($"Unable to load ${"NimbleKnees"}: {value}");
				throw;
			}
			((BasePlugin)this).Log.INFO("Plugin NimbleKnees is loaded!");
		}
	}
	public static class Extensions
	{
		public static void INFO(this ManualLogSource logSource, string data)
		{
			logSource.LogInfo((object)data);
		}

		public static void FATAL(this ManualLogSource logSource, string data)
		{
			logSource.LogFatal((object)data);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "NimbleKnees";

		public const string PLUGIN_NAME = "NimbleKnees";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}