Decompiled source of DSPVisibleShield v0.0.1

DSPVisibleShield.dll

Decompiled 10 months 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 BepInEx.Configuration;
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("DspFontPatcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DspFontPatcher")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("81DF3045-8007-4F6A-AAF6-903139D85B6C")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
namespace DSPVisibleShield;

[BepInPlugin("Appun.DSP.plugin.VisibleShield", "DSPVisibleShield", "0.0.1")]
[HarmonyPatch]
public class DSPMiniLabo : BaseUnityPlugin
{
	public class LogManager
	{
		public static ManualLogSource Logger;
	}

	public static ConfigEntry<bool> BuildModeOnly;

	public void Awake()
	{
		LogManager.Logger = ((BaseUnityPlugin)this).Logger;
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		BuildModeOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("BuildModeOnly", "BuildModeOnly", true, "BuildModeOnly");
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(FactoryModel), "LateUpdate")]
	public static bool FactoryModel_LateUpdate_Prefix(FactoryModel __instance, ref bool __state)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Invalid comparison between Unknown and I4
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Invalid comparison between Unknown and I4
		__state = __instance.drawATFieldShape;
		if ((BuildModeOnly.Value && (int)UIGame.viewMode == 1) || (!BuildModeOnly.Value && (int)UIGame.viewMode == 0) || (!BuildModeOnly.Value && (int)UIGame.viewMode == 2))
		{
			__instance.drawATFieldShape = true;
		}
		return true;
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(FactoryModel), "LateUpdate")]
	public static void FactoryModel_LateUpdate_Postfix(FactoryModel __instance, ref bool __state)
	{
		__instance.drawATFieldShape = __state;
	}
}