Decompiled source of PostProcessing v0.1.2

PostProcessing.dll

Decompiled 4 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
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("PostProcessing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PostProcessing")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("836db46b-86d6-47dd-8cf9-39be99a17b13")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
public class AedenthornUtils
{
	public static bool IgnoreKeyPresses(bool extra = false)
	{
		if (!extra)
		{
			int result;
			if (!((Object)(object)ZNetScene.instance == (Object)null) && !((Object)(object)Player.m_localPlayer == (Object)null) && !Minimap.IsOpen() && !Console.IsVisible() && !TextInput.IsVisible() && !ZNet.instance.InPasswordDialog())
			{
				Chat instance = Chat.instance;
				result = ((instance != null && instance.HasFocus()) ? 1 : 0);
			}
			else
			{
				result = 1;
			}
			return (byte)result != 0;
		}
		int result2;
		if (!((Object)(object)ZNetScene.instance == (Object)null) && !((Object)(object)Player.m_localPlayer == (Object)null) && !Minimap.IsOpen() && !Console.IsVisible() && !TextInput.IsVisible() && !ZNet.instance.InPasswordDialog())
		{
			Chat instance2 = Chat.instance;
			if ((instance2 == null || !instance2.HasFocus()) && !StoreGui.IsVisible() && !InventoryGui.IsVisible() && !Menu.IsVisible())
			{
				TextViewer instance3 = TextViewer.instance;
				result2 = ((instance3 != null && instance3.IsVisible()) ? 1 : 0);
				goto IL_00d2;
			}
		}
		result2 = 1;
		goto IL_00d2;
		IL_00d2:
		return (byte)result2 != 0;
	}

	public static bool CheckKeyDown(string value)
	{
		try
		{
			return Input.GetKeyDown(value.ToLower());
		}
		catch
		{
			return false;
		}
	}

	public static bool CheckKeyUp(string value)
	{
		try
		{
			return Input.GetKeyUp(value.ToLower());
		}
		catch
		{
			return false;
		}
	}

	public static bool CheckKeyHeld(string value, bool req = true)
	{
		try
		{
			return Input.GetKey(value.ToLower());
		}
		catch
		{
			return !req;
		}
	}

	public static void ShuffleList<T>(List<T> list)
	{
		int num = list.Count;
		while (num > 1)
		{
			num--;
			int index = Random.Range(0, num);
			T value = list[index];
			list[index] = list[num];
			list[num] = value;
		}
	}

	public static string GetAssetPath(object obj, bool create = false)
	{
		return GetAssetPath(obj.GetType().Namespace, create);
	}

	public static string GetAssetPath(string name, bool create = false)
	{
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name);
		if (create && !Directory.Exists(text))
		{
			Directory.CreateDirectory(text);
		}
		return text;
	}

	public static string GetTransformPath(Transform t)
	{
		if (!Object.op_Implicit((Object)(object)t.parent))
		{
			return ((Object)t).name;
		}
		return GetTransformPath(t.parent) + "/" + ((Object)t).name;
	}

	public static byte[] EncodeToPNG(Texture2D texture)
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Expected O, but got Unknown
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		RenderTexture temporary = RenderTexture.GetTemporary(((Texture)texture).width, ((Texture)texture).height, 0, (RenderTextureFormat)7, (RenderTextureReadWrite)0);
		Graphics.Blit((Texture)(object)texture, temporary);
		RenderTexture active = RenderTexture.active;
		RenderTexture.active = temporary;
		Texture2D val = new Texture2D(((Texture)texture).width, ((Texture)texture).height, (TextureFormat)4, true, false);
		val.ReadPixels(new Rect(0f, 0f, (float)((Texture)temporary).width, (float)((Texture)temporary).height), 0, 0);
		val.Apply();
		RenderTexture.active = active;
		RenderTexture.ReleaseTemporary(temporary);
		Texture2D val2 = new Texture2D(((Texture)texture).width, ((Texture)texture).height);
		val2.SetPixels(val.GetPixels());
		val2.Apply();
		return ImageConversion.EncodeToPNG(val2);
	}
}
namespace PostProcessing;

