Decompiled source of Align Menu Buttons v1.0.0

BepInEx/plugins/AlignMenuButtons.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("AlignMenuButtons")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AlignMenuButtons")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e70cdc45-29b2-4699-a182-55b3a711ad2f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace AlignMenuButtons
{
	[HarmonyPatch(typeof(MenuManager), "OnEnable")]
	internal class AlignMenuPatch
	{
		private static void Postfix(MenuManager __instance)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)__instance.startHostButton == (Object)null))
			{
				float x = ((Component)__instance.startHostButton).transform.localPosition.x;
				float z = ((Component)__instance.startHostButton).transform.localPosition.z;
				Button[] componentsInChildren = __instance.menuButtons.GetComponentsInChildren<Button>();
				foreach (Button val in componentsInChildren)
				{
					((Component)val).transform.localPosition = new Vector3(x, ((Component)val).transform.localPosition.y, z);
				}
			}
		}
	}
	[BepInPlugin("GoldenGuy1000.AlignMenuButtons", "AlignMenuButtons", "1.0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string MODNAME = "AlignMenuButtons";

		public const string AUTHOR = "GoldenGuy1000";

		public const string GUID = "GoldenGuy1000.AlignMenuButtons";

		public const string VERSION = "1.0.0.0";

		internal readonly Harmony harmony;

		internal readonly Assembly assembly;

		public Plugin()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			harmony = new Harmony("GoldenGuy1000.AlignMenuButtons");
			assembly = Assembly.GetExecutingAssembly();
			harmony.PatchAll(assembly);
		}
	}
}