Decompiled source of Hide Plane Patch v1.2.1

HidePlanePatch.dll

Decompiled 14 hours ago
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using HidePlanePatch.Patches;
using PluginUtilities;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("HVHP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TaleSpire Modding Community")]
[assembly: AssemblyProduct("HVHP")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4e4deb5e-97f9-4901-bf67-6748a9c1229a")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.2.1.0")]
namespace HidePlanePatch
{
	[BepInPlugin("org.HF.plugins.HPP", "Hide Plane Patch", "1.2.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class HPPPlugin : DependencyUnityPlugin
	{
		public const string Guid = "org.HF.plugins.HPP";

		public const string Version = "1.2.1.0";

		private const string Name = "Hide Plane Patch";

		internal static Harmony harmony;

		internal static ManualLogSource _logger;

		internal static ConfigEntry<float> CullBoxMultiplier;

		public static void DoPatching()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			harmony = new Harmony("org.HF.plugins.HPP");
			harmony.PatchAll();
			_logger.LogInfo((object)"Hide Plane Patch: Patched.");
		}

		private static void DoConfig(ConfigFile config)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			CullBoxMultiplier = config.Bind<float>("CullBox", "Size", 100f, new ConfigDescription("", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationAttributes
			{
				CallbackAction = delegate
				{
					SetHHPSize();
				},
				DispName = "Cull Box Size"
			} }));
		}

		protected override void OnAwake()
		{
			_logger = ((BaseUnityPlugin)this).Logger;
			DoConfig(((BaseUnityPlugin)this).Config);
			DoPatching();
			_logger.LogInfo((object)"Hide Plane Patch is Active.");
			if ((Object)(object)HeightHidePlanePatch.HeightHidePlane == (Object)null)
			{
				HeightHidePlanePatch.HeightHidePlane = Object.FindAnyObjectByType<HeightHidePlane>();
			}
			SetHHPSize();
		}

		internal static void SetHHPSize()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)HeightHidePlanePatch.HeightHidePlane != (Object)null)
			{
				((Component)HeightHidePlanePatch.HeightHidePlane).transform.localScale = new Vector3(CullBoxMultiplier.Value, 1f, CullBoxMultiplier.Value);
			}
		}

		protected override void OnDestroyed()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)HeightHidePlanePatch.HeightHidePlane != (Object)null)
			{
				((Component)HeightHidePlanePatch.HeightHidePlane).transform.localScale = new Vector3(1f, 1f, 1f);
				HeightHidePlanePatch.HeightHidePlane = null;
			}
			harmony.UnpatchSelf();
			CullBoxMultiplier = null;
			_logger = null;
			harmony = null;
			((BaseUnityPlugin)this).Logger.LogDebug((object)"Hide Plane Patch unloaded");
		}
	}
}
namespace HidePlanePatch.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("HidePlanePatch.Properties.Resources", typeof(Resources).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal Resources()
		{
		}
	}
}
namespace HidePlanePatch.Patches
{
	[HarmonyPatch(typeof(HeightHidePlane), "Awake")]
	internal sealed class HeightHidePlanePatch
	{
		internal static HeightHidePlane HeightHidePlane;

		private static void Postfix(ref HeightHidePlane __instance)
		{
			HeightHidePlane = __instance;
			HPPPlugin.SetHHPSize();
		}
	}
}