Decompiled source of GraphicsMod v0.9.2

Mods/GraphicsMod.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib.BoneMenu;
using GraphicsMod;
using Il2CppHorizonBasedAmbientOcclusion.Universal;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppMK.Glow.URP;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Mod), "GraphicsMod", "0.9.1", "You", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("GraphicsMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GraphicsMod")]
[assembly: AssemblyTitle("GraphicsMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 GraphicsMod
{
	public class Mod : MelonMod
	{
		private bool _enabled = true;

		private bool _aoOn = true;

		private bool _aoUltra;

		private float _bloom = 0.5f;

		private float _sharpen = 0.5f;

		private float _vivid = 0.5f;

		private float _volumetric;

		private bool _ultraShadows;

		private bool _superRes;

		private bool _msaa8x;

		private bool _ssr;

		private bool _aces;

		private bool _sharpTextures;

		private bool _rtProbe;

		private bool _fakeDlss;

		private ReflectionProbe _probe;

		private float _probeTimer;

		private float _probeInterval = 2.5f;

		private GameObject _go;

		private Volume _volume;

		private VolumeProfile _profile;

		private HBAO _hbao;

		private MKGlow _glow;

		private ColorAdjustments _color;

		private Vignette _vignette;

		private Tonemapping _tonemap;

		private ChromaticAberration _chroma;

		private FilmGrain _grain;

		private Volumetrics _volumetrics;

		private readonly Dictionary<int, (float bias, int aniso)> _texOriginals = new Dictionary<int, (float, int)>();

		private float _origLodBias = float.NaN;

		private AnisotropicFiltering _origAniso;

		private BoolElement _enabledEl;

		private BoolElement _aoOnEl;

		private BoolElement _aoUltraEl;

		private BoolElement _ultraShadowsEl;

		private BoolElement _superResEl;

		private BoolElement _msaa8xEl;

		private BoolElement _ssrEl;

		private BoolElement _acesEl;

		private BoolElement _sharpTexEl;

		private BoolElement _rtProbeEl;

		private FloatElement _bloomEl;

		private FloatElement _sharpenEl;

		private FloatElement _vividEl;

		public override void OnInitializeMelon()
		{
			BuildVolume();
			BuildMenu();
			Apply();
			((MelonBase)this).LoggerInstance.Msg("GraphicsMod loaded. Open BoneMenu > Graphics to adjust.");
		}

		public override void OnSceneWasInitialized(int buildIndex, string sceneName)
		{
			if (_enabled && _sharpTextures)
			{
				ApplyTextureSharpness();
			}
			ApplyRealisticLights();
			FixVolumeLayer();
		}

		private void FixVolumeLayer()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_go == (Object)null)
			{
				return;
			}
			try
			{
				UniversalAdditionalCameraData val = (((Object)(object)Camera.main != (Object)null) ? CameraExtensions.GetUniversalAdditionalCameraData(Camera.main) : null);
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				LayerMask volumeLayerMask = val.volumeLayerMask;
				int value = ((LayerMask)(ref volumeLayerMask)).value;
				if ((value & (1 << _go.layer)) != 0)
				{
					return;
				}
				for (int i = 0; i < 32; i++)
				{
					if ((value & (1 << i)) != 0)
					{
						_go.layer = i;
						break;
					}
				}
				((MelonBase)this).LoggerInstance.Msg($"GraphicsMod: moved volume to layer {_go.layer} to match this level's camera.");
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not fix the volume's layer: " + ex.Message);
			}
		}

		public override void OnUpdate()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_probe == (Object)null) && ((Component)_probe).gameObject.activeSelf)
			{
				Camera main = Camera.main;
				if ((Object)(object)main != (Object)null)
				{
					((Component)_probe).transform.position = ((Component)main).transform.position;
				}
				_probeTimer -= Time.deltaTime;
				if (_probeTimer <= 0f)
				{
					_probeTimer = _probeInterval;
					_probe.RenderProbe();
				}
			}
		}

		private void ApplyRtProbe()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			bool flag = _enabled && _rtProbe;
			if (flag && (Object)(object)_probe == (Object)null)
			{
				try
				{
					GameObject val = new GameObject("GraphicsMod ReflectionProbe");
					Object.DontDestroyOnLoad((Object)(object)val);
					_probe = val.AddComponent<ReflectionProbe>();
					_probe.mode = (ReflectionProbeMode)1;
					_probe.refreshMode = (ReflectionProbeRefreshMode)2;
					_probe.timeSlicingMode = (ReflectionProbeTimeSlicingMode)1;
					_probe.resolution = 512;
					_probe.size = new Vector3(60f, 60f, 60f);
					_probe.intensity = 1.1f;
					_probe.boxProjection = false;
					_probe.hdr = true;
					_probeTimer = 0f;
					((MelonBase)this).LoggerInstance.Msg("Real-time reflection probe created.");
				}
				catch (Exception ex)
				{
					((MelonBase)this).LoggerInstance.Warning("Could not create the reflection probe: " + ex.Message);
				}
			}
			if ((Object)(object)_probe != (Object)null)
			{
				((Component)_probe).gameObject.SetActive(flag);
			}
		}

		private T Add<T>() where T : VolumeComponent
		{
			try
			{
				T val = ((Il2CppObjectBase)_profile.Add(Il2CppType.Of<T>(), false)).Cast<T>();
				((VolumeComponent)val).active = true;
				return val;
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("No " + typeof(T).Name + " effect available: " + ex.Message);
				return default(T);
			}
		}

		private void BuildVolume()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0043: 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)
			try
			{
				_go = new GameObject("GraphicsMod Volume");
				Object.DontDestroyOnLoad((Object)(object)_go);
				UniversalAdditionalCameraData val = (((Object)(object)Camera.main != (Object)null) ? CameraExtensions.GetUniversalAdditionalCameraData(Camera.main) : null);
				if ((Object)(object)val != (Object)null)
				{
					LayerMask volumeLayerMask = val.volumeLayerMask;
					int value = ((LayerMask)(ref volumeLayerMask)).value;
					for (int i = 0; i < 32; i++)
					{
						if ((value & (1 << i)) != 0)
						{
							_go.layer = i;
							break;
						}
					}
					((MelonBase)this).LoggerInstance.Msg($"GraphicsMod: volume placed on layer {_go.layer} (camera's volumeLayerMask = {value}).");
				}
				else
				{
					((MelonBase)this).LoggerInstance.Warning("GraphicsMod: no main camera / UniversalAdditionalCameraData found yet; volume left on the default layer, which may not be scanned.");
				}
				_volume = _go.AddComponent<Volume>();
				_volume.isGlobal = true;
				_volume.priority = 100f;
				_volume.weight = 1f;
				_profile = ScriptableObject.CreateInstance<VolumeProfile>();
				_hbao = Add<HBAO>();
				_glow = Add<MKGlow>();
				_color = Add<ColorAdjustments>();
				_vignette = Add<Vignette>();
				_tonemap = Add<Tonemapping>();
				_chroma = Add<ChromaticAberration>();
				_grain = Add<FilmGrain>();
				_volumetrics = Add<Volumetrics>();
				_volume.sharedProfile = _profile;
				((MelonBase)this).LoggerInstance.Msg($"GraphicsMod: volume ready ({_profile.components.Count} effects).");
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not build the graphics volume: " + ex.Message);
			}
		}

		private void Apply()
		{
			ApplyAo();
			ApplyBloom();
			ApplySharpen();
			ApplyVivid();
			ApplyPipeline();
			ApplyTonemap();
			ApplyTextureSharpness();
			ApplyRtProbe();
			ApplyRealisticLights();
			ApplyVolumetric();
		}

		private void ApplyRealisticLights()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			try
			{
				bool flag = _enabled && _ultraShadows;
				foreach (Light item in Object.FindObjectsOfType<Light>())
				{
					if ((Object)(object)item == (Object)null)
					{
						continue;
					}
					if (!flag)
					{
						if ((int)item.shadows == 1)
						{
							item.shadows = (LightShadows)2;
						}
					}
					else
					{
						item.shadows = (LightShadows)2;
						item.shadowStrength = 1f;
						item.shadowBias = 0.02f;
						item.shadowNormalBias = 0.4f;
						item.shadowNearPlane = 0.05f;
					}
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not tune light shadows: " + ex.Message);
			}
		}

		private UniversalRenderPipelineAsset GetAsset()
		{
			RenderPipelineAsset currentRenderPipeline = GraphicsSettings.currentRenderPipeline;
			return (UniversalRenderPipelineAsset)(object)((currentRenderPipeline is UniversalRenderPipelineAsset) ? currentRenderPipeline : null);
		}

		private void ApplyAo()
		{
			if ((Object)(object)_hbao == (Object)null)
			{
				return;
			}
			if (!_enabled || !_aoOn)
			{
				((VolumeParameter)_hbao.intensity).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.intensity).value = 0f;
				return;
			}
			((VolumeParameter)_hbao.mode).overrideState = true;
			((VolumeParameter<Mode>)(object)_hbao.mode).value = (Mode)1;
			((VolumeParameter)_hbao.perPixelNormals).overrideState = true;
			((VolumeParameter<PerPixelNormals>)(object)_hbao.perPixelNormals).value = (PerPixelNormals)2;
			((VolumeParameter)_hbao.noiseType).overrideState = true;
			((VolumeParameter<NoiseType>)(object)_hbao.noiseType).value = (NoiseType)1;
			((VolumeParameter)_hbao.bias).overrideState = true;
			((VolumeParameter<float>)(object)_hbao.bias).value = 0.172f;
			((VolumeParameter)_hbao.quality).overrideState = true;
			((VolumeParameter<Quality>)(object)_hbao.quality).value = (Quality)4;
			((VolumeParameter)_hbao.resolution).overrideState = true;
			((VolumeParameter<Resolution>)(object)_hbao.resolution).value = (Resolution)0;
			((VolumeParameter)_hbao.blurType).overrideState = true;
			((VolumeParameter)_hbao.useMultiBounce).overrideState = true;
			((VolumeParameter<bool>)(object)_hbao.useMultiBounce).value = true;
			((VolumeParameter)_hbao.colorBleedingEnabled).overrideState = true;
			if (_aoUltra)
			{
				((VolumeParameter)_hbao.intensity).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.intensity).value = 2.2f;
				((VolumeParameter)_hbao.radius).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.radius).value = 0.45f;
				((VolumeParameter<BlurType>)(object)_hbao.blurType).value = (BlurType)2;
				((VolumeParameter<bool>)(object)_hbao.colorBleedingEnabled).value = true;
				((VolumeParameter)_hbao.saturation).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.saturation).value = 1.6f;
			}
			else
			{
				((VolumeParameter)_hbao.intensity).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.intensity).value = 2.1f;
				((VolumeParameter)_hbao.radius).overrideState = true;
				((VolumeParameter<float>)(object)_hbao.radius).value = 0.35f;
				((VolumeParameter<BlurType>)(object)_hbao.blurType).value = (BlurType)1;
				((VolumeParameter<bool>)(object)_hbao.colorBleedingEnabled).value = false;
			}
		}

		private void ApplyBloom()
		{
			if (!((Object)(object)_glow == (Object)null))
			{
				if (!_enabled || _bloom <= 0.001f)
				{
					((VolumeParameter)_glow.bloomIntensity).overrideState = true;
					((VolumeParameter<float>)(object)_glow.bloomIntensity).value = 0f;
					return;
				}
				((VolumeParameter)_glow.bloomIntensity).overrideState = true;
				((VolumeParameter<float>)(object)_glow.bloomIntensity).value = Mathf.Lerp(0.5f, 5f, _bloom);
				((VolumeParameter)_glow.bloomScattering).overrideState = true;
				((VolumeParameter<float>)(object)_glow.bloomScattering).value = Mathf.Lerp(4f, 8f, _bloom);
			}
		}

		private void ApplySharpen()
		{
			try
			{
				UniversalRenderPipelineAsset asset = GetAsset();
				if ((Object)(object)asset == (Object)null)
				{
					((MelonBase)this).LoggerInstance.Warning("No active UniversalRenderPipelineAsset found for sharpening.");
				}
				else if (_enabled && _sharpen > 0.01f)
				{
					asset.m_UpscalingFilter = (UpscalingFilterSelection)3;
					asset.m_FsrOverrideSharpness = true;
					asset.m_FsrSharpness = _sharpen;
				}
				else
				{
					asset.m_FsrOverrideSharpness = false;
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not set sharpening: " + ex.Message);
			}
		}

		private void ApplyPipeline()
		{
			try
			{
				UniversalRenderPipelineAsset asset = GetAsset();
				if (!((Object)(object)asset == (Object)null))
				{
					if (_enabled && _ultraShadows)
					{
						asset.shadowDistance = 500f;
						asset.m_ShadowCascadeCount = 4;
						asset.m_CascadeBorder = 0.05f;
						asset.m_MainLightShadowmapResolution = (ShadowResolution)4096;
						asset.m_AdditionalLightsShadowmapResolution = (ShadowResolution)4096;
						asset.m_AdditionalLightsPerObjectLimit = 8;
						asset.m_SoftShadowsSupported = true;
					}
					if (_enabled && _fakeDlss)
					{
						asset.renderScale = 0.67f;
						asset.m_UpscalingFilter = (UpscalingFilterSelection)3;
						asset.m_FsrOverrideSharpness = true;
						asset.m_FsrSharpness = 0.9f;
					}
					else
					{
						asset.renderScale = ((_enabled && _superRes) ? 2f : 1f);
					}
					if (_enabled && _ultraShadows)
					{
						QualitySettings.pixelLightCount = 32;
						QualitySettings.shadowDistance = 500f;
						QualitySettings.vSyncCount = 0;
					}
					asset.msaaSampleCount = ((!_enabled || !_msaa8x) ? 1 : 8);
					if (_enabled && _ssr)
					{
						asset.m_EnableSSR = true;
						asset.m_MaxSsrSteps = 96;
						asset.m_SsrMinMip = 0;
						asset.m_SsrHitRadius = 0.015f;
					}
					else
					{
						asset.m_EnableSSR = false;
					}
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not apply the experimental pipeline settings: " + ex.Message);
			}
		}

		private void ApplyTonemap()
		{
			if (!((Object)(object)_tonemap == (Object)null))
			{
				bool flag = _enabled && _aces;
				((VolumeParameter)_tonemap.mode).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<TonemappingMode>)(object)_tonemap.mode).value = (TonemappingMode)2;
				}
				if ((Object)(object)_chroma != (Object)null)
				{
					((VolumeParameter)_chroma.intensity).overrideState = flag;
					((VolumeParameter<float>)(object)_chroma.intensity).value = 0.35f;
				}
				if ((Object)(object)_grain != (Object)null)
				{
					((VolumeParameter)_grain.intensity).overrideState = flag;
					((VolumeParameter<float>)(object)_grain.intensity).value = 0.3f;
					((VolumeParameter)_grain.response).overrideState = flag;
					((VolumeParameter<float>)(object)_grain.response).value = 0.8f;
				}
			}
		}

		private void ApplyTextureSharpness()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (float.IsNaN(_origLodBias))
				{
					_origLodBias = QualitySettings.lodBias;
					_origAniso = QualitySettings.anisotropicFiltering;
				}
				if (!_enabled || !_sharpTextures)
				{
					RestoreTextures();
					QualitySettings.lodBias = _origLodBias;
					QualitySettings.anisotropicFiltering = _origAniso;
					return;
				}
				QualitySettings.lodBias = 4.5f;
				QualitySettings.anisotropicFiltering = (AnisotropicFiltering)2;
				int num = 0;
				foreach (Texture2D item in Resources.FindObjectsOfTypeAll<Texture2D>())
				{
					if ((Object)(object)item == (Object)null || ((Texture)item).mipmapCount <= 1)
					{
						continue;
					}
					string name = ((Object)item).name;
					if (!string.IsNullOrEmpty(name) && name.IndexOf("Lightmap", StringComparison.OrdinalIgnoreCase) < 0)
					{
						int instanceID = ((Object)item).GetInstanceID();
						if (!_texOriginals.ContainsKey(instanceID))
						{
							_texOriginals[instanceID] = (((Texture)item).mipMapBias, ((Texture)item).anisoLevel);
						}
						((Texture)item).mipMapBias = -0.6f;
						((Texture)item).anisoLevel = 16;
						num++;
					}
				}
				((MelonBase)this).LoggerInstance.Msg($"Sharp Textures: adjusted {num} loaded textures.");
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not sharpen textures: " + ex.Message);
			}
		}

		private void RestoreTextures()
		{
			try
			{
				foreach (Texture2D item in Resources.FindObjectsOfTypeAll<Texture2D>())
				{
					if (!((Object)(object)item == (Object)null) && _texOriginals.TryGetValue(((Object)item).GetInstanceID(), out (float, int) value))
					{
						((Texture)item).mipMapBias = value.Item1;
						((Texture)item).anisoLevel = value.Item2;
					}
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Warning("Could not restore textures: " + ex.Message);
			}
			_texOriginals.Clear();
		}

		private void ApplyVivid()
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_color == (Object)null))
			{
				float num = (_enabled ? _vivid : 0f);
				((VolumeParameter)_color.contrast).overrideState = true;
				((VolumeParameter<float>)(object)_color.contrast).value = Mathf.Lerp(0f, 18f, num);
				((VolumeParameter)_color.saturation).overrideState = true;
				((VolumeParameter<float>)(object)_color.saturation).value = Mathf.Lerp(0f, 20f, num);
				if ((Object)(object)_vignette != (Object)null)
				{
					((VolumeParameter)_vignette.intensity).overrideState = true;
					((VolumeParameter<float>)(object)_vignette.intensity).value = Mathf.Lerp(0f, 0.22f, num);
					((VolumeParameter)_vignette.smoothness).overrideState = true;
					((VolumeParameter<float>)(object)_vignette.smoothness).value = 0.6f;
					((VolumeParameter)_vignette.color).overrideState = true;
					((VolumeParameter<Color>)(object)_vignette.color).value = Color.black;
				}
			}
		}

		private void ApplyVolumetric()
		{
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_volumetrics == (Object)null))
			{
				float num = (_enabled ? _volumetric : 0f);
				bool flag = num > 0.01f;
				((VolumeParameter)_volumetrics.FogViewDistance).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<float>)(object)_volumetrics.FogViewDistance).value = Mathf.Lerp(20f, 300f, num);
				}
				((VolumeParameter)_volumetrics.GlobalStaticLightMultiplier).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<float>)(object)_volumetrics.GlobalStaticLightMultiplier).value = Mathf.Lerp(1f, 1.5f, num);
				}
				((VolumeParameter)_volumetrics.FogBaseHeight).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<float>)(object)_volumetrics.FogBaseHeight).value = -10000f;
				}
				((VolumeParameter)_volumetrics.FogMaxHeight).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<float>)(object)_volumetrics.FogMaxHeight).value = 10000f;
				}
				((VolumeParameter)_volumetrics.VolumetricAlbedo).overrideState = flag;
				if (flag)
				{
					((VolumeParameter<Color>)(object)_volumetrics.VolumetricAlbedo).value = Color.white;
				}
			}
		}

		private void BuildMenu()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_00cd: 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)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: 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_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: 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_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			Page val = Page.Root.CreatePage("Graphics", Color.cyan, 0, true);
			_enabledEl = val.CreateBool("Enabled", Color.cyan, _enabled, (Action<bool>)delegate(bool v)
			{
				_enabled = v;
				Apply();
			});
			_aoOnEl = val.CreateBool("Ambient Occlusion", Color.white, _aoOn, (Action<bool>)delegate(bool v)
			{
				_aoOn = v;
				ApplyAo();
			});
			_aoUltraEl = val.CreateBool("AO: Ultra (GI)", Color.white, _aoUltra, (Action<bool>)delegate(bool v)
			{
				_aoUltra = v;
				ApplyAo();
			});
			_bloomEl = val.CreateFloat("Bloom", Color.yellow, _bloom, 0.1f, 0f, 1f, (Action<float>)delegate(float v)
			{
				_bloom = v;
				ApplyBloom();
			});
			_sharpenEl = val.CreateFloat("Sharpen", Color.green, _sharpen, 0.1f, 0f, 1f, (Action<float>)delegate(float v)
			{
				_sharpen = v;
				ApplySharpen();
			});
			_vividEl = val.CreateFloat("Vivid Colors", Color.magenta, _vivid, 0.1f, 0f, 1f, (Action<float>)delegate(float v)
			{
				_vivid = v;
				ApplyVivid();
			});
			val.CreateFloat("Volumetric Fog / God Rays", Color.blue, _volumetric, 0.1f, 0f, 1f, (Action<float>)delegate(float v)
			{
				_volumetric = v;
				ApplyVolumetric();
			});
			Page val2 = val.CreatePage("Experimental (heavy)", Color.red, 0, true);
			_ultraShadowsEl = val2.CreateBool("Ultra Shadows", Color.white, _ultraShadows, (Action<bool>)delegate(bool v)
			{
				_ultraShadows = v;
				ApplyPipeline();
			});
			_superResEl = val2.CreateBool("Supersampling 2x", Color.white, _superRes, (Action<bool>)delegate(bool v)
			{
				_superRes = v;
				ApplyPipeline();
			});
			_msaa8xEl = val2.CreateBool("MSAA 8x", Color.white, _msaa8x, (Action<bool>)delegate(bool v)
			{
				_msaa8x = v;
				ApplyPipeline();
			});
			_ssrEl = val2.CreateBool("Screen-Space Reflections", Color.white, _ssr, (Action<bool>)delegate(bool v)
			{
				_ssr = v;
				ApplyPipeline();
			});
			_acesEl = val2.CreateBool("ACES Tonemapping", Color.white, _aces, (Action<bool>)delegate(bool v)
			{
				_aces = v;
				ApplyTonemap();
			});
			_sharpTexEl = val2.CreateBool("Sharp Textures (all loaded)", Color.white, _sharpTextures, (Action<bool>)delegate(bool v)
			{
				_sharpTextures = v;
				ApplyTextureSharpness();
			});
			_rtProbeEl = val2.CreateBool("Realtime Reflection Probe", Color.white, _rtProbe, (Action<bool>)delegate(bool v)
			{
				_rtProbe = v;
				ApplyRtProbe();
			});
			val2.CreateBool("Fake DLSS (FSR upscale)", Color.white, _fakeDlss, (Action<bool>)delegate(bool v)
			{
				_fakeDlss = v;
				ApplyPipeline();
			});
			val2.CreateFunction("MAX EVERYTHING (4060 killer)", Color.red, (Action)MaxEverything);
		}

		private void MaxEverything()
		{
			_enabled = true;
			_aoOn = true;
			_aoUltra = true;
			_bloom = 1f;
			_sharpen = 1f;
			_vivid = 1f;
			_ultraShadows = true;
			_superRes = true;
			_msaa8x = true;
			_ssr = true;
			_aces = true;
			_sharpTextures = true;
			_rtProbe = true;
			_probeInterval = 0.5f;
			_volumetric = 1f;
			Apply();
			if (_enabledEl != null)
			{
				_enabledEl.Value = true;
			}
			if (_aoOnEl != null)
			{
				_aoOnEl.Value = true;
			}
			if (_aoUltraEl != null)
			{
				_aoUltraEl.Value = true;
			}
			if (_bloomEl != null)
			{
				_bloomEl.Value = 1f;
			}
			if (_sharpenEl != null)
			{
				_sharpenEl.Value = 1f;
			}
			if (_vividEl != null)
			{
				_vividEl.Value = 1f;
			}
			if (_ultraShadowsEl != null)
			{
				_ultraShadowsEl.Value = true;
			}
			if (_superResEl != null)
			{
				_superResEl.Value = true;
			}
			if (_msaa8xEl != null)
			{
				_msaa8xEl.Value = true;
			}
			if (_ssrEl != null)
			{
				_ssrEl.Value = true;
			}
			if (_acesEl != null)
			{
				_acesEl.Value = true;
			}
			if (_sharpTexEl != null)
			{
				_sharpTexEl.Value = true;
			}
			if (_rtProbeEl != null)
			{
				_rtProbeEl.Value = true;
			}
			((MelonBase)this).LoggerInstance.Msg("MAX EVERYTHING applied. Good luck.");
		}
	}
}