Decompiled source of BigWalkTrainer v1.1.0

plugins\BigWalkTrainer.dll

Decompiled 3 hours ago
using System;
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.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Enviro;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using LobbyNetworking;
using Microsoft.CodeAnalysis;
using Mirror;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BigWalkTrainer")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BigWalkTrainer")]
[assembly: AssemblyTitle("BigWalkTrainer")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BigWalkTrainer
{
	internal static class BigMap
	{
		private static readonly Color PlayerColor = new Color(0.35f, 1f, 0.55f, 1f);

		private static readonly Color GourdColor = new Color(1f, 0.82f, 0.25f, 1f);

		private static readonly Color PlaceColor = new Color(0.85f, 0.87f, 0.9f, 0.9f);

		private static readonly Color WaypointColor = new Color(0.78f, 0.55f, 1f, 1f);

		private static readonly Color TrailColor = new Color(1f, 1f, 1f, 0.45f);

		private static readonly Color RouteColor = new Color(1f, 0.82f, 0.25f, 0.55f);

		private static readonly Color GridColor = new Color(1f, 1f, 1f, 0.05f);

		private static Vector2 center;

		private static float ppm = 1f;

		private static bool following = true;

		private static Vector2 downPos;

		private static bool mouseDown;

		private static bool dragged;

		private static GUIStyle labelStyle;

		private static GUIStyle centredStyle;

		public static void Opened()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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)
			following = true;
			PlayerCharacter val = WorldScanner.Local();
			if ((Object)(object)val != (Object)null)
			{
				center = new Vector2(((Component)val).transform.position.x, ((Component)val).transform.position.z);
			}
			ppm = Mathf.Clamp(ppm, 0.02f, 20f);
			if (ppm == 1f)
			{
				ppm = 1.5f;
			}
		}

		public static string Draw(float scale, out bool close)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: 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_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Invalid comparison between Unknown and I4
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: 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_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_057e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Invalid comparison between Unknown and I4
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Unknown result type (might be due to invalid IL or missing references)
			//IL_064e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0658: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Invalid comparison between Unknown and I4
			//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_092a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0967: Unknown result type (might be due to invalid IL or missing references)
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Expected O, but got Unknown
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Unknown result type (might be due to invalid IL or missing references)
			//IL_0875: Unknown result type (might be due to invalid IL or missing references)
			//IL_0887: Unknown result type (might be due to invalid IL or missing references)
			//IL_0897: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_0804: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_080f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_0816: Unknown result type (might be due to invalid IL or missing references)
			//IL_0822: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
			close = false;
			PlayerCharacter pc = WorldScanner.Local();
			float num = (float)Screen.width / scale;
			float num2 = (float)Screen.height / scale;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(24f, 24f, num - 48f, num2 - 48f);
			GUI.Box(val, GUIContent.none, Theme.Window);
			GUI.Label(new Rect(((Rect)(ref val)).x + 20f, ((Rect)(ref val)).y + 14f, 300f, 24f), "Map", Theme.Title);
			if (GUI.Button(new Rect(((Rect)(ref val)).xMax - 52f, ((Rect)(ref val)).y + 10f, 34f, 32f), "×", Theme.Close))
			{
				close = true;
			}
			if (GUI.Button(new Rect(((Rect)(ref val)).xMax - 196f, ((Rect)(ref val)).y + 12f, 134f, 28f), "Center on me", Theme.Button))
			{
				following = true;
			}
			Rect map = new Rect(((Rect)(ref val)).x + 16f, ((Rect)(ref val)).y + 52f, ((Rect)(ref val)).width - 32f, ((Rect)(ref val)).height - 100f);
			if ((Object)(object)pc != (Object)null && following)
			{
				center = new Vector2(((Component)pc).transform.position.x, ((Component)pc).transform.position.z);
			}
			string text = null;
			Event current = Event.current;
			Vector2 mouse = current.mousePosition - ((Rect)(ref map)).position;
			bool inside = ((Rect)(ref map)).Contains(current.mousePosition);
			if (inside && (int)current.type == 6)
			{
				Vector2 val2 = ToWorld(mouse, map);
				ppm = Mathf.Clamp(ppm * ((current.delta.y < 0f) ? 1.2f : (5f / 6f)), 0.02f, 20f);
				Vector2 val3 = ToWorld(mouse, map);
				center += val2 - val3;
				following = false;
				current.Use();
			}
			GUI.BeginGroup(map);
			Color color = GUI.color;
			GUI.color = new Color(0f, 0f, 0f, 0.35f);
			GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref map)).width, ((Rect)(ref map)).height), (Texture)(object)Texture2D.whiteTexture);
			DrawGrid(map);
			string hover = null;
			Target clicked = null;
			Waypoints.Waypoint clickedWaypoint = null;
			if (Plugin.TrailOnMap.Value)
			{
				DrawTrail(map);
			}
			if (Route.Active && (Object)(object)pc != (Object)null)
			{
				DrawRoute(map, ((Component)pc).transform.position);
			}
			foreach (Target place in WorldScanner.Places)
			{
				if ((Object)(object)place.T != (Object)null)
				{
					Dot(place.T.position, PlaceColor, 6f, place.Name, place, null, ppm > 1.2f);
				}
			}
			HashSet<string> markers = Extras.Markers;
			if (markers.Count > 0)
			{
				foreach (Target item in WorldScanner.Items)
				{
					if ((Object)(object)item.T != (Object)null && markers.Contains(item.Name))
					{
						Dot(item.T.position, Minimap.MarkerColor, 7f, item.Name, item);
					}
				}
			}
			foreach (Waypoints.Waypoint item2 in Waypoints.All)
			{
				Dot(item2.Pos, WaypointColor, 9f, item2.Name, null, item2, alwaysLabel: true);
			}
			foreach (Target collectible in WorldScanner.Collectibles)
			{
				if ((Object)(object)collectible.T != (Object)null && !collectible.Collected)
				{
					Dot(collectible.T.position, GourdColor, 9f, collectible.Name, collectible);
				}
			}
			foreach (Target player in WorldScanner.Players)
			{
				if ((Object)(object)player.T != (Object)null)
				{
					Dot(player.T.position, PlayerColor, 12f, player.Name, player, null, alwaysLabel: true);
				}
			}
			if ((Object)(object)pc != (Object)null)
			{
				Vector2 val4 = ToMap(((Component)pc).transform.position, map);
				Camera main = Camera.main;
				float num3 = (((Object)(object)main != (Object)null) ? ((Component)main).transform.eulerAngles.y : ((Component)pc).transform.eulerAngles.y);
				Rect val5 = default(Rect);
				((Rect)(ref val5))..ctor(val4.x - 9f, val4.y - 9f, 18f, 18f);
				Matrix4x4 matrix = GUI.matrix;
				GUIUtility.RotateAroundPivot(num3, ((Rect)(ref val5)).center);
				GUI.color = Color.black;
				GUI.DrawTexture(new Rect(((Rect)(ref val5)).x - 2f, ((Rect)(ref val5)).y - 2f, ((Rect)(ref val5)).width + 4f, ((Rect)(ref val5)).height + 4f), (Texture)(object)Theme.ArrowTex);
				GUI.color = Color.white;
				GUI.DrawTexture(val5, (Texture)(object)Theme.ArrowTex);
				GUI.matrix = matrix;
			}
			GUI.color = color;
			GUI.EndGroup();
			if (inside && (int)current.type == 0 && current.button == 0)
			{
				mouseDown = true;
				dragged = false;
				downPos = current.mousePosition;
				current.Use();
			}
			else if (mouseDown && (int)current.type == 3)
			{
				Vector2 val6 = current.mousePosition - downPos;
				if (((Vector2)(ref val6)).magnitude > 4f)
				{
					dragged = true;
				}
				if (dragged)
				{
					center -= new Vector2(current.delta.x, 0f - current.delta.y) / ppm;
					following = false;
				}
				current.Use();
			}
			else if (mouseDown && (int)current.type == 1)
			{
				mouseDown = false;
				if (!dragged && inside)
				{
					if (clicked != null)
					{
						text = (WorldScanner.TeleportTo(clicked) ? ("Teleported to " + clicked.Name + ".") : "Couldn't teleport.");
					}
					else if (clickedWaypoint != null)
					{
						text = (WorldScanner.TeleportTo(clickedWaypoint.Pos + Vector3.up * 0.2f) ? ("Teleported to " + clickedWaypoint.Name + ".") : "Couldn't teleport.");
					}
					else
					{
						Vector2 val7 = ToWorld(mouse, map);
						text = Extras.TeleportToGround(new Vector3(val7.x, 0f, val7.y));
					}
					if (text != null && text.StartsWith("Teleported"))
					{
						following = true;
					}
				}
				current.Use();
			}
			if (hover != null)
			{
				Vector2 val8 = Theme.Pill.CalcSize(new GUIContent(hover));
				GUI.Label(new Rect(current.mousePosition.x + 14f, current.mousePosition.y + 8f, val8.x, 26f), hover, Theme.Pill);
			}
			float num4 = NiceStep(120f / ppm);
			float num5 = num4 * ppm;
			float num6 = ((Rect)(ref val)).yMax - 36f;
			GUI.DrawTexture(new Rect(((Rect)(ref val)).x + 20f, num6 + 10f, num5, 2f), (Texture)(object)Texture2D.whiteTexture);
			GUI.Label(new Rect(((Rect)(ref val)).x + 26f + num5, num6, 100f, 22f), Stats.Metres(num4), Theme.Small);
			GUI.Label(new Rect(((Rect)(ref val)).x + 140f + num5, num6, ((Rect)(ref val)).width - 160f - num5, 22f), "Green players  ·  gold gourds  ·  purple saved spots  ·  white places  ·  blue marked items      Click: go there  ·  drag: move  ·  wheel: zoom  ·  " + Keys.Name(Plugin.BigMapKey) + ": close", Theme.Small);
			return text;
			void Dot(Vector3 world, Color c, float size, string label, Target t, Waypoints.Waypoint w = null, bool alwaysLabel = false)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: 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_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				Vector2 val9 = ToMap(world, map);
				if (!(val9.x < -10f) && !(val9.y < -10f) && !(val9.x > ((Rect)(ref map)).width + 10f) && !(val9.y > ((Rect)(ref map)).height + 10f))
				{
					GUI.color = Color.black;
					GUI.DrawTexture(new Rect(val9.x - size / 2f - 1f, val9.y - size / 2f - 1f, size + 2f, size + 2f), (Texture)(object)Theme.KnobTex);
					GUI.color = c;
					GUI.DrawTexture(new Rect(val9.x - size / 2f, val9.y - size / 2f, size, size), (Texture)(object)Theme.KnobTex);
					if (alwaysLabel)
					{
						ShadowText(new Rect(val9.x + size, val9.y - 9f, 200f, 18f), label, c);
					}
					Vector2 val10 = mouse - val9;
					if (((Vector2)(ref val10)).magnitude <= size / 2f + 5f && inside)
					{
						float value = (((Object)(object)pc != (Object)null) ? Vector3.Distance(((Component)pc).transform.position, world) : 0f);
						hover = $"{label}  ·  {value:0} m";
						if (t != null)
						{
							clicked = t;
						}
						if (w != null)
						{
							clickedWaypoint = w;
						}
					}
				}
			}
		}

		private static Vector2 ToMap(Vector3 world, Rect map)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((Rect)(ref map)).width / 2f + (world.x - center.x) * ppm, ((Rect)(ref map)).height / 2f - (world.z - center.y) * ppm);
		}

		private static Vector2 ToWorld(Vector2 local, Rect map)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(center.x + (local.x - ((Rect)(ref map)).width / 2f) / ppm, center.y - (local.y - ((Rect)(ref map)).height / 2f) / ppm);
		}

		private static float NiceStep(float raw)
		{
			float[] array = new float[12]
			{
				1f, 2f, 5f, 10f, 20f, 50f, 100f, 200f, 500f, 1000f,
				2000f, 5000f
			};
			foreach (float num in array)
			{
				if (num >= raw)
				{
					return num;
				}
			}
			return 10000f;
		}

		private static void DrawGrid(Rect map)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_009b: 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_00bf: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			float num = NiceStep(80f / ppm);
			GUI.color = GridColor;
			Vector2 val = ToWorld(Vector2.zero, map);
			Vector2 val2 = ToWorld(new Vector2(((Rect)(ref map)).width, ((Rect)(ref map)).height), map);
			for (float num2 = Mathf.Ceil(val.x / num) * num; num2 <= val2.x; num2 += num)
			{
				GUI.DrawTexture(new Rect(ToMap(new Vector3(num2, 0f, 0f), map).x, 0f, 1f, ((Rect)(ref map)).height), (Texture)(object)Texture2D.whiteTexture);
			}
			for (float num3 = Mathf.Ceil(val2.y / num) * num; num3 <= val.y; num3 += num)
			{
				GUI.DrawTexture(new Rect(0f, ToMap(new Vector3(0f, 0f, num3), map).y, ((Rect)(ref map)).width, 1f), (Texture)(object)Texture2D.whiteTexture);
			}
		}

		private static void DrawTrail(Rect map)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0052: 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_0060: 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)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			GUI.color = TrailColor;
			List<Vector3> points = Trail.Points;
			int num = ((ppm < 0.3f) ? 4 : ((!(ppm < 0.8f)) ? 1 : 2));
			for (int i = 0; i < points.Count; i += num)
			{
				if (!Trail.IsBreak(points[i]))
				{
					Vector2 val = ToMap(points[i], map);
					if (!(val.x < 0f) && !(val.y < 0f) && !(val.x > ((Rect)(ref map)).width) && !(val.y > ((Rect)(ref map)).height))
					{
						GUI.DrawTexture(new Rect(val.x - 1.5f, val.y - 1.5f, 3f, 3f), (Texture)(object)Theme.KnobTex);
					}
				}
			}
		}

		private static void DrawRoute(Rect map, Vector3 from)
		{
			//IL_0000: 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)
			//IL_000b: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			GUI.color = RouteColor;
			Vector2 a = ToMap(from, map);
			int num = 1;
			foreach (Target item in Route.Order)
			{
				if (!((Object)(object)item.T == (Object)null) && !item.Collected)
				{
					Vector2 val = ToMap(item.T.position, map);
					Line(a, val, (num == 1) ? 3f : 2f);
					if (ppm > 0.15f)
					{
						ShadowText(new Rect(val.x - 30f, val.y + 6f, 60f, 16f), num.ToString(), GourdColor, centred: true);
					}
					a = val;
					num++;
				}
			}
		}

		internal static void Line(Vector2 a, Vector2 b, float width)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = b - a;
			float magnitude = ((Vector2)(ref val)).magnitude;
			if (!(magnitude < 0.5f))
			{
				float num = Mathf.Atan2(val.y, val.x) * 57.29578f;
				Matrix4x4 matrix = GUI.matrix;
				GUIUtility.RotateAroundPivot(num, a);
				GUI.DrawTexture(new Rect(a.x, a.y - width / 2f, magnitude, width), (Texture)(object)Texture2D.whiteTexture);
				GUI.matrix = matrix;
			}
		}

		private static void ShadowText(Rect r, string text, Color c, bool centred = false)
		{
			//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_001d: Expected O, but got Unknown
			//IL_0027: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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)
			if (labelStyle == null)
			{
				labelStyle = new GUIStyle(Theme.Small)
				{
					fontStyle = (FontStyle)1
				};
				labelStyle.normal.textColor = Color.white;
			}
			if (centredStyle == null)
			{
				centredStyle = new GUIStyle(labelStyle)
				{
					alignment = (TextAnchor)4
				};
			}
			GUIStyle val = (centred ? centredStyle : labelStyle);
			Color color = GUI.color;
			GUI.color = Color.black;
			GUI.Label(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, val);
			GUI.color = c;
			GUI.Label(r, text, val);
			GUI.color = color;
		}
	}
	internal static class Extras
	{
		[HarmonyPatch(typeof(PlayerMover), "FixedUpdate")]
		internal static class MoverPatch
		{
			private static void Postfix(PlayerMover __instance)
			{
				//IL_0048: 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_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_024e: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0191: Unknown result type (might be due to invalid IL or missing references)
				//IL_026f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: 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_01ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: 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_0137: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
				PlayerCharacter pc = __instance.pc;
				if ((Object)(object)pc == (Object)null || (Object)(object)pc.rb == (Object)null || pc.rb.isKinematic || (Object)(object)pc != (Object)(object)WorldScanner.Local())
				{
					return;
				}
				Rigidbody rb = pc.rb;
				if (Anchored)
				{
					rb.velocity = Vector3.zero;
					rb.position = AnchorPos;
				}
				else
				{
					if (PlayerFrozen)
					{
						return;
					}
					Vector3 velocity = rb.velocity;
					bool flag = false;
					bool flag2 = Input.GetKey((KeyCode)119) || Input.GetKey((KeyCode)97) || Input.GetKey((KeyCode)115) || Input.GetKey((KeyCode)100);
					if (Following != null && !flag2 && pc.tunings != null && (Object)(object)Following.T != (Object)null)
					{
						Vector3 val = Vector3.ProjectOnPlane(Following.T.position - ((Component)pc).transform.position, Vector3.up);
						float magnitude = ((Vector3)(ref val)).magnitude;
						if (magnitude > 3f)
						{
							float num = ((magnitude > 9f) ? pc.tunings.forwardSprintSpeed : pc.tunings.forwardSpeed);
							Vector3 val2 = val / magnitude;
							velocity.x = val2.x * num;
							velocity.z = val2.z * num;
							flag = true;
						}
					}
					else if (Movement.AutoWalk && !flag2 && pc.tunings != null)
					{
						Camera main = Camera.main;
						Vector3 val3 = Vector3.ProjectOnPlane(((Object)(object)main != (Object)null) ? ((Component)main).transform.forward : ((Component)pc).transform.forward, Vector3.up);
						Vector3 normalized = ((Vector3)(ref val3)).normalized;
						float num2 = (Input.GetKey((KeyCode)304) ? pc.tunings.forwardSprintSpeed : pc.tunings.forwardSpeed);
						velocity.x = normalized.x * num2;
						velocity.z = normalized.z * num2;
						flag = true;
					}
					float value = Plugin.GravityScale.Value;
					bool flag3 = pc.ground != null && !pc.ground.isGrounded && !pc.ground.isSwimming;
					if (value < 0.99f && flag3)
					{
						velocity.y -= Physics.gravity.y * (1f - value) * Time.fixedDeltaTime;
						flag = true;
					}
					if (flag)
					{
						rb.velocity = velocity;
					}
				}
			}
		}

		public static bool PlayerFrozen;

		public static bool Anchored;

		private static Vector3 AnchorPos;

		public static Target Following;

		private const float FollowGap = 3f;

		private const float FollowTeleport = 25f;

		private const float FollowStuckTime = 4f;

		private static float followStuck;

		private static float followLastDist;

		private static readonly List<Vector3> teleportHistory = new List<Vector3>();

		private static bool brightSaved;

		private static AmbientMode savedAmbientMode;

		private static Color savedAmbientLight;

		private static float savedAmbientIntensity;

		private static bool fogSaved;

		private static bool savedRenderFog;

		private static bool savedEnviroFog;

		private static bool savedEnviroUnityFog;

		private static HashSet<string> markers;

		public static bool CanUndoTeleport => teleportHistory.Count > 0;

		public static HashSet<string> Markers => markers ?? (markers = new HashSet<string>(Plugin.ItemMarkers.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries), StringComparer.Ordinal));

		public static string SetAnchor(bool on)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter val = WorldScanner.Local();
			if (on && (Object)(object)val == (Object)null)
			{
				return "Join a world first.";
			}
			Anchored = on;
			if (on)
			{
				AnchorPos = (((Object)(object)val.rb != (Object)null) ? val.rb.position : ((Component)val).transform.position);
				return "Anchored: you won't slide or get knocked off.";
			}
			if ((Object)(object)val != (Object)null && val.faller != null)
			{
				val.faller.ClearNextFall();
			}
			return "Anchor released.";
		}

		public static string StartFollow(Target t)
		{
			if ((Object)(object)t?.Player == (Object)null)
			{
				return "Pick a player.";
			}
			if (Anchored)
			{
				SetAnchor(on: false);
			}
			Movement.AutoWalk = false;
			Following = t;
			followStuck = 0f;
			followLastDist = float.MaxValue;
			return "Following " + t.Name + ". Move (WASD) to stop.";
		}

		public static void StopFollow()
		{
			Following = null;
		}

		public static string UpdateFollow()
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			if (Following == null)
			{
				return null;
			}
			PlayerCharacter val = WorldScanner.Local();
			if ((Object)(object)val == (Object)null || (Object)(object)Following.T == (Object)null)
			{
				Following = null;
				return "Stopped following (they left).";
			}
			if (PlayerFrozen)
			{
				return null;
			}
			if (Input.GetKey((KeyCode)119) || Input.GetKey((KeyCode)97) || Input.GetKey((KeyCode)115) || Input.GetKey((KeyCode)100))
			{
				string name = Following.Name;
				Following = null;
				return "Stopped following " + name + ".";
			}
			Vector3 position = ((Component)val).transform.position;
			Vector3 position2 = Following.T.position;
			float num = Vector3.Distance(position, position2);
			followStuck = ((num > 6f && num > followLastDist - 0.05f) ? (followStuck + Time.deltaTime) : 0f);
			followLastDist = num;
			if (num > 25f || Mathf.Abs(position2.y - position.y) > 6f || followStuck > 4f)
			{
				followStuck = 0f;
				followLastDist = float.MaxValue;
				WorldScanner.TeleportTo(Following, record: false);
			}
			return null;
		}

		public static Vector3? AimPoint(float range = 1000f)
		{
			//IL_001c: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit? val = AimHit(range);
			if (!val.HasValue)
			{
				return null;
			}
			RaycastHit value = val.Value;
			Vector3 point = ((RaycastHit)(ref value)).point;
			value = val.Value;
			return point + ((RaycastHit)(ref value)).normal * 0.4f + Vector3.up * 0.4f;
		}

		public static RaycastHit? AimHit(float range)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//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_00ad: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			Camera main = Camera.main;
			if ((Object)(object)main == (Object)null)
			{
				return null;
			}
			Transform transform = ((Component)main).transform;
			PlayerCharacter val = WorldScanner.Local();
			Il2CppStructArray<RaycastHit> obj = Physics.RaycastAll(new Ray(transform.position, transform.forward), range, -1, (QueryTriggerInteraction)1);
			RaycastHit? result = null;
			foreach (RaycastHit item in (Il2CppArrayBase<RaycastHit>)(object)obj)
			{
				RaycastHit current = item;
				if ((Object)(object)((RaycastHit)(ref current)).collider == (Object)null || ((Object)(object)val != (Object)null && ((Component)((RaycastHit)(ref current)).collider).transform.IsChildOf(((Component)val).transform)))
				{
					continue;
				}
				if (result.HasValue)
				{
					float distance = ((RaycastHit)(ref current)).distance;
					RaycastHit value = result.Value;
					if (!(distance < ((RaycastHit)(ref value)).distance))
					{
						continue;
					}
				}
				result = current;
			}
			return result;
		}

		public static string TeleportToAim()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (!Spawner.InGame)
			{
				return "Join a world first.";
			}
			Vector3? val = AimPoint();
			if (!val.HasValue)
			{
				return "Nothing in range to teleport to.";
			}
			if (!WorldScanner.TeleportTo(val.Value))
			{
				return "Couldn't teleport.";
			}
			return "Teleported to where you looked.";
		}

		public static Vector3? GroundAt(float x, float z)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			PlayerCharacter val = WorldScanner.Local();
			float num = (((Object)(object)val != (Object)null) ? ((Component)val).transform.position.y : 0f) + 1500f;
			RaycastHit val2 = default(RaycastHit);
			if (!Physics.Raycast(new Vector3(x, num, z), Vector3.down, ref val2, 4000f, -1, (QueryTriggerInteraction)1))
			{
				return null;
			}
			return ((RaycastHit)(ref val2)).point + Vector3.up * 1f;
		}

		public static string TeleportToGround(Vector3 spot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			Vector3? val = GroundAt(spot.x, spot.z);
			if (!val.HasValue)
			{
				return "No ground there.";
			}
			if (!WorldScanner.TeleportTo(val.Value))
			{
				return "Couldn't teleport.";
			}
			return "Teleported.";
		}

		public static void RecordTeleportFrom(Vector3 pos)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			teleportHistory.Add(pos);
			if (teleportHistory.Count > 20)
			{
				teleportHistory.RemoveAt(0);
			}
		}

		public static bool UndoTeleport()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (teleportHistory.Count == 0)
			{
				return false;
			}
			Vector3 pos = teleportHistory[teleportHistory.Count - 1];
			teleportHistory.RemoveAt(teleportHistory.Count - 1);
			return WorldScanner.TeleportTo(pos, record: false);
		}

		public static bool BackToSafeGround()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter val = WorldScanner.Local();
			if ((Object)(object)val == (Object)null || val.ground == null)
			{
				return false;
			}
			Vector3 lastSafePosition = val.ground.lastSafePosition;
			if (lastSafePosition == Vector3.zero)
			{
				return false;
			}
			return WorldScanner.TeleportTo(lastSafePosition + Vector3.up * 0.3f);
		}

		public static string GetBack()
		{
			if (CanUndoTeleport)
			{
				if (!UndoTeleport())
				{
					return "Couldn't go back.";
				}
				return "Back to where you were before teleporting.";
			}
			if (!BackToSafeGround())
			{
				return "No safe spot recorded yet.";
			}
			return "Back on safe ground.";
		}

		public static void ApplyVisuals()
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.FullBright.Value)
			{
				if (!brightSaved)
				{
					savedAmbientMode = RenderSettings.ambientMode;
					savedAmbientLight = RenderSettings.ambientLight;
					savedAmbientIntensity = RenderSettings.ambientIntensity;
					brightSaved = true;
				}
				RenderSettings.ambientMode = (AmbientMode)3;
				RenderSettings.ambientLight = new Color(0.85f, 0.85f, 0.85f);
				RenderSettings.ambientIntensity = 1f;
			}
			else if (brightSaved)
			{
				RenderSettings.ambientMode = savedAmbientMode;
				RenderSettings.ambientLight = savedAmbientLight;
				RenderSettings.ambientIntensity = savedAmbientIntensity;
				brightSaved = false;
			}
			EnviroFogSettings val = (((Object)(object)EnviroManager.instance != (Object)null && (Object)(object)((EnviroManagerBase)EnviroManager.instance).Fog != (Object)null) ? ((EnviroManagerBase)EnviroManager.instance).Fog.Settings : null);
			if (Plugin.NoFog.Value)
			{
				if (!fogSaved)
				{
					savedRenderFog = RenderSettings.fog;
					savedEnviroFog = val != null && val.fog;
					savedEnviroUnityFog = val != null && val.unityFog;
					fogSaved = true;
				}
				RenderSettings.fog = false;
				if (val != null)
				{
					val.fog = false;
					val.unityFog = false;
				}
			}
			else if (fogSaved)
			{
				RenderSettings.fog = savedRenderFog;
				if (val != null)
				{
					val.fog = savedEnviroFog;
					val.unityFog = savedEnviroUnityFog;
				}
				fogSaved = false;
			}
		}

		public static void ReloadMarkers()
		{
			markers = null;
		}

		public static void ToggleMarker(string name)
		{
			if (!Markers.Remove(name))
			{
				Markers.Add(name);
			}
			Plugin.ItemMarkers.Value = string.Join(",", Markers);
		}
	}
	internal static class HostDetect
	{
		public enum State
		{
			NotInGame,
			Hosting,
			Checking,
			Yes,
			No
		}

		[HarmonyPatch(typeof(PlayerNetworking), "UserCode_CmdSetEchoAmount__Single")]
		internal static class EchoPatch
		{
			private static bool Prefix(PlayerNetworking __instance, float echoValue)
			{
				if (!Mark(echoValue, 0.001234f))
				{
					return true;
				}
				__instance.NetworkechoAmount = Snap(echoValue) + 0.004321f;
				return false;
			}
		}

		private const float Grid = 0.01f;

		private const float ProbeMark = 0.001234f;

		private const float ReplyMark = 0.004321f;

		private const float Tolerance = 3E-05f;

		private const int MaxAttempts = 6;

		private const float AttemptInterval = 1.5f;

		private static IntPtr session;

		private static float baseEcho;

		private static int attempts;

		private static float nextAttempt;

		public static State Current { get; private set; }

		public static bool HostHasTrainer
		{
			get
			{
				if (Current != State.Yes)
				{
					return Current == State.Hosting;
				}
				return true;
			}
		}

		public static void Recheck()
		{
			if (Current == State.Yes || Current == State.No)
			{
				Begin();
			}
		}

		public static void Update()
		{
			NetworkIdentity localPlayer = NetworkClient.localPlayer;
			if (!Spawner.InGame || (Object)(object)localPlayer == (Object)null)
			{
				Current = State.NotInGame;
				session = IntPtr.Zero;
				return;
			}
			if (NetworkServer.active)
			{
				Current = State.Hosting;
				session = ((Il2CppObjectBase)localPlayer).Pointer;
				return;
			}
			if (session != ((Il2CppObjectBase)localPlayer).Pointer)
			{
				session = ((Il2CppObjectBase)localPlayer).Pointer;
				Begin();
			}
			if (Current != State.Checking)
			{
				return;
			}
			PlayerNetworking component = ((Component)localPlayer).GetComponent<PlayerNetworking>();
			if ((Object)(object)component == (Object)null)
			{
				return;
			}
			if (Mark(component.echoAmount, 0.004321f))
			{
				Finish(component, State.Yes);
			}
			else if (!(Time.unscaledTime < nextAttempt))
			{
				if (attempts >= 6)
				{
					Finish(component, State.No);
					return;
				}
				attempts++;
				nextAttempt = Time.unscaledTime + 1.5f;
				component.CmdSetEchoAmount(Snap(baseEcho) + 0.001234f);
			}
		}

		private static void Begin()
		{
			PlayerNetworking val = (((Object)(object)NetworkClient.localPlayer != (Object)null) ? ((Component)NetworkClient.localPlayer).GetComponent<PlayerNetworking>() : null);
			baseEcho = (((Object)(object)val != (Object)null) ? val.echoAmount : 0f);
			if (Mark(baseEcho, 0.001234f) || Mark(baseEcho, 0.004321f))
			{
				baseEcho = Snap(baseEcho);
			}
			attempts = 0;
			nextAttempt = Time.unscaledTime + 2f;
			Current = State.Checking;
		}

		private static void Finish(PlayerNetworking pn, State result)
		{
			Current = result;
			pn.CmdSetEchoAmount(baseEcho);
			Plugin.L.LogInfo((object)((result == State.Yes) ? "Host has the trainer: spawning enabled." : "Host doesn't have the trainer: spawning stays off."));
		}

		private static float Snap(float v)
		{
			return Mathf.Floor(v / 0.01f) * 0.01f;
		}

		private static bool Mark(float v, float mark)
		{
			return Mathf.Abs(v - Snap(v) - mark) < 3E-05f;
		}
	}
	internal static class HostTools
	{
		private static PlayerCharacter pendingCarry;

		private static float carryAt;

		public static bool Available => NetworkServer.active;

		private static void Move(HouseNetworkTransform hnt, Transform t, Rigidbody rb, Vector3 pos, Quaternion rot)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0042: 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)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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)
			if ((Object)(object)rb != (Object)null)
			{
				rb.velocity = Vector3.zero;
				rb.angularVelocity = Vector3.zero;
				rb.position = pos;
				rb.rotation = rot;
			}
			t.SetPositionAndRotation(pos, rot);
			if (!((Object)(object)hnt == (Object)null))
			{
				hnt._syncedPosition = new float3(pos.x, pos.y, pos.z);
				hnt._syncedRotation = rot;
				hnt.targetPosition = pos;
				hnt.targetRotation = rot;
				hnt.RpcMove(pos, Compression.CompressQuaternion(rot), (ushort)0);
				hnt.RpcVelocity(Vector3.zero, Vector3.zero);
			}
		}

		private static bool InFront(float distance, out Vector3 pos, out Quaternion facing)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_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_0085: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter val = WorldScanner.Local();
			Camera main = Camera.main;
			pos = default(Vector3);
			facing = Quaternion.identity;
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			Vector3 val2 = Vector3.ProjectOnPlane(((Object)(object)main != (Object)null) ? ((Component)main).transform.forward : ((Component)val).transform.forward, Vector3.up);
			Vector3 val3 = ((Vector3)(ref val2)).normalized;
			if (((Vector3)(ref val3)).sqrMagnitude < 0.01f)
			{
				val3 = ((Component)val).transform.forward;
			}
			pos = ((Component)val).transform.position + val3 * distance + Vector3.up * 0.5f;
			facing = Quaternion.LookRotation(-val3, Vector3.up);
			return true;
		}

		private static bool Bringable(Prop p)
		{
			if ((Object)(object)p != (Object)null && ((Component)p).gameObject.activeInHierarchy && (Object)(object)p.exclusiveHolder == (Object)null && !p.isInInventory && (Object)(object)p.currentHome == (Object)null && !WorldScanner.IsCollectible(p))
			{
				return (Object)(object)((Component)p).GetComponent<NetworkIdentity>() != (Object)null;
			}
			return false;
		}

		public static Dictionary<string, int> CountBringable()
		{
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			foreach (Prop item in WorldScanner.FindActive<Prop>())
			{
				if (Bringable(item))
				{
					string key = Spawner.CleanName(((Object)((Component)item).gameObject).name);
					dictionary[key] = ((!dictionary.TryGetValue(key, out var value)) ? 1 : (value + 1));
				}
			}
			return dictionary;
		}

		public static bool BringItem(string name)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			if (!Available || !InFront(1.6f, out var pos, out var facing))
			{
				return false;
			}
			Vector3 me = ((Component)WorldScanner.Local()).transform.position;
			Prop val = (from p in WorldScanner.FindActive<Prop>()
				where Bringable(p) && Spawner.CleanName(((Object)((Component)p).gameObject).name) == name
				select p).OrderByDescending(delegate(Prop p)
			{
				//IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val2 = ((Component)p).transform.position - me;
				return ((Vector3)(ref val2)).sqrMagnitude;
			}).FirstOrDefault();
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			Move(val.houseNetworkTransform, ((Component)val).transform, val.rb, pos, facing);
			return true;
		}

		public static bool BringPlayer(PlayerCharacter target)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (!Available || (Object)(object)target == (Object)null || (Object)(object)target == (Object)(object)WorldScanner.Local())
			{
				return false;
			}
			if (!InFront(1.8f, out var pos, out var facing))
			{
				return false;
			}
			Move(target.houseNetworkTransform, ((Component)target).transform, target.rb, pos, facing);
			return true;
		}

		public static bool CarryPlayer(PlayerCharacter target)
		{
			if (!BringPlayer(target))
			{
				return false;
			}
			pendingCarry = target;
			carryAt = Time.unscaledTime + 0.25f;
			return true;
		}

		public static void Update()
		{
			if (!((Object)(object)pendingCarry == (Object)null) && !(Time.unscaledTime < carryAt))
			{
				PlayerCharacter val = pendingCarry;
				pendingCarry = null;
				PlayerCharacter val2 = WorldScanner.Local();
				if (Available && !((Object)(object)val2 == (Object)null) && !((Object)(object)val2.playerNetworking == (Object)null) && !((Object)(object)val == (Object)null))
				{
					val2.playerNetworking.CmdPickUpPlayer(val);
				}
			}
		}
	}
	internal static class Keys
	{
		public static readonly List<(ConfigEntry<KeyCode> Entry, string Label)> All = new List<(ConfigEntry<KeyCode>, string)>();

		public static ConfigEntry<KeyCode> Capturing;

		public static void Init()
		{
			All.Clear();
			All.Add((Plugin.MenuKey, "Open / close the menu"));
			All.Add((Plugin.FreeCamKey, "Free cam"));
			All.Add((Plugin.FlyKey, "Fly through walls"));
			All.Add((Plugin.TeleportToCamKey, "Go to the free cam"));
			All.Add((Plugin.ClickTeleportKey, "Teleport to where you look"));
			All.Add((Plugin.BigMapKey, "Big map"));
			All.Add((Plugin.MinimapKey, "Minimap"));
			All.Add((Plugin.BackKey, "Get back"));
			All.Add((Plugin.AutoWalkKey, "Auto-walk"));
			All.Add((Plugin.AnchorKey, "Anchor (freeze in place)"));
			All.Add((Plugin.NextGourdKey, "Next gourd on the route"));
			All.Add((Plugin.ZoomKey, "Zoom (hold)"));
			All.Add((Plugin.HideHudKey, "Hide HUD"));
			All.Add((Plugin.RespawnKey, "Spawn the last item again"));
			All.Add((Plugin.DeleteKey, "Delete the spawned item you look at"));
		}

		public static bool Down(ConfigEntry<KeyCode> e)
		{
			//IL_0008: 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)
			if (Capturing == null && (int)e.Value != 0)
			{
				return Input.GetKeyDown(e.Value);
			}
			return false;
		}

		public unsafe static string Name(KeyCode k)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected I4, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Invalid comparison between Unknown and I4
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected I4, but got Unknown
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected I4, but got Unknown
			if ((int)k >= 48)
			{
				if ((int)k <= 57)
				{
					return (k - 48).ToString();
				}
				if ((int)k <= 280)
				{
					if ((int)k == 96)
					{
						return "`";
					}
					if ((int)k == 280)
					{
						return "Page Up";
					}
				}
				else
				{
					if ((int)k == 281)
					{
						return "Page Down";
					}
					switch (k - 303)
					{
					case 5:
						return "Left Alt";
					case 4:
						return "Right Alt";
					case 3:
						return "Left Ctrl";
					case 2:
						return "Right Ctrl";
					case 1:
						return "Left Shift";
					case 0:
						return "Right Shift";
					}
					switch (k - 325)
					{
					case 0:
						return "Middle mouse";
					case 1:
						return "Mouse 4";
					case 2:
						return "Mouse 5";
					case 3:
						return "Mouse 6";
					case 4:
						return "Mouse 7";
					}
				}
			}
			else if ((int)k == 0)
			{
				return "—";
			}
			return ((object)(*(KeyCode*)(&k))/*cast due to .constrained prefix*/).ToString();
		}

		public static string Name(ConfigEntry<KeyCode> e)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Name(e.Value);
		}

		public static void HandleCapture(Event e)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Invalid comparison between Unknown and I4
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			if (Capturing == null)
			{
				return;
			}
			KeyCode val = (KeyCode)0;
			if ((int)e.type == 4 && (int)e.keyCode != 0)
			{
				val = e.keyCode;
			}
			else
			{
				if ((int)e.type != 0 || e.button < 2)
				{
					return;
				}
				val = (KeyCode)(323 + e.button);
			}
			e.Use();
			if ((int)val != 27)
			{
				Capturing.Value = val;
			}
			Capturing = null;
		}

		public static string UsedElsewhere(ConfigEntry<KeyCode> e)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if ((int)e.Value == 0)
			{
				return null;
			}
			foreach (var (val, result) in All)
			{
				if (val != e && val.Value == e.Value)
				{
					return result;
				}
			}
			return null;
		}

		public static void ResetAll()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			foreach (var item2 in All)
			{
				ConfigEntry<KeyCode> item = item2.Entry;
				item.Value = (KeyCode)((ConfigEntryBase)item).DefaultValue;
			}
			Capturing = null;
		}
	}
	internal static class Looks
	{
		public struct Swatch
		{
			public int Id;

			public Color Color;

			public bool RewardOnly;
		}

		public static readonly LookPart[] Parts = (LookPart[])(object)new LookPart[3]
		{
			default(LookPart),
			(LookPart)1,
			(LookPart)2
		};

		private const int NativeStride = 24;

		private const int RewardOffset = 20;

		private static readonly List<Swatch> swatches = new List<Swatch>();

		private static IntPtr loadedFrom;

		public static bool CanChange
		{
			get
			{
				if (!Spawner.IsHost)
				{
					return HostDetect.HostHasTrainer;
				}
				return true;
			}
		}

		public static List<Swatch> Swatches()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Expected O, but got Unknown
			PlayerCharacter obj = WorldScanner.Local();
			object obj2;
			if (obj == null)
			{
				obj2 = null;
			}
			else
			{
				PlayerLooks looks = obj.looks;
				obj2 = ((looks != null) ? looks.lookSet : null);
			}
			PlayerLookSet val = (PlayerLookSet)obj2;
			if ((Object)(object)val == (Object)null || ((Il2CppObjectBase)val).Pointer == loadedFrom)
			{
				return swatches;
			}
			swatches.Clear();
			Il2CppStructArray<LookColor> colors = val.colors;
			int num = ((Il2CppArrayBase<LookColor>)(object)colors)?.Length ?? 0;
			IntPtr ptr = ((colors != null) ? (((Il2CppObjectBase)colors).Pointer + IntPtr.Size * 4) : IntPtr.Zero);
			for (int i = 0; i < num; i++)
			{
				Color color = val.GetColor(i);
				color.a = 1f;
				bool rewardOnly = Marshal.ReadByte(ptr, i * 24 + 20) != 0;
				swatches.Add(new Swatch
				{
					Id = i,
					Color = color,
					RewardOnly = rewardOnly
				});
			}
			loadedFrom = ((Il2CppObjectBase)val).Pointer;
			int num2 = 0;
			foreach (Swatch swatch in swatches)
			{
				if (swatch.RewardOnly)
				{
					num2++;
				}
			}
			ManualLogSource l = Plugin.L;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(42, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Colours: ");
				((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(swatches.Count);
				((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" loaded, ");
				((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num2);
				((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" of them reward colours.");
			}
			l.LogInfo(val2);
			return swatches;
		}

		public static int Current(LookPart part)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter obj = WorldScanner.Local();
			PlayerNetworking val = ((obj != null) ? obj.playerNetworking : null);
			if (!((Object)(object)val == (Object)null))
			{
				return Get(val, part);
			}
			return -1;
		}

		private static int Get(PlayerNetworking pn, LookPart part)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Invalid comparison between Unknown and I4
			if ((int)part != 0)
			{
				if ((int)part == 1)
				{
					return pn.NetworklookIdTorso;
				}
				return pn.NetworklookIdLegs;
			}
			return pn.NetworklookIdHead;
		}

		public static Color ColorOf(int id)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			List<Swatch> list = Swatches();
			if (id < 0 || id >= list.Count)
			{
				return Color.gray;
			}
			return list[id].Color;
		}

		public static bool Set(LookPart part, int id)
		{
			//IL_0036: 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_0064: Expected I4, but got Unknown
			PlayerCharacter obj = WorldScanner.Local();
			PlayerNetworking val = ((obj != null) ? obj.playerNetworking : null);
			if ((Object)(object)val == (Object)null || id < 0 || id >= Swatches().Count)
			{
				return false;
			}
			if (Spawner.IsHost)
			{
				return ServerSet(val, part, id);
			}
			if (!HostDetect.HostHasTrainer)
			{
				return false;
			}
			Spawner.SendRequest($"look|{(int)part}|{id}");
			return true;
		}

		internal static bool ServerSet(PlayerNetworking pn, LookPart part, int id)
		{
			//IL_0023: 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_0028: Invalid comparison between Unknown and I4
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || (Object)(object)pn == (Object)null || id < 0 || id >= Swatches().Count)
			{
				return false;
			}
			if ((int)part != 0)
			{
				if ((int)part == 1)
				{
					pn.NetworklookIdTorso = id;
				}
				else
				{
					pn.NetworklookIdLegs = id;
				}
			}
			else
			{
				pn.NetworklookIdHead = id;
			}
			PlayerCharacter component = ((Component)pn).GetComponent<PlayerCharacter>();
			PlayerLooks val = ((component != null) ? component.looks : null);
			if (val != null)
			{
				val.ServerSaveLook(part, id);
				val.RefreshLook();
			}
			return true;
		}

		public static void Randomize(bool allParts, LookPart only)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			int count = Swatches().Count;
			if (count == 0)
			{
				return;
			}
			if (allParts)
			{
				LookPart[] parts = Parts;
				for (int i = 0; i < parts.Length; i++)
				{
					Set(parts[i], Random.Range(0, count));
				}
			}
			else
			{
				Set(only, Random.Range(0, count));
			}
		}
	}
	internal static class Minimap
	{
		private const float Size = 230f;

		private const float Margin = 16f;

		private static readonly Color PlayerColor = new Color(0.35f, 1f, 0.55f, 1f);

		private static readonly Color CollectibleColor = new Color(1f, 0.82f, 0.25f, 1f);

		internal static readonly Color MarkerColor = new Color(0.4f, 0.8f, 1f, 1f);

		public static Target Draw(float scale, bool interactive, out Vector3? groundClick)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: 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_0252: 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_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Expected O, but got Unknown
			//IL_04e3: 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_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: 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_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			groundClick = null;
			PlayerCharacter val = WorldScanner.Local();
			Camera main = Camera.main;
			if ((Object)(object)val == (Object)null || (Object)(object)main == (Object)null)
			{
				return null;
			}
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor((float)Screen.width / scale - 230f - 16f, 16f, 230f, 230f);
			GUI.Box(val2, GUIContent.none, Theme.Window);
			float value = Plugin.MinimapRange.Value;
			float radius = 99f;
			float k = radius / value;
			Vector2 center = ((Rect)(ref val2)).center;
			Vector3 me = ((Component)val).transform.position;
			Quaternion toMap = Quaternion.Euler(0f, 0f - ((Component)main).transform.eulerAngles.y, 0f);
			Color color = GUI.color;
			Event e = Event.current;
			Target clicked = null;
			string hover = null;
			if (Plugin.TrailOnMap.Value)
			{
				GUI.color = new Color(1f, 1f, 1f, 0.4f);
				List<Vector3> points = Trail.Points;
				for (int i = 0; i < points.Count; i++)
				{
					if (!Trail.IsBreak(points[i]))
					{
						Vector2 val3 = MapPos(points[i]);
						if (!(((Vector2)(ref val3)).magnitude > radius))
						{
							GUI.DrawTexture(new Rect(center.x + val3.x - 1f, center.y + val3.y - 1f, 2f, 2f), (Texture)(object)Texture2D.whiteTexture);
						}
					}
				}
			}
			Target target = (Route.Active ? Route.Next : null);
			if (target != null && (Object)(object)target.T != (Object)null)
			{
				Vector2 val4 = MapPos(target.T.position);
				if (((Vector2)(ref val4)).magnitude > radius)
				{
					val4 = ((Vector2)(ref val4)).normalized * radius;
				}
				GUI.color = new Color(1f, 0.82f, 0.25f, 0.6f);
				BigMap.Line(center, center + val4, 2f);
			}
			foreach (Target collectible in WorldScanner.Collectibles)
			{
				if (!collectible.Collected)
				{
					Dot(collectible, CollectibleColor, 7f);
				}
			}
			HashSet<string> markers = Extras.Markers;
			if (markers.Count > 0)
			{
				foreach (Target item in WorldScanner.Items)
				{
					if (markers.Contains(item.Name))
					{
						Dot(item, MarkerColor, 6f);
					}
				}
			}
			foreach (Target player in WorldScanner.Players)
			{
				Dot(player, PlayerColor, 10f);
			}
			GUI.color = Color.white;
			GUI.DrawTexture(new Rect(center.x - 6f, center.y - 6f, 12f, 12f), (Texture)(object)Theme.KnobTex);
			GUI.DrawTexture(new Rect(center.x - 1f, center.y - 16f, 2f, 9f), (Texture)(object)Texture2D.whiteTexture);
			Vector2 val5 = MapPos(me + Vector3.forward * 1000f);
			Vector2 val6 = ((Vector2)(ref val5)).normalized * (radius + 4f);
			GUI.color = Theme.Muted;
			GUI.Label(new Rect(center.x + val6.x - 8f, center.y + val6.y - 9f, 16f, 18f), "N", Theme.Section);
			GUI.color = color;
			GUI.Label(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).yMax - 24f, 206f, 18f), $"{value:0} m", Theme.Small);
			if (hover != null)
			{
				Vector2 val7 = Theme.Pill.CalcSize(new GUIContent(hover));
				GUI.Label(new Rect(e.mousePosition.x - val7.x - 8f, e.mousePosition.y + 10f, val7.x, 26f), hover, Theme.Pill);
			}
			if (clicked != null)
			{
				e.Use();
			}
			else if (interactive && (int)e.type == 0 && e.button == 0)
			{
				val5 = e.mousePosition - center;
				if (((Vector2)(ref val5)).magnitude <= radius)
				{
					Vector2 val8 = (e.mousePosition - center) / k;
					groundClick = me + Quaternion.Inverse(toMap) * new Vector3(val8.x, 0f, 0f - val8.y);
					e.Use();
				}
			}
			return clicked;
			void Dot(Target t, Color c, float size)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: 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_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)t.T == (Object)null))
				{
					Vector2 val9 = MapPos(t.T.position);
					if (!(((Vector2)(ref val9)).magnitude > radius))
					{
						Rect val10 = default(Rect);
						((Rect)(ref val10))..ctor(center.x + val9.x - size / 2f, center.y + val9.y - size / 2f, size, size);
						GUI.color = c;
						GUI.DrawTexture(val10, (Texture)(object)Theme.KnobTex);
						if (interactive)
						{
							Rect val11 = default(Rect);
							((Rect)(ref val11))..ctor(((Rect)(ref val10)).x - 4f, ((Rect)(ref val10)).y - 4f, ((Rect)(ref val10)).width + 8f, ((Rect)(ref val10)).height + 8f);
							if (((Rect)(ref val11)).Contains(e.mousePosition))
							{
								hover = $"{t.Name}  ·  {Vector3.Distance(me, t.T.position):0} m";
								if ((int)e.type == 0 && e.button == 0)
								{
									clicked = t;
								}
							}
						}
					}
				}
			}
			Vector2 MapPos(Vector3 world)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: 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_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val9 = toMap * (world - me);
				return new Vector2(val9.x * k, (0f - val9.z) * k);
			}
		}
	}
	internal static class Movement
	{
		private static readonly Dictionary<IntPtr, float[]> baseTunings = new Dictionary<IntPtr, float[]>();

		private static PlayerTunings applied;

		private static float appliedSpeed = -1f;

		private static float appliedJump = -1f;

		private static Prop lastHeld;

		private static readonly List<(Prop prop, float until, float mult)> watching = new List<(Prop, float, float)>();

		private const float ThrowSpeedThreshold = 2f;

		private const float ReleaseWindow = 0.5f;

		private const float AirJumpSpeed = 6f;

		public const int UnlimitedAirJumps = 10;

		private static int airJumpsUsed;

		public static bool AutoWalk;

		private static bool noFallApplied;

		public static bool ThrowWorksHere
		{
			get
			{
				if (!Spawner.IsHost)
				{
					return HostDetect.HostHasTrainer;
				}
				return true;
			}
		}

		public static void UpdateAirJump()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter val = WorldScanner.Local();
			if ((Object)(object)val == (Object)null || val.ground == null || (Object)(object)val.rb == (Object)null)
			{
				return;
			}
			if (val.ground.isGrounded || val.ground.isSwimming)
			{
				airJumpsUsed = 0;
				return;
			}
			int value = Plugin.AirJumps.Value;
			if (value > 0 && Input.GetKeyDown((KeyCode)32) && (value >= 10 || airJumpsUsed < value))
			{
				Vector3 velocity = val.rb.velocity;
				velocity.y = Mathf.Max(velocity.y, 6f * Plugin.JumpMult.Value);
				val.rb.velocity = velocity;
				airJumpsUsed++;
				if (val.faller != null)
				{
					val.faller.heightLastGrounded = ((Component)val).transform.position.y;
				}
			}
		}

		public static void WatchThrow(Prop prop, float mult)
		{
			watching.Add((prop, Time.time + 0.5f, mult));
		}

		public static void FixedUpdate()
		{
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			PlayerCharacter val = WorldScanner.Local();
			PlayerHands val2 = (((Object)(object)val != (Object)null) ? val.hands : null);
			Prop val3 = ((val2 != null) ? val2.heldProp : null);
			float value = Plugin.ThrowMult.Value;
			if ((Object)(object)lastHeld != (Object)null && (Object)(object)val3 != (Object)(object)lastHeld && value > 1.01f)
			{
				if (Spawner.IsHost)
				{
					WatchThrow(lastHeld, value);
				}
				else if (HostDetect.HostHasTrainer && (Object)(object)lastHeld.networkIdentity != (Object)null)
				{
					Spawner.SendRequest(string.Format(CultureInfo.InvariantCulture, "throw|{0}|{1:0.##}", lastHeld.networkIdentity.netId, value));
				}
			}
			lastHeld = val3;
			for (int num = watching.Count - 1; num >= 0; num--)
			{
				(Prop, float, float) tuple = watching[num];
				if ((Object)(object)tuple.Item1 == (Object)null || (Object)(object)tuple.Item1.rb == (Object)null || Time.time > tuple.Item2)
				{
					watching.RemoveAt(num);
				}
				else
				{
					Vector3 velocity = tuple.Item1.rb.velocity;
					if (!(((Vector3)(ref velocity)).magnitude < 2f))
					{
						tuple.Item1.rb.velocity = velocity * tuple.Item3;
						watching.RemoveAt(num);
					}
				}
			}
		}

		public static void Update()
		{
			PlayerCharacter val = WorldScanner.Local();
			PlayerTunings val2 = (((Object)(object)val != (Object)null) ? val.tunings : null);
			if (val2 == null)
			{
				applied = null;
				return;
			}
			if (applied == null || ((Il2CppObjectBase)applied).Pointer != ((Il2CppObjectBase)val2).Pointer)
			{
				if (!baseTunings.ContainsKey(((Il2CppObjectBase)val2).Pointer))
				{
					baseTunings[((Il2CppObjectBase)val2).Pointer] = new float[9] { val2.forwardSpeed, val2.forwardSprintSpeed, val2.crouchForwardSpeed, val2.crouchForwardSprintSpeed, val2.swimForwardSpeed, val2.swimForwardSprintSpeed, val2.forwardSprintGhostSpeed, val2.jumpForce, val2.maxUpwardsVelocity };
				}
				applied = val2;
				appliedSpeed = (appliedJump = -1f);
			}
			float[] array = baseTunings[((Il2CppObjectBase)val2).Pointer];
			float value = Plugin.SpeedMult.Value;
			if (value != appliedSpeed)
			{
				val2.forwardSpeed = array[0] * value;
				val2.forwardSprintSpeed = array[1] * value;
				val2.crouchForwardSpeed = array[2] * value;
				val2.crouchForwardSprintSpeed = array[3] * value;
				val2.swimForwardSpeed = array[4] * value;
				val2.swimForwardSprintSpeed = array[5] * value;
				val2.forwardSprintGhostSpeed = array[6] * value;
				appliedSpeed = value;
			}
			float value2 = Plugin.JumpMult.Value;
			if (value2 != appliedJump)
			{
				val2.jumpForce = array[7] * value2;
				val2.maxUpwardsVelocity = array[8] * Mathf.Max(1f, value2);
				appliedJump = value2;
			}
			bool value3 = Plugin.NoFall.Value;
			if (val.faller != null && (value3 || noFallApplied))
			{
				val.faller.ignoreFalling = value3;
				noFallApplied = value3;
			}
		}
	}
	internal static class PhotoMode
	{
		private static readonly List<Canvas> hiddenCanvases = new List<Canvas>();

		public static float Hours = 12f;

		private static bool savedSimulate = true;

		public static bool HudHidden { get; private set; }

		public static bool TimeOverride { get; private set; }

		private static EnviroManager Env => EnviroManager.instance;

		public static bool HasEnviro
		{
			get
			{
				if ((Object)(object)Env != (Object)null)
				{
					return (Object)(object)((EnviroManagerBase)Env).Time != (Object)null;
				}
				return false;
			}
		}

		public static void SetHudHidden(bool hide)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Invalid comparison between Unknown and I4
			if (hide == HudHidden)
			{
				return;
			}
			HudHidden = hide;
			if (hide)
			{
				hiddenCanvases.Clear();
				{
					foreach (Canvas item in WorldScanner.FindActive<Canvas>())
					{
						if (!((Object)(object)item == (Object)null) && ((Behaviour)item).enabled && ((Component)item).gameObject.activeInHierarchy && item.isRootCanvas && (int)item.renderMode != 2)
						{
							((Behaviour)item).enabled = false;
							hiddenCanvases.Add(item);
						}
					}
					return;
				}
			}
			foreach (Canvas hiddenCanvase in hiddenCanvases)
			{
				if ((Object)(object)hiddenCanvase != (Object)null)
				{
					((Behaviour)hiddenCanvase).enabled = true;
				}
			}
			hiddenCanvases.Clear();
		}

		public static float CurrentHours()
		{
			try
			{
				return HasEnviro ? ((EnviroManagerBase)Env).Time.GetTimeOfDay() : 12f;
			}
			catch (Exception)
			{
				return 12f;
			}
		}

		public static void SetTimeOverride(bool on)
		{
			if (HasEnviro && on != TimeOverride)
			{
				EnviroTime settings = ((EnviroManagerBase)Env).Time.Settings;
				if (on)
				{
					Hours = CurrentHours();
					savedSimulate = settings.simulate;
					settings.simulate = false;
				}
				else
				{
					settings.simulate = savedSimulate;
				}
				TimeOverride = on;
			}
		}

		public static void Apply()
		{
			if (TimeOverride)
			{
				if (!HasEnviro)
				{
					TimeOverride = false;
					return;
				}
				((EnviroManagerBase)Env).Time.Settings.simulate = false;
				((EnviroManagerBase)Env).Time.SetTimeOfDay(Hours);
			}
		}
	}
	[BepInPlugin("bigwalk.trainer", "Big Walk Trainer", "1.1.0")]
	public class Plugin : BasePlugin
	{
		public const string Guid = "bigwalk.trainer";

		public const string Version = "1.1.0";

		public const string SupportUrl = "https://ko-fi.com/soulmods";

		internal static ManualLogSource L;

		internal static ConfigEntry<KeyCode> MenuKey;

		internal static ConfigEntry<KeyCode> FreeCamKey;

		internal static ConfigEntry<KeyCode> RespawnKey;

		internal static ConfigEntry<KeyCode> TeleportToCamKey;

		internal static ConfigEntry<bool> AllowClientSpawns;

		internal static ConfigEntry<int> MaxSpawned;

		internal static ConfigEntry<bool> HostHasTrainer;

		internal static ConfigEntry<KeyCode> FlyKey;

		internal static ConfigEntry<KeyCode> HideHudKey;

		internal static ConfigEntry<bool> EspEnabled;

		internal static ConfigEntry<bool> CollectibleEsp;

		internal static ConfigEntry<float> EspMaxDistance;

		internal static ConfigEntry<float> SpeedMult;

		internal static ConfigEntry<float> JumpMult;

		internal static ConfigEntry<bool> NoFall;

		internal static ConfigEntry<float> ThrowMult;

		internal static ConfigEntry<int> AirJumps;

		internal static ConfigEntry<KeyCode> AutoWalkKey;

		internal static ConfigEntry<float> GravityScale;

		internal static ConfigEntry<KeyCode> BackKey;

		internal static ConfigEntry<KeyCode> ZoomKey;

		internal static ConfigEntry<float> ZoomFactor;

		internal static ConfigEntry<bool> FullBright;

		internal static ConfigEntry<bool> NoFog;

		internal static ConfigEntry<string> ItemMarkers;

		internal static ConfigEntry<bool> GourdCompass;

		internal static ConfigEntry<KeyCode> DeleteKey;

		internal static ConfigEntry<KeyCode> MinimapKey;

		internal static ConfigEntry<bool> MinimapEnabled;

		internal static ConfigEntry<float> MinimapRange;

		internal static ConfigEntry<string> Favorites;

		internal static ConfigEntry<KeyCode> ClickTeleportKey;

		internal static ConfigEntry<KeyCode> BigMapKey;

		internal static ConfigEntry<KeyCode> AnchorKey;

		internal static ConfigEntry<KeyCode> NextGourdKey;

		internal static ConfigEntry<bool> Crosshair;

		internal static ConfigEntry<bool> Inspector;

		internal static ConfigEntry<bool> TrailInWorld;

		internal static ConfigEntry<bool> TrailOnMap;

		internal static ConfigEntry<bool> RadioAnywhere;

		internal static ConfigEntry<bool> ListenWhileWatching;

		internal static ConfigFile Cfg;

		public override void Load()
		{
			//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: 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_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Expected O, but got Unknown
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			L = ((BasePlugin)this).Log;
			Cfg = ((BasePlugin)this).Config;
			((BasePlugin)this).Config.SaveOnConfigSet = false;
			MenuKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Menu", (KeyCode)277, "Open/close the trainer menu. (F1 is BepInEx ConfigurationManager's default.)");
			FreeCamKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "FreeCam", (KeyCode)283, "Toggle free cam.");
			RespawnKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "SpawnLast", (KeyCode)284, "Spawn the last picked item where you're looking.");
			TeleportToCamKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "TeleportToFreeCam", (KeyCode)285, "While in free cam: move your character to the camera and exit free cam.");
			FlyKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Fly", (KeyCode)286, "Fly: free cam that carries your character, through walls.");
			HideHudKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "HideHud", (KeyCode)287, "Hide the game's HUD and the trainer's labels (for screenshots).");
			EspEnabled = ((BasePlugin)this).Config.Bind<bool>("ESP", "Enabled", false, "Show other players' names, distance and a box.");
			CollectibleEsp = ((BasePlugin)this).Config.Bind<bool>("ESP", "Collectibles", false, "Mark uncollected gourds and big keys on screen.");
			EspMaxDistance = ((BasePlugin)this).Config.Bind<float>("ESP", "MaxDistance", 1000f, "Hide ESP for anything farther than this (metres).");
			SpeedMult = ((BasePlugin)this).Config.Bind<float>("Player", "SpeedMultiplier", 1f, "Walk/sprint/swim speed multiplier (1 = normal).");
			JumpMult = ((BasePlugin)this).Config.Bind<float>("Player", "JumpMultiplier", 1f, "Jump force multiplier (1 = normal).");
			NoFall = ((BasePlugin)this).Config.Bind<bool>("Player", "NoFall", false, "Long falls don't knock you down.");
			ThrowMult = ((BasePlugin)this).Config.Bind<float>("Player", "ThrowMultiplier", 1f, "Throw power multiplier (1 = normal).");
			AirJumps = ((BasePlugin)this).Config.Bind<int>("Player", "AirJumps", 0, "Extra jumps in mid-air (0 = off, 10 = unlimited).");
			AutoWalkKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "AutoWalk", (KeyCode)289, "Keep walking forward until pressed again (S also stops).");
			GravityScale = ((BasePlugin)this).Config.Bind<float>("Player", "GravityScale", 1f, "Your gravity while in the air (1 = normal, 0.2 = very floaty).");
			BackKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "GetBack", (KeyCode)291, "Undo your last teleport, or go back to the last safe ground.");
			ZoomKey = ((BasePlugin)this).Config.Bind<KeyCode>("Keys", "Zoom", (KeyCode)308, "Hold to zoom in.");
			ZoomFactor = ((BasePlugin)this).Config.Bind<float>("Vision", "ZoomFactor", 4f, "How much the zoom key magnifies.");
			FullBright = ((BasePlugin)this).Config.Bind<bool>("Vision", "FullBright", false, "See clearly in the dark (your screen only).");
			NoFog = ((BasePlugin)this).Config.Bind<bool>("Vision", "NoFog", false, "Remove fog (your screen only).");
			ItemMa