Decompiled source of YogaMod v2.0.1

Lighty-YogaMod/YogaMod.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
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 BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using HumanoidAPI;
using Microsoft.CodeAnalysis;
using UnityEngine;
using YogaMod.Menus;
using YogaMod.Modules.Game;
using YogaMod.Modules.Interface;
using YogaMod.Modules.Player;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("YogaMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("YogaMod")]
[assembly: AssemblyTitle("YogaMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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]
	[Microsoft.CodeAnalysis.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;
		}
	}
	[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 YogaMod
{
	internal class EmbeddedSoundPlayer : MonoBehaviour
	{
		private AudioSource audioSource;

		internal void LoadFromEmbeddedResource(string resourceName)
		{
			if ((Object)(object)audioSource == (Object)null)
			{
				audioSource = ((Component)this).gameObject.AddComponent<AudioSource>();
				audioSource.playOnAwake = false;
			}
			AudioClip val = LoadAudioClipFromEmbeddedResource(resourceName);
			if ((Object)(object)val != (Object)null)
			{
				audioSource.clip = val;
			}
			else
			{
				Debug.LogError((object)("Failed to load audio resource: " + resourceName));
			}
		}

		internal void Play()
		{
			if ((Object)(object)audioSource != (Object)null && (Object)(object)audioSource.clip != (Object)null)
			{
				audioSource.Play();
			}
			else
			{
				Debug.LogWarning((object)"No audio clip loaded to play.");
			}
		}

		private AudioClip LoadAudioClipFromEmbeddedResource(string resourceName)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Expected O, but got Unknown
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			using Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
			if (stream == null)
			{
				Debug.LogError((object)("Embedded resource not found: " + resourceName));
				return null;
			}
			byte[] array = new byte[stream.Length];
			int num = stream.Read(array, 0, array.Length);
			string text = Path.Combine(Application.temporaryCachePath, "yogaMod_temporarySound.wav");
			File.WriteAllBytes(text, array);
			WWW val = new WWW("file://" + text);
			try
			{
				while (!val.isDone)
				{
				}
				AudioClip audioClip = val.GetAudioClip(false, false);
				try
				{
					File.Delete(text);
				}
				catch
				{
				}
				return audioClip;
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}
	}
	public class Notification
	{
		public string Text;

		public int Counter;

		public bool ExitSound;

		public Notification(string text, int counter = 10, bool exitSound = true)
		{
			Text = text;
			Counter = counter;
			ExitSound = exitSound;
			base..ctor();
		}
	}
	public static class Tools
	{
		private static Texture2D MakeTexture(int width, int height, Color color, int radius)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(width, height, (TextureFormat)5, false);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0f, 0f, 0f, 0f);
			float num = radius;
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num2 = 1f;
					if (j < radius && i < radius)
					{
						num2 = ComputeAlpha(j, i, num, num, num);
					}
					else if (j > width - radius - 1 && i < radius)
					{
						num2 = ComputeAlpha(j, i, (float)width - num - 1f, num, num);
					}
					else if (j < radius && i > height - radius - 1)
					{
						num2 = ComputeAlpha(j, i, num, (float)height - num - 1f, num);
					}
					else if (j > width - radius - 1 && i > height - radius - 1)
					{
						num2 = ComputeAlpha(j, i, (float)width - num - 1f, (float)height - num - 1f, num);
					}
					if (num2 <= 0f)
					{
						val.SetPixel(j, i, val2);
					}
					else
					{
						val.SetPixel(j, i, new Color(color.r, color.g, color.b, num2 * color.a));
					}
				}
			}
			val.Apply();
			return val;
		}

		private static float ComputeAlpha(float x, float y, float cx, float cy, float radius)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			float num = Vector2.Distance(new Vector2(x, y), new Vector2(cx, cy));
			float num2 = num - radius;
			if (num2 <= -0.5f)
			{
				return 1f;
			}
			if (num2 >= 0.5f)
			{
				return 0f;
			}
			return 1f - Mathf.Clamp01(num2 + 0.5f);
		}

		public static GUISkin MakeSkin(int texWidth = 256, int texHeight = 256, int radius = 12)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_0047: Expected O, but got Unknown
			//IL_0048: 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)
			//IL_0059: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00b7: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			GUISkin val = ScriptableObject.CreateInstance<GUISkin>();
			Texture2D background = MakeTexture(texWidth, texHeight, Color.white, radius);
			GUIStyle val2 = new GUIStyle();
			val2.normal.background = background;
			val2.normal.textColor = Color.white;
			val2.border = new RectOffset(radius, radius, radius, radius);
			val2.alignment = (TextAnchor)4;
			val2.richText = true;
			GUIStyle val3 = val2;
			val.button = new GUIStyle(val3);
			val.toggle = new GUIStyle(val3);
			GUIStyle val4 = new GUIStyle(GUI.skin.label);
			val4.normal.textColor = Color.white;
			val.label = val4;
			GUIStyle val5 = new GUIStyle(val3);
			val5.normal.textColor = Color.white;
			val.textField = val5;
			val.window = new GUIStyle(val3)
			{
				alignment = (TextAnchor)1
			};
			val.box = new GUIStyle(val3)
			{
				alignment = (TextAnchor)1
			};
			return val;
		}

		public static string RainbowText(string text, float offset = 0f, float fontSize = -1f)
		{
			string text2 = "";
			for (int i = 0; i < text.Length; i++)
			{
				char c = text[i];
				text2 = text2 + "<color=#" + HsvToHex(100f / (float)text.Length * ((float)i + offset) % 100f) + ">";
				text2 += c;
				text2 += "</color>";
			}
			return Mathf.Approximately(fontSize, -1f) ? text2 : $"<size={fontSize}>{text2}</size>";
		}

		public static string HsvToHex(float h, float s = 1f, float v = 1f)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Color val = Color.HSVToRGB(h / 100f, s, v);
			return ColorUtility.ToHtmlStringRGB(val);
		}

		public static string KeyCodeToString(KeyCode key)
		{
			string text = ((object)(KeyCode)(ref key)).ToString();
			text = text.Replace("Alpha", "");
			return text.Replace("Keypad", "");
		}

		public static void EnabledNotify(string name, bool value)
		{
			if (YogaModMain.Instance.shallNotify)
			{
				string text = (value ? "enabled" : "disabled");
				YogaModMain.Instance.Notify(name + " was " + text + "!", 3, exitSound: false);
			}
		}
	}
	public class UI
	{
		public static bool CustomToggle(Rect rect, bool value, string text)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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)
			if (value)
			{
				GUI.backgroundColor = Color.green;
			}
			else
			{
				GUI.backgroundColor = new Color(0.9f, 0.9f, 0.9f);
			}
			bool result = GUI.Toggle(rect, value, "<color=black>" + text + "</color>");
			GUI.backgroundColor = Color.gray;
			return result;
		}

		public static bool CustomButton(Rect pos, string text)
		{
			//IL_0001: 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)
			GUI.backgroundColor = Color.gray;
			return GUI.Button(pos, "<color=black>" + text + "</color>");
		}
	}
	public static class YmPluginInfo
	{
		public const string PluginGuid = "de.lighty.hff_yoga_mod";

		public const string PluginName = "YogaMod";

		public const string PluginVersion = "2.0.0";
	}
	[BepInPlugin("de.lighty.hff_yoga_mod", "YogaMod", "2.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class YogaModMain : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static WindowFunction <0>__OnWindow;

			public static WindowFunction <1>__OnWindow;

			public static WindowFunction <2>__OnWindow;
		}

		[CompilerGenerated]
		private sealed class <StartupNotifyWithDelay>d__17 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public YogaModMain <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <StartupNotifyWithDelay>d__17(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(3f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this.Notify("YogaMod 2.0.0 was Loaded ([email protected])!");
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>4__this.Notify("Open YogaMod by pressing RightShift!");
					Mutes.MuteNotifications = true;
					<>4__this.Notify("YogaMod is NOT a Human: Fall Flat Hack!", 10, exitSound: false);
					Mutes.MuteNotifications = false;
					<>4__this._loaded = true;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		internal static ManualLogSource Logger;

		internal static YogaModMain Instance;

		internal bool MenuVisible;

		private GUISkin _mainSkin;

		private readonly List<Notification> _notifications = new List<Notification>();

		private float _rainbow;

		public bool shallNotify = true;

		private float _notificationTimer;

		private EmbeddedSoundPlayer _notifyStartSound;

		private EmbeddedSoundPlayer _notifyEndSound;

		private ConfigEntry<KeyCode> _menuVisibleKey;

		private bool _loaded = false;

		private const string HapiVersion = "0.2.0";

		private void KeyCodeSetup()
		{
			GameMenu.KeyCodeSetup();
			PlayerMenu.KeyCodeSetup();
			InterfaceMenu.KeyCodeSetup();
			_menuVisibleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "OpenMenuKey", (KeyCode)303, "Key to Open the YogaMod Menu!");
		}

		internal static ConfigEntry<KeyCode> BindKey(string section, string key, KeyCode defaultValue, string description)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return ((BaseUnityPlugin)Instance).Config.Bind<KeyCode>(section, key, defaultValue, description);
		}

		private void Awake()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			Instance = this;
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin YogaMod is loaded!");
			HAPI.InitPlugin("de.lighty.hff_yoga_mod", "0.2.0");
			Harmony val = new Harmony("de.lighty.hff_yoga_mod");
			val.PatchAll();
			KeyCodeSetup();
			GameObject val2 = new GameObject("YogaModSoundPlayer");
			Object.DontDestroyOnLoad((Object)(object)val2);
			_notifyStartSound = val2.AddComponent<EmbeddedSoundPlayer>();
			_notifyStartSound.LoadFromEmbeddedResource("YogaMod.Sounds.notif_enter.wav");
			_notifyEndSound = val2.AddComponent<EmbeddedSoundPlayer>();
			_notifyEndSound.LoadFromEmbeddedResource("YogaMod.Sounds.notif_exit.wav");
		}

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(StartupNotifyWithDelay());
		}

		[IteratorStateMachine(typeof(<StartupNotifyWithDelay>d__17))]
		private IEnumerator StartupNotifyWithDelay()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <StartupNotifyWithDelay>d__17(0)
			{
				<>4__this = this
			};
		}

		internal void Notify(string value, int time = 10, bool exitSound = true)
		{
			if (!Mutes.HideNotifications && (!Mutes.HideModuleToggle || time != 3))
			{
				if (!Mutes.MuteNotifications)
				{
					_notifyStartSound.Play();
				}
				_notifications.Add(new Notification(value, time, exitSound));
			}
		}

		private void NotifyHandler()
		{
			_notificationTimer += Time.deltaTime;
			if (!(_notificationTimer >= 1f))
			{
				return;
			}
			_notificationTimer = 0f;
			foreach (Notification item in _notifications.ToList())
			{
				item.Counter--;
				if (item.Counter <= 0)
				{
					if (item.ExitSound && !Mutes.MuteNotifications)
					{
						_notifyEndSound.Play();
					}
					_notifications.Remove(item);
				}
			}
		}

		private void Update()
		{
			NotifyHandler();
			if (_loaded)
			{
				_rainbow += Time.deltaTime * 5f;
				GameMenu.OnKeyPress();
				GameMenu.OnHandle();
				PlayerMenu.OnKeyPress();
				PlayerMenu.OnHandle();
				InterfaceMenu.OnKeyPress();
				InterfaceMenu.OnHandle();
				if (Input.GetKeyDown((KeyCode)303))
				{
					MenuVisible = !MenuVisible;
					HAPI.SetMouseForce(MenuVisible);
				}
			}
		}

		private void OnGUI()
		{
			//IL_0100: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Expected O, but got Unknown
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Expected O, but got Unknown
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)_mainSkin))
			{
				_mainSkin = Tools.MakeSkin();
			}
			int num = Mathf.RoundToInt((float)GUI.skin.font.fontSize * 1.5f);
			int num2 = Screen.height - num;
			GUI.skin.button = _mainSkin.button;
			GUI.skin.window = _mainSkin.window;
			GUI.skin.toggle = _mainSkin.button;
			GUI.skin.label = _mainSkin.label;
			GUI.skin.box = _mainSkin.box;
			GUI.skin.textField = _mainSkin.textField;
			int num3 = 0;
			foreach (Notification item in _notifications.ToList().AsEnumerable().Reverse())
			{
				GUI.backgroundColor = Color.black;
				if (GUI.Button(new Rect((float)(Screen.width - 400), (float)(num3 * (num + 35)), 400f, (float)(num + 30)), Tools.RainbowText($"{item.Text}\n(Dismissing in {item.Counter}s)", _rainbow + (float)num3, num)))
				{
					_notifications.Remove(item);
				}
				num3++;
			}
			if (!_loaded)
			{
				return;
			}
			GUI.backgroundColor = Color.black;
			InterfaceMenu.OnGUI();
			if (MenuVisible)
			{
				Rect menuRect = GameMenu.MenuRect;
				object obj = <>O.<0>__OnWindow;
				if (obj == null)
				{
					WindowFunction val = GameMenu.OnWindow;
					<>O.<0>__OnWindow = val;
					obj = (object)val;
				}
				GameMenu.MenuRect = GUI.Window(2811672, menuRect, (WindowFunction)obj, "YogaMod - Game");
				Rect menuRect2 = PlayerMenu.MenuRect;
				object obj2 = <>O.<1>__OnWindow;
				if (obj2 == null)
				{
					WindowFunction val2 = PlayerMenu.OnWindow;
					<>O.<1>__OnWindow = val2;
					obj2 = (object)val2;
				}
				PlayerMenu.MenuRect = GUI.Window(2811673, menuRect2, (WindowFunction)obj2, "YogaMod - Player");
				Rect menuRect3 = InterfaceMenu.MenuRect;
				object obj3 = <>O.<2>__OnWindow;
				if (obj3 == null)
				{
					WindowFunction val3 = InterfaceMenu.OnWindow;
					<>O.<2>__OnWindow = val3;
					obj3 = (object)val3;
				}
				InterfaceMenu.MenuRect = GUI.Window(2811674, menuRect3, (WindowFunction)obj3, "YogaMod - Interface");
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "YogaMod";

		public const string PLUGIN_NAME = "YogaMod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace YogaMod.Modules.Player
{
	public static class Conscious
	{
		public static ConfigEntry<KeyCode> ExecKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (UI.CustomButton(new Rect(5f, (float)y, 190f, 20f), "Make Conscious (" + Tools.KeyCodeToString(ExecKey.Value) + ")"))
			{
				MakePlayerConscious();
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ExecKey.Value))
			{
				YogaModMain.Instance.Notify("Made Conscious!", 3, exitSound: false);
				MakePlayerConscious();
			}
		}

		public static void KeyCodeSetup()
		{
			ExecKey = YogaModMain.BindKey("Player", "MakeConscious", (KeyCode)120, "Key to make Player Conscious");
		}

		private static void MakePlayerConscious()
		{
			LocalHuman.Data.unconsciousTime = 0f;
		}
	}
	public static class Flight
	{
		internal static bool Enabled;

		internal static float SpeedValue = 0.5f;

		private static string _speedInput = SpeedValue.ToString(CultureInfo.CurrentCulture);

		public static ConfigEntry<KeyCode> ToggleKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Flight (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			y += GUI.skin.font.fontSize + 10;
			_speedInput = GUI.TextField(new Rect(5f, (float)y, 190f, 20f), _speedInput);
			try
			{
				SpeedValue = float.Parse(_speedInput);
			}
			catch
			{
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			LocalHuman.RigRoot.GetComponent<Rigidbody>().isKinematic = Enabled;
			if (Enabled)
			{
				if (Input.GetKey((KeyCode)119))
				{
					Transform transform = LocalHuman.RigRoot.transform;
					transform.position += ((Component)Camera.main).transform.forward * SpeedValue;
				}
				if (Input.GetKey((KeyCode)115))
				{
					Transform transform2 = LocalHuman.RigRoot.transform;
					transform2.position -= ((Component)Camera.main).transform.forward * SpeedValue;
				}
				if (Input.GetKey((KeyCode)97))
				{
					Transform transform3 = LocalHuman.RigRoot.transform;
					transform3.position -= ((Component)Camera.main).transform.right * SpeedValue;
				}
				if (Input.GetKey((KeyCode)100))
				{
					Transform transform4 = LocalHuman.RigRoot.transform;
					transform4.position += ((Component)Camera.main).transform.right * SpeedValue;
				}
			}
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Player - Flight", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Player", "Flight", (KeyCode)105, "Key to toggle Flight");
		}
	}
	public static class FreeCamFlight
	{
		internal static bool Enabled;

		internal static bool JustEnabled;

		internal static bool HasBeenEnabled;

		public static ConfigEntry<KeyCode> ToggleKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Free-Cam Flight (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			if (Enabled && !HasBeenEnabled)
			{
				JustEnabled = true;
				HasBeenEnabled = true;
			}
			if (!Enabled)
			{
				JustEnabled = false;
				HasBeenEnabled = false;
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			LocalHuman.RigRoot.GetComponent<Rigidbody>().isKinematic = false;
			if (Enabled)
			{
				Transform transform = GameElements.FreeRoamCamera.transform;
				if (JustEnabled)
				{
					transform.position = LocalHuman.RigRoot.transform.position - transform.forward * 5f + transform.up / 2f;
					JustEnabled = false;
				}
				LocalHuman.RigRoot.transform.position = transform.position + transform.forward * 5f - transform.up / 2f;
				LocalHuman.RigRoot.GetComponent<Rigidbody>().isKinematic = true;
			}
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				JustEnabled = Enabled;
				Tools.EnabledNotify("Player - Free-Cam Flight", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Player", "FreeCamFlight", (KeyCode)117, "Key to toggle Free-Cam Flight");
		}
	}
	public static class Freeze
	{
		internal static bool Enabled;

		public static ConfigEntry<KeyCode> ToggleKey;

		private static Vector3 _lastPosition;

		public static int UIRender(int y)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			bool enabled = Enabled;
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Freeze (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			if (enabled != Enabled)
			{
				OnToggle();
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		private static void OnToggle()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			_lastPosition = LocalHuman.RigRoot.transform.position;
		}

		public static void Handle()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (Enabled)
			{
				LocalHuman.RigRoot.transform.position = _lastPosition;
			}
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Player - Freeze", Enabled);
				OnToggle();
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Player", "Freeze", (KeyCode)102, "Key to toggle Freeze");
		}

		private static void FreezeSet()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			_lastPosition = LocalHuman.RigRoot.transform.position;
		}
	}
	public static class NoClip
	{
		internal static bool Enabled;

		public static ConfigEntry<KeyCode> ToggleKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "No Clip (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			NoClipSet();
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Player - NoClip", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Player", "NoClip", (KeyCode)110, "Key to toggle No-Clip");
		}

		private static void NoClipSet()
		{
			if (LocalHuman.Head.GetComponent<Collider>().isTrigger != Enabled)
			{
				LocalHuman.RigRoot.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.Hips.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.Waist.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.Chest.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightArm.Hand.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightArm.Arm.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightArm.Forearm.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftArm.Hand.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftArm.Arm.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftArm.Forearm.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftLeg.Leg.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftLeg.Foot.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.LeftLeg.Thigh.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightLeg.Leg.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightLeg.Foot.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.RightLeg.Thigh.GetComponent<Collider>().isTrigger = Enabled;
				LocalHuman.Head.GetComponent<Collider>().isTrigger = Enabled;
			}
		}
	}
	public static class Teleport
	{
		public static ConfigEntry<KeyCode> TpToKey;

		public static ConfigEntry<KeyCode> TpBringKey;

		public static ConfigEntry<KeyCode> PointToCamKey;

		public static ConfigEntry<KeyCode> TpToCamKey;

		public static GameObject TpPoint;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			if (UI.CustomButton(new Rect(5f, (float)y, 190f, 20f), "Teleport To Point (" + Tools.KeyCodeToString(TpToKey.Value) + ")"))
			{
				TpTo();
			}
			y += GUI.skin.font.fontSize + 10;
			if (UI.CustomButton(new Rect(5f, (float)y, 190f, 20f), "TPPoint to Player (" + Tools.KeyCodeToString(TpBringKey.Value) + ")"))
			{
				TpBring();
			}
			y += GUI.skin.font.fontSize + 10;
			if (UI.CustomButton(new Rect(5f, (float)y, 190f, 20f), "TPPoint to Camera (" + Tools.KeyCodeToString(PointToCamKey.Value) + ")"))
			{
				PointToCam();
			}
			y += GUI.skin.font.fontSize + 10;
			if (UI.CustomButton(new Rect(5f, (float)y, 190f, 20f), "Teleport To Camera (" + Tools.KeyCodeToString(TpToCamKey.Value) + ")"))
			{
				TpToCam();
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		private static void TpTo()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			LocalHuman.RigRoot.transform.position = TpPoint.transform.position;
		}

		private static void TpBring()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			TpPoint.transform.position = LocalHuman.RigRoot.transform.position;
		}

		private static void PointToCam()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			TpPoint.transform.position = ((Component)Camera.main).transform.position;
		}

		private static void TpToCam()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			LocalHuman.RigRoot.transform.position = ((Component)Camera.main).transform.position;
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(TpToKey.Value))
			{
				TpTo();
			}
			if (Input.GetKeyDown(TpBringKey.Value))
			{
				TpBring();
			}
			if (Input.GetKeyDown(PointToCamKey.Value))
			{
				PointToCam();
			}
			if (Input.GetKeyDown(TpToCamKey.Value))
			{
				TpToCam();
			}
		}

		public static void KeyCodeSetup()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			TpPoint = GameObject.CreatePrimitive((PrimitiveType)0);
			((Object)TpPoint).name = "YogaMod Teleport Point";
			TpPoint.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
			TpPoint.GetComponent<Collider>().isTrigger = true;
			Object.DontDestroyOnLoad((Object)(object)TpPoint);
			TpPoint.GetComponent<Renderer>().material = new Material(Shader.Find("Standard"))
			{
				color = new Color(1f, 0.4f, 0.25f, 1f)
			};
			TpToKey = YogaModMain.BindKey("Player-Teleport", "TpToKey", (KeyCode)49, "Key to Teleport Point to the Player");
			TpBringKey = YogaModMain.BindKey("Player-Teleport", "TpBringKey", (KeyCode)50, "Key to Teleport Player to the Point");
			PointToCamKey = YogaModMain.BindKey("Player-Teleport", "TpPointToCam", (KeyCode)51, "Key to Teleport Point to the Camera");
			TpToCamKey = YogaModMain.BindKey("Player-Teleport", "TpToCam", (KeyCode)52, "Key to Teleport Player to the Camera");
		}
	}
}
namespace YogaMod.Modules.Interface
{
	internal class ScreenPosition
	{
		public Vector3 Position;

