Decompiled source of LCModControl v1.0.0

LCModControl.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LCModControl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCModControl")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("63f543a9-70b1-49d6-bdbf-873e13e60ea1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("aaa.lcmodcontrol", "LCModControl", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public static ManualLogSource LoggerInstance;

	private void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		LoggerInstance = ((BaseUnityPlugin)this).Logger;
		Harmony val = new Harmony("aaa.lcmodcontrol");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"LCModControl loaded and ready to go.");
	}
}
namespace LCModControl;

[HarmonyPatch]
public static class KeysLockDoorsPatch
{
	private static MethodBase TargetMethod()
	{
		Type type = AccessTools.TypeByName("KeysLockDoors.Plugin");
		if (type == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find type KeysLockDoors.Plugin. Skipping...");
			return null;
		}
		MethodInfo methodInfo = AccessTools.Method(type, "Awake", (Type[])null, (Type[])null);
		if (methodInfo == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find Awake method for KeysLockDoors.Plugin. Skipping...");
		}
		return methodInfo;
	}

	private static bool Prefix()
	{
		Plugin.LoggerInstance.LogInfo((object)"Blocking KeysLockDoors Awake method to prevent it from loading.");
		return false;
	}
}
[HarmonyPatch]
public static class FogRemoverPatch
{
	private static MethodBase TargetMethod()
	{
		Type type = AccessTools.TypeByName("fogremover.ravenfogremoverInitialization");
		if (type == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find type fogremover.ravenfogremoverInitialization. Skipping...");
			return null;
		}
		MethodInfo methodInfo = AccessTools.Method(type, "Awake", (Type[])null, (Type[])null);
		if (methodInfo == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find Awake method for fogremover.ravenfogremoverInitialization. Skipping...");
		}
		return methodInfo;
	}

	private static bool Prefix()
	{
		Plugin.LoggerInstance.LogInfo((object)"Blocking fogremover.ravenfogremoverInitialization Awake method to prevent it from loading.");
		return false;
	}
}
[HarmonyPatch]
public static class FogRemovePatch
{
	private static MethodBase TargetMethod()
	{
		Type type = AccessTools.TypeByName("FogRemove.RemoveFog.Initialization");
		if (type == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find type FogRemove.RemoveFog.Initialization. Skipping...");
			return null;
		}
		MethodInfo methodInfo = AccessTools.Method(type, "Awake", (Type[])null, (Type[])null);
		if (methodInfo == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find Awake method for FogRemove.RemoveFog.Initialization. Skipping...");
		}
		return methodInfo;
	}

	private static bool Prefix()
	{
		Plugin.LoggerInstance.LogInfo((object)"Blocking FogRemove.RemoveFog Awake method to prevent it from loading.");
		return false;
	}
}
[HarmonyPatch]
public static class FogRemoverMainPatch
{
	private static MethodBase TargetMethod()
	{
		Type type = AccessTools.TypeByName("FogRemover.FogRemover");
		if (type == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find type FogRemover.FogRemover. Skipping...");
			return null;
		}
		MethodInfo methodInfo = AccessTools.Method(type, "Awake", (Type[])null, (Type[])null);
		if (methodInfo == null)
		{
			Plugin.LoggerInstance.LogWarning((object)"Could not find Awake method for FogRemover.FogRemover. Skipping...");
		}
		return methodInfo;
	}

	private static bool Prefix()
	{
		Plugin.LoggerInstance.LogInfo((object)"Blocking FogRemover Awake method to prevent it from loading.");
		return false;
	}
}