Decompiled source of BetterTerminal v0.1.1

BepInEx/plugins/LCBetterTerminal.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LCBetterTerminal.Patches;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("LCBetterTerminal")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LCBetterTerminal")]
[assembly: AssemblyTitle("LCBetterTerminal")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace LCBetterTerminal
{
	[BepInPlugin("com.nekorooni.BetterTerminal", "Better Terminal", "0.0.1")]
	public class BetterTerminal : BaseUnityPlugin
	{
		private const string modGUID = "com.nekorooni.BetterTerminal";

		private const string modName = "Better Terminal";

		private const string modVersion = "0.0.1";

		private readonly Harmony harmony = new Harmony("com.nekorooni.BetterTerminal");

		public static BetterTerminal instance;

		internal ManualLogSource log;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			log = Logger.CreateLogSource("com.nekorooni.BetterTerminal");
			log.LogInfo((object)"Yo waddup");
			harmony.PatchAll(typeof(BetterTerminal));
			harmony.PatchAll(typeof(TerminalPatch));
		}
	}
}
namespace LCBetterTerminal.Patches
{
	[HarmonyPatch(typeof(Terminal))]
	internal class TerminalPatch
	{
		[HarmonyPatch("BeginUsingTerminal")]
		[HarmonyPrefix]
		public static void OpenTerminal(Terminal __instance)
		{
			BetterTerminal.instance.log.LogInfo((object)"Begin terminal patch");
			((Component)__instance.terminalUIScreen).gameObject.SetActive(true);
		}

		[HarmonyPatch("QuitTerminal")]
		[HarmonyPrefix]
		public static void CloseTerminal(Terminal __instance)
		{
			BetterTerminal.instance.log.LogInfo((object)"Close terminal patch");
			((Component)__instance.terminalUIScreen).gameObject.SetActive(false);
		}
	}
}