		public float Distance;

		public ScreenPosition(Vector3 position, float distance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			Position = position;
			Distance = distance;
			base..ctor();
		}
	}
	public static class CheckpointEsp
	{
		internal static bool Enabled;

		public static ConfigEntry<KeyCode>? ToggleKey;

		internal static bool RenderAll;

		internal static float RainbowOffset;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Checkpoint ESP (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			y += GUI.skin.font.fontSize + 10;
			RenderAll = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), RenderAll, "ALL Checkpoint ESP ");
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			RainbowOffset += Time.deltaTime * 5f;
		}

		public static void OnGUI()
		{
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			if (RenderAll)
			{
				Transform[] checkpoints = Game.currentLevel.checkpoints;
				for (int i = 0; i < checkpoints.Length; i++)
				{
					Transform transform = checkpoints[i];
					ScreenPosition screenPosition = ToScreen(transform);
					if (screenPosition != null)
					{
						GUI.Label(new Rect(screenPosition.Position.x - 50f, (float)Screen.height - screenPosition.Position.y - (float)GUI.skin.font.fontSize, 100f, (float)GUI.skin.font.fontSize * 2f), Tools.RainbowText("Checkpoint #" + (i + 1), RainbowOffset));
					}
				}
			}
			else
			{
				if (!Enabled)
				{
					return;
				}
				int currentCheckpointNumber = Game.instance.currentCheckpointNumber;
				Transform[] checkpoints2 = Game.currentLevel.checkpoints;
				if (currentCheckpointNumber + 1 <= checkpoints2.Length)
				{
					ScreenPosition screenPosition2 = ToScreen(checkpoints2[currentCheckpointNumber + 1]);
					if (screenPosition2 != null)
					{
						GUI.Label(new Rect(screenPosition2.Position.x - 50f, (float)Screen.height - screenPosition2.Position.y - (float)GUI.skin.font.fontSize, 100f, (float)GUI.skin.font.fontSize * 2f), Tools.RainbowText("Checkpoint #" + (currentCheckpointNumber + 1), RainbowOffset));
					}
				}
			}
		}

		private static ScreenPosition? ToScreen(Transform transform)
		{
			//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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Camera.main.WorldToScreenPoint(transform.position);
			if (val.x < 0f || val.x > (float)Screen.width || val.y < 0f || val.y > (float)Screen.height || val.z < 0f)
			{
				return null;
			}
			float distance = Vector3.Distance(((Component)Camera.main).transform.position, transform.position);
			return new ScreenPosition(val, distance);
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Interface - Checkpoint ESP", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Interface", "Checkpoint ESP", (KeyCode)48, "Key to toggle Checkpoint ESP");
		}
	}
	public static class Mutes
	{
		internal static bool MuteNotifications;

		internal static bool HideNotifications;

		internal static bool HideModuleToggle;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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)
			MuteNotifications = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), MuteNotifications, "Mute ALL Notifications");
			y += GUI.skin.font.fontSize + 10;
			HideNotifications = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), HideNotifications, "Hide ALL Notifications");
			y += GUI.skin.font.fontSize + 10;
			HideModuleToggle = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), HideModuleToggle, "Hide ALL Module Toggles");
			y += GUI.skin.font.fontSize + 20;
			return y;
		}
	}
}
namespace YogaMod.Modules.Game
{
	public static class GameSpeed
	{
		internal static bool Enabled;

