Decompiled source of VerdantFallsPP v1.0.0

VerdantFallsPP.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("VerdantFallsPP")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VerdantFallsPP")]
[assembly: AssemblyTitle("VerdantFallsPP")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 VerdantFallsPP
{
	[BepInPlugin("com.Nuxlar.VerdantFallsPP", "VerdantFallsPP", "1.0.0")]
	public class VerdantFallsPP : BaseUnityPlugin
	{
		public void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			SceneDirector.Start += new hook_Start(ChangePP);
		}

		private void ChangePP(orig_Start orig, SceneDirector self)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "lakes")
			{
				GameObject obj = GameObject.Find("Weather, Lakes");
				((Component)obj.transform.GetChild(1)).GetComponent<Light>().intensity = 1f;
				PostProcessProfile profile = ((Component)obj.transform.GetChild(2)).GetComponent<PostProcessVolume>().profile;
				((ParameterOverride<float>)(object)profile.GetSetting<RampFog>().fogIntensity).value = 0.65f;
				RemoveEffectByName(profile, "DepthOfField");
			}
		}

		private void RemoveEffectByName(PostProcessProfile profile, string effectTypeName)
		{
			List<PostProcessEffectSettings> settings = profile.settings;
			for (int num = settings.Count - 1; num >= 0; num--)
			{
				if (((object)settings[num]).GetType().Name == effectTypeName)
				{
					profile.RemoveSettings(((object)settings[num]).GetType());
					Debug.Log((object)(effectTypeName + " removed from the Post Process Profile."));
					return;
				}
			}
			Debug.LogWarning((object)(effectTypeName + " not found in the Post Process Profile."));
		}
	}
}