[BepInPlugin("aedenthorn.PostProcessing", "Post Processing", "0.1.2")]
public class BepInExPlugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(PostProcessingBehaviour), "OnEnable")]
	private static class PostProcessingBehaviour_OnEnable_Patch
	{
		private static void Prefix(PostProcessingBehaviour __instance)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__instance.profile != (Object)null && !defaultPostProcessingSet)
			{
				defaultVignetteSettings = __instance.profile.vignette.settings;
				defaultVignetteEnabled = ((PostProcessingModel)__instance.profile.vignette).enabled;
				defaultBloomSettings = __instance.profile.bloom.settings;
				defaultEyeAdaptSettings = __instance.profile.eyeAdaptation.settings;
				defaultEyeAdaptEnabled = ((PostProcessingModel)__instance.profile.eyeAdaptation).enabled;
				defaultMotionBlurSettings = __instance.profile.motionBlur.settings;
				defaultDepthOfFieldSettings = __instance.profile.depthOfField.settings;
				defaultColorGradingSettings = __instance.profile.colorGrading.settings;
				defaultAOSettings = __instance.profile.ambientOcclusion.settings;
				defaultCASettings = __instance.profile.chromaticAberration.settings;
				defaultSSRSettings = __instance.profile.screenSpaceReflection.settings;
				defaultSSREnabled = ((PostProcessingModel)__instance.profile.screenSpaceReflection).enabled;
				defaultPostProcessingSet = true;
			}
		}
	}

	[HarmonyPatch(typeof(PostProcessingBehaviour), "OnPreCull")]
	private static class PostProcessingBehaviour_OnPreCull_Patch
	{
		private static void Postfix(ref VignetteComponent ___m_Vignette, ref BloomComponent ___m_Bloom, ref EyeAdaptationComponent ___m_EyeAdaptation, ref DepthOfFieldComponent ___m_DepthOfField, ref MotionBlurComponent ___m_MotionBlur, ref ColorGradingComponent ___m_ColorGrading, ref TaaComponent ___m_Taa, ref FxaaComponent ___m_Fxaa, ref AmbientOcclusionComponent ___m_AmbientOcclusion, ref ChromaticAberrationComponent ___m_ChromaticAberration, ref ScreenSpaceReflectionComponent ___m_ScreenSpaceReflection)
		{
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_061d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_058d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0599: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Unknown result type (might be due to invalid IL or missing references)
			//IL_064e: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0730: Unknown result type (might be due to invalid IL or missing references)
			//IL_0735: Unknown result type (might be due to invalid IL or missing references)
			//IL_0742: Unknown result type (might be due to invalid IL or missing references)
			//IL_0747: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0791: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_07df: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_0807: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_080e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_0821: Unknown result type (might be due to invalid IL or missing references)
			//IL_0826: Unknown result type (might be due to invalid IL or missing references)
			//IL_082d: Unknown result type (might be due to invalid IL or missing references)
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0836: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_083d: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0849: Unknown result type (might be due to invalid IL or missing references)
			//IL_0859: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
			//IL_091e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_0935: Unknown result type (might be due to invalid IL or missing references)
			//IL_093a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0946: Unknown result type (might be due to invalid IL or missing references)
			//IL_094b: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a16: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a34: Unknown result type (might be due to invalid IL or missing references)
			if (modEnabled.Value && customVignette.Value)
			{
				Settings val = default(Settings);
				val.mode = (Mode)0;
				val.opacity = vignetteOpacity.Value;
				val.intensity = vignetteIntensity.Value;
				val.color = vignetteColor.Value;
				val.center = vignetteCenter.Value;
				val.smoothness = vignetteSmoothness.Value;
				val.roundness = vignetteRoundness.Value;
				val.rounded = vignetteRounded.Value;
				Settings settings = val;
				((PostProcessingComponent<VignetteModel>)(object)___m_Vignette).model.settings = settings;
				((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)___m_Vignette).model).enabled = true;
			}
			else
			{
				((PostProcessingComponent<VignetteModel>)(object)___m_Vignette).model.settings = defaultVignetteSettings;
				((PostProcessingModel)((PostProcessingComponent<VignetteModel>)(object)___m_Vignette).model).enabled = defaultVignetteEnabled;
			}
			if (modEnabled.Value && customBloom.Value)
			{
				BloomSettings val2 = default(BloomSettings);
				val2.intensity = bloomIntensity.Value;
				val2.threshold = bloomThreshold.Value;
				val2.softKnee = bloomSoftKnee.Value;
				val2.radius = bloomRadius.Value;
				val2.antiFlicker = bloomAntiFlicker.Value;
				BloomSettings bloom = val2;
				LensDirtSettings val3 = default(LensDirtSettings);
				val3.intensity = bloomLensDirtIntensity.Value;
				LensDirtSettings lensDirt = val3;
				Settings val4 = default(Settings);
				val4.bloom = bloom;
				val4.lensDirt = lensDirt;
				Settings settings2 = val4;
				((PostProcessingComponent<BloomModel>)(object)___m_Bloom).model.settings = settings2;
			}
			else
			{
				((PostProcessingComponent<BloomModel>)(object)___m_Bloom).model.settings = defaultBloomSettings;
			}
			if (modEnabled.Value && customEyeAdapt.Value)
			{
				Settings val5 = default(Settings);
				val5.lowPercent = eyeAdaptLowPercent.Value;
				val5.highPercent = eyeAdaptHighPercent.Value;
				val5.minLuminance = eyeAdaptMinLuminance.Value;
				val5.maxLuminance = eyeAdaptMaxLuminance.Value;
				val5.keyValue = eyeAdaptKeyValue.Value;
				val5.dynamicKeyValue = eyeAdaptDynamicKeyValue.Value;
				val5.adaptationType = eyeAdaptAdaptationType.Value;
				val5.speedUp = eyeAdaptSpeedUp.Value;
				val5.speedDown = eyeAdaptSpeedDown.Value;
				val5.logMin = eyeAdaptLogMin.Value;
				val5.logMax = eyeAdaptLogMax.Value;
				Settings settings3 = val5;
				((PostProcessingComponent<EyeAdaptationModel>)(object)___m_EyeAdaptation).model.settings = settings3;
				((PostProcessingModel)((PostProcessingComponent<EyeAdaptationModel>)(object)___m_EyeAdaptation).model).enabled = true;
			}
			else
			{
				((PostProcessingComponent<EyeAdaptationModel>)(object)___m_EyeAdaptation).model.settings = defaultEyeAdaptSettings;
				((PostProcessingModel)((PostProcessingComponent<EyeAdaptationModel>)(object)___m_EyeAdaptation).model).enabled = defaultEyeAdaptEnabled;
			}
			if (modEnabled.Value && customMotionBlur.Value)
			{
				Settings val6 = default(Settings);
				val6.shutterAngle = motionBlurShutterAngle.Value;
				val6.sampleCount = motionBlurSampleCount.Value;
				val6.frameBlending = motionBlurFrameBlending.Value;
				Settings settings4 = val6;
				((PostProcessingComponent<MotionBlurModel>)(object)___m_MotionBlur).model.settings = settings4;
			}
			else
			{
				((PostProcessingComponent<MotionBlurModel>)(object)___m_MotionBlur).model.settings = defaultMotionBlurSettings;
			}
			if (modEnabled.Value && customDepthOfField.Value)
			{
				Settings val7 = default(Settings);
				val7.focusDistance = depthOfFieldFocusDistance.Value;
				val7.aperture = depthOfFieldAperture.Value;
				val7.focalLength = depthOfFieldFocalLength.Value;
				val7.useCameraFov = depthOfFieldUseCameraFov.Value;
				val7.kernelSize = depthOfFieldKernelSize.Value;
				Settings settings5 = val7;
				((PostProcessingComponent<DepthOfFieldModel>)(object)___m_DepthOfField).model.settings = settings5;
				((PostProcessingModel)((PostProcessingComponent<DepthOfFieldModel>)(object)___m_DepthOfField).model).enabled = true;
			}
			else
			{
				((PostProcessingComponent<DepthOfFieldModel>)(object)___m_DepthOfField).model.settings = defaultDepthOfFieldSettings;
				((PostProcessingModel)((PostProcessingComponent<DepthOfFieldModel>)(object)___m_DepthOfField).model).enabled = false;
			}
			if (modEnabled.Value && customColorGrading.Value)
			{
				TonemappingSettings val8 = default(TonemappingSettings);
				val8.tonemapper = colorGradingTonemapper.Value;
				val8.neutralBlackIn = colorGradingNeutralBlackIn.Value;
				val8.neutralWhiteIn = colorGradingNeutralWhiteIn.Value;
				val8.neutralBlackOut = colorGradingNeutralBlackOut.Value;
				val8.neutralWhiteOut = colorGradingNeutralWhiteOut.Value;
				val8.neutralWhiteLevel = colorGradingNeutralWhiteLevel.Value;
				val8.neutralWhiteClip = colorGradingNeutralWhiteClip.Value;
				TonemappingSettings tonemapping = val8;
				BasicSettings val9 = default(BasicSettings);
				val9.postExposure = colorGradingPostExposure.Value;
				val9.temperature = colorGradingTemperature.Value;
				val9.tint = colorGradingTint.Value;
				val9.hueShift = colorGradingHueShift.Value;
				val9.saturation = colorGradingSaturation.Value;
				val9.contrast = colorGradingContrast.Value;
				BasicSettings basic = val9;
				ChannelMixerSettings val10 = default(ChannelMixerSettings);
				val10.red = colorGradingChannelMixerRed.Value;
				val10.green = colorGradingChannelMixerGreen.Value;
				val10.blue = colorGradingChannelMixerBlue.Value;
				val10.currentEditingChannel = colorGradingChannelMixerCurrentEditingChannel.Value;
				ChannelMixerSettings channelMixer = val10;
				Settings val11 = default(Settings);
				val11.tonemapping = tonemapping;
				val11.basic = basic;
				val11.channelMixer = channelMixer;
				val11.colorWheels = defaultColorGradingSettings.colorWheels;
				val11.curves = defaultColorGradingSettings.curves;
				Settings settings6 = val11;
				((PostProcessingComponent<ColorGradingModel>)(object)___m_ColorGrading).model.settings = settings6;
			}
			else
			{
				((PostProcessingComponent<ColorGradingModel>)(object)___m_ColorGrading).model.settings = defaultColorGradingSettings;
			}
			if (modEnabled.Value && customAO.Value)
			{
				Settings val12 = default(Settings);
				val12.intensity = AOIntensity.Value;
				val12.intensityFar = AOIntensityFar.Value;
				val12.farDistance = AOFarDistance.Value;
				val12.radius = AORadius.Value;
				val12.sampleCount = AOSampleCount.Value;
				val12.downsampling = AODownsampling.Value;
				val12.forceForwardCompatibility = AOForceForwardCompatibility.Value;
				val12.ambientOnly = AOAmbientOnly.Value;
				val12.highPrecision = AOHighPrecision.Value;
				Settings settings7 = val12;
				((PostProcessingComponent<AmbientOcclusionModel>)(object)___m_AmbientOcclusion).model.settings = settings7;
			}
			else
			{
				((PostProcessingComponent<AmbientOcclusionModel>)(object)___m_AmbientOcclusion).model.settings = defaultAOSettings;
			}
			if (!defaultAASet)
			{
				defaultAATaaSettings = ((PostProcessingComponent<AntialiasingModel>)(object)___m_Taa).model.settings;
				defaultAAFxaaSettings = ((PostProcessingComponent<AntialiasingModel>)(object)___m_Fxaa).model.settings;
				defaultAASet = true;
			}
			if (modEnabled.Value && customAA.Value)
			{
				FxaaSettings val13 = default(FxaaSettings);
				val13.preset = AAFxaaPreset.Value;
				FxaaSettings fxaaSettings = val13;
				TaaSettings val14 = default(TaaSettings);
				val14.jitterSpread = AAJitterSpread.Value;
				val14.sharpen = AASharpen.Value;
				val14.stationaryBlending = AAStationaryBlending.Value;
				val14.motionBlending = AAMotionBlending.Value;
				TaaSettings taaSettings = val14;
				Settings val15 = default(Settings);
				val15.method = AAMethod.Value;
				val15.fxaaSettings = fxaaSettings;
				val15.taaSettings = taaSettings;
				Settings settings8 = val15;
				val15 = default(Settings);
				val15.method = AAMethod.Value;
				val15.fxaaSettings = fxaaSettings;
				val15.taaSettings = taaSettings;
				Settings settings9 = val15;
				((PostProcessingComponent<AntialiasingModel>)(object)___m_Taa).model.settings = settings8;
				((PostProcessingComponent<AntialiasingModel>)(object)___m_Fxaa).model.settings = settings9;
			}
			else
			{
				((PostProcessingComponent<AntialiasingModel>)(object)___m_Taa).model.settings = defaultAATaaSettings;
				((PostProcessingComponent<AntialiasingModel>)(object)___m_Fxaa).model.settings = defaultAAFxaaSettings;
			}
			if (modEnabled.Value && customCA.Value)
			{
				Settings val16 = default(Settings);
				val16.intensity = CAIntensity.Value;
				Settings settings10 = val16;
				((PostProcessingComponent<ChromaticAberrationModel>)(object)___m_ChromaticAberration).model.settings = settings10;
			}
			else
			{
				((PostProcessingComponent<ChromaticAberrationModel>)(object)___m_ChromaticAberration).model.settings = defaultCASettings;
			}
			if (modEnabled.Value && customSSR.Value)
			{
				((PostProcessingComponent<ScreenSpaceReflectionModel>)(object)___m_ScreenSpaceReflection).model.settings = new Settings
				{
					reflection = new ReflectionSettings
					{
						blendType = SSRBlendType.Value,
						reflectionQuality = SSRReflectionQuality.Value,
						maxDistance = SSRMaxDistance.Value,
						iterationCount = SSRIteractionCount.Value,
						stepSize = SSRStepSize.Value,
						widthModifier = SSRWidthModifier.Value,
						reflectionBlur = SSRReflectionBlur.Value,
						reflectBackfaces = SSRReflectBackFaces.Value
					},
					intensity = new IntensitySettings
					{
						reflectionMultiplier = SSRReflectionMultiplier.Value,
						fadeDistance = SSRFadeDistance.Value,
						fresnelFade = SSRFresnelFade.Value,
						fresnelFadePower = SSRFresnelFadePower.Value
					},
					screenEdgeMask = new ScreenEdgeMask
					{
						intensity = SSRMaskIntensity.Value
					}
				};
				((PostProcessingModel)((PostProcessingComponent<ScreenSpaceReflectionModel>)(object)___m_ScreenSpaceReflection).model).enabled = true;
			}
			else
			{
				((PostProcessingComponent<ScreenSpaceReflectionModel>)(object)___m_ScreenSpaceReflection).model.settings = defaultSSRSettings;
				((PostProcessingModel)((PostProcessingComponent<ScreenSpaceReflectionModel>)(object)___m_ScreenSpaceReflection).model).enabled = defaultSSREnabled;
			}
		}
	}

	private static bool defaultPostProcessingSet = false;

	private static Settings defaultVignetteSettings;

	private static bool defaultVignetteEnabled;

	private static Settings defaultBloomSettings;

	private static Settings defaultEyeAdaptSettings;

	private static bool defaultEyeAdaptEnabled;

	private static Settings defaultMotionBlurSettings;

	private static Settings defaultDepthOfFieldSettings;

	private static Settings defaultColorGradingSettings;

	private static Settings defaultAOSettings;

	private static Settings defaultCASettings;

	private static Settings defaultSSRSettings;

	private static bool defaultSSREnabled;

	private static bool defaultAASet = false;

	private static Settings defaultAATaaSettings;

	private static Settings defaultAAFxaaSettings;

	private static readonly bool isDebug = true;

	private static BepInExPlugin context;

	public static ConfigEntry<bool> modEnabled;

	public static ConfigEntry<int> nexusID;

	public static ConfigEntry<string> hotKey;

	public static ConfigEntry<bool> customVignette;

	public static ConfigEntry<bool> customBloom;

	public static ConfigEntry<bool> customEyeAdapt;

	public static ConfigEntry<bool> customMotionBlur;

	public static ConfigEntry<bool> customColorGrading;

	public static ConfigEntry<bool> customDepthOfField;

	public static ConfigEntry<bool> customAA;

	public static ConfigEntry<bool> customAO;

	public static ConfigEntry<bool> customCA;

	public static ConfigEntry<bool> customSSR;

	public static ConfigEntry<Color> vignetteColor;

	public static ConfigEntry<float> vignetteOpacity;

	public static ConfigEntry<float> vignetteIntensity;

	public static ConfigEntry<Vector2> vignetteCenter;

	public static ConfigEntry<float> vignetteSmoothness;

	public static ConfigEntry<float> vignetteRoundness;

	public static ConfigEntry<bool> vignetteRounded;

	public static ConfigEntry<float> bloomIntensity;

	public static ConfigEntry<float> bloomThreshold;

	public static ConfigEntry<float> bloomSoftKnee;

	public static ConfigEntry<float> bloomRadius;

	public static ConfigEntry<bool> bloomAntiFlicker;

	public static ConfigEntry<float> bloomLensDirtIntensity;

	public static ConfigEntry<float> eyeAdaptLowPercent;

	public static ConfigEntry<float> eyeAdaptHighPercent;

	public static ConfigEntry<float> eyeAdaptMinLuminance;

	public static ConfigEntry<float> eyeAdaptMaxLuminance;

	public static ConfigEntry<float> eyeAdaptKeyValue;

	public static ConfigEntry<bool> eyeAdaptDynamicKeyValue;

	public static ConfigEntry<EyeAdaptationType> eyeAdaptAdaptationType;

	public static ConfigEntry<float> eyeAdaptSpeedUp;

	public static ConfigEntry<float> eyeAdaptSpeedDown;

	public static ConfigEntry<int> eyeAdaptLogMin;

	public static ConfigEntry<int> eyeAdaptLogMax;

	public static ConfigEntry<float> motionBlurShutterAngle;

	public static ConfigEntry<int> motionBlurSampleCount;

	public static ConfigEntry<float> motionBlurFrameBlending;

	public static ConfigEntry<float> depthOfFieldFocusDistance;

	public static ConfigEntry<float> depthOfFieldAperture;

	public static ConfigEntry<float> depthOfFieldFocalLength;

	public static ConfigEntry<bool> depthOfFieldUseCameraFov;

	public static ConfigEntry<KernelSize> depthOfFieldKernelSize;

	public static ConfigEntry<Tonemapper> colorGradingTonemapper;

	public static ConfigEntry<Vector3> colorGradingChannelMixerRed;

	public static ConfigEntry<Vector3> colorGradingChannelMixerGreen;

	public static ConfigEntry<Vector3> colorGradingChannelMixerBlue;

	public static ConfigEntry<int> colorGradingChannelMixerCurrentEditingChannel;

	public static ConfigEntry<float> colorGradingNeutralBlackIn;

	public static ConfigEntry<float> colorGradingNeutralWhiteIn;

	public static ConfigEntry<float> colorGradingNeutralBlackOut;

	public static ConfigEntry<float> colorGradingNeutralWhiteOut;

	public static ConfigEntry<float> colorGradingNeutralWhiteLevel;

	public static ConfigEntry<float> colorGradingNeutralWhiteClip;

	public static ConfigEntry<float> colorGradingPostExposure;

	public static ConfigEntry<float> colorGradingTemperature;

	public static ConfigEntry<float> colorGradingTint;

	public static ConfigEntry<float> colorGradingHueShift;

	public static ConfigEntry<float> colorGradingSaturation;

	public static ConfigEntry<float> colorGradingContrast;

	public static ConfigEntry<Method> AAMethod;

	public static ConfigEntry<FxaaPreset> AAFxaaPreset;

	public static ConfigEntry<float> AAJitterSpread;

	public static ConfigEntry<float> AASharpen;

	public static ConfigEntry<float> AAStationaryBlending;

	public static ConfigEntry<float> AAMotionBlending;

	public static ConfigEntry<float> AOIntensity;

	public static ConfigEntry<float> AOIntensityFar;

	public static ConfigEntry<float> AOFarDistance;

	public static ConfigEntry<float> AORadius;

	public static ConfigEntry<SampleCount> AOSampleCount;

	public static ConfigEntry<bool> AODownsampling;

	public static ConfigEntry<bool> AOForceForwardCompatibility;

	public static ConfigEntry<bool> AOAmbientOnly;

	public static ConfigEntry<bool> AOHighPrecision;

	public static ConfigEntry<float> CAIntensity;

	public static ConfigEntry<SSRReflectionBlendType> SSRBlendType;

	public static ConfigEntry<SSRResolution> SSRReflectionQuality;

	public static ConfigEntry<float> SSRMaxDistance;

	public static ConfigEntry<int> SSRIteractionCount;

	public static ConfigEntry<int> SSRStepSize;

	public static ConfigEntry<float> SSRWidthModifier;

	public static ConfigEntry<float> SSRReflectionBlur;

	public static ConfigEntry<bool> SSRReflectBackFaces;

	public static ConfigEntry<float> SSRReflectionMultiplier;

	public static ConfigEntry<float> SSRFadeDistance;

	public static ConfigEntry<float> SSRFresnelFade;

	public static ConfigEntry<float> SSRFresnelFadePower;

	public static ConfigEntry<float> SSRMaskIntensity;

	public static void Dbgl(string str = "", bool pref = true)
	{
		if (isDebug)
		{
			Debug.Log((object)((pref ? (typeof(BepInExPlugin).Namespace + " ") : "") + str));
		}
	}

	private void Awake()
	{
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Unknown result type (might be due to invalid IL or missing references)
		//IL_069d: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		context = this;
		modEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("_General", "Enabled", true, "Enable this mod");
		hotKey = ((BaseUnityPlugin)this).Config.Bind<string>("_Options", "HotKey", "[0]", "Key to toggle mod");
		nexusID = ((BaseUnityPlugin)this).Config.Bind<int>("General", "NexusID", 1587, "Nexus mod ID for updates");
		customVignette = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customVignette", false, "customVignette");
		customBloom = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customBloom", false, "customBloom");
		customEyeAdapt = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customEyeAdapt", false, "customEyeAdapt");
		customMotionBlur = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customMotionBlur", false, "customMotionBlur");
		customColorGrading = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customColorGrading", false, "customColorGrading");
		customDepthOfField = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customDepthOfField", false, "customDepthOfField");
		customAA = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customAA", false, "customAA");
		customAO = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customAO", false, "customAO");
		customCA = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customCA", false, "customCA");
		customSSR = ((BaseUnityPlugin)this).Config.Bind<bool>("_Settings", "customSSR", false, "customSSR");
		vignetteColor = ((BaseUnityPlugin)this).Config.Bind<Color>("VignetteSettings", "vignetteColor", new Color(0f, 0f, 0f, 1f), "vignetteColor");
		vignetteOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("VignetteSettings", "vignetteOpacity", 1f, "vignetteOpacity");
		vignetteIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("VignetteSettings", "vignetteIntensity", 0.45f, "vignetteIntensity");
		vignetteCenter = ((BaseUnityPlugin)this).Config.Bind<Vector2>("VignetteSettings", "vignetteCenter", new Vector2(0.5f, 0.5f), "vignetteCenter");
		vignetteSmoothness = ((BaseUnityPlugin)this).Config.Bind<float>("VignetteSettings", "vignetteSmoothness", 0.2f, "vignetteSmoothness");
		vignetteRoundness = ((BaseUnityPlugin)this).Config.Bind<float>("VignetteSettings", "vignetteRoundness", 1f, "vignetteRoundness");
		vignetteRounded = ((BaseUnityPlugin)this).Config.Bind<bool>("VignetteSettings", "vignetteRounded", false, "vignetteRounded");
		bloomIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("BloomSettings", "bloomIntensity", 0.3f, "bloomIntensity");
		bloomThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("BloomSettings", "bloomThreshold", 0.7f, "bloomThreshold");
		bloomSoftKnee = ((BaseUnityPlugin)this).Config.Bind<float>("BloomSettings", "bloomSoftKnee", 0.7f, "bloomSoftKnee");
		bloomRadius = ((BaseUnityPlugin)this).Config.Bind<float>("BloomSettings", "bloomRadius", 5f, "bloomRadius");
		bloomAntiFlicker = ((BaseUnityPlugin)this).Config.Bind<bool>("BloomSettings", "bloomAntiFlicker", true, "bloomAntiFlicker");
		bloomLensDirtIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("BloomSettings", "bloomLensDirtIntensity", 10.4f, "bloomLensDirtIntensity");
		eyeAdaptLowPercent = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptLowPercent", 12.2743f, "eyeAdaptLowPercent");
		eyeAdaptHighPercent = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptHighPercent", 87.7257f, "eyeAdaptHighPercent");
		eyeAdaptMinLuminance = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptMinLuminance", -4f, "eyeAdaptMinLuminance");
		eyeAdaptMaxLuminance = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptMaxLuminance", -1f, "eyeAdaptMaxLuminance");
		eyeAdaptKeyValue = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptKeyValue", 0.14f, "eyeAdaptKeyValue");
		eyeAdaptDynamicKeyValue = ((BaseUnityPlugin)this).Config.Bind<bool>("EyeAdaptSettings", "eyeAdaptDynamicKeyValue", false, "eyeAdaptDynamicKeyValue");
		eyeAdaptAdaptationType = ((BaseUnityPlugin)this).Config.Bind<EyeAdaptationType>("EyeAdaptSettings", "eyeAdaptAdaptationType", (EyeAdaptationType)1, "eyeAdaptAdaptationType");
		eyeAdaptSpeedUp = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptSpeedUp", 4f, "eyeAdaptSpeedUp");
		eyeAdaptSpeedDown = ((BaseUnityPlugin)this).Config.Bind<float>("EyeAdaptSettings", "eyeAdaptSpeedDown", 4f, "eyeAdaptSpeedDown");
		eyeAdaptLogMin = ((BaseUnityPlugin)this).Config.Bind<int>("EyeAdaptSettings", "eyeAdaptLogMin", -8, "eyeAdaptLogMin");
		eyeAdaptLogMax = ((BaseUnityPlugin)this).Config.Bind<int>("EyeAdaptSettings", "eyeAdaptLogMax", 4, "eyeAdaptLogMax");
		motionBlurShutterAngle = ((BaseUnityPlugin)this).Config.Bind<float>("MotionBlurSettings", "motionBlurShutterAngle", 150f, "motionBlurShutterAngle");
		motionBlurSampleCount = ((BaseUnityPlugin)this).Config.Bind<int>("MotionBlurSettings", "motionBlurSampleCount", 10, "motionBlurSampleCount");
		motionBlurFrameBlending = ((BaseUnityPlugin)this).Config.Bind<float>("MotionBlurSettings", "motionBlurFrameBlending", 0f, "motionBlurFrameBlending");
		depthOfFieldFocusDistance = ((BaseUnityPlugin)this).Config.Bind<float>("DOFSettings", "depthOfFieldFocusDistance", 35.96f, "depthOfFieldFocusDistance");
		depthOfFieldAperture = ((BaseUnityPlugin)this).Config.Bind<float>("DOFSettings", "depthOfFieldAperture", 1f, "depthOfFieldAperture");
		depthOfFieldFocalLength = ((BaseUnityPlugin)this).Config.Bind<float>("DOFSettings", "depthOfFieldFocalLength", 70f, "depthOfFieldFocalLength");
		depthOfFieldUseCameraFov = ((BaseUnityPlugin)this).Config.Bind<bool>("DOFSettings", "depthOfFieldUseCameraFov", false, "depthOfFieldUseCameraFov");
		depthOfFieldKernelSize = ((BaseUnityPlugin)this).Config.Bind<KernelSize>("DOFSettings", "depthOfFieldKernelSize", (KernelSize)1, "depthOfFieldKernelSize");
		colorGradingTonemapper = ((BaseUnityPlugin)this).Config.Bind<Tonemapper>("ColorGradingSettings", "colorGradingTonemapper", (Tonemapper)1, "colorGradingTonemapper");
		colorGradingChannelMixerRed = ((BaseUnityPlugin)this).Config.Bind<Vector3>("ColorGradingSettings", "colorGradingChannelMixerRed", new Vector3(1f, 0f, 0f), "colorGradingChannelMixerRed");
		colorGradingChannelMixerGreen = ((BaseUnityPlugin)this).Config.Bind<Vector3>("ColorGradingSettings", "colorGradingChannelMixerGreen", new Vector3(0f, 1f, 0f), "colorGradingChannelMixerGreen");
		colorGradingChannelMixerBlue = ((BaseUnityPlugin)this).Config.Bind<Vector3>("ColorGradingSettings", "colorGradingChannelMixerBlue", new Vector3(0f, 0f, 1f), "colorGradingChannelMixerBlue");
		colorGradingChannelMixerCurrentEditingChannel = ((BaseUnityPlugin)this).Config.Bind<int>("ColorGradingSettings", "colorGradingChannelMixerCurrentEditingChannel", 0, "colorGradingChannelMixerCurrentEditingChannel");
		colorGradingNeutralBlackIn = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralBlackIn", 0.02f, "colorGradingNeutralBlackIn");
		colorGradingNeutralWhiteIn = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralWhiteIn", 10f, "colorGradingNeutralWhiteIn");
		colorGradingNeutralBlackOut = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralBlackOut", 0f, "colorGradingNeutralBlackOut");
		colorGradingNeutralWhiteOut = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralWhiteOut", 10f, "colorGradingNeutralWhiteOut");
		colorGradingNeutralWhiteLevel = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralWhiteLevel", 5.3f, "colorGradingNeutralWhiteLevel");
		colorGradingNeutralWhiteClip = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingNeutralWhiteClip", 10f, "colorGradingNeutralWhiteClip");
		colorGradingPostExposure = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingPostExposure", 1f, "colorGradingPostExposure");
		colorGradingTemperature = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingTemperature", -8f, "colorGradingTemperature");
		colorGradingTint = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingTint", 0f, "colorGradingTint");
		colorGradingHueShift = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingHueShift", 0f, "colorGradingHueShift");
		colorGradingSaturation = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingSaturation", 1f, "colorGradingSaturation");
		colorGradingContrast = ((BaseUnityPlugin)this).Config.Bind<float>("ColorGradingSettings", "colorGradingContrast", 1.2f, "colorGradingContrast");
		AAMethod = ((BaseUnityPlugin)this).Config.Bind<Method>("AASettings", "AAMethod", (Method)0, "AAMethod");
		AAFxaaPreset = ((BaseUnityPlugin)this).Config.Bind<FxaaPreset>("AASettings", "AAFxaaPreset", (FxaaPreset)4, "AAFxaaPreset");
		AAJitterSpread = ((BaseUnityPlugin)this).Config.Bind<float>("AASettings", "AAJitterSpread", 0.2f, "AAJitterSpread");
		AASharpen = ((BaseUnityPlugin)this).Config.Bind<float>("AASettings", "AASharpen", 0.3f, "AASharpen");
		AAStationaryBlending = ((BaseUnityPlugin)this).Config.Bind<float>("AASettings", "AAStationaryBlending", 0.95f, "AAStationaryBlending");
		AAMotionBlending = ((BaseUnityPlugin)this).Config.Bind<float>("AASettings", "AAMotionBlending", 0.85f, "AAMotionBlending");
		AOIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("AOSettings", "AOIntensity", 1f, "AOIntensity");
		AOIntensityFar = ((BaseUnityPlugin)this).Config.Bind<float>("AOSettings", "AOIntensityFar", 1.5f, "AOIntensityFar");
		AOFarDistance = ((BaseUnityPlugin)this).Config.Bind<float>("AOSettings", "AOFarDistance", 150f, "AOFarDistance");
		AORadius = ((BaseUnityPlugin)this).Config.Bind<float>("AOSettings", "AORadius", 0.15f, "AORadius");
		AOSampleCount = ((BaseUnityPlugin)this).Config.Bind<SampleCount>("AOSettings", "AOSampleCount", (SampleCount)10, "AOSampleCount");
		AODownsampling = ((BaseUnityPlugin)this).Config.Bind<bool>("AOSettings", "AODownsampling", false, "AODownsampling");
		AOForceForwardCompatibility = ((BaseUnityPlugin)this).Config.Bind<bool>("AOSettings", "AOForceForwardCompatibility", false, "AOForceForwardCompatibility");
		AOAmbientOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("AOSettings", "AOAmbientOnly", false, "AOAmbientOnly");
		AOHighPrecision = ((BaseUnityPlugin)this).Config.Bind<bool>("AOSettings", "AOHighPrecision", false, "AOHighPrecision");
		CAIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("CASettings", "CAIntensity", 0.1f, "CAIntensity");
		SSRBlendType = ((BaseUnityPlugin)this).Config.Bind<SSRReflectionBlendType>("ReflectionSettings", "SSRBlendType", (SSRReflectionBlendType)0, "SSRBlendType");
		SSRReflectionQuality = ((BaseUnityPlugin)this).Config.Bind<SSRResolution>("ReflectionSettings", "SSRReflectionQuality", (SSRResolution)2, "SSRReflectionQuality");
		SSRMaxDistance = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRMaxDistance", 100f, "SSRMaxDistance");
		SSRIteractionCount = ((BaseUnityPlugin)this).Config.Bind<int>("ReflectionSettings", "SSRIteractionCount", 256, "SSRIteractionCount");
		SSRStepSize = ((BaseUnityPlugin)this).Config.Bind<int>("ReflectionSettings", "SSRStepSize", 3, "SSRStepSize");
		SSRWidthModifier = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRWidthModifier", 0.5f, "SSRWidthModifier");
		SSRReflectionBlur = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRReflectionBlur", 1f, "SSRReflectionBlur");
		SSRReflectBackFaces = ((BaseUnityPlugin)this).Config.Bind<bool>("ReflectionSettings", "SSRReflectBackFaces", true, "SSRReflectBackFaces");
		SSRReflectionMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRReflectionMultiplier", 0.93f, "SSRReflectionMultiplier");
		SSRFadeDistance = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRFadeDistance", 100f, "SSRFadeDistance");
		SSRFresnelFade = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRFresnelFade", 1f, "SSRFresnelFade");
		SSRFresnelFadePower = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRFresnelFadePower", 1f, "SSRFresnelFadePower");
		SSRMaskIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("ReflectionSettings", "SSRMaskIntensity", 0.03f, "SSRMaskIntensity");
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), MetadataHelper.GetMetadata((object)this).GUID);
	}

	private void Update()
	{
		if (AedenthornUtils.CheckKeyDown(hotKey.Value))
		{
			modEnabled.Value = !modEnabled.Value;
		}
	}
}