Decompiled source of Chromatic Aberration Remover v1.0.0

ChromaAberrationRemover.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;
using UnityEngine.PostProcessing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ChromaAberrationRemover")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ChromaAberrationRemover")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("FB0FB195-71DB-4D8E-A31B-BBDC2A3EFD18")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ChromaAberrationRemover;

[BepInPlugin("Puppyroni.inscryption.chromaOFF", "ChromaAberrationRemover", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private FieldInfo _chroma;

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"ChromaAberrationRemover loaded! - Made By Puppyroni");
		_chroma = typeof(PostProcessingBehaviour).GetField("m_ChromaticAberration", BindingFlags.Instance | BindingFlags.NonPublic);
	}

	private void Update()
	{
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		Camera main = Camera.main;
		if ((Object)(object)main == (Object)null)
		{
			return;
		}
		PostProcessingBehaviour component = ((Component)main).GetComponent<PostProcessingBehaviour>();
		if ((Object)(object)component == (Object)null || _chroma == null)
		{
			return;
		}
		object value = _chroma.GetValue(component);
		if (value == null)
		{
			return;
		}
		PropertyInfo property = value.GetType().GetProperty("model");
		if (!(property == null))
		{
			ChromaticAberrationModel val = (ChromaticAberrationModel)property.GetValue(value);
			if (val != null)
			{
				Settings settings = val.settings;
				settings.intensity = 1E-05f;
				val.settings = settings;
			}
		}
	}
}