		internal static float SpeedValue = 1f;

		private static string _speedInput = SpeedValue.ToString(CultureInfo.CurrentCulture);

		public static ConfigEntry<KeyCode> ToggleKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Speed (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			y += GUI.skin.font.fontSize + 10;
			_speedInput = GUI.TextField(new Rect(5f, (float)y, 190f, 20f), _speedInput);
			try
			{
				SpeedValue = float.Parse(_speedInput);
			}
			catch
			{
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			if (!Enabled)
			{
				Time.timeScale = 1f;
			}
			else
			{
				Time.timeScale = SpeedValue;
			}
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Game - Speed", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			ToggleKey = YogaModMain.BindKey("Game", "GameSpeed", (KeyCode)107, "Key to toggle GameSpeed");
		}
	}
	public static class WorldGravity
	{
		internal static bool Enabled;

		internal static float DefaultGravity = 0f;

		internal static float GravityValue = -9.8f;

		private static string _gravityInput = GravityValue.ToString(CultureInfo.CurrentCulture);

		public static ConfigEntry<KeyCode> ToggleKey;

		public static int UIRender(int y)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			Enabled = UI.CustomToggle(new Rect(5f, (float)y, 190f, 20f), Enabled, "Gravity (" + Tools.KeyCodeToString(ToggleKey.Value) + ")");
			y += GUI.skin.font.fontSize + 10;
			_gravityInput = GUI.TextField(new Rect(5f, (float)y, 190f, 20f), _gravityInput);
			try
			{
				GravityValue = float.Parse(_gravityInput);
			}
			catch
			{
			}
			y += GUI.skin.font.fontSize + 20;
			return y;
		}

