Decompiled source of Doorbelle v1.0.2

plugins/Doorbelle.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Logging;
using Doorbelle.Patches;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("LethalCompanyModding")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Lets you walk in space")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+eae645a1b4a2d8aa20adcdefd7d0cc2eaf3581af")]
[assembly: AssemblyProduct("Doorbelle")]
[assembly: AssemblyTitle("dev.mamallama.lcm.doorbelle")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/LethalCompanyModding/Doorbelle")]
[assembly: AssemblyVersion("1.0.2.0")]
[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;
		}
	}
}
internal static class LCMPluginInfo
{
	public const string PLUGIN_GUID = "dev.mamallama.lcm.doorbelle";

	public const string PLUGIN_NAME = "Doorbelle";

	public const string PLUGIN_VERSION = "1.0.2";
}
namespace Doorbelle
{
	[BepInPlugin("dev.mamallama.lcm.doorbelle", "Doorbelle", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("dev.mamallama.lcm.doorbelle");

		public static ManualLogSource Log;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin dev.mamallama.lcm.doorbelle is loaded!");
			Log = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll(typeof(HangarShipDoorPatches));
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}
	}
}
namespace Doorbelle.Patches
{
	public class HangarShipDoorPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(HangarShipDoor), "Start")]
		public static void HangarShipDoorAwakePatch(HangarShipDoor __instance)
		{
			HangerShipDoorAlwaysOpenPatch(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(HangarShipDoor), "SetDoorButtonsEnabled")]
		public static void HangerShipDoorAlwaysOpenPatch(HangarShipDoor __instance)
		{
			__instance.buttonsEnabled = true;
			Plugin.Log.LogInfo((object)"Unlocking ship doors");
		}
	}
	public class StartOfRoundPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(StartOfRound), "TeleportPlayerInShipIfOutOfRoomBounds")]
		public static bool StartOfRoundTPPatch()
		{
			return false;
		}
	}
}