Decompiled source of UIButtonFix v1.0.0

UIButtonFix.dll

Decompiled 7 hours 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 HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UIButtonFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UIButtonFix")]
[assembly: AssemblyTitle("UIButtonFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 UIButtonFix
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "com.lethalcompany.uibuttonfix";

		public const string PLUGIN_NAME = "UI Button Fix";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	[BepInPlugin("com.lethalcompany.uibuttonfix", "UI Button Fix", "1.0.0")]
	public class UIButtonFixPlugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.lethalcompany.uibuttonfix").PatchAll();
		}
	}
	[HarmonyPatch(typeof(Selectable), "OnPointerEnter")]
	public class OnPointerEnterPatch
	{
		[HarmonyPostfix]
		public static void Postfix(Selectable __instance)
		{
			if (!((Object)(object)EventSystem.current == (Object)null))
			{
				GameObject currentSelectedGameObject = EventSystem.current.currentSelectedGameObject;
				if ((Object)(object)currentSelectedGameObject != (Object)null && (Object)(object)currentSelectedGameObject != (Object)(object)((Component)__instance).gameObject)
				{
					EventSystem.current.SetSelectedGameObject((GameObject)null);
				}
			}
		}
	}
}