		public static void Handle()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (!Enabled)
			{
				Physics.gravity = new Vector3(0f, DefaultGravity, 0f);
			}
			else
			{
				Physics.gravity = new Vector3(0f, GravityValue, 0f);
			}
		}

		public static void KeyPress()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(ToggleKey.Value))
			{
				Enabled = !Enabled;
				Tools.EnabledNotify("Game - Gravity", Enabled);
			}
		}

		public static void KeyCodeSetup()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			DefaultGravity = Physics.gravity.y;
			ToggleKey = YogaModMain.BindKey("Game", "WorldGravity", (KeyCode)104, "Key to toggle WorldGravity");
		}
	}
}
namespace YogaMod.Menus
{
	public static class GameMenu
	{
		public static Rect MenuRect = new Rect(350f, 50f, 200f, 200f);

		public static void OnWindow(int id)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			GUI.DragWindow(new Rect(0f, 0f, 200f, 30f));
			num += 40;
			num = GameSpeed.UIRender(num);
			num = WorldGravity.UIRender(num);
			((Rect)(ref MenuRect)).height = num + 10;
		}

		public static void OnHandle()
		{
			try
			{
				GameSpeed.Handle();
				WorldGravity.Handle();
			}
			catch
			{
				YogaModMain.Logger.LogError((object)"A Game Module threw an Exception!");
			}
		}

