Decompiled source of NoSlideTimer v1.1.1

BepInEx/plugins/StraftatNoSlideTimer.dll

Decompiled 9 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On;
using StraftatSlideNoSlideTimer.Hooks;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("MMHOOK_Assembly-CSharp")]
[assembly: AssemblyCompany("bananasov")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Disabled the slide timer in STRAFTAT")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.1+29fec1e6c1b7c6b17d4a8eeb6340a36f5cb6851e")]
[assembly: AssemblyProduct("StraftatNoSlideTimer")]
[assembly: AssemblyTitle("com.github.bananasov.StraftatNoSlideTimer")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/bananasov/StraftatNoSlideTimer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.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;
		}
	}
}
[BepInPlugin("com.github.bananasov.StraftatNoSlideTimer", "StraftatNoSlideTimer", "1.1.1")]
public class Plugin : BaseUnityPlugin
{
	internal static ManualLogSource Log;

	private void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		FirstPersonControllerHooks.Initialize();
		Log.LogInfo((object)"Plugin StraftatNoSlideTimer is loaded!");
	}
}
internal static class LCMPluginInfo
{
	public const string PLUGIN_GUID = "com.github.bananasov.StraftatNoSlideTimer";

	public const string PLUGIN_NAME = "StraftatNoSlideTimer";

	public const string PLUGIN_VERSION = "1.1.1";
}
namespace StraftatSlideNoSlideTimer.Hooks
{
	public static class FirstPersonControllerHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_HandleSlide <0>__FirstPersonControllerOnHandleSlide;
		}

		public static void Initialize()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			Plugin.Log.LogInfo((object)"Hooking FirstPersonController");
			object obj = <>O.<0>__FirstPersonControllerOnHandleSlide;
			if (obj == null)
			{
				hook_HandleSlide val = FirstPersonControllerOnHandleSlide;
				<>O.<0>__FirstPersonControllerOnHandleSlide = val;
				obj = (object)val;
			}
			FirstPersonController.HandleSlide += (hook_HandleSlide)obj;
		}

		private static void FirstPersonControllerOnHandleSlide(orig_HandleSlide orig, FirstPersonController self)
		{
			self.slideTimer = 0.2f;
			orig.Invoke(self);
			self.slideTimer = 0.2f;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}