Decompiled source of Everbloom v1.1.4

Everbloom.dll

Decompiled 4 days 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 BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Everbloom")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.4.0")]
[assembly: AssemblyInformationalVersion("1.1.4")]
[assembly: AssemblyProduct("Everbloom")]
[assembly: AssemblyTitle("Everbloom")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.4.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Everbloom
{
	[BepInPlugin("org.faemountain.eternalfrost", "Everbloom", "1.1.4")]
	public sealed class EverbloomPlugin : BaseUnityPlugin
	{
		private enum SeasonTab
		{
			Winter,
			Summer,
			Underwater,
			Japan
		}

		private struct SnowParticle
		{
			public float X;

			public float Y;

			public float Speed;

			public float Drift;

			public float Size;

			public float Phase;
		}

		private struct SandParticle
		{
			public float X;

			public float Y;

			public float Speed;

			public float Drift;

			public float Height;

			public float Length;

			public float Opacity;

			public float Tone;

			public float Phase;
		}

		private struct BubbleParticle
		{
			public float X;

			public float Y;

			public float Speed;

			public float Drift;

			public float Size;

			public float Phase;
		}

		private struct SakuraPetalParticle
		{
			public float X;

			public float Y;

			public float Speed;

			public float Drift;

			public float Size;

			public float Rotation;

			public float RotationSpeed;

			public float Phase;

			public float Tone;
		}

		private struct SakuraFireflyParticle
		{
			public float X;

			public float Y;

			public float Speed;

			public float Drift;

			public float Size;

			public float Phase;
		}

		public const string PluginGuid = "org.faemountain.eternalfrost";

		public const string PluginName = "Everbloom";

		public const string PluginVersion = "1.1.4";

		private ConfigEntry<bool> _enabled;

		private ConfigEntry<int> _snowflakeCount;

		private ConfigEntry<bool> _sandstormEnabled;

		private ConfigEntry<int> _sandParticleCount;

		private ConfigEntry<float> _sandWindSpeed;

		private ConfigEntry<float> _sandGrainSize;

		private ConfigEntry<float> _sandOpacity;

		private ConfigEntry<float> _blueTint;

		private ConfigEntry<bool> _coldFilterEnabled;

		private ConfigEntry<bool> _snowEnabled;

		private ConfigEntry<bool> _warmGlowEnabled;

		private ConfigEntry<bool> _yellowFilterEnabled;

		private ConfigEntry<float> _yellowFilterStrength;

		private ConfigEntry<bool> _redFilterEnabled;

		private ConfigEntry<float> _redFilterStrength;

		private ConfigEntry<bool> _vignetteEnabled;

		private ConfigEntry<float> _vignetteStrength;

		private ConfigEntry<float> _vignetteRadius;

		private ConfigEntry<int> _vignetteColor;

		private ConfigEntry<bool> _underwaterBlueFilterEnabled;

		private ConfigEntry<float> _underwaterBlueFilterStrength;

		private ConfigEntry<bool> _underwaterVignetteEnabled;

		private ConfigEntry<float> _underwaterVignetteStrength;

		private ConfigEntry<float> _underwaterVignetteRadius;

		private ConfigEntry<bool> _underwaterEffectEnabled;

		private ConfigEntry<float> _underwaterEffectStrength;

		private ConfigEntry<float> _underwaterEffectSpeed;

		private ConfigEntry<int> _underwaterBubbleCount;

		private ConfigEntry<float> _underwaterBubbleBlur;

		private ConfigEntry<bool> _underwaterPlayerLightEnabled;

		private ConfigEntry<float> _underwaterPlayerLightStrength;

		private ConfigEntry<float> _underwaterPlayerLightRadius;

		private ConfigEntry<bool> _sakuraFilterEnabled;

		private ConfigEntry<float> _sakuraFilterStrength;

		private ConfigEntry<bool> _sakuraPetalsEnabled;

		private ConfigEntry<int> _sakuraPetalCount;

		private ConfigEntry<float> _sakuraPetalSpeed;

		private ConfigEntry<float> _sakuraPetalSize;

		private ConfigEntry<float> _sakuraPetalOpacity;

		private ConfigEntry<bool> _sakuraVignetteEnabled;

		private ConfigEntry<float> _sakuraVignetteStrength;

		private ConfigEntry<float> _sakuraVignetteRadius;

		private ConfigEntry<bool> _sakuraFirefliesEnabled;

		private ConfigEntry<int> _sakuraFireflyCount;

		private ConfigEntry<float> _sakuraFireflyBrightness;

		private ConfigEntry<float> _sakuraFireflySpeed;

		private ConfigEntry<bool> _heatHazeEnabled;

		private ConfigEntry<float> _heatHazeStrength;

		private ConfigEntry<float> _heatHazeSpeed;

		private ConfigEntry<float> _heatHazeArea;

		private ConfigEntry<bool> _opticalDistortionEnabled;

		private ConfigEntry<float> _opticalDistortionStrength;

		private ConfigEntry<float> _opticalDistortionSpeed;

		private ConfigEntry<float> _opticalDistortionWaveSize;

		private ConfigEntry<float> _opticalDistortionArea;

		private ConfigEntry<float> _opticalDistortionQuality;

		private ConfigEntry<float> _warmGlowStrength;

		private ConfigEntry<float> _warmGlowRadius;

		private ConfigEntry<KeyboardShortcut> _toggleKey;

		private ConfigEntry<KeyboardShortcut> _menuKey;

		private Texture2D? _white;

		private Texture2D? _snowDot;

		private Texture2D? _sandStreak;

		private Texture2D? _warmGlow;

		private Texture2D? _vignetteTexture;

		private Texture2D? _underwaterVignetteTexture;

		private Texture2D? _underwaterPlayerLight;

		private Texture2D? _bubbleTexture;

		private Texture2D? _bubbleBlurTexture;

		private Texture2D? _sakuraPetalTexture;

		private Texture2D? _sakuraGlowTexture;

		private Texture2D? _sakuraVignetteTexture;

		private float _builtSakuraVignetteRadius = -1f;

		private Texture2D? _heatHazeTexture;

		private float _builtVignetteRadius = -1f;

		private float _builtUnderwaterVignetteRadius = -1f;

		private Texture2D? _uiPanelTexture;

		private Texture2D? _uiHeaderTexture;

		private Texture2D? _uiCardTexture;

		private Texture2D? _uiToolbarTexture;

		private Texture2D? _uiLineTexture;

		private Texture2D? _uiTabIdleTexture;

		private Texture2D? _uiWinterTabTexture;

		private Texture2D? _uiSummerTabTexture;

		private Texture2D? _uiUnderwaterTabTexture;

		private Texture2D? _uiJapanTabTexture;

		private Texture2D? _uiButtonTexture;

		private Texture2D? _uiButtonHoverTexture;

		private Texture2D? _uiButtonPressedTexture;

		private Texture2D? _uiToggleOnTexture;

		private Texture2D? _uiToggleHoverTexture;

		private Texture2D? _uiToggleOffTexture;

		private Texture2D[] _uiVignetteColorTextures = Array.Empty<Texture2D>();

		private GUIStyle[] _vignetteColorStyles = Array.Empty<GUIStyle>();

		private Texture2D? _uiSliderTrackTexture;

		private Texture2D? _uiSliderThumbTexture;

		private GUIStyle? _windowStyle;

		private GUIStyle? _headerStyle;

		private GUIStyle? _toolbarStyle;

		private GUIStyle? _cardStyle;

		private GUIStyle? _titleStyle;

		private GUIStyle? _eyebrowStyle;

		private GUIStyle? _logoStyle;

		private GUIStyle? _badgeStyle;

		private GUIStyle? _statusOnStyle;

		private GUIStyle? _statusOffStyle;

		private GUIStyle? _cardTitleStyle;

		private GUIStyle? _cardDescriptionStyle;

		private GUIStyle? _toggleOnStyle;

		private GUIStyle? _toggleOffStyle;

		private GUIStyle? _sliderStyle;

		private GUIStyle? _sliderThumbStyle;

		private GUIStyle? _sectionStyle;

		private GUIStyle? _sectionNumberStyle;

		private GUIStyle? _bodyStyle;

		private GUIStyle? _mutedStyle;

		private GUIStyle? _valueStyle;

		private GUIStyle? _buttonStyle;

		private GUIStyle? _smallButtonStyle;

		private GUIStyle? _masterButtonStyle;

		private GUIStyle? _footerStyle;

		private GUIStyle? _lineStyle;

		private GUIStyle? _tabStyle;

		private GUIStyle? _winterTabActiveStyle;

		private GUIStyle? _summerTabActiveStyle;

		private GUIStyle? _underwaterTabActiveStyle;

		private GUIStyle? _japanTabActiveStyle;

		private SeasonTab _activeTab;

		private bool _menuOpen;

		private bool _waitingForMenuKey;

		private bool _waitingForToggleKey;

		private bool _showHotkeys;

		private Vector2 _menuScroll;

		private Rect _menuRect;

		private int _menuScreenWidth;

		private int _menuScreenHeight;

		private SnowParticle[] _snow = Array.Empty<SnowParticle>();

		private SandParticle[] _sand = Array.Empty<SandParticle>();

		private BubbleParticle[] _bubbles = Array.Empty<BubbleParticle>();

		private SakuraPetalParticle[] _sakuraPetals = Array.Empty<SakuraPetalParticle>();

		private SakuraFireflyParticle[] _sakuraFireflies = Array.Empty<SakuraFireflyParticle>();

		private bool _manualEnabled = true;

		private Transform? _playerTransform;

		private float _nextPlayerLookupTime;

		private Vector2 _playerScreenPosition;

		private bool _hasPlayerScreenPosition;

		private Camera? _mainCamera;

		private Camera? _distortionCamera;

		private ScreenSpaceOpticalDistortion? _opticalDistortionRenderer;

		private bool _ownsOpticalDistortionRenderer;

		private float _nextDistortionCameraLookupTime;

		private void Awake()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Expected O, but got Unknown
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Expected O, but got Unknown
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Expected O, but got Unknown
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Expected O, but got Unknown
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Expected O, but got Unknown
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Expected O, but got Unknown
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Expected O, but got Unknown
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_0460: Expected O, but got Unknown
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Expected O, but got Unknown
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Expected O, but got Unknown
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Expected O, but got Unknown
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Expected O, but got Unknown
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Expected O, but got Unknown
			//IL_0602: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Expected O, but got Unknown
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: Expected O, but got Unknown
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0701: Expected O, but got Unknown
			//IL_0735: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Expected O, but got Unknown
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_077d: Expected O, but got Unknown
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Expected O, but got Unknown
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Expected O, but got Unknown
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0858: Expected O, but got Unknown
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Expected O, but got Unknown
			//IL_08e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08eb: Expected O, but got Unknown
			//IL_091f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0929: Expected O, but got Unknown
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0988: Expected O, but got Unknown
			//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c6: Expected O, but got Unknown
			//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a04: Expected O, but got Unknown
			//IL_0a59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a63: Expected O, but got Unknown
			//IL_0a97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa1: Expected O, but got Unknown
			//IL_0ad5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adf: Expected O, but got Unknown
			//IL_0b13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1d: Expected O, but got Unknown
			//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5b: Expected O, but got Unknown
			//IL_0b8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b99: Expected O, but got Unknown
			//IL_0bcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd7: Expected O, but got Unknown
			//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c53: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7a: Invalid comparison between Unknown and I4
			//IL_0d2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Config.SaveOnConfigSet = false;
			_enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", false, "Enable all visual effects, including snowfall and sandstorm.");
			_snowflakeCount = ((BaseUnityPlugin)this).Config.Bind<int>("Effects", "SnowflakeCount", 95, new ConfigDescription("Number of visible snow and ice particles.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 300), Array.Empty<object>()));
			_sandstormEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Sandstorm", "Enabled", false, "Enable a screen-wide animated sandstorm.");
			_sandParticleCount = ((BaseUnityPlugin)this).Config.Bind<int>("Summer / Sandstorm", "ParticleCount", 240, new ConfigDescription("Number of visible sand and dust streaks.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 600), Array.Empty<object>()));
			_sandWindSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Sandstorm", "WindSpeed", 1.7f, new ConfigDescription("Horizontal speed of the blowing sand.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 4f), Array.Empty<object>()));
			_sandGrainSize = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Sandstorm", "GrainSize", 1f, new ConfigDescription("Visual size of the sand streaks.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2.5f), Array.Empty<object>()));
			_sandOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Sandstorm", "Opacity", 0.72f, new ConfigDescription("Opacity of the wind-blown sand and dust.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 1f), Array.Empty<object>()));
			_blueTint = ((BaseUnityPlugin)this).Config.Bind<float>("Effects", "BlueTint", 0.18f, new ConfigDescription("Strength of the cold blue screen tint.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>()));
			_coldFilterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Winter / Cold Filter", "Enabled", false, "Enable the cold blue screen filter.");
			_snowEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Winter / Snowfall", "Enabled", false, "Enable falling snow particles.");
			_warmGlowEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Winter / Warm Glow", "Enabled", false, "Enable the warm light around the player.");
			_yellowFilterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Yellow Filter", "Enabled", false, "Enable a soft golden-yellow summer color filter.");
			_yellowFilterStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Yellow Filter", "Strength", 0.16f, new ConfigDescription("Strength of the yellow tint.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.5f), Array.Empty<object>()));
			_redFilterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Red Filter", "Enabled", false, "Enable a warm red summer color filter.");
			_redFilterStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Red Filter", "Strength", 0.1f, new ConfigDescription("Strength of the red tint.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.4f), Array.Empty<object>()));
			_vignetteEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Vignette", "Enabled", false, "Darken the outer edges of the screen with a soft vignette.");
			_vignetteStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Vignette", "Strength", 0.42f, new ConfigDescription("Darkness of the vignette at the screen edges.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_vignetteRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Vignette", "InnerRadius", 0.48f, new ConfigDescription("How far the clear center extends before the vignette fades in.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.35f, 0.88f), Array.Empty<object>()));
			_vignetteColor = ((BaseUnityPlugin)this).Config.Bind<int>("Summer / Vignette", "Color", 0, new ConfigDescription("Vignette edge color: 0 = dark, 1 = red, 2 = yellow, 3 = sand.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 3), Array.Empty<object>()));
			_underwaterBlueFilterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Underwater / Blue Filter", "Enabled", false, "Enable the cool blue underwater color grade.");
			_underwaterBlueFilterStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Blue Filter", "Strength", 0.28f, new ConfigDescription("Intensity of the underwater blue tint.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.65f), Array.Empty<object>()));
			_underwaterVignetteEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Underwater / Black Vignette", "Enabled", false, "Darken the screen edges with a separate black underwater vignette.");
			_underwaterVignetteStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Black Vignette", "Strength", 0.48f, new ConfigDescription("Darkness of the underwater vignette.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_underwaterVignetteRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Black Vignette", "InnerRadius", 0.48f, new ConfigDescription("Size of the clear center before the black edges fade in.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.35f, 0.88f), Array.Empty<object>()));
			_underwaterEffectEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Underwater / Water Effect", "Enabled", false, "Enable rising underwater bubbles.");
			_underwaterEffectStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Water Effect", "Strength", 0.62f, new ConfigDescription("Visibility of rising underwater bubbles.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_underwaterEffectSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Water Effect", "Speed", 0.65f, new ConfigDescription("Movement speed of rising underwater bubbles.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2.5f), Array.Empty<object>()));
			_underwaterBubbleCount = ((BaseUnityPlugin)this).Config.Bind<int>("Underwater / Water Effect", "BubbleCount", 28, new ConfigDescription("Number of rising underwater bubbles.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			_underwaterBubbleBlur = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / Water Effect", "BubbleBlur", 0f, new ConfigDescription("Softens the bubble rings. 0 = crisp bubbles; 1 = fully softened bubbles.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_underwaterPlayerLightEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Underwater / White Player Light", "Enabled", false, "Enable a soft white light centered on the player's position.");
			_underwaterPlayerLightStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / White Player Light", "Brightness", 0.95f, new ConfigDescription("Brightness of the white player light.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>()));
			_underwaterPlayerLightRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Underwater / White Player Light", "Radius", 0.2f, new ConfigDescription("Radius of the white light as a fraction of the shorter screen dimension.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.06f, 0.5f), Array.Empty<object>()));
			_sakuraFilterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Japan / Pink Filter", "Enabled", false, "Enable a soft sakura-pink color overlay.");
			_sakuraFilterStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Pink Filter", "Strength", 0.14f, new ConfigDescription("Intensity of the soft pink color grade.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.45f), Array.Empty<object>()));
			_sakuraPetalsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Japan / Sakura Petals", "Enabled", false, "Enable drifting cherry blossom petals.");
			_sakuraPetalCount = ((BaseUnityPlugin)this).Config.Bind<int>("Japan / Sakura Petals", "Count", 85, new ConfigDescription("Number of visible cherry blossom petals.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 260), Array.Empty<object>()));
			_sakuraPetalSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Sakura Petals", "Speed", 0.85f, new ConfigDescription("Falling and drifting speed of sakura petals.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2.5f), Array.Empty<object>()));
			_sakuraPetalSize = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Sakura Petals", "Size", 1f, new ConfigDescription("Scale of the cherry blossom petals.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2.2f), Array.Empty<object>()));
			_sakuraPetalOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Sakura Petals", "Opacity", 0.82f, new ConfigDescription("Visibility of the falling petals.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 1f), Array.Empty<object>()));
			_sakuraVignetteEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Japan / Pink Vignette", "Enabled", false, "Enable a soft plum-pink vignette around the screen edges.");
			_sakuraVignetteStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Pink Vignette", "Strength", 0.34f, new ConfigDescription("Strength of the pink vignette at the edges.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_sakuraVignetteRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Pink Vignette", "InnerRadius", 0.52f, new ConfigDescription("Size of the clear center before the vignette fades in.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.35f, 0.88f), Array.Empty<object>()));
			_sakuraFirefliesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Japan / Hotaru Fireflies", "Enabled", false, "Enable softly glowing fireflies drifting among the sakura petals.");
			_sakuraFireflyCount = ((BaseUnityPlugin)this).Config.Bind<int>("Japan / Hotaru Fireflies", "Count", 14, new ConfigDescription("Number of floating fireflies.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 48), Array.Empty<object>()));
			_sakuraFireflyBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Hotaru Fireflies", "Brightness", 0.7f, new ConfigDescription("Brightness of the warm pink-gold firefly glow.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>()));
			_sakuraFireflySpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Japan / Hotaru Fireflies", "Speed", 0.65f, new ConfigDescription("Drifting speed of the fireflies.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2.5f), Array.Empty<object>()));
			_heatHazeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Heat Haze", "Enabled", false, "Enable an animated mirage-like heat haze overlay.");
			_heatHazeStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Heat Haze", "Strength", 0.45f, new ConfigDescription("Intensity of the animated heat shimmer.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_heatHazeSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Heat Haze", "Speed", 1f, new ConfigDescription("Animation speed of the heat shimmer.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 3f), Array.Empty<object>()));
			_heatHazeArea = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Heat Haze", "ScreenCoverage", 0.55f, new ConfigDescription("Fraction of the screen covered by the heat haze, starting from the bottom.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 1f), Array.Empty<object>()));
			_opticalDistortionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Summer / Optical Distortion", "Enabled", false, "Enable real screen-space pixel displacement on the main camera.");
			_opticalDistortionStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Optical Distortion", "Strength", 0.45f, new ConfigDescription("Maximum intensity of the image displacement.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			_opticalDistortionSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Optical Distortion", "Speed", 1f, new ConfigDescription("Animation speed of the optical waves.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 3f), Array.Empty<object>()));
			_opticalDistortionWaveSize = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Optical Distortion", "WaveSize", 1f, new ConfigDescription("Wavelength scale. Higher values create broader, slower bends.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 3f), Array.Empty<object>()));
			_opticalDistortionArea = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Optical Distortion", "ScreenCoverage", 0.55f, new ConfigDescription("Fraction of the screen affected, measured upward from the bottom.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 1f), Array.Empty<object>()));
			_opticalDistortionQuality = ((BaseUnityPlugin)this).Config.Bind<float>("Summer / Optical Distortion", "ProcessingScale", 0.4f, new ConfigDescription("Internal processing resolution. Lower values improve performance but make the effect softer.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 0.75f), Array.Empty<object>()));
			_warmGlowStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Warm Glow", "Brightness", 0.9f, new ConfigDescription("Brightness of the circular warm light around the player. Set to 0 to disable it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1.5f), Array.Empty<object>()));
			_warmGlowRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Warm Glow", "Radius", 0.24f, new ConfigDescription("Glow radius as a fraction of the shorter screen dimension.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.08f, 0.7f), Array.Empty<object>()));
			_menuKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "MenuKey", new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()), "Keyboard shortcut used to open the in-game settings menu.");
			_toggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "ToggleKey", new KeyboardShortcut((KeyCode)290, Array.Empty<KeyCode>()), "Keyboard shortcut used to enable or disable all mod effects. Supports modifier keys.");
			KeyboardShortcut value = _toggleKey.Value;
			KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey;
			value = _menuKey.Value;
			if (mainKey == ((KeyboardShortcut)(ref value)).MainKey)
			{
				value = _menuKey.Value;
				KeyCode val = (KeyCode)(((int)((KeyboardShortcut)(ref value)).MainKey == 290) ? 291 : 290);
				_toggleKey.Value = new KeyboardShortcut(val, Array.Empty<KeyCode>());
			}
			_manualEnabled = _enabled.Value;
			CreateTextures();
			RebuildSnow();
			RebuildSand();
			RebuildBubbles();
			RebuildSakuraPetals();
			RebuildSakuraFireflies();
			RefreshPlayerReference();
			((BaseUnityPlugin)this).Config.Save();
			if ((Object)(object)GraphicsSettings.currentRenderPipeline != (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"Optical distortion uses OnRenderImage and requires the Built-in Render Pipeline. The other visual effects remain available.");
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} {1} initialized. {2} opens settings; {3} toggles effects.", "Everbloom", "1.1.4", _menuKey.Value, _toggleKey.Value));
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
			if ((Object)(object)_opticalDistortionRenderer != (Object)null)
			{
				if (_ownsOpticalDistortionRenderer)
				{
					Object.Destroy((Object)(object)_opticalDistortionRenderer);
				}
				else
				{
					((Behaviour)_opticalDistortionRenderer).enabled = false;
				}
			}
			DestroyTextures();
		}

		private void Update()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut value;
			if (!_waitingForMenuKey && !_waitingForToggleKey)
			{
				value = _menuKey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					_menuOpen = !_menuOpen;
					if (!_menuOpen)
					{
						_waitingForMenuKey = false;
						_waitingForToggleKey = false;
						((BaseUnityPlugin)this).Config.Save();
					}
				}
			}
			if (!_waitingForMenuKey && !_waitingForToggleKey)
			{
				value = _toggleKey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					bool value2 = (_manualEnabled = !_manualEnabled || !_enabled.Value);
					_enabled.Value = value2;
					((BaseUnityPlugin)this).Config.Save();
					((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("Eternal Frost {0} ({1}).", _manualEnabled ? "enabled" : "disabled", _toggleKey.Value));
				}
			}
			int value3 = _snowflakeCount.Value;
			if (_snow.Length != value3)
			{
				RebuildSnow();
			}
			int value4 = _sandParticleCount.Value;
			if (_sand.Length != value4)
			{
				RebuildSand();
			}
			int value5 = _underwaterBubbleCount.Value;
			if (_bubbles.Length != value5)
			{
				RebuildBubbles();
			}
			int value6 = _sakuraPetalCount.Value;
			if (_sakuraPetals.Length != value6)
			{
				RebuildSakuraPetals();
			}
			int value7 = _sakuraFireflyCount.Value;
			if (_sakuraFireflies.Length != value7)
			{
				RebuildSakuraFireflies();
			}
			if ((Object)(object)_mainCamera == (Object)null || !((Behaviour)_mainCamera).isActiveAndEnabled || Time.unscaledTime >= _nextDistortionCameraLookupTime)
			{
				_mainCamera = Camera.main;
				_nextDistortionCameraLookupTime = Time.unscaledTime + 0.5f;
			}
			SyncOpticalDistortionRenderer();
			if (!_manualEnabled || !_enabled.Value)
			{
				_hasPlayerScreenPosition = false;
				return;
			}
			if (_snowEnabled.Value)
			{
				UpdateSnow(Time.deltaTime);
			}
			if (_sandstormEnabled.Value)
			{
				UpdateSand(Time.deltaTime);
			}
			if (_underwaterEffectEnabled.Value)
			{
				UpdateBubbles(Time.unscaledDeltaTime);
			}
			if (_sakuraPetalsEnabled.Value)
			{
				UpdateSakuraPetals(Time.unscaledDeltaTime);
			}
			if (_sakuraFirefliesEnabled.Value)
			{
				UpdateSakuraFireflies(Time.unscaledDeltaTime);
			}
			if (_warmGlowEnabled.Value || _underwaterPlayerLightEnabled.Value)
			{
				UpdatePlayerScreenPosition();
			}
			else
			{
				_hasPlayerScreenPosition = false;
			}
		}

		private void SyncOpticalDistortionRenderer()
		{
			bool num = _manualEnabled && _enabled.Value && _opticalDistortionEnabled.Value && _opticalDistortionStrength.Value > 0.001f;
			if ((Object)(object)_distortionCamera != (Object)(object)_mainCamera)
			{
				if ((Object)(object)_opticalDistortionRenderer != (Object)null)
				{
					if (_ownsOpticalDistortionRenderer)
					{
						Object.Destroy((Object)(object)_opticalDistortionRenderer);
					}
					else
					{
						((Behaviour)_opticalDistortionRenderer).enabled = false;
					}
				}
				_opticalDistortionRenderer = null;
				_ownsOpticalDistortionRenderer = false;
				_distortionCamera = _mainCamera;
			}
			if (!num || (Object)(object)_mainCamera == (Object)null)
			{
				if ((Object)(object)_opticalDistortionRenderer != (Object)null)
				{
					((Behaviour)_opticalDistortionRenderer).enabled = false;
				}
				return;
			}
			if ((Object)(object)_opticalDistortionRenderer == (Object)null)
			{
				_opticalDistortionRenderer = ((Component)_mainCamera).GetComponent<ScreenSpaceOpticalDistortion>();
				if ((Object)(object)_opticalDistortionRenderer == (Object)null)
				{
					_opticalDistortionRenderer = ((Component)_mainCamera).gameObject.AddComponent<ScreenSpaceOpticalDistortion>();
					_ownsOpticalDistortionRenderer = true;
				}
			}
			if (!((Object)(object)_opticalDistortionRenderer == (Object)null))
			{
				_opticalDistortionRenderer.SetParameters(_opticalDistortionStrength.Value, _opticalDistortionSpeed.Value, _opticalDistortionWaveSize.Value, _opticalDistortionArea.Value, _opticalDistortionQuality.Value);
				((Behaviour)_opticalDistortionRenderer).enabled = true;
			}
		}

		private void RebuildSnow()
		{
			int num = Mathf.Clamp(_snowflakeCount.Value, 0, 300);
			_snow = new SnowParticle[num];
			for (int i = 0; i < num; i++)
			{
				_snow[i] = new SnowParticle
				{
					X = Random.value,
					Y = Random.value,
					Speed = Random.Range(0.025f, 0.095f),
					Drift = Random.Range(0.008f, 0.035f),
					Size = Random.Range(1.5f, 5.5f),
					Phase = Random.Range(0f, 6.28318f)
				};
			}
		}

		private void UpdateSnow(float delta)
		{
			for (int i = 0; i < _snow.Length; i++)
			{
				SnowParticle snowParticle = _snow[i];
				snowParticle.Y += snowParticle.Speed * delta;
				snowParticle.X += Mathf.Sin(Time.time * 0.7f + snowParticle.Phase) * snowParticle.Drift * delta;
				if (snowParticle.Y > 1.03f)
				{
					snowParticle.Y = -0.03f;
					snowParticle.X = Random.value;
				}
				if (snowParticle.X < -0.02f)
				{
					snowParticle.X = 1.02f;
				}
				if (snowParticle.X > 1.02f)
				{
					snowParticle.X = -0.02f;
				}
				_snow[i] = snowParticle;
			}
		}

		private void RebuildSand()
		{
			int num = Mathf.Clamp(_sandParticleCount.Value, 0, 600);
			_sand = new SandParticle[num];
			for (int i = 0; i < num; i++)
			{
				_sand[i] = new SandParticle
				{
					X = Random.Range(-0.05f, 1.05f),
					Y = Random.value,
					Speed = Random.Range(0.42f, 1f),
					Drift = Random.Range(0.006f, 0.022f),
					Height = Random.Range(1.2f, 2.8f),
					Length = Random.Range(7f, 19f),
					Opacity = Random.Range(0.38f, 0.95f),
					Tone = Random.value,
					Phase = Random.Range(0f, 6.28318f)
				};
			}
		}

		private void UpdateSand(float delta)
		{
			float value = _sandWindSpeed.Value;
			float unscaledTime = Time.unscaledTime;
			for (int i = 0; i < _sand.Length; i++)
			{
				SandParticle sandParticle = _sand[i];
				sandParticle.X -= sandParticle.Speed * value * 0.34f * delta;
				sandParticle.Y += (0.006f + Mathf.Sin(unscaledTime * 2.1f + sandParticle.Phase) * sandParticle.Drift) * value * delta;
				if (sandParticle.X < -0.08f)
				{
					sandParticle.X = 1.08f;
					sandParticle.Y = Random.value;
				}
				if (sandParticle.Y > 1.06f)
				{
					sandParticle.Y = -0.06f;
				}
				else if (sandParticle.Y < -0.06f)
				{
					sandParticle.Y = 1.06f;
				}
				_sand[i] = sandParticle;
			}
		}

		private void RebuildBubbles()
		{
			int num = Mathf.Clamp(_underwaterBubbleCount.Value, 0, 100);
			_bubbles = new BubbleParticle[num];
			for (int i = 0; i < num; i++)
			{
				_bubbles[i] = new BubbleParticle
				{
					X = Random.value,
					Y = Random.value,
					Speed = Random.Range(0.025f, 0.085f),
					Drift = Random.Range(0.006f, 0.024f),
					Size = Random.Range(5f, 15f),
					Phase = Random.Range(0f, 6.28318f)
				};
			}
		}

		private void UpdateBubbles(float delta)
		{
			if (delta <= 0f)
			{
				return;
			}
			float value = _underwaterEffectSpeed.Value;
			float unscaledTime = Time.unscaledTime;
			for (int i = 0; i < _bubbles.Length; i++)
			{
				BubbleParticle bubbleParticle = _bubbles[i];
				bubbleParticle.Y -= bubbleParticle.Speed * value * delta;
				bubbleParticle.X += Mathf.Sin(unscaledTime * 0.75f + bubbleParticle.Phase) * bubbleParticle.Drift * value * delta;
				if (bubbleParticle.Y < -0.06f)
				{
					bubbleParticle.Y = 1.04f;
					bubbleParticle.X = Random.value;
					bubbleParticle.Size = Random.Range(5f, 15f);
				}
				if (bubbleParticle.X < -0.03f)
				{
					bubbleParticle.X = 1.03f;
				}
				else if (bubbleParticle.X > 1.03f)
				{
					bubbleParticle.X = -0.03f;
				}
				_bubbles[i] = bubbleParticle;
			}
		}

		private void RebuildSakuraPetals()
		{
			int num = Mathf.Clamp(_sakuraPetalCount.Value, 0, 260);
			_sakuraPetals = new SakuraPetalParticle[num];
			for (int i = 0; i < num; i++)
			{
				_sakuraPetals[i] = new SakuraPetalParticle
				{
					X = Random.value,
					Y = Random.value,
					Speed = Random.Range(0.035f, 0.12f),
					Drift = Random.Range(0.012f, 0.045f),
					Size = Random.Range(8f, 19f),
					Rotation = Random.Range(0f, 360f),
					RotationSpeed = Random.Range(-55f, 55f),
					Phase = Random.Range(0f, 6.28318f),
					Tone = Random.value
				};
			}
		}

		private void UpdateSakuraPetals(float delta)
		{
			if (delta <= 0f)
			{
				return;
			}
			float value = _sakuraPetalSpeed.Value;
			float unscaledTime = Time.unscaledTime;
			for (int i = 0; i < _sakuraPetals.Length; i++)
			{
				SakuraPetalParticle sakuraPetalParticle = _sakuraPetals[i];
				sakuraPetalParticle.Y += sakuraPetalParticle.Speed * value * delta;
				sakuraPetalParticle.X += (Mathf.Sin(unscaledTime * 0.72f + sakuraPetalParticle.Phase) * sakuraPetalParticle.Drift + sakuraPetalParticle.Drift * 0.18f) * value * delta;
				sakuraPetalParticle.Rotation += sakuraPetalParticle.RotationSpeed * value * delta;
				if (sakuraPetalParticle.Y > 1.08f)
				{
					sakuraPetalParticle.Y = -0.08f;
					sakuraPetalParticle.X = Random.value;
					sakuraPetalParticle.Size = Random.Range(8f, 19f);
					sakuraPetalParticle.Tone = Random.value;
				}
				if (sakuraPetalParticle.X < -0.05f)
				{
					sakuraPetalParticle.X = 1.05f;
				}
				else if (sakuraPetalParticle.X > 1.05f)
				{
					sakuraPetalParticle.X = -0.05f;
				}
				_sakuraPetals[i] = sakuraPetalParticle;
			}
		}

		private void RebuildSakuraFireflies()
		{
			int num = Mathf.Clamp(_sakuraFireflyCount.Value, 0, 48);
			_sakuraFireflies = new SakuraFireflyParticle[num];
			for (int i = 0; i < num; i++)
			{
				_sakuraFireflies[i] = new SakuraFireflyParticle
				{
					X = Random.value,
					Y = Random.value,
					Speed = Random.Range(0.008f, 0.026f),
					Drift = Random.Range(0.012f, 0.04f),
					Size = Random.Range(10f, 24f),
					Phase = Random.Range(0f, 6.28318f)
				};
			}
		}

		private void UpdateSakuraFireflies(float delta)
		{
			if (delta <= 0f)
			{
				return;
			}
			float value = _sakuraFireflySpeed.Value;
			float unscaledTime = Time.unscaledTime;
			for (int i = 0; i < _sakuraFireflies.Length; i++)
			{
				SakuraFireflyParticle sakuraFireflyParticle = _sakuraFireflies[i];
				sakuraFireflyParticle.Y -= sakuraFireflyParticle.Speed * value * delta;
				sakuraFireflyParticle.X += Mathf.Sin(unscaledTime * 0.48f + sakuraFireflyParticle.Phase) * sakuraFireflyParticle.Drift * value * delta;
				if (sakuraFireflyParticle.Y < -0.06f)
				{
					sakuraFireflyParticle.Y = 1.06f;
					sakuraFireflyParticle.X = Random.value;
				}
				if (sakuraFireflyParticle.X < -0.04f)
				{
					sakuraFireflyParticle.X = 1.04f;
				}
				else if (sakuraFireflyParticle.X > 1.04f)
				{
					sakuraFireflyParticle.X = -0.04f;
				}
				_sakuraFireflies[i] = sakuraFireflyParticle;
			}
		}

		private void UpdatePlayerScreenPosition()
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_playerTransform == (Object)null || Time.unscaledTime >= _nextPlayerLookupTime)
			{
				RefreshPlayerReference();
			}
			if ((Object)(object)_playerTransform == (Object)null)
			{
				_hasPlayerScreenPosition = false;
				return;
			}
			if ((Object)(object)_mainCamera == (Object)null || !((Behaviour)_mainCamera).isActiveAndEnabled)
			{
				_mainCamera = Camera.main;
			}
			if ((Object)(object)_mainCamera == (Object)null)
			{
				_hasPlayerScreenPosition = false;
				return;
			}
			Vector3 val = _playerTransform.position + Vector3.up * 0.18f;
			Vector3 val2 = _mainCamera.WorldToScreenPoint(val);
			if (val2.z <= 0f || val2.x < (float)(-Screen.width) || val2.x > (float)Screen.width * 2f || val2.y < (float)(-Screen.height) || val2.y > (float)Screen.height * 2f)
			{
				_hasPlayerScreenPosition = false;
				return;
			}
			_playerScreenPosition = new Vector2(val2.x, (float)Screen.height - val2.y);
			_hasPlayerScreenPosition = true;
		}

		private void RefreshPlayerReference()
		{
			_nextPlayerLookupTime = Time.unscaledTime + 0.75f;
			_playerTransform = FindHeroControllerTransform();
			if ((Object)(object)_playerTransform == (Object)null)
			{
				try
				{
					GameObject val = GameObject.FindGameObjectWithTag("Player");
					if ((Object)(object)val != (Object)null)
					{
						_playerTransform = val.transform;
					}
				}
				catch (UnityException)
				{
				}
			}
			if ((Object)(object)_playerTransform == (Object)null)
			{
				_hasPlayerScreenPosition = false;
			}
			else
			{
				_mainCamera = Camera.main;
			}
		}

		private Transform? FindHeroControllerTransform()
		{
			try
			{
				Type type = null;
				Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
				for (int i = 0; i < assemblies.Length; i++)
				{
					if (!(type == null))
					{
						break;
					}
					type = assemblies[i].GetType("HeroController", throwOnError: false);
				}
				if (type == null)
				{
					return null;
				}
				object obj = null;
				PropertyInfo property = type.GetProperty("instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
				if (property != null)
				{
					obj = property.GetValue(null, null);
				}
				if (obj == null)
				{
					FieldInfo field = type.GetField("instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
					if (field != null)
					{
						obj = field.GetValue(null);
					}
				}
				Component val = (Component)((obj is Component) ? obj : null);
				if (val != null)
				{
					return val.transform;
				}
				GameObject val2 = (GameObject)((obj is GameObject) ? obj : null);
				if (val2 != null)
				{
					return val2.transform;
				}
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogDebug((object)("Could not get HeroController: " + ex.GetType().Name));
			}
			return null;
		}

		private void OnGUI()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			HandleHotkeyCapture();
			if (_manualEnabled && _enabled.Value && (int)Event.current.type == 7)
			{
				float num = Screen.width;
				float num2 = Screen.height;
				if (num > 0f && num2 > 0f)
				{
					DrawColdTint(num, num2);
					DrawYellowTint(num, num2);
					DrawRedTint(num, num2);
					DrawVignette(num, num2);
					DrawHeatHaze(num, num2);
					DrawWarmGlow(num, num2);
					DrawSnow(num, num2);
					DrawSand(num, num2);
					DrawUnderwaterBlueTint(num, num2);
					DrawUnderwaterEffect(num, num2);
					DrawUnderwaterVignette(num, num2);
					DrawUnderwaterPlayerLight(num, num2);
					DrawSakuraPinkFilter(num, num2);
					DrawSakuraFireflies(num, num2);
					DrawSakuraPetals(num, num2);
					DrawSakuraVignette(num, num2);
				}
			}
			if (_menuOpen)
			{
				EnsureUiStyles();
				DrawSettingsMenu();
			}
		}

		private void DrawColdTint(float w, float h)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_white == (Object)null) && _coldFilterEnabled.Value)
			{
				float num = 0.92f + Mathf.Sin(Time.time * 0.45f) * 0.08f;
				GUI.color = new Color(0.48f, 0.78f, 1f, _blueTint.Value * num);
				GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_white);
				GUI.color = Color.white;
			}
		}

		private void DrawYellowTint(float w, float h)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_white == (Object)null) && _yellowFilterEnabled.Value)
			{
				float num = Mathf.Clamp(_yellowFilterStrength.Value, 0f, 0.5f);
				if (!(num <= 0.001f))
				{
					GUI.color = new Color(1f, 0.84f, 0.3f, num);
					GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_white);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawRedTint(float w, float h)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_white == (Object)null) && _redFilterEnabled.Value)
			{
				float num = Mathf.Clamp(_redFilterStrength.Value, 0f, 0.4f);
				if (!(num <= 0.001f))
				{
					GUI.color = new Color(0.92f, 0.2f, 0.13f, num);
					GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_white);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawVignette(float w, float h)
		{
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if (!_vignetteEnabled.Value || (Object)(object)_vignetteTexture == (Object)null)
			{
				return;
			}
			float num = Mathf.Clamp01(_vignetteStrength.Value);
			if (!(num <= 0.001f))
			{
				float num2 = Mathf.Clamp(_vignetteRadius.Value, 0.35f, 0.88f);
				if (Mathf.Abs(num2 - _builtVignetteRadius) > 0.002f)
				{
					RebuildVignetteTexture(num2);
				}
				Color color = default(Color);
				switch (_vignetteColor.Value)
				{
				case 1:
					((Color)(ref color))..ctor(0.64f, 0.1f, 0.075f, num);
					break;
				case 2:
					((Color)(ref color))..ctor(0.86f, 0.58f, 0.16f, num);
					break;
				case 3:
					((Color)(ref color))..ctor(0.69f, 0.51f, 0.3f, num);
					break;
				default:
					((Color)(ref color))..ctor(0.015f, 0.022f, 0.032f, num);
					break;
				}
				GUI.color = color;
				GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_vignetteTexture, (ScaleMode)0, true);
				GUI.color = Color.white;
			}
		}

		private void DrawHeatHaze(float w, float h)
		{
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_heatHazeTexture == (Object)null) && _heatHazeEnabled.Value)
			{
				float num = Mathf.Clamp01(_heatHazeStrength.Value);
				if (!(num <= 0.001f))
				{
					float num2 = Mathf.Clamp(_heatHazeArea.Value, 0.2f, 1f);
					float num3 = h * num2;
					float num4 = Mathf.Clamp(_heatHazeSpeed.Value, 0.1f, 3f);
					float unscaledTime = Time.unscaledTime;
					float num5 = unscaledTime * 0.075f * num4;
					float num6 = Mathf.Sin(unscaledTime * 0.31f * num4) * 0.018f;
					Rect val = default(Rect);
					((Rect)(ref val))..ctor(num6, num5, 1f, 1f);
					Rect val2 = new Rect(0f, h - num3, w, num3);
					GUI.color = new Color(1f, 0.82f, 0.54f, num * 0.78f);
					GUI.DrawTextureWithTexCoords(val2, (Texture)(object)_heatHazeTexture, val);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawUnderwaterBlueTint(float w, float h)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_white == (Object)null) && _underwaterBlueFilterEnabled.Value)
			{
				float num = Mathf.Clamp(_underwaterBlueFilterStrength.Value, 0f, 0.65f);
				if (!(num <= 0.001f))
				{
					GUI.color = new Color(0.08f, 0.42f, 0.68f, num);
					GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_white);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawUnderwaterVignette(float w, float h)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			if (!_underwaterVignetteEnabled.Value || (Object)(object)_underwaterVignetteTexture == (Object)null)
			{
				return;
			}
			float num = Mathf.Clamp01(_underwaterVignetteStrength.Value);
			if (!(num <= 0.001f))
			{
				float num2 = Mathf.Clamp(_underwaterVignetteRadius.Value, 0.35f, 0.88f);
				if (Mathf.Abs(num2 - _builtUnderwaterVignetteRadius) > 0.002f)
				{
					RebuildUnderwaterVignetteTexture(num2);
				}
				GUI.color = new Color(0.002f, 0.003f, 0.006f, num);
				GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_underwaterVignetteTexture, (ScaleMode)0, true);
				GUI.color = Color.white;
			}
		}

		private void DrawUnderwaterEffect(float w, float h)
		{
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			if (!_underwaterEffectEnabled.Value || (Object)(object)_bubbleTexture == (Object)null || _bubbles.Length == 0)
			{
				return;
			}
			float num = Mathf.Clamp01(_underwaterEffectStrength.Value);
			if (num <= 0.001f)
			{
				return;
			}
			float num2 = Mathf.Pow(num, 0.72f);
			float num3 = Mathf.Clamp(Mathf.Min(w, h) / 720f, 0.75f, 1.8f);
			float num4 = Mathf.Clamp01(_underwaterBubbleBlur.Value);
			for (int i = 0; i < _bubbles.Length; i++)
			{
				BubbleParticle bubbleParticle = _bubbles[i];
				float num5 = 0.78f + 0.22f * Mathf.Sin(Time.unscaledTime * 1.8f + bubbleParticle.Phase);
				float num6 = bubbleParticle.Size * num3;
				float num7 = num2 * (0.3f + num5 * 0.42f);
				float num8 = bubbleParticle.X * w;
				float num9 = bubbleParticle.Y * h;
				if (num4 > 0.001f && (Object)(object)_bubbleBlurTexture != (Object)null)
				{
					float num10 = num6 * (1f + num4 * 0.28f);
					float num11 = num7 * num4;
					GUI.color = new Color(0.96f, 0.99f, 1f, num11);
					GUI.DrawTexture(new Rect(num8 - num10 * 0.5f, num9 - num10 * 0.5f, num10, num10), (Texture)(object)_bubbleBlurTexture, (ScaleMode)0, true);
				}
				float num12 = num7 * (1f - num4);
				if (num12 > 0.001f)
				{
					GUI.color = new Color(1f, 1f, 1f, num12);
					GUI.DrawTexture(new Rect(num8 - num6 * 0.5f, num9 - num6 * 0.5f, num6, num6), (Texture)(object)_bubbleTexture, (ScaleMode)0, true);
				}
			}
			GUI.color = Color.white;
		}

		private void DrawUnderwaterPlayerLight(float w, float h)
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_underwaterPlayerLight == (Object)null) && _underwaterPlayerLightEnabled.Value && _hasPlayerScreenPosition)
			{
				float num = Mathf.Clamp(_underwaterPlayerLightStrength.Value, 0f, 1.5f);
				if (!(num <= 0.001f))
				{
					float num2 = 0.98f + Mathf.Sin(Time.unscaledTime * 1.6f) * 0.02f;
					float num3 = Mathf.Min(w, h) * Mathf.Clamp(_underwaterPlayerLightRadius.Value, 0.06f, 0.5f);
					float num4 = num3 * 2f;
					Rect val = new Rect(_playerScreenPosition.x - num3, _playerScreenPosition.y - num3, num4, num4);
					GUI.color = new Color(0.78f, 0.91f, 1f, Mathf.Clamp01(0.34f * num * num2));
					GUI.DrawTexture(val, (Texture)(object)_underwaterPlayerLight, (ScaleMode)0, true);
					float num5 = num4 * 0.58f;
					Rect val2 = new Rect(_playerScreenPosition.x - num5 * 0.5f, _playerScreenPosition.y - num5 * 0.5f, num5, num5);
					GUI.color = new Color(1f, 1f, 1f, Mathf.Clamp01(0.26f * num * num2));
					GUI.DrawTexture(val2, (Texture)(object)_underwaterPlayerLight, (ScaleMode)0, true);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawSakuraPinkFilter(float w, float h)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_white == (Object)null) && _sakuraFilterEnabled.Value)
			{
				float num = Mathf.Clamp(_sakuraFilterStrength.Value, 0f, 0.45f);
				if (!(num <= 0.001f))
				{
					GUI.color = new Color(1f, 0.6f, 0.75f, num);
					GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_white);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawSakuraPetals(float w, float h)
		{
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			if (!_sakuraPetalsEnabled.Value || (Object)(object)_sakuraPetalTexture == (Object)null || _sakuraPetals.Length == 0)
			{
				return;
			}
			float num = Mathf.Clamp01(_sakuraPetalOpacity.Value);
			if (!(num <= 0.001f))
			{
				float num2 = Mathf.Clamp(Mathf.Min(w, h) / 720f, 0.72f, 1.85f) * Mathf.Clamp(_sakuraPetalSize.Value, 0.5f, 2.2f);
				float unscaledTime = Time.unscaledTime;
				Rect val = default(Rect);
				for (int i = 0; i < _sakuraPetals.Length; i++)
				{
					SakuraPetalParticle sakuraPetalParticle = _sakuraPetals[i];
					float num3 = Mathf.Lerp(0.52f, 1f, sakuraPetalParticle.Tone);
					float num4 = 0.88f + 0.12f * Mathf.Sin(unscaledTime * 1.1f + sakuraPetalParticle.Phase);
					float num5 = sakuraPetalParticle.Size * num2 * num3;
					float num6 = num * num3 * num4;
					Color color = Color.Lerp(new Color(1f, 0.7f, 0.82f, num6), new Color(1f, 0.93f, 0.96f, num6), sakuraPetalParticle.Tone);
					((Rect)(ref val))..ctor(sakuraPetalParticle.X * w - num5 * 0.5f, sakuraPetalParticle.Y * h - num5 * 0.5f, num5 * 0.78f, num5);
					Matrix4x4 matrix = GUI.matrix;
					GUIUtility.RotateAroundPivot(sakuraPetalParticle.Rotation, ((Rect)(ref val)).center);
					GUI.color = color;
					GUI.DrawTexture(val, (Texture)(object)_sakuraPetalTexture, (ScaleMode)0, true);
					GUI.matrix = matrix;
				}
				GUI.color = Color.white;
			}
		}

		private void DrawSakuraVignette(float w, float h)
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			if (!_sakuraVignetteEnabled.Value || (Object)(object)_sakuraVignetteTexture == (Object)null)
			{
				return;
			}
			float num = Mathf.Clamp01(_sakuraVignetteStrength.Value);
			if (!(num <= 0.001f))
			{
				float num2 = Mathf.Clamp(_sakuraVignetteRadius.Value, 0.35f, 0.88f);
				if (Mathf.Abs(num2 - _builtSakuraVignetteRadius) > 0.002f)
				{
					RebuildSakuraVignetteTexture(num2);
				}
				GUI.color = new Color(0.22f, 0.035f, 0.105f, num);
				GUI.DrawTexture(new Rect(0f, 0f, w, h), (Texture)(object)_sakuraVignetteTexture, (ScaleMode)0, true);
				GUI.color = Color.white;
			}
		}

		private void DrawSakuraFireflies(float w, float h)
		{
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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)
			if (!_sakuraFirefliesEnabled.Value || (Object)(object)_sakuraGlowTexture == (Object)null || _sakuraFireflies.Length == 0)
			{
				return;
			}
			float num = Mathf.Clamp(_sakuraFireflyBrightness.Value, 0f, 1.5f);
			if (!(num <= 0.001f))
			{
				float num2 = Mathf.Clamp(Mathf.Min(w, h) / 720f, 0.72f, 1.85f);
				float unscaledTime = Time.unscaledTime;
				for (int i = 0; i < _sakuraFireflies.Length; i++)
				{
					SakuraFireflyParticle sakuraFireflyParticle = _sakuraFireflies[i];
					float num3 = 0.42f + 0.58f * (0.5f + 0.5f * Mathf.Sin(unscaledTime * 1.7f + sakuraFireflyParticle.Phase));
					float num4 = sakuraFireflyParticle.Size * num2 * (0.85f + num3 * 0.35f);
					float num5 = Mathf.Clamp01(num * num3 * 0.58f);
					GUI.color = Color.Lerp(new Color(1f, 0.68f, 0.34f, num5), new Color(1f, 0.54f, 0.73f, num5), 0.5f + 0.5f * Mathf.Sin(sakuraFireflyParticle.Phase));
					GUI.DrawTexture(new Rect(sakuraFireflyParticle.X * w - num4 * 0.5f, sakuraFireflyParticle.Y * h - num4 * 0.5f, num4, num4), (Texture)(object)_sakuraGlowTexture, (ScaleMode)0, true);
				}
				GUI.color = Color.white;
			}
		}

		private void DrawWarmGlow(float w, float h)
		{
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: 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)
			if (!((Object)(object)_warmGlow == (Object)null) && _warmGlowEnabled.Value && _hasPlayerScreenPosition)
			{
				float num = Mathf.Clamp(_warmGlowStrength.Value, 0f, 1.5f);
				if (!(num <= 0.001f))
				{
					float num2 = 0.96f + Mathf.Sin(Time.unscaledTime * 2.7f) * 0.025f + Mathf.Sin(Time.unscaledTime * 6.3f + 1.4f) * 0.015f;
					float num3 = Mathf.Min(w, h) * Mathf.Clamp(_warmGlowRadius.Value, 0.08f, 0.7f);
					float num4 = num3 * 2f;
					Rect val = new Rect(_playerScreenPosition.x - num3, _playerScreenPosition.y - num3, num4, num4);
					GUI.color = new Color(1f, 0.78f, 0.56f, Mathf.Clamp01(0.64f * num * num2));
					GUI.DrawTexture(val, (Texture)(object)_warmGlow, (ScaleMode)0, true);
					float num5 = num4 * 0.62f;
					Rect val2 = new Rect(_playerScreenPosition.x - num5 * 0.5f, _playerScreenPosition.y - num5 * 0.5f, num5, num5);
					GUI.color = new Color(1f, 0.94f, 0.78f, Mathf.Clamp01(0.46f * num * num2));
					GUI.DrawTexture(val2, (Texture)(object)_warmGlow, (ScaleMode)0, true);
					GUI.color = Color.white;
				}
			}
		}

		private void DrawSnow(float w, float h)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_snowDot == (Object)null) && _snowEnabled.Value)
			{
				for (int i = 0; i < _snow.Length; i++)
				{
					SnowParticle snowParticle = _snow[i];
					float num = 0.62f + 0.38f * Mathf.Sin(Time.time * 2.2f + snowParticle.Phase);
					float num2 = snowParticle.Size * (0.75f + num * 0.35f);
					float num3 = 0.35f + num * 0.55f;
					GUI.color = new Color(0.78f, 0.93f, 1f, num3);
					GUI.DrawTexture(new Rect(snowParticle.X * w, snowParticle.Y * h, num2, num2), (Texture)(object)_snowDot);
				}
				GUI.color = Color.white;
			}
		}

		private void DrawSand(float w, float h)
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_sandStreak == (Object)null) && _sandstormEnabled.Value && !(_sandOpacity.Value <= 0.001f))
			{
				float num = Mathf.Clamp(Mathf.Min(w, h) / 720f, 0.75f, 1.8f);
				float num2 = _sandGrainSize.Value * num;
				float value = _sandOpacity.Value;
				float unscaledTime = Time.unscaledTime;
				for (int i = 0; i < _sand.Length; i++)
				{
					SandParticle sandParticle = _sand[i];
					float num3 = 0.82f + 0.18f * Mathf.Sin(unscaledTime * 3.2f + sandParticle.Phase);
					float num4 = Mathf.Clamp01(value * sandParticle.Opacity * num3);
					float num5 = Mathf.Lerp(0.72f, 0.96f, sandParticle.Tone);
					float num6 = Mathf.Lerp(0.46f, 0.72f, sandParticle.Tone);
					float num7 = Mathf.Lerp(0.22f, 0.4f, sandParticle.Tone);
					GUI.color = new Color(num5, num6, num7, num4);
					float num8 = sandParticle.Length * num2;
					float num9 = sandParticle.Height * num2;
					GUI.DrawTexture(new Rect(sandParticle.X * w, sandParticle.Y * h, num8, num9), (Texture)(object)_sandStreak);
				}
				GUI.color = Color.white;
			}
		}

		private void DrawSettingsMenu()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp((float)Screen.width - 28f, 320f, 1180f);
			float num2 = Mathf.Clamp((float)Screen.height - 28f, 420f, 980f);
			if (((Rect)(ref _menuRect)).width <= 0f || _menuScreenWidth != Screen.width || _menuScreenHeight != Screen.height)
			{
				_menuRect = new Rect(((float)Screen.width - num) * 0.5f, ((float)Screen.height - num2) * 0.5f, num, num2);
				_menuScreenWidth = Screen.width;
				_menuScreenHeight = Screen.height;
			}
			else
			{
				((Rect)(ref _menuRect)).width = num;
				((Rect)(ref _menuRect)).height = num2;
				((Rect)(ref _menuRect)).x = Mathf.Clamp(((Rect)(ref _menuRect)).x, 8f, Mathf.Max(8f, (float)Screen.width - num - 8f));
				((Rect)(ref _menuRect)).y = Mathf.Clamp(((Rect)(ref _menuRect)).y, 8f, Mathf.Max(8f, (float)Screen.height - num2 - 8f));
			}
			_menuRect = GUI.Window(486215, _menuRect, new WindowFunction(DrawSettingsWindow), GUIContent.none, _windowStyle);
		}

		private void DrawSettingsWindow(int windowId)
		{
			//IL_01c2: 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_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: 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_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_0532: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("FM", _logoStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(46f),
				GUILayout.Height(46f)
			});
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("FAE MOUNTAIN  /  VISUAL MOD", _eyebrowStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("FROZEN MOUNT FAY", _titleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.FlexibleSpace();
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(112f) });
			bool flag = _manualEnabled && _enabled.Value;
			GUILayout.Label(flag ? "АКТИВЕН" : "ВЫКЛЮЧЕН", flag ? _statusOnStyle : _statusOffStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(25f) });
			GUILayout.Label("BUILD  1.1.4", _mutedStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUIStyle val = ((_activeTab == SeasonTab.Winter) ? _winterTabActiveStyle : _tabStyle);
			GUIStyle val2 = ((_activeTab == SeasonTab.Summer) ? _summerTabActiveStyle : _tabStyle);
			GUIStyle val3 = ((_activeTab == SeasonTab.Underwater) ? _underwaterTabActiveStyle : _tabStyle);
			GUIStyle val4 = ((_activeTab == SeasonTab.Japan) ? _japanTabActiveStyle : _tabStyle);
			if (GUILayout.Button("❄  ЗИМА", val, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(48f),
				GUILayout.ExpandWidth(true)
			}))
			{
				_activeTab = SeasonTab.Winter;
				_menuScroll = Vector2.zero;
			}
			if (GUILayout.Button("☀  ЛЕТО", val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(48f),
				GUILayout.ExpandWidth(true)
			}))
			{
				_activeTab = SeasonTab.Summer;
				_menuScroll = Vector2.zero;
			}
			if (GUILayout.Button("≈  ПОД ВОДОЙ", val3, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(48f),
				GUILayout.ExpandWidth(true)
			}))
			{
				_activeTab = SeasonTab.Underwater;
				_menuScroll = Vector2.zero;
			}
			if (GUILayout.Button("✿  ЯПОНИЯ", val4, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(48f),
				GUILayout.ExpandWidth(true)
			}))
			{
				_activeTab = SeasonTab.Japan;
				_menuScroll = Vector2.zero;
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(_toolbarStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("УПРАВЛЕНИЕ", _eyebrowStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Label(((object)_menuKey.Value/*cast due to .constrained prefix*/).ToString() + "   /   " + ((object)_toggleKey.Value/*cast due to .constrained prefix*/).ToString(), _valueStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(_showHotkeys ? "−" : "КЛАВИШИ", _smallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(92f),
				GUILayout.Height(30f)
			}))
			{
				_showHotkeys = !_showHotkeys;
			}
			GUILayout.EndHorizontal();
			if (_showHotkeys)
			{
				GUILayout.Space(4f);
				DrawHotkeyCard();
			}
			GUILayout.Space(5f);
			_menuScroll = GUILayout.BeginScrollView(_menuScroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			if (_activeTab == SeasonTab.Winter)
			{
				DrawWinterTab();
			}
			else if (_activeTab == SeasonTab.Summer)
			{
				DrawSummerTab();
			}
			else if (_activeTab == SeasonTab.Underwater)
			{
				DrawUnderwaterTab();
			}
			else
			{
				DrawJapanTab();
			}
			GUILayout.EndScrollView();
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(_toolbarStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("ОБЩИЙ ПЕРЕКЛЮЧАТЕЛЬ", _eyebrowStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(flag ? "Все выбранные эффекты работают" : "Эффекты выключены, настройки сохранены", _mutedStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.FlexibleSpace();
			if (GUILayout.Button(flag ? "ВЫКЛ. ВСЁ" : "ВКЛ. ВЫБРАННОЕ", _masterButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(178f),
				GUILayout.Height(38f)
			}))
			{
				_manualEnabled = !flag;
				_enabled.Value = !flag;
				((BaseUnityPlugin)this).Config.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("F8  МЕНЮ     •     F9  ВСЕ ЭФФЕКТЫ", _footerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("×", _smallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(28f),
				GUILayout.Height(24f)
			}))
			{
				_menuOpen = false;
				((BaseUnityPlugin)this).Config.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 78f));
		}

		private void DrawWinterTab()
		{
			if (((Rect)(ref _menuRect)).width >= 1080f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawColdFilterSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSnowSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawWarmGlowSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else if (((Rect)(ref _menuRect)).width >= 850f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawColdFilterSection();
				DrawSnowSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawWarmGlowSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else
			{
				DrawColdFilterSection();
				DrawSnowSection();
				DrawWarmGlowSection();
			}
		}

		private void DrawColdFilterSection()
		{
			DrawSectionHeading("01", "ХОЛОДНЫЙ ФИЛЬТР", "Мягкий ледяной оттенок поверх изображения");
			DrawToggleCard("Холодная цветокоррекция", "Добавляет синий тон, не перекрывая детали игры.", _coldFilterEnabled);
			DrawSliderCard("Интенсивность", "Сила холодного оттенка", _blueTint, 0f, 0.5f, "0.00");
			GUILayout.Space(10f);
		}

		private void DrawSnowSection()
		{
			DrawSectionHeading("02", "СНЕГОПАД", "Лёгкие снежинки поверх игрового мира");
			DrawToggleCard("Снег", "Включает анимированные снежинки. По умолчанию выключено.", _snowEnabled);
			DrawIntegerSliderCard("Количество снежинок", "Плотность снегопада — от редких хлопьев до метели", _snowflakeCount, 0, 300);
			GUILayout.Space(10f);
		}

		private void DrawWarmGlowSection()
		{
			DrawSectionHeading("03", "ТЁПЛЫЙ СВЕТ", "Небольшой световой ореол рядом с персонажем");
			DrawToggleCard("Свечение персонажа", "Включает локальный мягкий свет вокруг героя.", _warmGlowEnabled);
			DrawSliderCard("Яркость", "Сила тёплого свечения", _warmGlowStrength, 0f, 1.5f, "0.00");
			DrawSliderCard("Радиус", "Размер светового ореола", _warmGlowRadius, 0.08f, 0.7f, "0.00");
		}

		private void DrawSummerTab()
		{
			if (((Rect)(ref _menuRect)).width >= 1080f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawYellowFilterSection();
				DrawRedFilterSection();
				DrawSandstormSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawVignetteSection();
				DrawHeatHazeSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawOpticalDistortionSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else if (((Rect)(ref _menuRect)).width >= 850f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawYellowFilterSection();
				DrawRedFilterSection();
				DrawHeatHazeSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawVignetteSection();
				DrawOpticalDistortionSection();
				DrawSandstormSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else
			{
				DrawYellowFilterSection();
				DrawRedFilterSection();
				DrawVignetteSection();
				DrawHeatHazeSection();
				DrawOpticalDistortionSection();
				DrawSandstormSection();
			}
		}

		private void DrawUnderwaterTab()
		{
			if (((Rect)(ref _menuRect)).width >= 850f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawUnderwaterBlueFilterSection();
				DrawUnderwaterPlayerLightSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawUnderwaterVignetteSection();
				DrawUnderwaterEffectSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else
			{
				DrawUnderwaterBlueFilterSection();
				DrawUnderwaterVignetteSection();
				DrawUnderwaterEffectSection();
				DrawUnderwaterPlayerLightSection();
			}
		}

		private void DrawJapanTab()
		{
			if (((Rect)(ref _menuRect)).width >= 1080f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSakuraFilterSection();
				DrawSakuraPetalsSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSakuraVignetteSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSakuraFirefliesSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else if (((Rect)(ref _menuRect)).width >= 850f)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSakuraFilterSection();
				DrawSakuraPetalsSection();
				GUILayout.EndVertical();
				GUILayout.Space(12f);
				GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				DrawSakuraVignetteSection();
				DrawSakuraFirefliesSection();
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
			}
			else
			{
				DrawSakuraFilterSection();
				DrawSakuraPetalsSection();
				DrawSakuraVignetteSection();
				DrawSakuraFirefliesSection();
			}
		}

		private void DrawSakuraFilterSection()
		{
			DrawSectionHeading("01", "РОЗОВЫЙ ФИЛЬТР", "Мягкий оттенок цветущей сакуры");
			DrawToggleCard("Цветовая атмосфера сакуры", "Добавляет нежный розово-персиковый тон, не перекрывая детали игры.", _sakuraFilterEnabled);
			DrawSliderCard("Интенсивность", "Сила розовой цветокоррекции", _sakuraFilterStrength, 0f, 0.45f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawSakuraPetalsSection()
		{
			DrawSectionHeading("02", "ЛЕПЕСТКИ САКУРЫ", "Лёгкий ветер несёт лепестки через экран");
			DrawToggleCard("Падающие лепестки", "Анимированные розовые и светлые лепестки с покачиванием и вращением.", _sakuraPetalsEnabled);
			DrawIntegerSliderCard("Количество лепестков", "Плотность цветопада", _sakuraPetalCount, 0, 260);
			DrawSliderCard("Скорость ветра", "Темп падения и бокового движения", _sakuraPetalSpeed, 0.1f, 2.5f, "0.00");
			DrawSliderCard("Размер лепестков", "Масштаб частиц сакуры", _sakuraPetalSize, 0.5f, 2.2f, "0.00");
			DrawSliderCard("Прозрачность", "Насколько заметны лепестки", _sakuraPetalOpacity, 0.05f, 1f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawSakuraVignetteSection()
		{
			DrawSectionHeading("03", "РОЗОВАЯ ВИНЬЕТКА", "Мягкая сливово-розовая рамка по краям");
			DrawToggleCard("Виньетка сакуры", "Затемняет края тёплым розово-сливовым оттенком.", _sakuraVignetteEnabled);
			DrawSliderCard("Сила виньетки", "Насыщенность затемнения по краям", _sakuraVignetteStrength, 0f, 1f, "0.00");
			DrawSliderCard("Размер центра", "Размер светлой области без виньетки", _sakuraVignetteRadius, 0.35f, 0.88f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawSakuraFirefliesSection()
		{
			DrawSectionHeading("04", "ХОТАРУ — СВЕТЛЯЧКИ", "Тёплые огоньки мерцают между лепестками");
			DrawToggleCard("Парящие светлячки", "Мягкие золотисто-розовые огоньки с плавным мерцанием.", _sakuraFirefliesEnabled);
			DrawIntegerSliderCard("Количество огоньков", "Плотность светлячков", _sakuraFireflyCount, 0, 48);
			DrawSliderCard("Яркость", "Сила свечения огоньков", _sakuraFireflyBrightness, 0f, 1.5f, "0.00");
			DrawSliderCard("Скорость", "Темп плавного парения", _sakuraFireflySpeed, 0.1f, 2.5f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawUnderwaterBlueFilterSection()
		{
			DrawSectionHeading("01", "СИНИЙ ПОДВОДНЫЙ ФИЛЬТР", "Холодный сине-бирюзовый оттенок глубокой воды");
			DrawToggleCard("Подводная цветокоррекция", "Добавляет водный синий тон, сохраняя читаемость игрового мира.", _underwaterBlueFilterEnabled);
			DrawSliderCard("Интенсивность", "Сила синего оттенка", _underwaterBlueFilterStrength, 0f, 0.65f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawUnderwaterVignetteSection()
		{
			DrawSectionHeading("02", "ЧЁРНАЯ ВИНЬЕТКА", "Глубокое затемнение по краям, как под толщей воды");
			DrawToggleCard("Подводная виньетка", "Затемняет углы и края отдельной чёрно-синей маской.", _underwaterVignetteEnabled);
			DrawSliderCard("Сила затемнения", "Насколько тёмными становятся края", _underwaterVignetteStrength, 0f, 1f, "0.00");
			DrawSliderCard("Размер центра", "Размер чистой области в середине экрана", _underwaterVignetteRadius, 0.35f, 0.88f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawUnderwaterEffectSection()
		{
			DrawSectionHeading("03", "ВСПЛЫВАЮЩИЕ ПУЗЫРЬКИ", "Лёгкие пузырьки с настройкой скорости, количества и мягкости");
			DrawToggleCard("Подводные пузырьки", "Добавляет всплывающие пузырьки с отдельной настройкой мягкости.", _underwaterEffectEnabled);
			DrawSliderCard("Интенсивность", "Видимость пузырьков", _underwaterEffectStrength, 0f, 1f, "0.00");
			DrawSliderCard("Скорость движения", "Скорость всплытия пузырьков", _underwaterEffectSpeed, 0.1f, 2.5f, "0.00");
			DrawIntegerSliderCard("Количество пузырьков", "Плотность всплывающих пузырьков", _underwaterBubbleCount, 0, 100);
			DrawSliderCard("Размытие пузырьков", "0 — чёткие контуры, 1 — максимально мягкие пузырьки", _underwaterBubbleBlur, 0f, 1f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawUnderwaterPlayerLightSection()
		{
			DrawSectionHeading("04", "БЕЛЫЙ СВЕТ ИГРОКА", "Мягкий белый ореол, исходящий от персонажа");
			DrawToggleCard("Белый свет от игрока", "Добавляет отдельное локальное белое свечение вокруг героя. Работает независимо от подводного фильтра и пузырьков.", _underwaterPlayerLightEnabled);
			DrawSliderCard("Яркость", "Сила белого света", _underwaterPlayerLightStrength, 0f, 1.5f, "0.00");
			DrawSliderCard("Радиус", "Размер светового ореола вокруг персонажа", _underwaterPlayerLightRadius, 0.06f, 0.5f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawYellowFilterSection()
		{
			DrawSectionHeading("01", "ЖЁЛТЫЙ ФИЛЬТР", "Мягкий золотистый оттенок летнего света");
			DrawToggleCard("Жёлтая цветокоррекция", "Добавляет тёплый жёлтый тон поверх игрового изображения.", _yellowFilterEnabled);
			DrawSliderCard("Интенсивность", "Сила жёлтого оттенка", _yellowFilterStrength, 0f, 0.5f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawRedFilterSection()
		{
			DrawSectionHeading("02", "КРАСНЫЙ ФИЛЬТР", "Насыщенный тёплый красно-янтарный тон");
			DrawToggleCard("Красная цветокоррекция", "Добавляет красный оттенок; можно использовать отдельно или вместе с жёлтым.", _redFilterEnabled);
			DrawSliderCard("Интенсивность", "Сила красного оттенка", _redFilterStrength, 0f, 0.4f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawVignetteSection()
		{
			DrawSectionHeading("03", "ВИНЬЕТКА", "Цветное затемнение по краям экрана");
			DrawToggleCard("Виньетка по краям", "Окрашивает края, оставляя центр изображения светлее.", _vignetteEnabled);
			DrawVignetteColorSelector();
			DrawSliderCard("Сила виньетки", "Интенсивность цветного затемнения", _vignetteStrength, 0f, 1f, "0.00");
			DrawSliderCard("Размер центра", "Размер области без виньетки", _vignetteRadius, 0.35f, 0.88f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawHeatHazeSection()
		{
			DrawSectionHeading("04", "МИРАЖ / МАРЕВО", "Движущиеся волны горячего воздуха");
			DrawToggleCard("Тепловое марево", "Декоративные волны поверх изображения — без смещения пикселей.", _heatHazeEnabled);
			DrawSliderCard("Интенсивность", "Насколько заметно марево", _heatHazeStrength, 0f, 1f, "0.00");
			DrawSliderCard("Скорость волн", "Темп движения тепловых волн", _heatHazeSpeed, 0.1f, 3f, "0.00");
			DrawSliderCard("Покрытие экрана", "Высота области марева, начиная снизу", _heatHazeArea, 0.2f, 1f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawOpticalDistortionSection()
		{
			DrawSectionHeading("05", "ОПТИЧЕСКОЕ ИСКАЖЕНИЕ", "Реальное смещение пикселей кадра камеры");
			DrawToggleCard("Искажение изображения", "Смещает детали уже отрисованного кадра. Требуется Built-in Render Pipeline.", _opticalDistortionEnabled);
			DrawSliderCard("Сила искажения", "Максимальное смещение деталей изображения", _opticalDistortionStrength, 0f, 1f, "0.00");
			DrawSliderCard("Скорость", "Темп движения оптических волн", _opticalDistortionSpeed, 0.1f, 3f, "0.00");
			DrawSliderCard("Размер волн", "Крупность и частота изгибов", _opticalDistortionWaveSize, 0.5f, 3f, "0.00");
			DrawSliderCard("Покрытие экрана", "Высота области искажения, начиная снизу", _opticalDistortionArea, 0.2f, 1f, "0.00");
			DrawSliderCard("Производительность", "Меньше значение — выше FPS, но картинка мягче", _opticalDistortionQuality, 0.25f, 0.75f, "0.00");
			GUILayout.Space(8f);
		}

		private void DrawSandstormSection()
		{
			DrawSectionHeading("06", "ПЕСЧАНАЯ МЕТЕЛЬ", "Порывы ветра несут песок и пыль через экран");
			DrawToggleCard("Песчаная буря", "Отдельные анимированные песчинки и пылевые следы. Не зависит от снега.", _sandstormEnabled);
			DrawIntegerSliderCard("Количество песка", "Плотность бури — от редких песчинок до густой метели", _sandParticleCount, 0, 600);
			DrawSliderCard("Скорость ветра", "Насколько быстро песок проносится через экран", _sandWindSpeed, 0.2f, 4f, "0.00");
			DrawSliderCard("Размер песчинок", "Длина и толщина летящих частиц", _sandGrainSize, 0.5f, 2.5f, "0.00");
			DrawSliderCard("Прозрачность", "Насколько заметны песок и пыль", _sandOpacity, 0.05f, 1f, "0.00");
		}

		private void DrawVignetteColorSelector()
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("ЦВЕТ ВИНЬЕТКИ", _eyebrowStyle, Array.Empty<GUILayoutOption>());
			int num = Mathf.Clamp(_vignetteColor.Value, 0, 3);
			string[] array = new string[4] { "ТЁМНАЯ", "КРАСНАЯ", "ЖЁЛТАЯ", "ПЕСОЧНАЯ" };
			for (int i = 0; i < 2; i++)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				for (int j = 0; j < 2; j++)
				{
					int num2 = i * 2 + j;
					bool num3 = num == num2;
					string text = (num3 ? "✓  " : "○  ") + array[num2];
					GUIStyle val = (GUIStyle)((num3 && _vignetteColorStyles.Length > num2) ? ((object)_vignetteColorStyles[num2]) : ((object)_buttonStyle));
					if (GUILayout.Button(text, val, (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.Height(36f),
						GUILayout.ExpandWidth(true)
					}))
					{
						_vignetteColor.Value = num2;
					}
					if (j == 0)
					{
						GUILayout.Space(6f);
					}
				}
				GUILayout.EndHorizontal();
				if (i == 0)
				{
					GUILayout.Space(6f);
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space(5f);
		}

		private void DrawHotkeyCard()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			DrawHotkeyBinding("ОТКРЫТЬ МЕНЮ", ((object)_menuKey.Value/*cast due to .constrained prefix*/).ToString(), _waitingForMenuKey, menuKey: true);
			GUILayout.Space(7f);
			DrawHotkeyBinding("ПЕРЕКЛЮЧАТЕЛЬ ЭФФЕКТОВ", ((object)_toggleKey.Value/*cast due to .constrained prefix*/).ToString(), _waitingForToggleKey, menuKey: false);
			GUILayout.EndHorizontal();
			GUILayout.Label("Нажми на клавишу и выбери новую. Esc отменяет назначение; Ctrl, Shift и Alt поддерживаются.", _mutedStyle, Array.Empty<GUILayoutOption>());
		}

		private void DrawHotkeyBinding(string label, string key, bool waiting, bool menuKey)
		{
			GUILayout.BeginVertical(_cardStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
			GUILayout.Label(label, _eyebrowStyle, Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(waiting ? "НАЖМИ КЛАВИШУ…" : key, _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(34f),
				GUILayout.ExpandWidth(true)
			}))
			{
				_waitingForMenuKey = menuKey;
				_waitingForToggleKey = !menuKey;
			}
			GUILayout.EndVertical();
		}

		private void DrawSectionHeading(string number, string heading, string subtitle)
		{
			//IL_0075: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUI.color = ((_activeTab == SeasonTab.Winter) ? new Color(0.47f, 0.82f, 1f) : ((_activeTab == SeasonTab.Underwater) ? new Color(0.32f, 0.82f, 0.96f) : ((_activeTab == SeasonTab.Japan) ? new Color(1f, 0.58f, 0.73f) : new Color(1f, 0.72f, 0.38f))));
			GUILayout.Label(number, _sectionNumberStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(30f),
				GUILayout.Height(28f)
			});
			GUI.color = Color.white;
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label(heading, _sectionStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(subtitle, _mutedStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
		}

		private void DrawToggleCard(string label, string description, ConfigEntry<bool> entry)
		{
			//IL_0069: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginVertical(_cardStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
			GUILayout.Label(label, _cardTitleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(description, _cardDescriptionStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.Space(8f);
			Color backgroundColor = GUI.backgroundColor;
			GUI.backgroundColor = (Color)((!entry.Value) ? Color.white : ((_activeTab == SeasonTab.Winter) ? new Color(0.7f, 0.91f, 1f) : ((_activeTab == SeasonTab.Underwater) ? new Color(0.55f, 0.9f, 1f) : ((_activeTab == SeasonTab.Japan) ? new Color(1f, 0.68f, 0.8f) : new Color(1f, 0.78f, 0.45f)))));
			GUIStyle val = (entry.Value ? _toggleOnStyle : _toggleOffStyle);
			if (GUILayout.Button(entry.Value ? "✓  ВКЛ" : "○  ВЫКЛ", val, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(94f),
				GUILayout.Height(36f)
			}))
			{
				entry.Value = !entry.Value;
			}
			GUI.backgroundColor = backgroundColor;
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Space(5f);
		}

		private void DrawSliderCard(string label, string description, ConfigEntry<float> entry, float min, float max, string format)
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _cardTitleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Label(entry.Value.ToString(format), _valueStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) });
			GUILayout.EndHorizontal();
			float num = GUILayout.HorizontalSlider(entry.Value, min, max, _sliderStyle, _sliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			if (!Mathf.Approximately(num, entry.Value))
			{
				entry.Value = num;
			}
			GUILayout.Label(description, _cardDescriptionStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.Space(4f);
		}

		private void DrawIntegerSliderCard(string label, string description, ConfigEntry<int> entry, int min, int max)
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _cardTitleStyle, Array.