		public static void OnKeyPress()
		{
			GameSpeed.KeyPress();
			WorldGravity.KeyPress();
		}

		public static void KeyCodeSetup()
		{
			GameSpeed.KeyCodeSetup();
			WorldGravity.KeyCodeSetup();
		}
	}
	public static class InterfaceMenu
	{
		public static Rect MenuRect = new Rect(950f, 50f, 200f, 200f);

		public static void OnWindow(int id)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			GUI.DragWindow(new Rect(0f, 0f, 200f, 30f));
			num += 40;
			num = CheckpointEsp.UIRender(num);
			num = Mutes.UIRender(num);
			((Rect)(ref MenuRect)).height = num + 10;
		}

		public static void OnHandle()
		{
			try
			{
				CheckpointEsp.Handle();
			}
			catch
			{
				YogaModMain.Logger.LogError((object)"A Game Module threw an Exception!");
			}
		}

		public static void OnGUI()
		{
			try
			{
				CheckpointEsp.OnGUI();
			}
			catch
			{
			}
		}

		public static void OnKeyPress()
		{
			CheckpointEsp.KeyPress();
		}

		public static void KeyCodeSetup()
		{
			CheckpointEsp.KeyCodeSetup();
		}
	}
	public static class PlayerMenu
	{
		public static Rect MenuRect = new Rect(650f, 50f, 200f, 200f);

		public static void OnWindow(int id)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			GUI.DragWindow(new Rect(0f, 0f, 200f, 30f));
			num += 40;
			num = FreeCamFlight.UIRender(num);
			num = Flight.UIRender(num);
			num = Conscious.UIRender(num);
			num = NoClip.UIRender(num);
			num = Teleport.UIRender(num);
			num = Freeze.UIRender(num);
			((Rect)(ref MenuRect)).height = num + 10;
		}

		public static void OnHandle()
		{
			try
			{
				FreeCamFlight.Handle();
				Flight.Handle();
				NoClip.Handle();
				Freeze.Handle();
			}
			catch
			{
				YogaModMain.Logger.LogError((object)"A Player Module threw an Exception!");
			}
		}

		public static void OnKeyPress()
		{
			FreeCamFlight.KeyPress();
			Flight.KeyPress();
			Conscious.KeyPress();
			NoClip.KeyPress();
			Teleport.KeyPress();
			Freeze.KeyPress();
		}

		public static void KeyCodeSetup()
		{
			FreeCamFlight.KeyCodeSetup();
			Flight.KeyCodeSetup();
			Conscious.KeyCodeSetup();
			NoClip.KeyCodeSetup();
			Teleport.KeyCodeSetup();
			Freeze.KeyCodeSetup();
		}
	}
}