Decompiled source of Disable Sickening Effects v1.0.0

DisableSickeningEffects.dll

Decompiled 2 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Presentation.PlayerDamageEffects;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using VFX.Calamities;
using VoidManager;
using VoidManager.CustomGUI;
using VoidManager.MPModChecks;
using VoidManager.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyCompany("DisableSickeningEffects")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e265719b36bffc29cd391158d30870680a12cfd0")]
[assembly: AssemblyProduct("DisableSickeningEffects")]
[assembly: AssemblyTitle("Disables effects for malfunction surges, black hole screen warp, and blur.")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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;
		}
	}
}
namespace DisableSickeningEffects
{
	internal static class Configs
	{
		internal static ConfigEntry<bool> AllowMalfunctionSurgeVFX;

		internal static ConfigEntry<bool> AllowGlitchPostFX;

		internal static ConfigEntry<bool> AllowBlackholeWarpFX;

		internal static ConfigEntry<bool> AllowBlurPostFX;

		internal static void Load(ConfigFile config)
		{
			AllowMalfunctionSurgeVFX = config.Bind<bool>("General", "AllowMalfunctionSurgeVFX", false, (ConfigDescription)null);
			AllowGlitchPostFX = config.Bind<bool>("General", "AllowGlitchPostFX", false, (ConfigDescription)null);
			AllowBlackholeWarpFX = config.Bind<bool>("General", "AllowBlackholeWarpFX", false, (ConfigDescription)null);
			AllowBlurPostFX = config.Bind<bool>("General", "AllowBlurPostFX", false, (ConfigDescription)null);
		}
	}
	internal class GUI : ModSettingsMenu
	{
		public override string Name()
		{
			return "Disable Sickening Effects";
		}

		public override void Draw()
		{
			if (GUITools.DrawButtonSelected("Malfunction Surge FX: " + (Configs.AllowMalfunctionSurgeVFX.Value ? "Enabled" : "Disabled"), Configs.AllowMalfunctionSurgeVFX.Value))
			{
				Configs.AllowMalfunctionSurgeVFX.Value = !Configs.AllowMalfunctionSurgeVFX.Value;
			}
			if (GUITools.DrawButtonSelected("Glitch PostFX: " + (Configs.AllowGlitchPostFX.Value ? "Enabled" : "Disabled"), Configs.AllowGlitchPostFX.Value))
			{
				Configs.AllowGlitchPostFX.Value = !Configs.AllowGlitchPostFX.Value;
			}
			if (GUITools.DrawButtonSelected("Blackhole Warp FX: " + (Configs.AllowBlackholeWarpFX.Value ? "Enabled" : "Disabled"), Configs.AllowBlackholeWarpFX.Value))
			{
				Configs.AllowBlackholeWarpFX.Value = !Configs.AllowBlackholeWarpFX.Value;
				if ((Object)(object)Patches.lastBlackHoleFX != (Object)null)
				{
					((Behaviour)Patches.lastBlackHoleFX).enabled = Configs.AllowBlackholeWarpFX.Value;
				}
			}
			if (GUITools.DrawButtonSelected("Blur PostFX: " + (Configs.AllowBlurPostFX.Value ? "Enabled" : "Disabled"), Configs.AllowBlurPostFX.Value))
			{
				Configs.AllowBlurPostFX.Value = !Configs.AllowBlurPostFX.Value;
			}
		}
	}
	public class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Dragon.DisableSickeningEffects";

		public const string PLUGIN_NAME = "DisableSickeningEffects";

		public const string USERS_PLUGIN_NAME = "Disable Sickening Effects";

		public const string PLUGIN_VERSION = "1.0.0";

		public const string PLUGIN_DESCRIPTION = "Disables effects for malfunction surges, black hole screen warp, and blur.";

		public const string PLUGIN_ORIGINAL_AUTHOR = "Dragon";

		public const string PLUGIN_AUTHORS = "Dragon";

		public const string PLUGIN_THUNDERSTORE_ID = "NihilityShift/DisableSickeningEffects";
	}
	[HarmonyPatch]
	internal class Patches
	{
		internal static CustomPassVolume lastBlackHoleFX;

		[HarmonyPatch(typeof(InterferenceObserver), "OnInterferenceActivated")]
		[HarmonyPrefix]
		private static bool InterferenceTwistBlocker()
		{
			BepinPlugin.Log.LogInfo((object)"Blocking Surge Effect");
			return Configs.AllowMalfunctionSurgeVFX.Value;
		}

		[HarmonyPatch(typeof(PostEffectControllerGlitch), "ProfileUpdate")]
		[HarmonyPrefix]
		private static bool GlitchFXBlocker()
		{
			return Configs.AllowGlitchPostFX.Value;
		}

		[HarmonyPatch(typeof(BlackholeFXHandler), "Awake")]
		[HarmonyPostfix]
		private static void BlackholeCameraFX(BlackholeFXHandler __instance)
		{
			((Behaviour)__instance._customPassVolume).enabled = Configs.AllowBlackholeWarpFX.Value;
			lastBlackHoleFX = __instance._customPassVolume;
		}

		[HarmonyPatch(typeof(PostEffectControllerBlur), "ProfileUpdate")]
		[HarmonyPostfix]
		private static void BlurFXBlocker(PostEffectControllerBlur __instance)
		{
			if (!Configs.AllowBlurPostFX.Value)
			{
				((VolumeComponent)__instance._blur).active = false;
			}
		}
	}
	[BepInPlugin("Dragon.DisableSickeningEffects", "Disable Sickening Effects", "1.0.0")]
	[BepInProcess("Void Crew.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BepinPlugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Configs.Load(((BaseUnityPlugin)this).Config);
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Dragon.DisableSickeningEffects is loaded!");
		}
	}
	public class VoidManagerPlugin : VoidPlugin
	{
		public override MultiplayerType MPType => (MultiplayerType)8;

		public override string Author => "Dragon";

		public override string Description => "Disables effects for malfunction surges, black hole screen warp, and blur.";

		public override string ThunderstoreID => "NihilityShift/DisableSickeningEffects";
	}
}