Decompiled source of Hold Scan Button v1.1.2

BepInEx/plugins/HoldScanButton.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using HoldScanButton.Patches;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("HoldScanButton")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A mod which allows you to hold the scan button instead of needing to spam it.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e176b95ccf205ccfcd919c056ec842f624ca0c1a")]
[assembly: AssemblyProduct("HoldScanButton")]
[assembly: AssemblyTitle("HoldScanButton")]
[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;
		}
	}
}
[BepInPlugin("HoldScanButton", "HoldScanButton", "1.0.0")]
public class HoldScanButtonPlugin : BaseUnityPlugin
{
	private readonly Harmony harmony = new Harmony("HoldScanButton");

	public static HoldScanButtonPlugin Instance;

	internal ManualLogSource logger;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		logger = Logger.CreateLogSource("HoldScanButton");
		logger.LogInfo((object)"Plugin HoldScanButton has loaded!");
		harmony.PatchAll(typeof(HoldScanButtonPatch));
	}
}
internal static class LCMPluginInfo
{
	public const string PLUGIN_GUID = "HoldScanButton";

	public const string PLUGIN_NAME = "HoldScanButton";

	public const string PLUGIN_VERSION = "1.0.0";
}
namespace HoldScanButton.Patches
{
	internal class HoldScanButtonPatch
	{
		private static CallbackContext pingContext;

		[HarmonyPatch(typeof(HUDManager), "Update")]
		[HarmonyPostfix]
		private static void UpdatePatch(HUDManager __instance)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if (IngamePlayerSettings.Instance.playerInput.actions.FindAction("PingScan", false).IsPressed())
			{
				__instance.PingScan_performed(pingContext);
			}
		}

		[HarmonyPatch(typeof(HUDManager), "PingScan_performed")]
		[HarmonyPrefix]
		private static void OnScan(HUDManager __instance, CallbackContext context)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			pingContext = context;
		}
	}
}