Decompiled source of UltraTimeManipulation v0.1.0

UltraTimeManipulation.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("UltraTimeManipulation")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyInformationalVersion("0.0.2")]
[assembly: AssemblyProduct("UltraTimeManipulation")]
[assembly: AssemblyTitle("UltraTimeManipulation")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace UltraTimeManipulation
{
	public class CustomSoundPlayer : MonoBehaviour
	{
		private static CustomSoundPlayer _instance;

		public AudioSource source;

		private string soundPath;

		public static CustomSoundPlayer Instance
		{
			get
			{
				return _instance;
			}
			set
			{
				throw new NotImplementedException();
			}
		}

		private void Start()
		{
			_instance = this;
			source = ((Component)this).gameObject.AddComponent<AudioSource>();
		}

		public void PlaySound(string file)
		{
			if (!string.IsNullOrEmpty(file))
			{
				if (!File.Exists(file))
				{
					Debug.LogError((object)("Could not find audio file '" + file + "'"));
					return;
				}
				soundPath = file;
				((Component)this).gameObject.SetActive(true);
				((MonoBehaviour)this).StartCoroutine(PlaySoundRoutine());
			}
		}

		private IEnumerator PlaySoundRoutine()
		{
			new FileInfo(soundPath);
			AudioType audioType = (AudioType)20;
			UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(new Uri(soundPath).AbsoluteUri, audioType);
			try
			{
				DownloadHandler downloadHandler = request.downloadHandler;
				DownloadHandlerAudioClip handler = (DownloadHandlerAudioClip)(object)((downloadHandler is DownloadHandlerAudioClip) ? downloadHandler : null);
				handler.streamAudio = false;
				request.SendWebRequest();
				yield return request;
				source.Stop();
				source.clip = handler.audioClip;
				source.volume = 1f * Plugin.volumeMult * MonoSingleton<PrefsManager>.Instance.GetFloat("sfxVolume", 0f);
				source.Play();
			}
			finally
			{
				((IDisposable)request)?.Dispose();
			}
		}
	}
	[BepInPlugin("UltraTimeManipulation", "UltraTimeManipulation", "0.01")]
	public class Plugin : BaseUnityPlugin
	{
		private class particleInfo
		{
			public float x;

			public float y;

			public float xVel;

			public float yVel;

			public float timeLeft;

			public Color color;

			public particleInfo(float x, float y, float xVel, float yVel, float timeLeft)
			{
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				this.x = x;
				this.y = y;
				this.xVel = xVel;
				this.yVel = yVel;
				this.timeLeft = timeLeft;
				float num = 0.45f;
				float num2 = 0.8f + 0.2f * (float)rnd.NextDouble();
				float num3 = 0.8f + 0.2f * (float)rnd.NextDouble();
				float num4 = 0.6f + 0.4f * (float)rnd.NextDouble();
				color = new Color(num, num2, num3, num4);
			}
		}

		public static Random rnd = new Random();

		public static bool modEnabled = true;

		public static float realTimeDelta = 1f;

		public static float rechargeMultiplier = 0.75f;

		public static float maxTimeAccumulated = 6f;

		public static float rampUpTime = 0.2f;

		public static float slowdownMult = 0.4f;

		public static bool keyToggleFunctionality = false;

		public static KeyCode slowdownCode = (KeyCode)326;

		public static float volumeMult = 0.7f;

		public static bool soundEnabled = true;

		public static bool soundSlowdownEnabled = true;

		public static float soundSlowDown = 1f;

		public static float soundSlowDownRelativePitch = 1f;

		public static bool visualsEnabled = true;

		public static float slowdownColorCompression = 1f;

		public static float slowdownDarkness = 1f;

		public static bool legacyDisplay = true;

		public static bool HUDFlashing = true;

		public static bool HUDSparks = true;

		public static float HUDSparksFadeOutTime = 2f;

		public static float HUDScale = 1f;

		public static bool minimalHUD = false;

		public static int HUDQuadrant = 3;

		public static string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";

		public static string underlayImageFile = Path.Combine(DefaultParentFolder, "underlay.png") ?? "";

		public static string underlayTopImageFile = Path.Combine(DefaultParentFolder, "underlayTop.png") ?? "";

		public static string filledBarImageFile = Path.Combine(DefaultParentFolder, "filledBar.png") ?? "";

		public static string emptyBarImageFile = Path.Combine(DefaultParentFolder, "emptyBar.png") ?? "";

		public static string spark0ImageFile = Path.Combine(DefaultParentFolder, "spark0.png") ?? "";

		public static string spark10ImageFile = Path.Combine(DefaultParentFolder, "spark10.png") ?? "";

		public static string spark20ImageFile = Path.Combine(DefaultParentFolder, "spark20.png") ?? "";

		public static string spark30ImageFile = Path.Combine(DefaultParentFolder, "spark30.png") ?? "";

		public static string spark40ImageFile = Path.Combine(DefaultParentFolder, "spark40.png") ?? "";

		public static string spark50ImageFile = Path.Combine(DefaultParentFolder, "spark50.png") ?? "";

		public static string spark60ImageFile = Path.Combine(DefaultParentFolder, "spark60.png") ?? "";

		public static string spark70ImageFile = Path.Combine(DefaultParentFolder, "spark70.png") ?? "";

		public static string spark80ImageFile = Path.Combine(DefaultParentFolder, "spark80.png") ?? "";

		public static string spark90ImageFile = Path.Combine(DefaultParentFolder, "spark90.png") ?? "";

		public static string speedupSound = Path.Combine(DefaultParentFolder, "speedup.wav") ?? "";

		public static string slowdownSound = Path.Combine(DefaultParentFolder, "slowdown.wav") ?? "";

		private CustomSoundPlayer csp;

		private readonly Harmony harmony = new Harmony("daemon.UltraTimeManipulation");

		public static bool modEnabledTemporary = true;

		private Texture2D underlayTexture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D underlayTopTexture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D filledBarTexture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D emptyBarTexture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark0Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark10Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark20Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark30Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark40Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark50Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark60Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark70Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark80Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private Texture2D spark90Texture = new Texture2D(0, 0, (TextureFormat)4, false);

		private double timeUntilFlash = 0.0;

		private double timeUntilFlashEnd = 0.20000000298023224;

		private double timeUntilMiniFlashRefresh = 0.10000000149011612;

		private double[] valueMultsSmallFlash = new double[11];

		private Color[] miniFlashes = (Color[])(object)new Color[11];

		private int sparkSideCounter = 0;

		private Texture2D currentSparkTex;

		private float sparkTimer = 0f;

		private List<particleInfo> particles = new List<particleInfo>();

		private bool speedupPlayedForcefully = false;

		private bool slowdownKeyActive = false;

		public static float currentSlowdownMult = 1f;

		public static float timeAccumulated = 0f;

		public static float timeInRampup = 0f;

		private bool slowdownEnded = false;

		private void determineTimeDelta()
		{
			if (currentSlowdownMult != 0f && !inMenu())
			{
				realTimeDelta = Time.deltaTime / currentSlowdownMult;
			}
			else
			{
				realTimeDelta = Time.unscaledDeltaTime;
			}
		}

		private bool inMenu()
		{
			return (double)Time.deltaTime < 0.0001;
		}

		private void Awake()
		{
			PluginConfig.UltraTimeManipulationConfig();
			csp = ((Component)this).gameObject.AddComponent<CustomSoundPlayer>();
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"UltraTimeManipulation Started");
		}

		[HarmonyPatch(typeof(LeaderboardController), "SubmitCyberGrindScore")]
		[HarmonyPrefix]
		public static bool no(LeaderboardController __instance)
		{
			return !modEnabled;
		}

		[HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")]
		[HarmonyPrefix]
		public static bool nope(LeaderboardController __instance)
		{
			return !modEnabled;
		}

		[HarmonyPatch(typeof(LeaderboardController), "SubmitFishSize")]
		[HarmonyPrefix]
		public static bool notevenfish(LeaderboardController __instance)
		{
			return !modEnabled;
		}

		public static bool IsGameplayScene()
		{
			string[] source = new string[6] { "Intro", "Bootstrap", "Main Menu", "Level 2-S", "Intermission1", "Intermission2" };
			return !source.Contains(SceneHelper.CurrentScene);
		}

		public void Start()
		{
			ImageConversion.LoadImage(underlayTexture, File.ReadAllBytes(underlayImageFile));
			ImageConversion.LoadImage(underlayTopTexture, File.ReadAllBytes(underlayTopImageFile));
			ImageConversion.LoadImage(filledBarTexture, File.ReadAllBytes(filledBarImageFile));
			ImageConversion.LoadImage(emptyBarTexture, File.ReadAllBytes(emptyBarImageFile));
			ImageConversion.LoadImage(spark0Texture, File.ReadAllBytes(spark0ImageFile));
			ImageConversion.LoadImage(spark10Texture, File.ReadAllBytes(spark10ImageFile));
			ImageConversion.LoadImage(spark20Texture, File.ReadAllBytes(spark20ImageFile));
			ImageConversion.LoadImage(spark30Texture, File.ReadAllBytes(spark30ImageFile));
			ImageConversion.LoadImage(spark40Texture, File.ReadAllBytes(spark40ImageFile));
			ImageConversion.LoadImage(spark50Texture, File.ReadAllBytes(spark50ImageFile));
			ImageConversion.LoadImage(spark60Texture, File.ReadAllBytes(spark60ImageFile));
			ImageConversion.LoadImage(spark70Texture, File.ReadAllBytes(spark70ImageFile));
			ImageConversion.LoadImage(spark80Texture, File.ReadAllBytes(spark80ImageFile));
			ImageConversion.LoadImage(spark90Texture, File.ReadAllBytes(spark90ImageFile));
		}

		private float OnGUIx(int i)
		{
			return (float)(100 + 40 * i) * HUDScale;
		}

		private void OnGUI()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d15: Unknown result type (might be due to invalid IL or missing references)
			if (!modEnabled || !modEnabledTemporary)
			{
				return;
			}
			if (legacyDisplay)
			{
				GUIStyle val = new GUIStyle();
				val.normal.textColor = Color.cyan;
				val.fontSize = (int)Math.Round(48f * HUDScale * 4f);
				val.alignment = (TextAnchor)4;
				GUI.backgroundColor = Color.black;
				string text = "";
				for (int i = 0; (double)i < Math.Round(10.0 / (double)maxTimeAccumulated * (double)(maxTimeAccumulated - timeAccumulated)); i++)
				{
					text += "*";
				}
				GUI.Box(new Rect(240f * HUDScale, (float)Screen.height - 280f * HUDScale, 600f * HUDScale, 240f * HUDScale), text, val);
				return;
			}
			int num = 0;
			int num2 = 0;
			if (HUDQuadrant == 1)
			{
				num = 1;
				num2 = 1;
			}
			else if (HUDQuadrant == 2)
			{
				num = 1;
				num2 = 0;
			}
			else if (HUDQuadrant == 3)
			{
				num = 0;
				num2 = 0;
			}
			else if (HUDQuadrant == 4)
			{
				num = 0;
				num2 = 1;
			}
			if (!minimalHUD)
			{
				GUI.DrawTexture(new Rect((float)(Screen.width * num2), (float)(Screen.height * (1 - num)), (float)((Texture)underlayTexture).width * HUDScale * (float)(1 - 2 * num2), (float)((Texture)underlayTexture).height * HUDScale * (float)(2 * num - 1)), (Texture)(object)underlayTexture, (ScaleMode)0);
			}
			double num3 = 1.0;
			Color val2 = default(Color);
			((Color)(ref val2))..ctor((float)num3, (float)num3, (float)num3, 1f);
			if (HUDFlashing)
			{
				num3 = 1.0;
				timeUntilFlash += 0f - realTimeDelta;
				if (timeUntilFlash < 0.0)
				{
					timeUntilFlashEnd += 0f - realTimeDelta;
					num3 = 1.0 - 0.9 * (1.0 - 10.0 * Math.Abs(0.10000000149011612 - timeUntilFlashEnd));
					if (timeUntilFlashEnd < 0.0)
					{
						timeUntilFlash = 1.899999976158142 * rnd.NextDouble() + 1.7999999523162842;
						if (rnd.NextDouble() < 0.38)
						{
							timeUntilFlash = 0.05 + 0.2 * rnd.NextDouble();
						}
						timeUntilFlashEnd = 0.20000000298023224;
					}
				}
				((Color)(ref val2))..ctor((float)num3, (float)num3, (float)num3, 1f);
				timeUntilMiniFlashRefresh += 0f - realTimeDelta;
				if (timeUntilMiniFlashRefresh < 0.0)
				{
					timeUntilMiniFlashRefresh = 0.1;
					for (int j = 0; j < miniFlashes.Length; j++)
					{
						valueMultsSmallFlash[j] = 0.9 + 0.1 * rnd.NextDouble();
					}
				}
				for (int k = 0; k < miniFlashes.Length; k++)
				{
					miniFlashes[k] = new Color((float)(valueMultsSmallFlash[k] * num3), (float)(valueMultsSmallFlash[k] * num3), (float)(valueMultsSmallFlash[k] * num3), 1f);
				}
			}
			else
			{
				num3 = 1.0;
				((Color)(ref val2))..ctor((float)num3, (float)num3, (float)num3, 1f);
				for (int l = 0; l < valueMultsSmallFlash.Length; l++)
				{
					valueMultsSmallFlash[l] = 1.0;
					miniFlashes[l] = new Color(1f, 1f, 1f, 1f);
				}
			}
			GUI.DrawTexture(new Rect((float)(Screen.width * num2), (float)(Screen.height * (1 - num)), (float)((Texture)underlayTexture).width * HUDScale * (float)(1 - 2 * num2), (float)((Texture)underlayTexture).height * HUDScale * (float)(2 * num - 1)), (Texture)(object)underlayTopTexture, (ScaleMode)0, true, 0f, val2, 0f, 0f);
			int num4 = (int)Math.Round(11.0 / (double)maxTimeAccumulated * (double)(maxTimeAccumulated - timeAccumulated));
			float num5 = 44f * HUDScale;
			float num6 = (float)((Texture)filledBarTexture).width * HUDScale;
			float num7 = (float)((Texture)emptyBarTexture).height * HUDScale;
			for (int m = 0; m < num4; m++)
			{
				GUI.DrawTexture(new Rect(((float)Screen.width - OnGUIx(m)) * (float)num2 + OnGUIx(m) * (float)(1 - num2), num5 * (float)num + ((float)Screen.height - num5) * (float)(1 - num), num6 * (float)(1 - 2 * num2), num7 * (float)(2 * num - 1)), (Texture)(object)filledBarTexture, (ScaleMode)0, true, 0f, miniFlashes[m], 0f, 0f);
			}
			for (int n = num4; n < 11; n++)
			{
				GUI.DrawTexture(new Rect(((float)Screen.width - OnGUIx(n)) * (float)num2 + OnGUIx(n) * (float)(1 - num2), num5 * (float)num + ((float)Screen.height - num5) * (float)(1 - num), num6 * (float)(1 - 2 * num2), num7 * (float)(2 * num - 1)), (Texture)(object)emptyBarTexture, (ScaleMode)0, true, 0f, miniFlashes[n], 0f, 0f);
			}
			if (!HUDSparks)
			{
				return;
			}
			if ((timeInRampup > 0f || (slowdownKeyActive && !inMenu())) && timeAccumulated < maxTimeAccumulated)
			{
				sparkTimer += 0f - realTimeDelta;
				if (sparkTimer < 0f)
				{
					sparkSideCounter++;
					float x;
					float y;
					if (sparkSideCounter % 3 == 0)
					{
						x = ((float)Screen.width - 36f * HUDScale) * (float)num2 + 36f * HUDScale * (float)(1 - num2);
						y = ((float)Screen.height - 92f * HUDScale) * (float)(1 - num) + (float)num * HUDScale * 92f;
					}
					else if (sparkSideCounter % 3 == 1)
					{
						x = ((float)Screen.width - 592f * HUDScale) * (float)num2 + 592f * HUDScale * (float)(1 - num2);
						y = ((float)Screen.height - 144f * HUDScale) * (float)(1 - num) + (float)num * HUDScale * 144f;
					}
					else
					{
						x = ((float)Screen.width - 612f * HUDScale) * (float)num2 + 612f * HUDScale * (float)(1 - num2);
						y = ((float)Screen.height - 80f * HUDScale) * (float)(1 - num) + (float)num * HUDScale * 80f;
					}
					sparkTimer = 0.04f;
					double num8 = rnd.NextDouble() * Math.PI * 2.0;
					double num9 = 200.0 + 100.0 * rnd.NextDouble();
					double num10 = num9 * Math.Cos(num8) * 0.75;
					double num11 = num9 * Math.Sin(num8);
					particles.Add(new particleInfo(x, y, (float)num10, (float)num11, HUDSparksFadeOutTime));
				}
			}
			for (int num12 = 0; num12 < particles.Count; num12++)
			{
				particleInfo particleInfo = particles[num12];
				double num13 = Math.Atan(particleInfo.yVel / particleInfo.xVel);
				if (particleInfo.xVel < 0f)
				{
					num13 = Math.PI + num13;
				}
				if (num13 < 0.0)
				{
					num13 += Math.PI * 2.0;
				}
				if (num13 > Math.PI * 2.0)
				{
					num13 += Math.PI * -2.0;
				}
				currentSparkTex = spark0Texture;
				if (num13 > Math.PI)
				{
					num13 += -Math.PI;
				}
				if (num13 < Math.PI / 36.0)
				{
					currentSparkTex = spark90Texture;
				}
				else if (num13 < Math.PI / 12.0)
				{
					currentSparkTex = spark80Texture;
				}
				else if (num13 < Math.PI * 5.0 / 36.0)
				{
					currentSparkTex = spark70Texture;
				}
				else if (num13 < Math.PI * 7.0 / 36.0)
				{
					currentSparkTex = spark60Texture;
				}
				else if (num13 < Math.PI / 4.0)
				{
					currentSparkTex = spark50Texture;
				}
				else if (num13 < 0.9599310885968813)
				{
					currentSparkTex = spark40Texture;
				}
				else if (num13 < Math.PI * 13.0 / 36.0)
				{
					currentSparkTex = spark30Texture;
				}
				else if (num13 < Math.PI * 5.0 / 12.0)
				{
					currentSparkTex = spark20Texture;
				}
				else if (num13 < Math.PI * 17.0 / 36.0)
				{
					currentSparkTex = spark10Texture;
				}
				else if (num13 < 1.6580627893946132)
				{
					currentSparkTex = spark0Texture;
				}
				else if (num13 < 1.8325957145940461)
				{
					currentSparkTex = spark10Texture;
				}
				else if (num13 < Math.PI * 23.0 / 36.0)
				{
					currentSparkTex = spark20Texture;
				}
				else if (num13 < 2.1816615649929116)
				{
					currentSparkTex = spark30Texture;
				}
				else if (num13 < Math.PI * 3.0 / 4.0)
				{
					currentSparkTex = spark40Texture;
				}
				else if (num13 < 2.5307274153917776)
				{
					currentSparkTex = spark50Texture;
				}
				else if (num13 < Math.PI * 31.0 / 36.0)
				{
					currentSparkTex = spark60Texture;
				}
				else if (num13 < Math.PI * 11.0 / 12.0)
				{
					currentSparkTex = spark70Texture;
				}
				else if (num13 < 3.0543261909900763)
				{
					currentSparkTex = spark80Texture;
				}
				else if (num13 < Math.PI)
				{
					currentSparkTex = spark90Texture;
				}
				int num14 = 0;
				if (num13 > Math.PI / 2.0)
				{
					num14 = 1;
				}
				float num15 = (float)((1 - 2 * num14) * ((Texture)currentSparkTex).width) * HUDScale * 1.5f;
				float num16 = (float)((Texture)currentSparkTex).height * HUDScale * 1.5f;
				GUI.DrawTexture(new Rect(particleInfo.x - num15 / 2f, particleInfo.y - num16 / 2f, num15, num16), (Texture)(object)currentSparkTex, (ScaleMode)0, true, 0f, new Color(particleInfo.color.r, particleInfo.color.g, particleInfo.color.b, particleInfo.color.a * particleInfo.timeLeft / HUDSparksFadeOutTime), 0f, 0f);
			}
			for (int num17 = 0; num17 < particles.Count; num17++)
			{
				particleInfo particleInfo2 = particles[num17];
				particleInfo2.timeLeft -= realTimeDelta;
				if (particleInfo2.timeLeft < 0f)
				{
					particles.RemoveAt(num17);
				}
			}
			for (int num18 = 0; num18 < particles.Count; num18++)
			{
				particleInfo particleInfo3 = particles[num18];
				particleInfo3.x += particleInfo3.xVel * realTimeDelta * HUDScale * 4f;
				particleInfo3.y += (0f - particleInfo3.yVel) * realTimeDelta * HUDScale * 4f;
				particleInfo3.yVel += -90f * realTimeDelta * (float)(2 * num - 1);
				if (particleInfo3.x < 0f || particleInfo3.x > (float)Screen.width || particleInfo3.y > (float)Screen.height)
				{
					particles.RemoveAt(num18);
				}
			}
		}

		public void Update()
		{
			//IL_006f: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			determineTimeDelta();
			if (IsGameplayScene())
			{
				modEnabledTemporary = true;
			}
			else
			{
				modEnabledTemporary = false;
			}
			if (!modEnabled || !modEnabledTemporary)
			{
				return;
			}
			if (MonoSingleton<NewMovement>.Instance.hp <= 0)
			{
				timeAccumulated = 0f;
			}
			if (!keyToggleFunctionality)
			{
				if (Input.GetKey(slowdownCode))
				{
					slowdownKeyActive = true;
				}
				else
				{
					slowdownKeyActive = false;
				}
				if (Input.GetKeyDown(slowdownCode))
				{
					if (soundEnabled && !inMenu())
					{
						csp.PlaySound(slowdownSound);
					}
					speedupPlayedForcefully = false;
				}
				if (Input.GetKeyUp(slowdownCode) && timeAccumulated < maxTimeAccumulated && soundEnabled && !inMenu() && !speedupPlayedForcefully)
				{
					csp.PlaySound(speedupSound);
				}
				if (timeAccumulated >= maxTimeAccumulated && !speedupPlayedForcefully)
				{
					if (soundEnabled)
					{
						csp.PlaySound(speedupSound);
					}
					speedupPlayedForcefully = true;
				}
			}
			if (keyToggleFunctionality)
			{
				if (Input.GetKeyDown(slowdownCode))
				{
					slowdownKeyActive = !slowdownKeyActive;
					if (soundEnabled)
					{
						if (slowdownKeyActive)
						{
							csp.PlaySound(slowdownSound);
						}
						else
						{
							csp.PlaySound(speedupSound);
						}
					}
				}
				if (timeAccumulated >= maxTimeAccumulated)
				{
					slowdownKeyActive = false;
					csp.PlaySound(speedupSound);
				}
			}
			if (MonoSingleton<NewMovement>.Instance.hp <= 0)
			{
				return;
			}
			if (Time.timeScale > slowdownMult - 0.01f && timeInRampup >= 0f && !slowdownEnded)
			{
				Time.timeScale = Math.Min(currentSlowdownMult, 1f);
				if (timeInRampup == 0f)
				{
					Time.timeScale = 1f;
					slowdownEnded = true;
				}
			}
			if (slowdownKeyActive && timeAccumulated < maxTimeAccumulated && !speedupPlayedForcefully)
			{
				float num = Time.deltaTime / currentSlowdownMult;
				if (num > 0.1f)
				{
					num = 0.1f;
				}
				timeAccumulated += num;
				timeInRampup += Time.deltaTime / currentSlowdownMult;
				if (timeInRampup > rampUpTime)
				{
					timeInRampup = rampUpTime;
				}
				slowdownEnded = false;
			}
			else
			{
				timeAccumulated += (0f - Time.deltaTime) * rechargeMultiplier / currentSlowdownMult;
				timeInRampup += (0f - Time.deltaTime) / currentSlowdownMult;
				if (timeInRampup < 0f)
				{
					timeInRampup = 0f;
				}
			}
			if (slowdownKeyActive && speedupPlayedForcefully)
			{
				timeAccumulated += (0f - Time.deltaTime) * rechargeMultiplier / currentSlowdownMult;
			}
			currentSlowdownMult = slowdownMult + (1f - slowdownMult) * Math.Max(rampUpTime - timeInRampup, 0f) / rampUpTime;
			if (timeAccumulated <= 0f)
			{
				timeAccumulated = 0f;
			}
		}
	}
	public class PluginConfig
	{
		public enum KeyEnum
		{
			Backspace,
			Tab,
			Escape,
			Space,
			UpArrow,
			DownArrow,
			RightArrow,
			LeftArrow,
			A,
			B,
			C,
			D,
			E,
			F,
			G,
			H,
			I,
			J,
			K,
			L,
			M,
			N,
			O,
			P,
			Q,
			R,
			S,
			T,
			U,
			V,
			W,
			X,
			Y,
			Z,
			Alpha1,
			Alpha2,
			Alpha3,
			Alpha4,
			Alpha5,
			Alpha6,
			Alpha7,
			Alpha8,
			Alpha9,
			Alpha0,
			CapsLock,
			RightShift,
			LeftShift,
			RightControl,
			LeftControl,
			RightAlt,
			LeftAlt,
			Mouse1,
			Mouse2,
			Mouse3,
			Mouse4,
			Mouse5,
			Mouse6,
			Mouse7,
			BackQuote,
			EqualsSign,
			Minus,
			LeftBracket,
			RightBracket,
			Semicolon,
			Quote,
			Comma,
			Period,
			Slash,
			Backslash,
			Numlock,
			KeypadDivide,
			KeypadMultiply,
			KeypadMinus,
			KeypadPlus,
			KeypadEnter,
			KeypadPeriod,
			Keypad0,
			Keypad1,
			Keypad2,
			Keypad3,
			Keypad4,
			Keypad5,
			Keypad6,
			Keypad7,
			Keypad8,
			Keypad9,
			Home,
			End,
			PageUp,
			PageDown,
			Enter,
			F1,
			F2,
			F3,
			F4,
			F5,
			F6,
			F7,
			F8,
			F9,
			F10,
			F11,
			F12,
			F13,
			F14,
			F15
		}

		public enum QuadrantEnum
		{
			One,
			Two,
			Three,
			Four
		}

		public enum IntensityEnum
		{
			None,
			VeryLight,
			Light,
			Medium,
			MediumHeavy,
			Heavy,
			VeryHeavy,
			Nightmare
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static FloatValueChangeEventDelegate <>9__8_1;

			public static BoolValueChangeEventDelegate <>9__8_2;

			public static BoolValueChangeEventDelegate <>9__8_3;

			public static EnumValueChangeEventDelegate<IntensityEnum> <>9__8_4;

			public static EnumValueChangeEventDelegate<IntensityEnum> <>9__8_5;

			public static EnumValueChangeEventDelegate<KeyEnum> <>9__8_6;

			public static BoolValueChangeEventDelegate <>9__8_7;

			public static FloatValueChangeEventDelegate <>9__8_8;

			public static EnumValueChangeEventDelegate<QuadrantEnum> <>9__8_9;

			public static BoolValueChangeEventDelegate <>9__8_10;

			public static BoolValueChangeEventDelegate <>9__8_11;

			public static BoolValueChangeEventDelegate <>9__8_12;

			public static FloatValueChangeEventDelegate <>9__8_13;

			public static BoolValueChangeEventDelegate <>9__8_14;

			public static FloatValueChangeEventDelegate <>9__8_15;

			public static FloatValueChangeEventDelegate <>9__8_16;

			public static FloatValueChangeEventDelegate <>9__8_17;

			public static FloatValueChangeEventDelegate <>9__8_18;

			internal void <UltraTimeManipulationConfig>b__8_1(FloatValueChangeEvent e)
			{
				Plugin.volumeMult = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_2(BoolValueChangeEvent e)
			{
				Plugin.soundEnabled = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_3(BoolValueChangeEvent e)
			{
				Plugin.visualsEnabled = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_4(EnumValueChangeEvent<IntensityEnum> e)
			{
				Plugin.slowdownColorCompression = convertIntensityEnumToColorCompressionFloat(e.value);
			}

			internal void <UltraTimeManipulationConfig>b__8_5(EnumValueChangeEvent<IntensityEnum> e)
			{
				Plugin.slowdownDarkness = convertIntensityEnumToGammaFloat(e.value);
			}

			internal void <UltraTimeManipulationConfig>b__8_6(EnumValueChangeEvent<KeyEnum> e)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				Plugin.slowdownCode = convertKeyEnumToKeyCode(e.value);
			}

			internal void <UltraTimeManipulationConfig>b__8_7(BoolValueChangeEvent e)
			{
				Plugin.keyToggleFunctionality = e.value;
				Debug.Log((object)e.value);
			}

			internal void <UltraTimeManipulationConfig>b__8_8(FloatValueChangeEvent e)
			{
				Plugin.HUDScale = e.value / 4f;
			}

			internal void <UltraTimeManipulationConfig>b__8_9(EnumValueChangeEvent<QuadrantEnum> e)
			{
				Plugin.HUDQuadrant = convertQuadrantEnumToInt(e.value);
			}

			internal void <UltraTimeManipulationConfig>b__8_10(BoolValueChangeEvent e)
			{
				Plugin.minimalHUD = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_11(BoolValueChangeEvent e)
			{
				Plugin.HUDFlashing = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_12(BoolValueChangeEvent e)
			{
				Plugin.HUDSparks = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_13(FloatValueChangeEvent e)
			{
				Plugin.HUDSparksFadeOutTime = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_14(BoolValueChangeEvent e)
			{
				Plugin.legacyDisplay = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_15(FloatValueChangeEvent e)
			{
				Plugin.slowdownMult = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_16(FloatValueChangeEvent e)
			{
				Plugin.maxTimeAccumulated = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_17(FloatValueChangeEvent e)
			{
				Plugin.rampUpTime = e.value;
			}

			internal void <UltraTimeManipulationConfig>b__8_18(FloatValueChangeEvent e)
			{
				Plugin.rechargeMultiplier = e.value;
			}
		}

		public static KeyCode convertKeyEnumToKeyCode(KeyEnum value)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f72: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: 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_0160: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: 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_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Unknown result type (might be due to invalid IL or missing references)
			//IL_052c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Unknown result type (might be due to invalid IL or missing references)
			//IL_0628: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Unknown result type (might be due to invalid IL or missing references)
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0712: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_0760: Unknown result type (might be due to invalid IL or missing references)
			//IL_0787: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0823: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Unknown result type (might be due to invalid IL or missing references)
			//IL_086e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0892: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08da: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0922: Unknown result type (might be due to invalid IL or missing references)
			//IL_0946: Unknown result type (might be due to invalid IL or missing references)
			//IL_096a: Unknown result type (might be due to invalid IL or missing references)
			//IL_098e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c46: 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_0c94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eda: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f6d: Unknown result type (might be due to invalid IL or missing references)
			KeyCode result = (KeyCode)0;
			if (value.Equals(KeyEnum.Backspace))
			{
				result = (KeyCode)8;
			}
			else if (value.Equals(KeyEnum.Tab))
			{
				result = (KeyCode)9;
			}
			else if (value.Equals(KeyEnum.Escape))
			{
				result = (KeyCode)27;
			}
			else if (value.Equals(KeyEnum.Space))
			{
				result = (KeyCode)32;
			}
			else if (value.Equals(KeyEnum.UpArrow))
			{
				result = (KeyCode)273;
			}
			else if (value.Equals(KeyEnum.DownArrow))
			{
				result = (KeyCode)274;
			}
			else if (value.Equals(KeyEnum.RightArrow))
			{
				result = (KeyCode)275;
			}
			else if (value.Equals(KeyEnum.LeftArrow))
			{
				result = (KeyCode)276;
			}
			else if (value.Equals(KeyEnum.A))
			{
				result = (KeyCode)97;
			}
			else if (value.Equals(KeyEnum.B))
			{
				result = (KeyCode)98;
			}
			else if (value.Equals(KeyEnum.C))
			{
				result = (KeyCode)99;
			}
			else if (value.Equals(KeyEnum.D))
			{
				result = (KeyCode)100;
			}
			else if (value.Equals(KeyEnum.E))
			{
				result = (KeyCode)101;
			}
			else if (value.Equals(KeyEnum.F))
			{
				result = (KeyCode)102;
			}
			else if (value.Equals(KeyEnum.G))
			{
				result = (KeyCode)103;
			}
			else if (value.Equals(KeyEnum.H))
			{
				result = (KeyCode)104;
			}
			else if (value.Equals(KeyEnum.I))
			{
				result = (KeyCode)105;
			}
			else if (value.Equals(KeyEnum.J))
			{
				result = (KeyCode)106;
			}
			else if (value.Equals(KeyEnum.K))
			{
				result = (KeyCode)107;
			}
			else if (value.Equals(KeyEnum.L))
			{
				result = (KeyCode)108;
			}
			else if (value.Equals(KeyEnum.M))
			{
				result = (KeyCode)109;
			}
			else if (value.Equals(KeyEnum.N))
			{
				result = (KeyCode)110;
			}
			else if (value.Equals(KeyEnum.O))
			{
				result = (KeyCode)111;
			}
			else if (value.Equals(KeyEnum.P))
			{
				result = (KeyCode)112;
			}
			else if (value.Equals(KeyEnum.Q))
			{
				result = (KeyCode)113;
			}
			else if (value.Equals(KeyEnum.R))
			{
				result = (KeyCode)114;
			}
			else if (value.Equals(KeyEnum.S))
			{
				result = (KeyCode)115;
			}
			else if (value.Equals(KeyEnum.T))
			{
				result = (KeyCode)116;
			}
			else if (value.Equals(KeyEnum.U))
			{
				result = (KeyCode)117;
			}
			else if (value.Equals(KeyEnum.V))
			{
				result = (KeyCode)118;
			}
			else if (value.Equals(KeyEnum.W))
			{
				result = (KeyCode)119;
			}
			else if (value.Equals(KeyEnum.X))
			{
				result = (KeyCode)120;
			}
			else if (value.Equals(KeyEnum.Y))
			{
				result = (KeyCode)121;
			}
			else if (value.Equals(KeyEnum.Z))
			{
				result = (KeyCode)122;
			}
			else if (value.Equals(KeyEnum.Alpha1))
			{
				result = (KeyCode)49;
			}
			else if (value.Equals(KeyEnum.Alpha2))
			{
				result = (KeyCode)50;
			}
			else if (value.Equals(KeyEnum.Alpha3))
			{
				result = (KeyCode)51;
			}
			else if (value.Equals(KeyEnum.Alpha4))
			{
				result = (KeyCode)52;
			}
			else if (value.Equals(KeyEnum.Alpha5))
			{
				result = (KeyCode)53;
			}
			else if (value.Equals(KeyEnum.Alpha6))
			{
				result = (KeyCode)54;
			}
			else if (value.Equals(KeyEnum.Alpha7))
			{
				result = (KeyCode)55;
			}
			else if (value.Equals(KeyEnum.Alpha8))
			{
				result = (KeyCode)56;
			}
			else if (value.Equals(KeyEnum.Alpha9))
			{
				result = (KeyCode)57;
			}
			else if (value.Equals(KeyEnum.Alpha0))
			{
				result = (KeyCode)48;
			}
			else if (value.Equals(KeyEnum.CapsLock))
			{
				result = (KeyCode)301;
			}
			else if (value.Equals(KeyEnum.RightShift))
			{
				result = (KeyCode)303;
			}
			else if (value.Equals(KeyEnum.LeftShift))
			{
				result = (KeyCode)304;
			}
			else if (value.Equals(KeyEnum.RightControl))
			{
				result = (KeyCode)305;
			}
			else if (value.Equals(KeyEnum.LeftControl))
			{
				result = (KeyCode)306;
			}
			else if (value.Equals(KeyEnum.RightAlt))
			{
				result = (KeyCode)307;
			}
			else if (value.Equals(KeyEnum.LeftAlt))
			{
				result = (KeyCode)308;
			}
			else if (value.Equals(KeyEnum.Mouse1))
			{
				result = (KeyCode)323;
			}
			else if (value.Equals(KeyEnum.Mouse2))
			{
				result = (KeyCode)324;
			}
			else if (value.Equals(KeyEnum.Mouse3))
			{
				result = (KeyCode)325;
			}
			else if (value.Equals(KeyEnum.Mouse4))
			{
				result = (KeyCode)326;
			}
			else if (value.Equals(KeyEnum.Mouse5))
			{
				result = (KeyCode)327;
			}
			else if (value.Equals(KeyEnum.Mouse6))
			{
				result = (KeyCode)328;
			}
			else if (value.Equals(KeyEnum.Mouse7))
			{
				result = (KeyCode)329;
			}
			else
			{
				if (value.Equals(KeyEnum.BackQuote))
				{
					return (KeyCode)96;
				}
				if (value.Equals(KeyEnum.EqualsSign))
				{
					return (KeyCode)61;
				}
				if (value.Equals(KeyEnum.Minus))
				{
					return (KeyCode)45;
				}
				if (value.Equals(KeyEnum.LeftBracket))
				{
					return (KeyCode)91;
				}
				if (value.Equals(KeyEnum.RightBracket))
				{
					return (KeyCode)93;
				}
				if (value.Equals(KeyEnum.Semicolon))
				{
					return (KeyCode)59;
				}
				if (value.Equals(KeyEnum.Quote))
				{
					return (KeyCode)39;
				}
				if (value.Equals(KeyEnum.Comma))
				{
					return (KeyCode)44;
				}
				if (value.Equals(KeyEnum.Period))
				{
					return (KeyCode)46;
				}
				if (value.Equals(KeyEnum.Slash))
				{
					return (KeyCode)47;
				}
				if (value.Equals(KeyEnum.Backslash))
				{
					return (KeyCode)92;
				}
				if (value.Equals(KeyEnum.Numlock))
				{
					return (KeyCode)300;
				}
				if (value.Equals(KeyEnum.KeypadDivide))
				{
					return (KeyCode)267;
				}
				if (value.Equals(KeyEnum.KeypadMultiply))
				{
					return (KeyCode)268;
				}
				if (value.Equals(KeyEnum.KeypadMinus))
				{
					return (KeyCode)269;
				}
				if (value.Equals(KeyEnum.KeypadPlus))
				{
					return (KeyCode)270;
				}
				if (value.Equals(KeyEnum.KeypadEnter))
				{
					return (KeyCode)271;
				}
				if (value.Equals(KeyEnum.KeypadPeriod))
				{
					return (KeyCode)266;
				}
				if (value.Equals(KeyEnum.Keypad0))
				{
					return (KeyCode)256;
				}
				if (value.Equals(KeyEnum.Keypad1))
				{
					return (KeyCode)257;
				}
				if (value.Equals(KeyEnum.Keypad2))
				{
					return (KeyCode)258;
				}
				if (value.Equals(KeyEnum.Keypad3))
				{
					return (KeyCode)259;
				}
				if (value.Equals(KeyEnum.Keypad4))
				{
					return (KeyCode)260;
				}
				if (value.Equals(KeyEnum.Keypad5))
				{
					return (KeyCode)261;
				}
				if (value.Equals(KeyEnum.Keypad6))
				{
					return (KeyCode)262;
				}
				if (value.Equals(KeyEnum.Keypad7))
				{
					return (KeyCode)263;
				}
				if (value.Equals(KeyEnum.Keypad8))
				{
					return (KeyCode)264;
				}
				if (value.Equals(KeyEnum.Keypad9))
				{
					return (KeyCode)265;
				}
				if (value.Equals(KeyEnum.Home))
				{
					return (KeyCode)278;
				}
				if (value.Equals(KeyEnum.End))
				{
					return (KeyCode)279;
				}
				if (value.Equals(KeyEnum.PageUp))
				{
					return (KeyCode)280;
				}
				if (value.Equals(KeyEnum.PageDown))
				{
					return (KeyCode)281;
				}
				if (value.Equals(KeyEnum.Enter))
				{
					return (KeyCode)13;
				}
				if (value.Equals(KeyEnum.F1))
				{
					return (KeyCode)282;
				}
				if (value.Equals(KeyEnum.F2))
				{
					return (KeyCode)283;
				}
				if (value.Equals(KeyEnum.F3))
				{
					return (KeyCode)284;
				}
				if (value.Equals(KeyEnum.F4))
				{
					return (KeyCode)285;
				}
				if (value.Equals(KeyEnum.F5))
				{
					return (KeyCode)286;
				}
				if (value.Equals(KeyEnum.F6))
				{
					return (KeyCode)287;
				}
				if (value.Equals(KeyEnum.F7))
				{
					return (KeyCode)288;
				}
				if (value.Equals(KeyEnum.F8))
				{
					return (KeyCode)289;
				}
				if (value.Equals(KeyEnum.F9))
				{
					return (KeyCode)290;
				}
				if (value.Equals(KeyEnum.F10))
				{
					return (KeyCode)291;
				}
				if (value.Equals(KeyEnum.F11))
				{
					return (KeyCode)292;
				}
				if (value.Equals(KeyEnum.F12))
				{
					return (KeyCode)293;
				}
				if (value.Equals(KeyEnum.F13))
				{
					return (KeyCode)294;
				}
				if (value.Equals(KeyEnum.F14))
				{
					return (KeyCode)295;
				}
				if (value.Equals(KeyEnum.F15))
				{
					return (KeyCode)296;
				}
			}
			return result;
		}

		private static void SetDisplayNames(EnumField<KeyEnum> field)
		{
			field.SetEnumDisplayName(KeyEnum.Minus, "-");
			field.SetEnumDisplayName(KeyEnum.EqualsSign, "=");
			field.SetEnumDisplayName(KeyEnum.LeftBracket, "[");
			field.SetEnumDisplayName(KeyEnum.RightBracket, "]");
			field.SetEnumDisplayName(KeyEnum.CapsLock, "Caps Lock");
			field.SetEnumDisplayName(KeyEnum.LeftShift, "Left Shift");
			field.SetEnumDisplayName(KeyEnum.RightShift, "Right Shift");
			field.SetEnumDisplayName(KeyEnum.LeftControl, "Left Control");
			field.SetEnumDisplayName(KeyEnum.RightControl, "Right Control");
			field.SetEnumDisplayName(KeyEnum.LeftAlt, "Left Alt");
			field.SetEnumDisplayName(KeyEnum.RightAlt, "Right Alt");
			field.SetEnumDisplayName(KeyEnum.BackQuote, "`");
			field.SetEnumDisplayName(KeyEnum.Quote, "'");
			field.SetEnumDisplayName(KeyEnum.Semicolon, ";");
			field.SetEnumDisplayName(KeyEnum.Slash, "/");
			field.SetEnumDisplayName(KeyEnum.Backslash, "\\");
			field.SetEnumDisplayName(KeyEnum.Keypad0, "Keypad 0");
			field.SetEnumDisplayName(KeyEnum.Keypad1, "Keypad 1");
			field.SetEnumDisplayName(KeyEnum.Keypad2, "Keypad 2");
			field.SetEnumDisplayName(KeyEnum.Keypad3, "Keypad 3");
			field.SetEnumDisplayName(KeyEnum.Keypad4, "Keypad 4");
			field.SetEnumDisplayName(KeyEnum.Keypad5, "Keypad 5");
			field.SetEnumDisplayName(KeyEnum.Keypad6, "Keypad 6");
			field.SetEnumDisplayName(KeyEnum.Keypad7, "Keypad 7");
			field.SetEnumDisplayName(KeyEnum.Keypad8, "Keypad 8");
			field.SetEnumDisplayName(KeyEnum.Keypad9, "Keypad 9");
			field.SetEnumDisplayName(KeyEnum.KeypadDivide, "Keypad /");
			field.SetEnumDisplayName(KeyEnum.KeypadMultiply, "Keypad *");
			field.SetEnumDisplayName(KeyEnum.KeypadPlus, "Keypad Plus");
			field.SetEnumDisplayName(KeyEnum.KeypadMinus, "Keypad Minus");
			field.SetEnumDisplayName(KeyEnum.KeypadEnter, "Keypad Enter");
			field.SetEnumDisplayName(KeyEnum.KeypadPeriod, "Keypad .");
			field.SetEnumDisplayName(KeyEnum.Period, ".");
			field.SetEnumDisplayName(KeyEnum.Comma, ",");
			field.SetEnumDisplayName(KeyEnum.PageUp, "Page Up");
			field.SetEnumDisplayName(KeyEnum.PageDown, "Page Down");
			field.SetEnumDisplayName(KeyEnum.UpArrow, "Up Arrow");
			field.SetEnumDisplayName(KeyEnum.DownArrow, "Down Arrow");
			field.SetEnumDisplayName(KeyEnum.LeftArrow, "Left Arrow");
			field.SetEnumDisplayName(KeyEnum.RightArrow, "Right Arrow");
			field.SetEnumDisplayName(KeyEnum.Alpha0, "0");
			field.SetEnumDisplayName(KeyEnum.Alpha1, "1");
			field.SetEnumDisplayName(KeyEnum.Alpha2, "2");
			field.SetEnumDisplayName(KeyEnum.Alpha3, "3");
			field.SetEnumDisplayName(KeyEnum.Alpha4, "4");
			field.SetEnumDisplayName(KeyEnum.Alpha5, "5");
			field.SetEnumDisplayName(KeyEnum.Alpha6, "6");
			field.SetEnumDisplayName(KeyEnum.Alpha7, "7");
			field.SetEnumDisplayName(KeyEnum.Alpha8, "8");
			field.SetEnumDisplayName(KeyEnum.Alpha9, "9");
			field.SetEnumDisplayName(KeyEnum.Mouse1, "Mouse 1");
			field.SetEnumDisplayName(KeyEnum.Mouse2, "Mouse 2");
			field.SetEnumDisplayName(KeyEnum.Mouse3, "Mouse 3");
			field.SetEnumDisplayName(KeyEnum.Mouse4, "Mouse 4");
			field.SetEnumDisplayName(KeyEnum.Mouse5, "Mouse 5");
			field.SetEnumDisplayName(KeyEnum.Mouse6, "Mouse 6");
			field.SetEnumDisplayName(KeyEnum.Mouse7, "Mouse 7");
		}

		public static int convertQuadrantEnumToInt(QuadrantEnum value)
		{
			int result = 0;
			if (value.Equals(QuadrantEnum.One))
			{
				result = 1;
			}
			else if (value.Equals(QuadrantEnum.Two))
			{
				result = 2;
			}
			else if (value.Equals(QuadrantEnum.Three))
			{
				result = 3;
			}
			else if (value.Equals(QuadrantEnum.Four))
			{
				result = 4;
			}
			return result;
		}

		public static float convertIntensityEnumToColorCompressionFloat(IntensityEnum value)
		{
			float result = 0f;
			if (value.Equals(IntensityEnum.None))
			{
				result = -20f;
			}
			if (value.Equals(IntensityEnum.VeryLight))
			{
				result = -0.5f;
			}
			if (value.Equals(IntensityEnum.Light))
			{
				result = 0f;
			}
			if (value.Equals(IntensityEnum.Medium))
			{
				result = 0.2f;
			}
			if (value.Equals(IntensityEnum.MediumHeavy))
			{
				result = 0.4f;
			}
			if (value.Equals(IntensityEnum.Heavy))
			{
				result = 0.6f;
			}
			if (value.Equals(IntensityEnum.VeryHeavy))
			{
				result = 1f;
			}
			if (value.Equals(IntensityEnum.Nightmare))
			{
				result = 1.5f;
			}
			return result;
		}

		public static float convertIntensityEnumToGammaFloat(IntensityEnum value)
		{
			float result = 0f;
			if (value.Equals(IntensityEnum.None))
			{
				result = 0f;
			}
			if (value.Equals(IntensityEnum.VeryLight))
			{
				result = 0.1f;
			}
			if (value.Equals(IntensityEnum.Light))
			{
				result = 0.25f;
			}
			if (value.Equals(IntensityEnum.Medium))
			{
				result = 0.4f;
			}
			if (value.Equals(IntensityEnum.MediumHeavy))
			{
				result = 0.6f;
			}
			if (value.Equals(IntensityEnum.Heavy))
			{
				result = 0.8f;
			}
			if (value.Equals(IntensityEnum.VeryHeavy))
			{
				result = 1f;
			}
			if (value.Equals(IntensityEnum.Nightmare))
			{
				result = 1.5f;
			}
			return result;
		}

		public static void UltraTimeManipulationConfig()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_0115: 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_0120: Expected O, but got Unknown
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Expected O, but got Unknown
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Expected O, but got Unknown
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Expected O, but got Unknown
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Expected O, but got Unknown
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Expected O, but got Unknown
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Expected O, but got Unknown
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Expected O, but got Unknown
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Expected O, but got Unknown
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Expected O, but got Unknown
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Expected O, but got Unknown
			//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Expected O, but got Unknown
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Expected O, but got Unknown
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_052b: Expected O, but got Unknown
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Expected O, but got Unknown
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Expected O, but got Unknown
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Expected O, but got Unknown
			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Expected O, but got Unknown
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Expected O, but got Unknown
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Expected O, but got Unknown
			//IL_0648: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Expected O, but got Unknown
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Expected O, but got Unknown
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Expected O, but got Unknown
			//IL_0665: Unknown result type (might be due to invalid IL or missing references)
			//IL_066a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Expected O, but got Unknown
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Expected O, but got Unknown
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c5: Expected O, but got Unknown
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0714: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Expected O, but got Unknown
			PluginConfigurator val = PluginConfigurator.Create("UltraTimeManipulation", "UltraTimeManipulation");
			val.SetIconWithURL(Path.Combine(Plugin.DefaultParentFolder, "icon.png") ?? "");
			ConfigHeader val2 = new ConfigHeader(val.rootPanel, "This mod disables score submissions when enabled.", 24);
			val2.textSize = 20;
			val2.textColor = Color.red;
			BoolField val3 = new BoolField(val.rootPanel, "Mod Enabled", "modEnabled", true);
			ConfigDivision division = new ConfigDivision(val.rootPanel, "division");
			val3.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				Plugin.modEnabled = e.value;
				((ConfigField)division).interactable = e.value;
				Time.timeScale = 1f;
			};
			Plugin.modEnabled = val3.value;
			((ConfigField)division).interactable = val3.value;
			Time.timeScale = 1f;
			ConfigPanel val4 = new ConfigPanel((ConfigPanel)(object)division, "Sounds", "sfxPanel");
			FloatField val5 = new FloatField(val4, "Volume Multiplier", "volumeMultiplier", 0.7f, 0f, 1f);
			object obj = <>c.<>9__8_1;
			if (obj == null)
			{
				FloatValueChangeEventDelegate val6 = delegate(FloatValueChangeEvent e)
				{
					Plugin.volumeMult = e.value;
				};
				<>c.<>9__8_1 = val6;
				obj = (object)val6;
			}
			val5.onValueChange += (FloatValueChangeEventDelegate)obj;
			Plugin.volumeMult = val5.value;
			BoolField val7 = new BoolField(val4, "Sounds Enabled", "soundsEnabled", true);
			object obj2 = <>c.<>9__8_2;
			if (obj2 == null)
			{
				BoolValueChangeEventDelegate val8 = delegate(BoolValueChangeEvent e)
				{
					Plugin.soundEnabled = e.value;
				};
				<>c.<>9__8_2 = val8;
				obj2 = (object)val8;
			}
			val7.onValueChange += (BoolValueChangeEventDelegate)obj2;
			Plugin.soundEnabled = val7.value;
			ConfigPanel val9 = new ConfigPanel((ConfigPanel)(object)division, "Visuals", "visualsPanel");
			BoolField val10 = new BoolField(val9, "Visuals Enabled", "visualsEnabled", true);
			object obj3 = <>c.<>9__8_3;
			if (obj3 == null)
			{
				BoolValueChangeEventDelegate val11 = delegate(BoolValueChangeEvent e)
				{
					Plugin.visualsEnabled = e.value;
				};
				<>c.<>9__8_3 = val11;
				obj3 = (object)val11;
			}
			val10.onValueChange += (BoolValueChangeEventDelegate)obj3;
			Plugin.visualsEnabled = val10.value;
			EnumField<IntensityEnum> val12 = new EnumField<IntensityEnum>(val9, "Slowdown Color Compression", "slowdownColorCompression", IntensityEnum.Medium);
			val12.SetEnumDisplayName(IntensityEnum.VeryLight, "Very Light");
			val12.SetEnumDisplayName(IntensityEnum.MediumHeavy, "Medium-Heavy");
			val12.SetEnumDisplayName(IntensityEnum.VeryHeavy, "Very Heavy");
			val12.onValueChange += delegate(EnumValueChangeEvent<IntensityEnum> e)
			{
				Plugin.slowdownColorCompression = convertIntensityEnumToColorCompressionFloat(e.value);
			};
			Plugin.slowdownColorCompression = convertIntensityEnumToColorCompressionFloat(val12.value);
			EnumField<IntensityEnum> val13 = new EnumField<IntensityEnum>(val9, "Slowdown Gamma Reduction", "slowdownDarkness", IntensityEnum.Medium);
			val13.SetEnumDisplayName(IntensityEnum.VeryLight, "Very Light");
			val13.SetEnumDisplayName(IntensityEnum.MediumHeavy, "Medium-Heavy");
			val13.SetEnumDisplayName(IntensityEnum.VeryHeavy, "Very Heavy");
			val13.onValueChange += delegate(EnumValueChangeEvent<IntensityEnum> e)
			{
				Plugin.slowdownDarkness = convertIntensityEnumToGammaFloat(e.value);
			};
			Plugin.slowdownDarkness = convertIntensityEnumToGammaFloat(val13.value);
			ConfigPanel val14 = new ConfigPanel((ConfigPanel)(object)division, "Input", "inputPanel");
			EnumField<KeyEnum> val15 = new EnumField<KeyEnum>(val14, "Slowdown Key", "keyID", KeyEnum.Mouse4);
			val15.onValueChange += delegate(EnumValueChangeEvent<KeyEnum> e)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				Plugin.slowdownCode = convertKeyEnumToKeyCode(e.value);
			};
			Plugin.slowdownCode = convertKeyEnumToKeyCode(val15.value);
			SetDisplayNames(val15);
			BoolField val16 = new BoolField(val14, "Toggle Instead Of Hold", "keyToggleFunctionality", false);
			object obj4 = <>c.<>9__8_7;
			if (obj4 == null)
			{
				BoolValueChangeEventDelegate val17 = delegate(BoolValueChangeEvent e)
				{
					Plugin.keyToggleFunctionality = e.value;
					Debug.Log((object)e.value);
				};
				<>c.<>9__8_7 = val17;
				obj4 = (object)val17;
			}
			val16.onValueChange += (BoolValueChangeEventDelegate)obj4;
			Plugin.keyToggleFunctionality = val16.value;
			ConfigPanel val18 = new ConfigPanel((ConfigPanel)(object)division, "HUD", "HUDPanel");
			FloatField val19 = new FloatField(val18, "HUD Scale", "HUDScale", 1f, 0.01f, 20f);
			object obj5 = <>c.<>9__8_8;
			if (obj5 == null)
			{
				FloatValueChangeEventDelegate val20 = delegate(FloatValueChangeEvent e)
				{
					Plugin.HUDScale = e.value / 4f;
				};
				<>c.<>9__8_8 = val20;
				obj5 = (object)val20;
			}
			val19.onValueChange += (FloatValueChangeEventDelegate)obj5;
			Plugin.HUDScale = val19.value / 4f;
			EnumField<QuadrantEnum> val21 = new EnumField<QuadrantEnum>(val18, "HUD Quadrant", "HUDQuadrant", QuadrantEnum.Two);
			val21.onValueChange += delegate(EnumValueChangeEvent<QuadrantEnum> e)
			{
				Plugin.HUDQuadrant = convertQuadrantEnumToInt(e.value);
			};
			Plugin.HUDQuadrant = convertQuadrantEnumToInt(val21.value);
			BoolField val22 = new BoolField(val18, "Minimal HUD", "minimalHUD", false);
			object obj6 = <>c.<>9__8_10;
			if (obj6 == null)
			{
				BoolValueChangeEventDelegate val23 = delegate(BoolValueChangeEvent e)
				{
					Plugin.minimalHUD = e.value;
				};
				<>c.<>9__8_10 = val23;
				obj6 = (object)val23;
			}
			val22.onValueChange += (BoolValueChangeEventDelegate)obj6;
			Plugin.minimalHUD = val22.value;
			BoolField val24 = new BoolField(val18, "Slowdown HUD Flickering", "flashingHUD", true);
			object obj7 = <>c.<>9__8_11;
			if (obj7 == null)
			{
				BoolValueChangeEventDelegate val25 = delegate(BoolValueChangeEvent e)
				{
					Plugin.HUDFlashing = e.value;
				};
				<>c.<>9__8_11 = val25;
				obj7 = (object)val25;
			}
			val24.onValueChange += (BoolValueChangeEventDelegate)obj7;
			Plugin.HUDFlashing = val24.value;
			BoolField val26 = new BoolField(val18, "Slowdown HUD Sparks", "sparkingHUD", true);
			object obj8 = <>c.<>9__8_12;
			if (obj8 == null)
			{
				BoolValueChangeEventDelegate val27 = delegate(BoolValueChangeEvent e)
				{
					Plugin.HUDSparks = e.value;
				};
				<>c.<>9__8_12 = val27;
				obj8 = (object)val27;
			}
			val26.onValueChange += (BoolValueChangeEventDelegate)obj8;
			Plugin.HUDSparks = val26.value;
			FloatField val28 = new FloatField(val18, "Slowdown HUD Sparks Lifetime", "sparkingLifetimeHUD", 0.8f, 0.01f, 10f);
			object obj9 = <>c.<>9__8_13;
			if (obj9 == null)
			{
				FloatValueChangeEventDelegate val29 = delegate(FloatValueChangeEvent e)
				{
					Plugin.HUDSparksFadeOutTime = e.value;
				};
				<>c.<>9__8_13 = val29;
				obj9 = (object)val29;
			}
			val28.onValueChange += (FloatValueChangeEventDelegate)obj9;
			Plugin.HUDSparksFadeOutTime = val28.value;
			new ConfigSpace(val18, 10f);
			new ConfigHeader(val18, "Legacy HUD should never be used, and doesn't work with any of the above options. It also looks bad.", 24);
			BoolField val30 = new BoolField(val18, "Legacy HUD (looks bad)", "legacyUI", false);
			object obj10 = <>c.<>9__8_14;
			if (obj10 == null)
			{
				BoolValueChangeEventDelegate val31 = delegate(BoolValueChangeEvent e)
				{
					Plugin.legacyDisplay = e.value;
				};
				<>c.<>9__8_14 = val31;
				obj10 = (object)val31;
			}
			val30.onValueChange += (BoolValueChangeEventDelegate)obj10;
			Plugin.legacyDisplay = val30.value;
			ConfigPanel val32 = new ConfigPanel((ConfigPanel)(object)division, "Slowdown Effect", "slowdownEffectPanel");
			FloatField val33 = new FloatField(val32, "Slowdown Speed Multiplier", "slowdownMultiplier", 0.4f, 0.01f, 1f);
			object obj11 = <>c.<>9__8_15;
			if (obj11 == null)
			{
				FloatValueChangeEventDelegate val34 = delegate(FloatValueChangeEvent e)
				{
					Plugin.slowdownMult = e.value;
				};
				<>c.<>9__8_15 = val34;
				obj11 = (object)val34;
			}
			val33.onValueChange += (FloatValueChangeEventDelegate)obj11;
			Plugin.slowdownMult = val33.value;
			FloatField val35 = new FloatField(val32, "Slowdown Max Duration (s)", "maxTime", 6f, 0.05f, 1E+09f);
			object obj12 = <>c.<>9__8_16;
			if (obj12 == null)
			{
				FloatValueChangeEventDelegate val36 = delegate(FloatValueChangeEvent e)
				{
					Plugin.maxTimeAccumulated = e.value;
				};
				<>c.<>9__8_16 = val36;
				obj12 = (object)val36;
			}
			val35.onValueChange += (FloatValueChangeEventDelegate)obj12;
			Plugin.maxTimeAccumulated = val35.value;
			FloatField val37 = new FloatField(val32, "Slowdown Rampup Time (s)", "rampUpTime", 0.2f, 0.001f, 1E+09f);
			object obj13 = <>c.<>9__8_17;
			if (obj13 == null)
			{
				FloatValueChangeEventDelegate val38 = delegate(FloatValueChangeEvent e)
				{
					Plugin.rampUpTime = e.value;
				};
				<>c.<>9__8_17 = val38;
				obj13 = (object)val38;
			}
			val37.onValueChange += (FloatValueChangeEventDelegate)obj13;
			Plugin.rampUpTime = val37.value;
			FloatField val39 = new FloatField(val32, "Recharge Rate (seconds use / s)", "rechargeMultiplier", 0.75f, 0f, 1000f);
			object obj14 = <>c.<>9__8_18;
			if (obj14 == null)
			{
				FloatValueChangeEventDelegate val40 = delegate(FloatValueChangeEvent e)
				{
					Plugin.rechargeMultiplier = e.value;
				};
				<>c.<>9__8_18 = val40;
				obj14 = (object)val40;
			}
			val39.onValueChange += (FloatValueChangeEventDelegate)obj14;
			Plugin.rechargeMultiplier = val39.value;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "UltraTimeManipulation";

		public const string PLUGIN_NAME = "UltraTimeManipulation";

		public const string PLUGIN_VERSION = "0.0.2";
	}
}
namespace UltraTimeManipulation.Patches
{
	[HarmonyPatch(typeof(NewMovement))]
	internal class Effects
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Darken()
		{
			if (Plugin.visualsEnabled)
			{
				float num = Plugin.timeInRampup / Plugin.rampUpTime;
				int num2 = 0;
				float num3 = 0f;
				switch (MonoSingleton<PrefsManager>.Instance.GetInt("colorCompression", 0))
				{
				case 0:
					num2 = 2048;
					num3 = 8f;
					break;
				case 1:
					num2 = 64;
					num3 = 3f;
					break;
				case 2:
					num2 = 32;
					num3 = 2f;
					break;
				case 3:
					num2 = 16;
					num3 = 1f;
					break;
				case 4:
					num2 = 8;
					num3 = 0f;
					break;
				case 5:
					num2 = 3;
					num3 = 0.5f;
					break;
				}
				num3 += Plugin.slowdownColorCompression;
				int num4 = (int)((double)num2 / Math.Pow(2.0, num * num3));
				if (num4 < 0)
				{
					num4 = 0;
				}
				if (num4 > num2)
				{
					num4 = num2;
				}
				Shader.SetGlobalInt("_ColorPrecision", num4);
				float @float = MonoSingleton<PrefsManager>.Instance.GetFloat("gamma", 0f);
				float num5 = @float - num * Plugin.slowdownDarkness;
				Shader.SetGlobalFloat("_Gamma", num5);
			}
		}
	}
}