Decompiled source of OmniMap v1.0.2

plugins/OmniMap.dll

Decompiled 8 hours ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Rewired;
using RoR2;
using RoR2.Navigation;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.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 OmniMap
{
	public class BindAction
	{
		public string id;

		public string en;

		public string ru;

		public ConfigEntry<KeyCode> k1;

		public ConfigEntry<KeyCode> k2;

		public KeyCode d1;

		public KeyCode d2;

		public Action run;

		public string Name => T.Get(en, ru);

		public KeyCode Get(int slot)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if (slot != 0)
			{
				return k2.Value;
			}
			return k1.Value;
		}

		public void Set(int slot, KeyCode k)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if (slot == 0)
			{
				k1.Value = k;
			}
			else
			{
				k2.Value = k;
			}
			C.MarkDirty();
		}
	}
	public class PendingBind
	{
		public int action;

		public int slot;

		public KeyCode key;

		public string holders;

		public bool gameConflict;
	}
	public static class Binds
	{
		public static readonly List<BindAction> All = new List<BindAction>();

		public static int WaitAction = -1;

		public static int WaitSlot;

		public static PendingBind Pending;

		private static ConfigFile cfg;

		private static Dictionary<KeyCode, List<string>> gameKeys = new Dictionary<KeyCode, List<string>>();

		private static float gameKeysAt = -100f;

		private static void Add(string id, string en, string ru, KeyCode d1, KeyCode d2, Action run)
		{
			//IL_001b: 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_0022: 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_0048: 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)
			BindAction bindAction = new BindAction
			{
				id = id,
				en = en,
				ru = ru,
				d1 = d1,
				d2 = d2,
				run = run
			};
			bindAction.k1 = cfg.Bind<KeyCode>("Keys", id + "_primary", d1, "Primary key: " + en);
			bindAction.k2 = cfg.Bind<KeyCode>("Keys", id + "_secondary", d2, "Secondary key: " + en);
			All.Add(bindAction);
		}

		public static void Init(ConfigFile f)
		{
			cfg = f;
			Add("settings", "Open / close settings", "Открыть / закрыть настройки", (KeyCode)288, (KeyCode)0, delegate
			{
				Plugin.Instance.Settings.Toggle();
			});
			Add("full", "Full map", "Полная карта", (KeyCode)109, (KeyCode)0, delegate
			{
				if (Plugin.Instance.Active)
				{
					Plugin.Instance.Hud.ToggleFull();
				}
			});
			Add("marker", "Place marker at crosshair", "Метка по прицелу", (KeyCode)110, (KeyCode)0, delegate
			{
				Plugin instance = Plugin.Instance;
				if (instance.Active && !instance.Hud.FullOpen)
				{
					Routes.MarkerAtCrosshair(instance.Hud.MainCam);
				}
			});
			Add("clear", "Clear markers and routes", "Убрать метки и маршруты", (KeyCode)98, (KeyCode)0, delegate
			{
				if (Plugin.Instance.Active)
				{
					Routes.ClearAll();
				}
			});
			Add("mini", "Show / hide minimap", "Показать / скрыть миникарту", (KeyCode)0, (KeyCode)0, delegate
			{
				C.MiniVisible.Value = !C.MiniVisible.Value;
				C.MarkDirty();
			});
			Add("zoomin", "Minimap zoom in", "Миникарта: приблизить", (KeyCode)270, (KeyCode)0, delegate
			{
				Zoom(0.8f);
			});
			Add("zoomout", "Minimap zoom out", "Миникарта: отдалить", (KeyCode)269, (KeyCode)0, delegate
			{
				Zoom(1.25f);
			});
			Add("rotate", "Toggle map rotation", "Вращение карты вкл / выкл", (KeyCode)0, (KeyCode)0, delegate
			{
				C.MiniRotate.Value = !C.MiniRotate.Value;
				C.MarkDirty();
			});
			Add("auto", "Cycle automatic route", "Переключить автомаршрут", (KeyCode)0, (KeyCode)0, delegate
			{
				C.PathAuto.Value = (C.PathAuto.Value + 1) % 7;
				C.MarkDirty();
			});
		}

		private static void Zoom(float k)
		{
			C.MiniRange.Value = Mathf.Clamp(C.MiniRange.Value * k, 15f, 250f);
			C.MarkDirty();
		}

		public unsafe static string KeyText(KeyCode k)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			if ((int)k != 0)
			{
				return ((object)(*(KeyCode*)(&k))/*cast due to .constrained prefix*/).ToString();
			}
			return "-";
		}

		private static bool Down(KeyCode k)
		{
			//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)
			if ((int)k != 0)
			{
				return Input.GetKeyDown(k);
			}
			return false;
		}

		public static void Process(bool typing)
		{
			//IL_003b: 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)
			if (WaitAction >= 0 || Pending != null)
			{
				return;
			}
			for (int i = 0; i < All.Count; i++)
			{
				BindAction bindAction = All[i];
				if ((!typing || !(bindAction.id != "settings")) && (Down(bindAction.k1.Value) || Down(bindAction.k2.Value)))
				{
					bindAction.run();
				}
			}
		}

		private static void RefreshGameKeys()
		{
			//IL_007c: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			if (Time.unscaledTime < gameKeysAt + 3f)
			{
				return;
			}
			gameKeysAt = Time.unscaledTime;
			Dictionary<KeyCode, List<string>> dictionary = new Dictionary<KeyCode, List<string>>();
			try
			{
				LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
				if (firstLocalUser != null && firstLocalUser.inputPlayer != null)
				{
					foreach (ControllerMap map in firstLocalUser.inputPlayer.controllers.maps.GetMaps((ControllerType)0, 0))
					{
						foreach (ActionElementMap allMap in map.AllMaps)
						{
							if ((int)allMap.keyCode != 0)
							{
								InputAction action = ReInput.mapping.GetAction(allMap.actionId);
								string item = ((action == null) ? "?" : (string.IsNullOrEmpty(action.descriptiveName) ? action.name : action.descriptiveName));
								if (!dictionary.TryGetValue(allMap.keyCode, out var value))
								{
									value = new List<string>();
									dictionary[allMap.keyCode] = value;
								}
								if (!value.Contains(item))
								{
									value.Add(item);
								}
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Reading game key bindings failed: " + ex.Message));
			}
			gameKeys = dictionary;
		}

		private static string Holders(KeyCode key, int skipAction, int skipSlot, out bool game)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			RefreshGameKeys();
			List<string> list = new List<string>();
			game = gameKeys.TryGetValue(key, out var value);
			if (game)
			{
				list.Add(T.Get("Game", "Игра") + ": " + string.Join(", ", value.ToArray()));
			}
			for (int i = 0; i < All.Count; i++)
			{
				for (int j = 0; j < 2; j++)
				{
					if ((i != skipAction || j != skipSlot) && All[i].Get(j) == key)
					{
						list.Add(T.Get("Mod", "Мод") + ": " + All[i].Name);
					}
				}
			}
			return string.Join("; ", list.ToArray());
		}

		public static void HandleCapture()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			//IL_0018: 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_0040: Invalid comparison between Unknown and I4
			//IL_0044: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			Event current = Event.current;
			if (WaitAction < 0 || (int)current.type != 4 || (int)current.keyCode == 0)
			{
				return;
			}
			current.Use();
			int waitAction = WaitAction;
			int waitSlot = WaitSlot;
			WaitAction = -1;
			if ((int)current.keyCode != 27)
			{
				bool game;
				string text = Holders(current.keyCode, waitAction, waitSlot, out game);
				if (text.Length == 0)
				{
					All[waitAction].Set(waitSlot, current.keyCode);
					return;
				}
				Pending = new PendingBind
				{
					action = waitAction,
					slot = waitSlot,
					key = current.keyCode,
					holders = text,
					gameConflict = game
				};
			}
		}

		public static void ConfirmPending()
		{
			//IL_0095: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			if (Pending == null)
			{
				return;
			}
			for (int i = 0; i < All.Count; i++)
			{
				for (int j = 0; j < 2; j++)
				{
					if ((i != Pending.action || j != Pending.slot) && All[i].Get(j) == Pending.key)
					{
						All[i].Set(j, (KeyCode)0);
					}
				}
			}
			All[Pending.action].Set(Pending.slot, Pending.key);
			Pending = null;
		}

		public static void Reset(int i)
		{
			//IL_001b: 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)
			All[i].k1.Value = All[i].d1;
			All[i].k2.Value = All[i].d2;
			C.MarkDirty();
		}

		public static void ResetAll()
		{
			for (int i = 0; i < All.Count; i++)
			{
				Reset(i);
			}
		}
	}
	public enum Kind
	{
		AllyPlayer,
		AllyMinion,
		EnemyNormal,
		EnemyElite,
		EnemyBoss,
		ChestWhite,
		ChestGreen,
		ChestRed,
		ChestLunar,
		ChestVoid,
		ChestEquip,
		ChestCategory,
		ChestSpecial,
		Multishop,
		Shrine,
		Printer,
		Scrapper,
		Drone,
		Barrel,
		Other,
		Teleporter,
		Portal,
		Pickup
	}
	public class KindInfo
	{
		public Kind kind;

		public string en;

		public string ru;

		public string group;

		public Color color;

		public string icon;

		public bool defShow;

		public ConfigEntry<bool> show;

		public ConfigEntry<string> iconCfg;

		public ConfigEntry<string> colorCfg;

		public ConfigEntry<float> sizeCfg;

		public float size = 1f;

		public bool key;

		private string cachedHex = "#";

		private Color cachedColor;

		public string IconId
		{
			get
			{
				string value = iconCfg.Value;
				if (string.IsNullOrEmpty(value) || !Icons.Has(value))
				{
					return icon;
				}
				return value;
			}
		}

		public bool HasCustomColor => !string.IsNullOrEmpty(colorCfg.Value);

		public float Scale => size * sizeCfg.Value;

		public bool IsDefault
		{
			get
			{
				if (string.IsNullOrEmpty(iconCfg.Value) && !HasCustomColor)
				{
					return Mathf.Abs(sizeCfg.Value - 1f) < 0.001f;
				}
				return false;
			}
		}

		public Color Tint(Color auto)
		{
			//IL_0014: 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_002d: 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)
			string value = colorCfg.Value;
			if (string.IsNullOrEmpty(value))
			{
				return auto;
			}
			if (value != cachedHex)
			{
				cachedHex = value;
				cachedColor = C.Hex(value, auto);
			}
			return cachedColor;
		}

		public void ResetLook()
		{
			iconCfg.Value = "";
			colorCfg.Value = "";
			sizeCfg.Value = 1f;
			C.MarkDirty();
		}
	}
	public static class C
	{
		public static ConfigFile F;

		public static ConfigEntry<bool> Enabled;

		public static ConfigEntry<string> Lang;

		public static ConfigEntry<bool> PingToMarker;

		public static ConfigEntry<float> UiScale;

		public static ConfigEntry<float> UiOpacity;

		public static ConfigEntry<bool> DebugCmds;

		public static ConfigEntry<int> ThemeAccent;

		public static ConfigEntry<int> ThemeBg;

		public static ConfigEntry<string> AccentHex;

		public static ConfigEntry<string> GradAHex;

		public static ConfigEntry<string> GradBHex;

		public static ConfigEntry<string> BgHex;

		public static ConfigEntry<bool> MiniVisible;

		public static ConfigEntry<bool> MiniRotate;

		public static ConfigEntry<bool> MiniBorder;

		public static ConfigEntry<bool> MiniTerrain;

		public static ConfigEntry<bool> MiniCompass;

		public static ConfigEntry<bool> MiniEdge;

		public static ConfigEntry<bool> MiniElevation;

		public static ConfigEntry<bool> MiniCone;

		public static ConfigEntry<bool> MiniRings;

		public static ConfigEntry<bool> MiniOutline;

		public static ConfigEntry<int> MiniShape;

		public static ConfigEntry<int> MiniCorner;

		public static ConfigEntry<int> MiniBorderMode;

		public static ConfigEntry<float> MiniSize;

		public static ConfigEntry<float> MiniOpacity;

		public static ConfigEntry<float> MiniOffX;

		public static ConfigEntry<float> MiniOffY;

		public static ConfigEntry<float> MiniRange;

		public static ConfigEntry<float> MiniBorderW;

		public static ConfigEntry<string> MiniBorderHex;

		public static ConfigEntry<bool> LocShow;

		public static ConfigEntry<bool> LocStage;

		public static ConfigEntry<bool> LocBg;

		public static ConfigEntry<bool> LocCoords;

		public static ConfigEntry<bool> LocTele;

		public static ConfigEntry<int> LocPos;

		public static ConfigEntry<int> LocColor;

		public static ConfigEntry<float> LocSize;

		public static ConfigEntry<float> CutUp;

		public static ConfigEntry<float> CutDown;

		public static ConfigEntry<float> TerrainFps;

		public static ConfigEntry<float> TerrainLight;

		public static ConfigEntry<float> TerrainLift;

		public static ConfigEntry<float> FullCutUp;

		public static ConfigEntry<int> TerrainRes;

		public static ConfigEntry<int> TerrainLayers;

		public static ConfigEntry<float> IconScale;

		public static ConfigEntry<float> EnemyScale;

		public static ConfigEntry<bool> HideUsed;

		public static ConfigEntry<bool> PickupIcons;

		public static ConfigEntry<bool> TeleRadius;

		public static ConfigEntry<bool> ShowLabels;

		public static ConfigEntry<float> FullSize;

		public static ConfigEntry<float> FullRange;

		public static ConfigEntry<bool> PathMarker;

		public static ConfigEntry<bool> PathSelected;

		public static ConfigEntry<bool> PathWorld;

		public static ConfigEntry<bool> MarkerWorld;

		public static ConfigEntry<int> PathAuto;

		public static ConfigEntry<int> MaxMarkers;

		public static ConfigEntry<float> PathWidth;

		public static ConfigEntry<string> PathColor;

		public static ConfigEntry<string> MarkerColor;

		public static readonly List<KindInfo> Kinds = new List<KindInfo>();

		private static readonly Dictionary<Kind, KindInfo> byKind = new Dictionary<Kind, KindInfo>();

		public static readonly Color White = new Color(0.9f, 0.9f, 0.9f);

		public static readonly Color Green = new Color(0.47f, 1f, 0.09f);

		public static readonly Color Red = new Color(0.91f, 0.31f, 0.23f);

		public static readonly Color Lunar = new Color(0.3f, 0.55f, 1f);

		public static readonly Color Yellow = new Color(1f, 0.92f, 0.1f);

		public static readonly Color Voidc = new Color(0.93f, 0.5f, 0.8f);

		public static readonly Color Orange = new Color(1f, 0.55f, 0.05f);

		private static bool dirty;

		private static float saveAt;

		public static KindInfo Info(Kind k)
		{
			return byKind[k];
		}

		private static void Add(Kind k, string en, string ru, string group, Color col, string icon, bool def = true, float size = 1f, bool key = false)
		{
			//IL_0022: 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_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			KindInfo kindInfo = new KindInfo
			{
				kind = k,
				en = en,
				ru = ru,
				group = group,
				color = col,
				icon = icon,
				defShow = def,
				size = size,
				key = key
			};
			kindInfo.show = F.Bind<bool>("Show", k.ToString(), def, en);
			kindInfo.iconCfg = F.Bind<string>("Icons", k.ToString() + "_Icon", "", "Icon override for " + en + " (empty = default)");
			kindInfo.colorCfg = F.Bind<string>("Icons", k.ToString() + "_Color", "", "Colour override for " + en + " as HEX (empty = automatic)");
			kindInfo.sizeCfg = F.Bind<float>("Icons", k.ToString() + "_Size", 1f, new ConfigDescription("Size multiplier for " + en, (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.4f, 3f), Array.Empty<object>()));
			Kinds.Add(kindInfo);
			byKind[k] = kindInfo;
		}

		private static ConfigEntry<float> Fl(string sec, string key, float def, float min, float max, string desc = "")
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			return F.Bind<float>(sec, key, def, new ConfigDescription(desc, (AcceptableValueBase)(object)new AcceptableValueRange<float>(min, max), Array.Empty<object>()));
		}

		public static void Init(ConfigFile f)
		{
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Expected O, but got Unknown
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Expected O, but got Unknown
			//IL_083d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0847: Expected O, but got Unknown
			//IL_086b: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0965: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8f: Unknown result type (might be due to invalid IL or missing references)
			F = f;
			f.SaveOnConfigSet = false;
			Enabled = f.Bind<bool>("General", "Enabled", true, "Enable Omni Map");
			Lang = f.Bind<string>("General", "Language", "auto", "auto = follow the game language until you pick one; en, uk, ru, de, es, fr, it, pt, tr, ja, ko, zh");
			PingToMarker = f.Bind<bool>("General", "PingToMarker", false, "Every game ping also creates a marker");
			UiScale = Fl("General", "UiScale", 1f, 0.7f, 1.8f, "Settings window scale");
			UiOpacity = Fl("General", "UiOpacity", 0.96f, 0.5f, 1f, "Settings window background opacity");
			DebugCmds = f.Bind<bool>("Debug", "CommandFile", false, "Developer: execute commands from BepInEx/omnimap_cmd.txt (leave off)");
			ThemeAccent = f.Bind<int>("Theme", "Accent", 0, "0-6 presets, 7 rainbow, 8-10 gradients, 11 custom colour, 12 custom gradient");
			AccentHex = f.Bind<string>("Theme", "AccentHex", "389EF2", "Custom accent colour");
			GradAHex = f.Bind<string>("Theme", "GradientA", "FF8C33", "Custom gradient colour A");
			GradBHex = f.Bind<string>("Theme", "GradientB", "F2408C", "Custom gradient colour B");
			ThemeBg = f.Bind<int>("Theme", "Background", 0, "0-5 presets, 6 custom");
			BgHex = f.Bind<string>("Theme", "BackgroundHex", "13161D", "Custom background colour");
			MiniVisible = f.Bind<bool>("Minimap", "Visible", true, "Show the minimap");
			MiniShape = f.Bind<int>("Minimap", "Shape", 1, "0 = square, 1 = round");
			MiniCorner = f.Bind<int>("Minimap", "Corner", 0, "0 = top-right, 1 = top-left, 2 = bottom-right, 3 = bottom-left");
			MiniSize = Fl("Minimap", "Size", 260f, 120f, 700f, "Size in pixels at 1080p");
			MiniOpacity = Fl("Minimap", "Opacity", 1f, 0.2f, 1f);
			MiniOffX = Fl("Minimap", "OffsetX", 18f, 0f, 1200f);
			MiniOffY = Fl("Minimap", "OffsetY", 340f, 0f, 1200f);
			MiniRange = Fl("Minimap", "Range", 60f, 15f, 250f, "Visible radius in metres");
			MiniRotate = f.Bind<bool>("Minimap", "RotateWithCamera", true, "Rotate the map with the camera");
			MiniBorder = f.Bind<bool>("Minimap", "Border", true, "Draw a border");
			MiniBorderMode = f.Bind<int>("Minimap", "BorderColorMode", 0, "0 accent, 1 white, 2 dark, 3 custom");
			MiniBorderHex = f.Bind<string>("Minimap", "BorderHex", "FFB81F", "Custom border colour");
			MiniBorderW = Fl("Minimap", "BorderWidth", 2f, 1f, 8f);
			MiniTerrain = f.Bind<bool>("Minimap", "Terrain", true, "Render the real level geometry");
			MiniCompass = f.Bind<bool>("Minimap", "Compass", true, "Show the north marker");
			MiniEdge = f.Bind<bool>("Minimap", "EdgeArrows", true, "Pin important icons (teleporter, portal, markers) to the edge");
			MiniElevation = f.Bind<bool>("Minimap", "ElevationHints", true, "Show arrows for objects far above / below you");
			MiniCone = f.Bind<bool>("Minimap", "ViewCone", true, "Show where the camera is looking");
			MiniRings = f.Bind<bool>("Minimap", "RangeRings", false, "Draw distance rings");
			MiniOutline = f.Bind<bool>("Minimap", "IconOutline", true, "Dark outline around procedural icons");
			LocShow = f.Bind<bool>("Location", "Show", true, "Show the stage name next to the minimap");
			LocPos = f.Bind<int>("Location", "Position", 0, "0 = below the minimap, 1 = above");
			LocSize = Fl("Location", "FontSize", 16f, 10f, 40f);
			LocStage = f.Bind<bool>("Location", "StageNumber", true, "Prefix the name with the stage number");
			LocBg = f.Bind<bool>("Location", "Background", true, "Dark plate behind the text");
			LocColor = f.Bind<int>("Location", "Colour", 0, "0 white, 1 accent");
			LocCoords = f.Bind<bool>("Location", "Coordinates", false, "Second line with your coordinates");
			LocTele = f.Bind<bool>("Location", "TeleporterDistance", false, "Second line with the distance to the teleporter");
			CutUp = Fl("Terrain", "CutawayAbove", 14f, 3f, 120f, "Hide geometry above this height over the player (roofs)");
			CutDown = Fl("Terrain", "DepthBelow", 70f, 10f, 300f, "How far below the player geometry is drawn");
			FullCutUp = Fl("Terrain", "FullMapCutawayAbove", 45f, 3f, 200f, "Same for the full map");
			TerrainFps = Fl("Terrain", "UpdatesPerSecond", 20f, 2f, 60f, "How often the map image is redrawn");
			TerrainLight = Fl("Terrain", "Brightness", 1.2f, 0.1f, 1.5f, "Light used for the map render");
			TerrainLift = Fl("Terrain", "ShadowLift", 0f, 0f, 0.5f, "Extra brightness added to the map image");
			TerrainLayers = f.Bind<int>("Terrain", "Layers", 1, new ConfigDescription("0 = ground only, 1 = ground + props, 2 = everything", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 2), Array.Empty<object>()));
			TerrainRes = f.Bind<int>("Terrain", "Resolution", 512, new ConfigDescription("Minimap texture size", (AcceptableValueBase)(object)new AcceptableValueRange<int>(128, 1024), Array.Empty<object>()));
			IconScale = Fl("Icons", "Scale", 1f, 0.5f, 2.5f, "Object icon size");
			EnemyScale = Fl("Icons", "EnemyScale", 1f, 0.5f, 3f, "Enemy marker size");
			HideUsed = f.Bind<bool>("Icons", "HideUsed", true, "Hide opened chests and used shrines");
			PickupIcons = f.Bind<bool>("Icons", "ItemIcons", true, "Show the actual item icon for dropped items");
			TeleRadius = f.Bind<bool>("Icons", "TeleporterRadius", true, "Draw the teleporter charge radius");
			ShowLabels = f.Bind<bool>("Icons", "FullMapLabels", true, "Draw names of objects on the full map");
			FullSize = Fl("FullMap", "Size", 0.82f, 0.4f, 1f, "Window size relative to the screen");
			FullRange = Fl("FullMap", "Range", 130f, 30f, 600f, "Initial half-height of the area in metres");
			PathMarker = f.Bind<bool>("Route", "RouteToMarker", true, "Draw a route to the active marker");
			PathSelected = f.Bind<bool>("Route", "RouteToSelected", true, "Draw a route to the object selected on the full map");
			PathAuto = f.Bind<int>("Route", "AutoRoute", 0, "0 off, 1 teleporter, 2 nearest chest, 3 nearest shrine, 4 nearest dropped item, 5 nearest portal, 6 nearest interactable");
			PathWorld = f.Bind<bool>("Route", "DrawInWorld", true, "Also draw the route in the 3D world");
			MarkerWorld = f.Bind<bool>("Route", "MarkerInWorld", true, "Show markers on the game screen");
			PathWidth = Fl("Route", "Width", 3f, 1f, 8f);
			PathColor = f.Bind<string>("Route", "Color", "FFD21F", "Route colour (hex)");
			MarkerColor = f.Bind<string>("Route", "MarkerColor", "FF3D8B", "Marker colour (hex)");
			MaxMarkers = f.Bind<int>("Route", "MaxMarkers", 5, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 12), Array.Empty<object>()));
			Add(Kind.AllyPlayer, "Other players", "Другие игроки", "Characters", new Color(0.35f, 0.85f, 1f), "arrow", def: true, 1.3f, key: true);
			Add(Kind.AllyMinion, "Allied drones / minions", "Союзные дроны и миньоны", "Characters", new Color(0.35f, 0.75f, 0.45f), "dot", def: true, 0.8f);
			Add(Kind.EnemyNormal, "Enemies", "Обычные враги", "Characters", new Color(0.95f, 0.22f, 0.22f), "dot", def: true, 0.85f);
			Add(Kind.EnemyElite, "Elites", "Элитные враги", "Characters", new Color(1f, 0.45f, 0.1f), "diamond", def: true, 1.2f);
			Add(Kind.EnemyBoss, "Bosses / champions", "Боссы и чемпионы", "Characters", new Color(0.8f, 0.15f, 0.95f), "star", def: true, 1.9f, key: true);
			Add(Kind.ChestWhite, "Small chests", "Малые сундуки", "Chests", White, "chest");
			Add(Kind.ChestGreen, "Large chests", "Большие сундуки", "Chests", Green, "chest", def: true, 1.1f);
			Add(Kind.ChestRed, "Legendary chests", "Легендарные сундуки", "Chests", Red, "chest", def: true, 1.25f, key: true);
			Add(Kind.ChestLunar, "Lunar pods", "Лунные коконы", "Chests", Lunar, "lunar");
			Add(Kind.ChestVoid, "Void chests / cradles", "Сундуки Бездны", "Chests", Voidc, "void", def: true, 1.1f);
			Add(Kind.ChestEquip, "Equipment barrels", "Бочки со снаряжением", "Chests", Orange, "pillar");
			Add(Kind.ChestCategory, "Category chests", "Тематические сундуки", "Chests", new Color(0.55f, 0.85f, 1f), "chest");
			Add(Kind.ChestSpecial, "Special chests (adaptive, lockbox, cache)", "Особые сундуки", "Chests", Yellow, "chest", def: true, 1.1f);
			Add(Kind.Multishop, "Multishop terminals", "Мультимагазины", "Chests", new Color(0.7f, 1f, 0.75f), "loot");
			Add(Kind.Shrine, "Shrines", "Святыни", "Objects", new Color(0.95f, 0.85f, 0.35f), "shrine", def: true, 1.05f);
			Add(Kind.Printer, "Printers / cauldrons", "Принтеры и котлы", "Objects", new Color(0.85f, 0.85f, 0.85f), "printer", def: true, 1.05f);
			Add(Kind.Scrapper, "Scrappers", "Переработчики", "Objects", new Color(0.75f, 0.75f, 0.8f), "scrapper");
			Add(Kind.Drone, "Broken drones / turrets", "Сломанные дроны и турели", "Objects", new Color(0.55f, 0.95f, 0.85f), "drone");
			Add(Kind.Barrel, "Barrels", "Бочки", "Objects", new Color(0.8f, 0.65f, 0.35f), "pillar", def: false, 0.8f);
			Add(Kind.Other, "Other interactables", "Прочие объекты", "Objects", new Color(0.8f, 0.8f, 1f), "diamond", def: true, 0.9f);
			Add(Kind.Teleporter, "Teleporter", "Телепортер", "Navigation", new Color(0.35f, 1f, 0.6f), "teleporter", def: true, 1.5f, key: true);
			Add(Kind.Portal, "Portals", "Порталы", "Navigation", new Color(0.45f, 0.7f, 1f), "portal", def: true, 1.4f, key: true);
			Add(Kind.Pickup, "Dropped items", "Выпавшие предметы", "Navigation", White, "loot");
			Binds.Init(f);
			f.Save();
		}

		public static Color Hex(string hex, Color fallback)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Color result = default(Color);
			if (!string.IsNullOrEmpty(hex) && ColorUtility.TryParseHtmlString(hex.StartsWith("#") ? hex : ("#" + hex), ref result))
			{
				return result;
			}
			return fallback;
		}

		public static string ToHex(Color c)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return ColorUtility.ToHtmlStringRGB(c);
		}

		public static void MarkDirty()
		{
			dirty = true;
			saveAt = Time.unscaledTime + 1.5f;
		}

		public static void FlushIfDue(bool force = false)
		{
			if (!dirty || (!force && Time.unscaledTime < saveAt))
			{
				return;
			}
			dirty = false;
			try
			{
				F.Save();
			}
			catch
			{
			}
		}
	}
	public static class DebugCmd
	{
		private static readonly Queue<string> queue = new Queue<string>();

		private static float waitUntil;

		private static float nextPoll;

		private static string pending;

		private static float pendingSince;

		private static int perfVsync;

		private static int perfFps;

		private static int perfN;

		private static float perfSum;

		private static float perfOn;

		private static string Dir => Path.Combine(Paths.BepInExRootPath, "omnimap_dump");

		public static void Poll()
		{
			if (!C.DebugCmds.Value)
			{
				return;
			}
			float unscaledTime = Time.unscaledTime;
			if (unscaledTime >= nextPoll)
			{
				nextPoll = unscaledTime + 1f;
				try
				{
					string path = Path.Combine(Paths.BepInExRootPath, "omnimap_cmd.txt");
					if (File.Exists(path))
					{
						string[] array = File.ReadAllLines(path);
						foreach (string text in array)
						{
							if (text.Trim().Length > 0)
							{
								queue.Enqueue(text.Trim());
							}
						}
						File.Delete(path);
					}
				}
				catch
				{
				}
			}
			if (pending != null)
			{
				Step(unscaledTime);
			}
			else if (!(unscaledTime < waitUntil) && queue.Count != 0)
			{
				try
				{
					Exec(queue.Dequeue(), unscaledTime);
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)("cmd: " + ex));
				}
			}
		}

		private static void Exec(string line, float now)
		{
			//IL_06a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06aa: Expected O, but got Unknown
			//IL_050c: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: 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_05d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: 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_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			string[] array = line.Split(' ');
			string text = array[0].ToLowerInvariant();
			Plugin.Log.LogInfo((object)("[cmd] " + line));
			switch (text)
			{
			case "wait":
				waitUntil = now + float.Parse(array[1]);
				break;
			case "startrun":
				Console.instance.SubmitCmd((NetworkUser)null, "gamemode ClassicRun", false);
				Console.instance.SubmitCmd((NetworkUser)null, "host 0", false);
				pending = "startrun1";
				pendingSince = now;
				break;
			case "console":
				Console.instance.SubmitCmd((NetworkUser)null, line.Substring(8), false);
				break;
			case "shot":
				Directory.CreateDirectory(Dir);
				ScreenCapture.CaptureScreenshot(Path.Combine(Dir, ((array.Length > 1) ? array[1] : "shot") + ".png"));
				break;
			case "dumpicons":
				DumpIcons();
				break;
			case "dumpmap":
				DumpMap();
				break;
			case "tune":
				Tune((array.Length > 1) ? array[1] : "t");
				break;
			case "probe":
				Probe();
				break;
			case "expand":
				Plugin.Instance.Settings.Expand((Kind)Enum.Parse(typeof(Kind), array[1]));
				break;
			case "lang":
			{
				int num3 = Array.IndexOf(T.Codes, array[1]);
				if (num3 >= 0)
				{
					T.Set(num3);
				}
				break;
			}
			case "rclick":
				Plugin.Instance.Hud.DebugClick(right: true, new Vector2(float.Parse(array[1]), float.Parse(array[2])), onTele: false);
				break;
			case "lclicktele":
				Plugin.Instance.Hud.DebugClick(right: false, Vector2.zero, onTele: true);
				break;
			case "rclicktele":
				Plugin.Instance.Hud.DebugClick(right: true, Vector2.zero, onTele: true);
				break;
			case "names":
				DumpNames();
				break;
			case "full":
				Plugin.Instance.Hud.ToggleFull();
				break;
			case "settings":
				Plugin.Instance.Settings.Toggle();
				break;
			case "tab":
				SettingsTab(int.Parse(array[1]));
				break;
			case "info":
				Info();
				break;
			case "markerahead":
			{
				Hud hud = Plugin.Instance.Hud;
				float num = ((array.Length > 1) ? float.Parse(array[1]) : 40f);
				float num2 = ((array.Length > 2) ? float.Parse(array[2]) : 0f) + hud.CamYaw;
				Vector3 val = Quaternion.Euler(0f, num2, 0f) * Vector3.forward;
				Routes.AddMarker(Routes.GroundAt(hud.MePos + val * num, hud.MePos.y + 30f));
				break;
			}
			case "stage":
			{
				SceneDef sceneDefFromSceneName = SceneCatalog.GetSceneDefFromSceneName(array[1]);
				if ((Object)(object)sceneDefFromSceneName != (Object)null && (Object)(object)Run.instance != (Object)null)
				{
					Run.instance.AdvanceStage(sceneDefFromSceneName);
				}
				else
				{
					Plugin.Log.LogWarning((object)("stage: not found " + array[1]));
				}
				break;
			}
			case "auto":
				C.PathAuto.Value = int.Parse(array[1]);
				break;
			case "selecttele":
				Routes.Selected = Scan.Tele;
				break;
			case "range":
				C.MiniRange.Value = float.Parse(array[1]);
				break;
			case "tpmark":
				TeleportToMarker();
				break;
			case "clearmarks":
				Routes.ClearAll();
				break;
			case "cfg":
				C.F[new ConfigDefinition(array[1], array[2])].SetSerializedValue(array[3]);
				break;
			case "perf":
				perfVsync = QualitySettings.vSyncCount;
				perfFps = Application.targetFrameRate;
				QualitySettings.vSyncCount = 0;
				Application.targetFrameRate = 1000;
				perfSum = 0f;
				perfN = 0;
				pending = "perf1";
				pendingSince = now;
				break;
			case "quit":
				Application.Quit();
				break;
			default:
				Plugin.Log.LogWarning((object)("unknown cmd " + text));
				break;
			}
		}

		private static void TeleportToMarker()
		{
			//IL_003a: 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_0049: 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)
			Marker activeMarker = Routes.ActiveMarker;
			CharacterBody me = Plugin.Instance.Hud.Me;
			if (activeMarker != null && !((Object)(object)me == (Object)null))
			{
				CharacterMotor characterMotor = me.characterMotor;
				if ((Object)(object)characterMotor != (Object)null)
				{
					((BaseCharacterController)characterMotor).Motor.SetPosition(activeMarker.pos + Vector3.up * 1.5f, true);
				}
			}
		}

		private static void SettingsTab(int t)
		{
			typeof(SettingsUI).GetField("tab", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(Plugin.Instance.Settings, t);
		}

		private static void Step(float now)
		{
			if (pending == "perf1" || pending == "perf2")
			{
				if (now - pendingSince < 1f)
				{
					return;
				}
				perfSum += Time.unscaledDeltaTime;
				perfN++;
				if (now - pendingSince > 7f)
				{
					float num = perfSum / (float)Mathf.Max(1, perfN) * 1000f;
					if (pending == "perf1")
					{
						perfOn = num;
						Plugin.Log.LogInfo((object)("[perf] map ON: " + num.ToString("0.00") + " ms/frame (" + (1000f / num).ToString("0") + " fps)"));
						C.Enabled.Value = false;
						perfSum = 0f;
						perfN = 0;
						pending = "perf2";
						pendingSince = now;
					}
					else
					{
						Plugin.Log.LogInfo((object)("[perf] map OFF: " + num.ToString("0.00") + " ms/frame (" + (1000f / num).ToString("0") + " fps); cost = " + (perfOn - num).ToString("0.00") + " ms"));
						C.Enabled.Value = true;
						QualitySettings.vSyncCount = perfVsync;
						Application.targetFrameRate = perfFps;
						pending = null;
					}
				}
			}
			else if (pending == "startrun1")
			{
				if ((Object)(object)PreGameController.instance != (Object)null && now - pendingSince > 3f)
				{
					pending = "startrun2";
					pendingSince = now;
				}
				else if (now - pendingSince > 60f)
				{
					pending = null;
					Plugin.Log.LogWarning((object)"startrun: lobby timeout");
				}
			}
			else if (pending == "startrun2" && now - pendingSince > 2f)
			{
				Console.instance.SubmitCmd((NetworkUser)null, "pregame_start_run", false);
				pending = null;
			}
		}

		private unsafe static void Info()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			Hud hud = Plugin.Instance.Hud;
			stringBuilder.AppendLine("scene=" + (((Object)(object)SceneCatalog.mostRecentSceneDef != (Object)null) ? SceneCatalog.mostRecentSceneDef.cachedName : "?"));
			string[] obj = new string[6]
			{
				"have=",
				hud.HaveMe.ToString(),
				" pos=",
				null,
				null,
				null
			};
			Vector3 mePos = hud.MePos;
			obj[3] = ((object)(*(Vector3*)(&mePos))/*cast due to .constrained prefix*/).ToString();
			obj[4] = " camYaw=";
			obj[5] = hud.CamYaw.ToString();
			stringBuilder.AppendLine(string.Concat(obj));
			stringBuilder.AppendLine("chars=" + Scan.Chars.Count + " objs=" + Scan.Objs.Count + " tele=" + (Scan.Tele != null));
			stringBuilder.AppendLine("camErr=" + hud.Cam.LastError);
			stringBuilder.AppendLine("routes=" + Routes.Active.Count);
			foreach (KeyValuePair<string, Route> item in Routes.Active)
			{
				stringBuilder.AppendLine("  " + item.Key + " pts=" + item.Value.pts.Count + " graph=" + item.Value.graphPath + " len=" + item.Value.length);
			}
			Directory.CreateDirectory(Dir);
			File.WriteAllText(Path.Combine(Dir, "info_" + (((Object)(object)SceneCatalog.mostRecentSceneDef != (Object)null) ? SceneCatalog.mostRecentSceneDef.cachedName : "x") + ".txt"), stringBuilder.ToString());
		}

		private static void DumpNames()
		{
			Directory.CreateDirectory(Dir);
			List<string> list = new List<string>(Scan.SeenNames);
			list.Sort();
			File.WriteAllLines(Path.Combine(Dir, "names.txt"), list.ToArray());
		}

		private static void DumpIcons()
		{
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: 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)
			Directory.CreateDirectory(Dir);
			foreach (KeyValuePair<string, string> gameKey in Icons.GameKeys)
			{
				Texture val = Icons.Get(gameKey.Key);
				Icons.SavePng(val, Path.Combine(Dir, "icon_" + gameKey.Key + ".png"));
				Plugin.Log.LogInfo((object)("icon " + gameKey.Key + " game=" + Icons.IsGame(gameKey.Key) + " " + val.width + "x" + val.height + " fmt=" + ((val is Texture2D) ? ((object)((Texture2D)val).format/*cast due to .constrained prefix*/).ToString() : "?")));
			}
			Plugin.Log.LogInfo((object)("shaders: " + Gfx.ShaderReport));
		}

		private unsafe static void Probe()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: 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_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_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			Hud hud = Plugin.Instance.Hud;
			if (!hud.HaveMe)
			{
				return;
			}
			Directory.CreateDirectory(Dir);
			StringBuilder stringBuilder = new StringBuilder();
			Vector3 val = hud.MePos;
			stringBuilder.AppendLine("player " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Terrain[] activeTerrains = Terrain.activeTerrains;
			stringBuilder.AppendLine("terrains=" + activeTerrains.Length);
			Terrain[] array = activeTerrains;
			foreach (Terrain val2 in array)
			{
				string[] obj = new string[14]
				{
					"   terrain ",
					((Object)val2).name,
					" layer=",
					LayerMask.LayerToName(((Component)val2).gameObject.layer),
					" draw=",
					val2.drawHeightmap.ToString(),
					" enabled=",
					((Behaviour)val2).enabled.ToString(),
					" pos=",
					null,
					null,
					null,
					null,
					null
				};
				val = ((Component)val2).transform.position;
				obj[9] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj[10] = " size=";
				val = val2.terrainData.size;
				obj[11] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj[12] = " mat=";
				obj[13] = (((Object)(object)val2.materialTemplate != (Object)null) ? ((Object)val2.materialTemplate.shader).name : "default");
				stringBuilder.AppendLine(string.Concat(obj));
			}
			Renderer[] array2 = Object.FindObjectsOfType<Renderer>();
			Bounds bounds;
			foreach (Renderer val3 in array2)
			{
				if (((Component)val3).gameObject.layer != 11 || !val3.enabled)
				{
					continue;
				}
				string text = "";
				Material[] sharedMaterials = val3.sharedMaterials;
				foreach (Material val4 in sharedMaterials)
				{
					if ((Object)(object)val4 != (Object)null && (Object)(object)val4.shader != (Object)null)
					{
						text = text + ((Object)val4.shader).name + "; ";
					}
				}
				string[] obj2 = new string[10]
				{
					"   WORLD ",
					Hier(((Component)val3).gameObject),
					" b=",
					null,
					null,
					null,
					null,
					null,
					null,
					null
				};
				bounds = val3.bounds;
				val = ((Bounds)(ref bounds)).center;
				obj2[3] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj2[4] = " sz=";
				bounds = val3.bounds;
				val = ((Bounds)(ref bounds)).size;
				obj2[5] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj2[6] = " cast=";
				obj2[7] = ((object)val3.shadowCastingMode/*cast due to .constrained prefix*/).ToString();
				obj2[8] = " sh=";
				obj2[9] = text;
				stringBuilder.AppendLine(string.Concat(obj2));
			}
			Vector3 val5 = hud.MePos + Vector3.up * 2f;
			Vector3 down = Vector3.down;
			LayerIndex world = LayerIndex.world;
			RaycastHit val6 = default(RaycastHit);
			if (Physics.Raycast(val5, down, ref val6, 50f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1))
			{
				GameObject gameObject = ((Component)((RaycastHit)(ref val6)).collider).gameObject;
				string[] obj3 = new string[8]
				{
					"ground hit: ",
					Hier(gameObject),
					" layer=",
					LayerMask.LayerToName(gameObject.layer),
					"(",
					gameObject.layer.ToString(),
					") at y=",
					null
				};
				val = ((RaycastHit)(ref val6)).point;
				obj3[7] = val.y.ToString();
				stringBuilder.AppendLine(string.Concat(obj3));
				array2 = gameObject.GetComponentsInChildren<Renderer>();
				foreach (Renderer val7 in array2)
				{
					string text2 = "";
					Material[] sharedMaterials = val7.sharedMaterials;
					foreach (Material val8 in sharedMaterials)
					{
						if ((Object)(object)val8 != (Object)null && (Object)(object)val8.shader != (Object)null)
						{
							text2 = text2 + ((Object)val8.shader).name + "; ";
						}
					}
					stringBuilder.AppendLine("   renderer " + ((Object)val7).name + " layer=" + LayerMask.LayerToName(((Component)val7).gameObject.layer) + " shaders=" + text2);
				}
			}
			else
			{
				stringBuilder.AppendLine("no ground hit");
			}
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			array2 = Object.FindObjectsOfType<Renderer>();
			foreach (Renderer val9 in array2)
			{
				if (val9.enabled && ((Component)val9).gameObject.activeInHierarchy)
				{
					bounds = val9.bounds;
					val = ((Bounds)(ref bounds)).center - hud.MePos;
					if (!(((Vector3)(ref val)).sqrMagnitude > 3600f))
					{
						string key = LayerMask.LayerToName(((Component)val9).gameObject.layer) + "(" + ((Component)val9).gameObject.layer + ")";
						dictionary.TryGetValue(key, out var value);
						dictionary[key] = value + 1;
					}
				}
			}
			stringBuilder.AppendLine("renderers within 60m by layer:");
			foreach (KeyValuePair<string, int> item in dictionary)
			{
				stringBuilder.AppendLine("   " + item.Key + " = " + item.Value);
			}
			stringBuilder.AppendLine("mask mode1=" + MapCam.ComputeMask(1) + " mode2=" + MapCam.ComputeMask(2));
			for (int k = 0; k < 32; k++)
			{
				string text3 = LayerMask.LayerToName(k);
				if (text3.Length > 0)
				{
					stringBuilder.AppendLine("   layer " + k + " = " + text3);
				}
			}
			File.WriteAllText(Path.Combine(Dir, "probe.txt"), stringBuilder.ToString());
		}

		private static string Hier(GameObject go)
		{
			string text = ((Object)go).name;
			Transform parent = go.transform.parent;
			int num = 0;
			while ((Object)(object)parent != (Object)null && num++ < 6)
			{
				text = ((Object)parent).name + "/" + text;
				parent = parent.parent;
			}
			return text;
		}

		private static void Tune(string tag)
		{
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			Hud hud = Plugin.Instance.Hud;
			if (hud.HaveMe)
			{
				Directory.CreateDirectory(Dir);
				float[][] array = new float[8][]
				{
					new float[3] { 0.5f, 0.6f, 0f },
					new float[3] { 0.6f, 0.9f, 0f },
					new float[3] { 0.8f, 0.8f, 0f },
					new float[3] { 0.6f, 1.2f, 0f },
					new float[3] { 1f, 0.6f, 0f },
					new float[3] { 0.4f, 1f, 0.03f },
					new float[3] { 0.8f, 1.2f, 0f },
					new float[3] { 1.2f, 1f, 0f }
				};
				hud.Cam.Mask = MapCam.ComputeMask(1);
				for (int i = 0; i < array.Length; i++)
				{
					hud.Cam.OvAmb = array[i][0];
					hud.Cam.OvLight = array[i][1];
					hud.Cam.OvLift = array[i][2];
					RenderTexture mini = hud.Cam.GetMini();
					hud.Cam.Render(mini, hud.MePos, 0f, 70f, C.CutUp.Value, C.CutDown.Value + C.CutUp.Value);
					Icons.SavePng((Texture)(object)mini, Path.Combine(Dir, "tune_" + tag + "_" + i + ".png"));
				}
				hud.Cam.OvAmb = (hud.Cam.OvLight = (hud.Cam.OvLift = -1f));
			}
		}

		private static void DumpMap()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			Hud hud = Plugin.Instance.Hud;
			if (!hud.HaveMe)
			{
				Plugin.Log.LogWarning((object)"dumpmap: no player");
				return;
			}
			Directory.CreateDirectory(Dir);
			for (int i = 0; i <= 2; i++)
			{
				hud.Cam.Mask = MapCam.ComputeMask(i);
				RenderTexture mini = hud.Cam.GetMini();
				hud.Cam.Render(mini, hud.MePos, hud.CamYaw, C.MiniRange.Value, C.CutUp.Value, C.CutDown.Value + C.CutUp.Value);
				Icons.SavePng((Texture)(object)mini, Path.Combine(Dir, "map_mode" + i + ".png"));
			}
			hud.Cam.Mask = MapCam.ComputeMask(C.TerrainLayers.Value);
			RenderTexture mini2 = hud.Cam.GetMini();
			hud.Cam.Render(mini2, hud.MePos, 0f, 140f, 200f, 400f);
			Icons.SavePng((Texture)(object)mini2, Path.Combine(Dir, "map_wide.png"));
			Plugin.Log.LogInfo((object)("dumpmap done, err=" + hud.Cam.LastError));
		}
	}
	public static class Gfx
	{
		public static Texture2D White;

		private static Material mat;

		public static string ShaderReport = "";

		private static bool fullBlend;

		private static Texture2D discTex;

		private static GUIStyle shadowStyle;

		public static bool GLReady => (Object)(object)mat != (Object)null;

		public static bool CanMask
		{
			get
			{
				if ((Object)(object)mat != (Object)null)
				{
					return fullBlend;
				}
				return false;
			}
		}

		public static void Init()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0023: 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_00ae: Expected O, but got Unknown
			if ((Object)(object)White != (Object)null)
			{
				return;
			}
			White = new Texture2D(1, 1, (TextureFormat)4, false);
			White.SetPixel(0, 0, Color.white);
			White.Apply();
			((Object)White).hideFlags = (HideFlags)61;
			Shader val = SafeFind("Hidden/Internal-Colored");
			fullBlend = (Object)(object)val != (Object)null;
			string[] array;
			if ((Object)(object)val == (Object)null)
			{
				array = new string[2] { "UI/Default", "Sprites/Default" };
				for (int i = 0; i < array.Length; i++)
				{
					val = SafeFind(array[i]);
					if ((Object)(object)val != (Object)null)
					{
						break;
					}
				}
			}
			if ((Object)(object)val != (Object)null)
			{
				mat = new Material(val);
				((Object)mat).hideFlags = (HideFlags)61;
				SetInt("_SrcBlend", 5);
				SetInt("_DstBlend", 10);
				SetInt("_Cull", 0);
				SetInt("_ZWrite", 0);
				SetInt("_ZTest", 8);
			}
			array = new string[11]
			{
				"Hidden/Internal-Colored", "UI/Default", "Sprites/Default", "Legacy Shaders/Diffuse", "Legacy Shaders/VertexLit", "Standard", "Unlit/Color", "Unlit/Texture", "Hidden/Internal-DepthNormalsTexture", "Mobile/Diffuse",
				"Diffuse"
			};
			foreach (string text in array)
			{
				ShaderReport = ShaderReport + text + "=" + ((Object)(object)SafeFind(text) != (Object)null) + " ";
			}
			ShaderReport = ShaderReport + "using=" + (((Object)(object)val != (Object)null) ? ((Object)val).name : "none(IMGUI fallback)");
		}

		private static Shader SafeFind(string name)
		{
			try
			{
				Shader[] array = Resources.FindObjectsOfTypeAll<Shader>();
				foreach (Shader val in array)
				{
					if ((Object)(object)val != (Object)null && ((Object)val).name == name)
					{
						return val;
					}
				}
			}
			catch (Exception)
			{
			}
			try
			{
				return Shader.Find(name);
			}
			catch (Exception)
			{
				return null;
			}
		}

		private static void SetInt(string prop, int v)
		{
			if (mat.HasProperty(prop))
			{
				mat.SetInt(prop, v);
			}
		}

		private static void Line(Vector2 a, Vector2 b, float w, Color c)
		{
			//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_001e: 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_0035: 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_0041: 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_0062: 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.01f))
			{
				Matrix4x4 matrix = GUI.matrix;
				GUIUtility.RotateAroundPivot(Mathf.Atan2(val.y, val.x) * 57.29578f, a);
				GUI.DrawTexture(new Rect(a.x, a.y - w * 0.5f, magnitude, w), (Texture)(object)White, (ScaleMode)0, true, 0f, c, 0f, 0f);
				GUI.matrix = matrix;
			}
		}

		private static void SegmentsIMGUI(List<Vector2> pairs, float width, Color c, bool dashed)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0034: 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_0038: 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_003e: 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)
			//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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_0059: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			float num = 10f + width * 2f;
			float num2 = 7f + width * 1.5f;
			for (int i = 0; i + 1 < pairs.Count; i += 2)
			{
				Vector2 val = pairs[i];
				Vector2 val2 = pairs[i + 1];
				Vector2 val3 = val2 - val;
				float magnitude = ((Vector2)(ref val3)).magnitude;
				if (magnitude < 0.01f)
				{
					continue;
				}
				if (!dashed)
				{
					Line(val, val2, width, c);
					continue;
				}
				Vector2 val4 = (val2 - val) / magnitude;
				for (float num3 = 0f; num3 < magnitude; num3 += num + num2)
				{
					Line(val + val4 * num3, val + val4 * Mathf.Min(magnitude, num3 + num), width, c);
				}
			}
		}

		private static void DiscIMGUI(Vector2 c, float r, Color col)
		{
			//IL_00a5: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)discTex == (Object)null)
			{
				discTex = new Texture2D(64, 64, (TextureFormat)4, false);
				((Object)discTex).hideFlags = (HideFlags)61;
				for (int i = 0; i < 64; i++)
				{
					for (int j = 0; j < 64; j++)
					{
						float num = (float)j + 0.5f - 32f;
						float num2 = (float)i + 0.5f - 32f;
						discTex.SetPixel(j, i, new Color(1f, 1f, 1f, Mathf.Clamp01(32f - Mathf.Sqrt(num * num + num2 * num2))));
					}
				}
				discTex.Apply();
			}
			GUI.DrawTexture(new Rect(c.x - r, c.y - r, r * 2f, r * 2f), (Texture)(object)discTex, (ScaleMode)0, true, 0f, col, 0f, 0f);
		}

		public static void CircleTex(Vector2 c, float r, Texture tex, Color col, int seg = 96)
		{
			//IL_0044: 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_00c9: 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_00dd: 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_0113: 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)
			if (!((Object)(object)mat == (Object)null) && !((Object)(object)tex == (Object)null))
			{
				mat.mainTexture = tex;
				mat.SetPass(0);
				Begin(Screen.width, Screen.height);
				GL.Begin(4);
				GL.Color(col);
				for (int i = 0; i < seg; i++)
				{
					float num = (float)i / (float)seg * (float)Math.PI * 2f;
					float num2 = (float)(i + 1) / (float)seg * (float)Math.PI * 2f;
					float num3 = Mathf.Cos(num);
					float num4 = Mathf.Sin(num);
					float num5 = Mathf.Cos(num2);
					float num6 = Mathf.Sin(num2);
					GL.TexCoord2(0.5f, 0.5f);
					V(c);
					GL.TexCoord2(0.5f + 0.5f * num3, 0.5f - 0.5f * num4);
					V(new Vector2(c.x + num3 * r, c.y + num4 * r));
					GL.TexCoord2(0.5f + 0.5f * num5, 0.5f - 0.5f * num6);
					V(new Vector2(c.x + num5 * r, c.y + num6 * r));
				}
				GL.End();
				End();
				mat.mainTexture = null;
			}
		}

		private static void BlendNormal()
		{
			if (fullBlend)
			{
				mat.SetInt("_SrcBlend", 5);
				mat.SetInt("_DstBlend", 10);
			}
		}

		public static void Begin(int w, int h, bool target = false)
		{
			GL.PushMatrix();
			GL.LoadPixelMatrix(0f, (float)w, (float)h, 0f);
		}

		public static void End()
		{
			GL.PopMatrix();
		}

		public static void Polyline(IList<Vector2> p, float width, Color c, bool dashed = false)
		{
			//IL_003e: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mat == (Object)null || p.Count < 2)
			{
				return;
			}
			BlendNormal();
			mat.SetPass(0);
			Begin(Screen.width, Screen.height);
			GL.Begin(4);
			GL.Color(c);
			float hw = width * 0.5f;
			float num = 12f * Mathf.Max(1f, width * 0.5f);
			float num2 = 8f * Mathf.Max(1f, width * 0.5f);
			float num3 = 0f;
			bool flag = true;
			for (int i = 1; i < p.Count; i++)
			{
				Vector2 val = p[i - 1];
				Vector2 val2 = p[i];
				Vector2 val3 = val2 - val;
				float magnitude = ((Vector2)(ref val3)).magnitude;
				if (magnitude < 0.01f)
				{
					continue;
				}
				Vector2 val4 = val3 / magnitude;
				if (!dashed)
				{
					Quad(val, val2, val4, hw);
					continue;
				}
				float num4 = 0f;
				while (num4 < magnitude)
				{
					float num5 = (flag ? num : num2);
					float num6 = Mathf.Min(num5 - num3, magnitude - num4);
					if (flag)
					{
						Quad(val + val4 * num4, val + val4 * (num4 + num6), val4, hw);
					}
					num4 += num6;
					num3 += num6;
					if (num3 >= num5 - 0.001f)
					{
						num3 = 0f;
						flag = !flag;
					}
				}
			}
			GL.End();
			End();
		}

		public static void Segments(List<Vector2> pairs, float width, Color c, bool dashed)
		{
			//IL_0048: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			if (pairs.Count < 2)
			{
				return;
			}
			if ((Object)(object)mat == (Object)null)
			{
				SegmentsIMGUI(pairs, width, c, dashed);
				return;
			}
			BlendNormal();
			mat.SetPass(0);
			Begin(Screen.width, Screen.height);
			GL.Begin(4);
			GL.Color(c);
			float hw = width * 0.5f;
			float num = 10f + width * 2f;
			float num2 = 7f + width * 1.5f;
			for (int i = 0; i + 1 < pairs.Count; i += 2)
			{
				Vector2 val = pairs[i];
				Vector2 val2 = pairs[i + 1];
				Vector2 val3 = val2 - val;
				float magnitude = ((Vector2)(ref val3)).magnitude;
				if (magnitude < 0.01f)
				{
					continue;
				}
				Vector2 val4 = val3 / magnitude;
				if (!dashed)
				{
					Quad(val, val2, val4, hw);
					continue;
				}
				for (float num3 = 0f; num3 < magnitude; num3 += num + num2)
				{
					Quad(val + val4 * num3, val + val4 * Mathf.Min(magnitude, num3 + num), val4, hw);
				}
			}
			GL.End();
			End();
		}

		private static void Quad(Vector2 a, Vector2 b, Vector2 dir, float hw)
		{
			//IL_0000: 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_000d: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0022: 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)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_003e: 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)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = new Vector2(0f - dir.y, dir.x) * hw;
			Vector2 v = a + val;
			Vector2 v2 = a - val;
			Vector2 v3 = b + val;
			Vector2 v4 = b - val;
			V(v);
			V(v2);
			V(v3);
			V(v3);
			V(v2);
			V(v4);
		}

		private static void V(Vector2 v)
		{
			//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)
			GL.Vertex3(v.x, v.y, 0f);
		}

		public static void Ring(Vector2 c, float rx, float ry, float width, Color col, int seg = 72)
		{
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: 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_018b: 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)
			if ((Object)(object)mat == (Object)null)
			{
				List<Vector2> list = new List<Vector2>();
				for (int i = 0; i < 40; i++)
				{
					float num = (float)i / 40f * (float)Math.PI * 2f;
					float num2 = (float)(i + 1) / 40f * (float)Math.PI * 2f;
					list.Add(new Vector2(c.x + Mathf.Cos(num) * rx, c.y + Mathf.Sin(num) * ry));
					list.Add(new Vector2(c.x + Mathf.Cos(num2) * rx, c.y + Mathf.Sin(num2) * ry));
				}
				SegmentsIMGUI(list, width, col, dashed: false);
				return;
			}
			BlendNormal();
			mat.SetPass(0);
			Begin(Screen.width, Screen.height);
			GL.Begin(4);
			GL.Color(col);
			float num3 = width * 0.5f;
			Vector2 v = Vector2.zero;
			Vector2 v2 = Vector2.zero;
			Vector2 val = default(Vector2);
			Vector2 val2 = default(Vector2);
			for (int j = 0; j <= seg; j++)
			{
				float num4 = (float)j / (float)seg * (float)Math.PI * 2f;
				float num5 = Mathf.Cos(num4);
				float num6 = Mathf.Sin(num4);
				((Vector2)(ref val))..ctor(c.x + num5 * (rx + num3), c.y + num6 * (ry + num3));
				((Vector2)(ref val2))..ctor(c.x + num5 * (rx - num3), c.y + num6 * (ry - num3));
				if (j > 0)
				{
					V(v);
					V(v2);
					V(val);
					V(val);
					V(v2);
					V(val2);
				}
				v = val;
				v2 = val2;
			}
			GL.End();
			End();
		}

		public static void Disc(Vector2 c, float r, Color col, int seg = 48)
		{
			//IL_003d: 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_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_0094: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mat == (Object)null)
			{
				DiscIMGUI(c, r, col);
				return;
			}
			BlendNormal();
			mat.SetPass(0);
			Begin(Screen.width, Screen.height);
			GL.Begin(4);
			GL.Color(col);
			for (int i = 0; i < seg; i++)
			{
				float num = (float)i / (float)seg * (float)Math.PI * 2f;
				float num2 = (float)(i + 1) / (float)seg * (float)Math.PI * 2f;
				V(c);
				V(new Vector2(c.x + Mathf.Cos(num) * r, c.y + Mathf.Sin(num) * r));
				V(new Vector2(c.x + Mathf.Cos(num2) * r, c.y + Mathf.Sin(num2) * r));
			}
			GL.End();
			End();
		}

		public static void Fan(Vector2 c, List<Vector2> pts, Color col)
		{
			//IL_008d: 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_009f: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			if (pts.Count < 2)
			{
				return;
			}
			if ((Object)(object)mat == (Object)null)
			{
				for (int i = 0; i + 1 < pts.Count; i++)
				{
					Vector2 b = pts[i];
					Vector2 val = pts[i + 1] - pts[i];
					Line(c, b, Mathf.Max(2f, ((Vector2)(ref val)).magnitude + 1f), col);
				}
				return;
			}
			BlendNormal();
			mat.SetPass(0);
			Begin(Screen.width, Screen.height);
			GL.Begin(4);
			GL.Color(col);
			for (int j = 0; j + 1 < pts.Count; j++)
			{
				V(c);
				V(pts[j]);
				V(pts[j + 1]);
			}
			GL.End();
			End();
		}

		public static void Lift(RenderTexture rt, float a)
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			if (CanMask && !((Object)(object)rt == (Object)null) && !(a <= 0.002f))
			{
				RenderTexture active = RenderTexture.active;
				RenderTexture.active = rt;
				GL.PushMatrix();
				GL.LoadPixelMatrix(0f, (float)((Texture)rt).width, (float)((Texture)rt).height, 0f);
				mat.SetInt("_SrcBlend", 1);
				mat.SetInt("_DstBlend", 1);
				mat.SetPass(0);
				GL.Begin(4);
				GL.Color(new Color(a, a, a, 0f));
				V(new Vector2(0f, 0f));
				V(new Vector2((float)((Texture)rt).width, 0f));
				V(new Vector2((float)((Texture)rt).width, (float)((Texture)rt).height));
				V(new Vector2(0f, 0f));
				V(new Vector2((float)((Texture)rt).width, (float)((Texture)rt).height));
				V(new Vector2(0f, (float)((Texture)rt).height));
				GL.End();
				GL.PopMatrix();
				RenderTexture.active = active;
				BlendNormal();
			}
		}

		public static void MaskCircle(RenderTexture rt)
		{
			//IL_0085: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: 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_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: 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_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: 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_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: 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_0284: Unknown result type (might be due to invalid IL or missing references)
			if (CanMask && !((Object)(object)rt == (Object)null))
			{
				RenderTexture active = RenderTexture.active;
				RenderTexture.active = rt;
				GL.PushMatrix();
				GL.LoadPixelMatrix(0f, (float)((Texture)rt).width, (float)((Texture)rt).height, 0f);
				mat.SetInt("_SrcBlend", 1);
				mat.SetInt("_DstBlend", 1);
				mat.SetPass(0);
				GL.Begin(4);
				GL.Color(new Color(0f, 0f, 0f, 1f));
				V(new Vector2(0f, 0f));
				V(new Vector2((float)((Texture)rt).width, 0f));
				V(new Vector2((float)((Texture)rt).width, (float)((Texture)rt).height));
				V(new Vector2(0f, 0f));
				V(new Vector2((float)((Texture)rt).width, (float)((Texture)rt).height));
				V(new Vector2(0f, (float)((Texture)rt).height));
				GL.End();
				mat.SetInt("_SrcBlend", 1);
				mat.SetInt("_DstBlend", 0);
				mat.SetPass(0);
				GL.Begin(4);
				GL.Color(new Color(0f, 0f, 0f, 0f));
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor((float)((Texture)rt).width * 0.5f, (float)((Texture)rt).height * 0.5f);
				float num = (float)Mathf.Min(((Texture)rt).width, ((Texture)rt).height) * 0.5f;
				float num2 = num * 2f;
				for (int i = 0; i < 96; i++)
				{
					float num3 = (float)i / 96f * (float)Math.PI * 2f;
					float num4 = (float)(i + 1) / 96f * (float)Math.PI * 2f;
					Vector2 v = val + new Vector2(Mathf.Cos(num3), Mathf.Sin(num3)) * num;
					Vector2 v2 = val + new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * num;
					Vector2 v3 = val + new Vector2(Mathf.Cos(num3), Mathf.Sin(num3)) * num2;
					Vector2 v4 = val + new Vector2(Mathf.Cos(num4), Mathf.Sin(num4)) * num2;
					V(v);
					V(v3);
					V(v4);
					V(v);
					V(v4);
					V(v2);
				}
				GL.End();
				GL.PopMatrix();
				RenderTexture.active = active;
				BlendNormal();
			}
		}

		public static void Rect(Rect r, Color c)
		{
			//IL_0000: 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)
			GUI.DrawTexture(r, (Texture)(object)White, (ScaleMode)0, true, 0f, c, 0f, 0f);
		}

		public static void Frame(Rect r, float w, Color c)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_005a: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			Rect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, w), c);
			Rect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - w, ((Rect)(ref r)).width, w), c);
			Rect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, w, ((Rect)(ref r)).height), c);
			Rect(new Rect(((Rect)(ref r)).xMax - w, ((Rect)(ref r)).y, w, ((Rect)(ref r)).height), c);
		}

		public static void Text(Rect r, string s, int size, Color c, TextAnchor a = (TextAnchor)4, bool bold = false)
		{
			//IL_0039: 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)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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)
			//IL_00b8: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (shadowStyle == null)
			{
				shadowStyle = new GUIStyle(GUI.skin.label)
				{
					wordWrap = false,
					clipping = (TextClipping)0
				};
			}
			shadowStyle.fontSize = size;
			shadowStyle.alignment = a;
			shadowStyle.fontStyle = (FontStyle)(bold ? 1 : 0);
			Color color = GUI.color;
			GUI.color = new Color(0f, 0f, 0f, 0.9f * c.a);
			shadowStyle.normal.textColor = Color.white;
			GUI.Label(new Rect(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), s, shadowStyle);
			GUI.Label(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), s, shadowStyle);
			GUI.color = c;
			GUI.Label(r, s, shadowStyle);
			GUI.color = color;
		}

		public static Vector2 Measure(string s, int size, bool bold = false)
		{
			//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)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			if (shadowStyle == null)
			{
				shadowStyle = new GUIStyle(GUI.skin.label)
				{
					wordWrap = false,
					clipping = (TextClipping)0
				};
			}
			shadowStyle.fontSize = size;
			shadowStyle.fontStyle = (FontStyle)(bold ? 1 : 0);
			return shadowStyle.CalcSize(new GUIContent(s));
		}
	}
	internal struct Hit
	{
		public Ent ent;

		public Marker marker;

		public Vector2 p;

		public float r;
	}
	public class Hud
	{
		public MapCam Cam = new MapCam();

		public bool FullOpen;

		public bool HaveMe;

		public Vector3 MePos;

		public float CamYaw;

		public float AimYaw;

		public CharacterBody Me;

		public Camera MainCam;

		private Vector3 fullCenter;

		private float fullHalfH = 130f;

		private bool fullFollow = true;

		private Rect fullRect;

		private bool dragging;

		private Vector2 downPos;

		private bool moved;

		private readonly List<Hit> hits = new List<Hit>();

		private Ent hoverEnt;

		private Marker hoverMarker;

		private View miniView;

		private View fullView;

		private bool miniValid;

		private bool fullValid;

		private float nextMini;

		private float nextFull;

		public Rect MiniRect;

		private readonly List<Vector2> segs = new List<Vector2>();

		private readonly List<Vector2> tmp = new List<Vector2>();

		public bool EditingLayout;

		private bool layoutDrag;

		private Vector2 layoutDragStart;

		private float lx0;

		private float ly0;

		private float labelBlockH;

		private string locKey = "";

		private string locName = "";

		private float UiS => (float)Screen.height / 1080f;

		public void ResetState()
		{
			miniValid = (fullValid = false);
			FullOpen = false;
			fullFollow = true;
		}

		public void ToggleFull()
		{
			//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)
			FullOpen = !FullOpen;
			if (FullOpen)
			{
				fullFollow = true;
				fullHalfH = C.FullRange.Value;
				fullCenter = MePos;
				fullValid = false;
			}
		}

		public Rect ComputeMiniRect()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			float num = C.MiniSize.Value * UiS;
			float num2 = C.MiniOffX.Value * UiS;
			float num3 = C.MiniOffY.Value * UiS;
			float num4 = Screen.width;
			float num5 = Screen.height;
			float num6;
			float num7;
			switch (C.MiniCorner.Value)
			{
			case 1:
				num6 = num2;
				num7 = num3;
				break;
			case 2:
				num6 = num4 - num - num2;
				num7 = num5 - num - num3;
				break;
			case 3:
				num6 = num2;
				num7 = num5 - num - num3;
				break;
			default:
				num6 = num4 - num - num2;
				num7 = num3;
				break;
			}
			return new Rect(num6, num7, num, num);
		}

		private Rect ComputeFullRect()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			float value = C.FullSize.Value;
			float num = (float)Screen.width * value;
			float num2 = (float)Screen.height * value;
			return new Rect(((float)Screen.width - num) * 0.5f, ((float)Screen.height - num2) * 0.5f, num, num2);
		}

		public void TickRender()
		{
			//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_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)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: 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)
			if (!HaveMe)
			{
				return;
			}
			Cam.Mask = MapCam.ComputeMask(C.TerrainLayers.Value);
			float num = 1f / Mathf.Max(1f, C.TerrainFps.Value);
			float unscaledTime = Time.unscaledTime;
			if (FullOpen)
			{
				fullRect = ComputeFullRect();
				if (fullFollow)
				{
					fullCenter = MePos;
				}
				if (unscaledTime >= nextFull || !fullValid)
				{
					nextFull = unscaledTime + num;
					View view = new View
					{
						center = fullCenter,
						yaw = 0f,
						halfH = fullHalfH,
						rect = fullRect,
						circle = false
					};
					if (C.MiniTerrain.Value)
					{
						int num2 = Mathf.RoundToInt(Mathf.Min(1600f, ((Rect)(ref fullRect)).width));
						int h = Mathf.RoundToInt((float)num2 * ((Rect)(ref fullRect)).height / ((Rect)(ref fullRect)).width);
						RenderTexture full = Cam.GetFull(num2, h);
						view.camDepth = Cam.Render(full, view.center, view.yaw, view.halfH, C.FullCutUp.Value, C.CutDown.Value + C.FullCutUp.Value);
					}
					fullView = view;
					fullValid = true;
				}
			}
			else if (C.MiniVisible.Value && C.MiniTerrain.Value && (unscaledTime >= nextMini || !miniValid))
			{
				nextMini = unscaledTime + num;
				Rect rect = ComputeMiniRect();
				View view2 = new View
				{
					center = MePos,
					yaw = (C.MiniRotate.Value ? CamYaw : 0f),
					halfH = C.MiniRange.Value,
					rect = rect,
					circle = (C.MiniShape.Value == 1)
				};
				RenderTexture mini = Cam.GetMini();
				view2.camDepth = Cam.Render(mini, view2.center, view2.yaw, view2.halfH, C.CutUp.Value, C.CutDown.Value + C.CutUp.Value);
				if (view2.circle)
				{
					Gfx.MaskCircle(mini);
				}
				miniView = view2;
				miniValid = true;
			}
		}

		private View CurrentMiniView()
		{
			//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_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_0032: 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_008a: 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)
			Rect rect = ComputeMiniRect();
			bool circle = C.MiniShape.Value == 1;
			if (C.MiniTerrain.Value && miniValid)
			{
				View result = miniView;
				result.rect = rect;
				result.circle = circle;
				return result;
			}
			return new View
			{
				center = MePos,
				yaw = (C.MiniRotate.Value ? CamYaw : 0f),
				halfH = C.MiniRange.Value,
				rect = rect,
				circle = circle
			};
		}

		public void OnGUI(bool active)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Invalid comparison between Unknown and I4
			if (active && HaveMe)
			{
				Gfx.Init();
				Icons.Init();
				Event current = Event.current;
				if (FullOpen)
				{
					DrawFull(current);
				}
				else if (C.MiniVisible.Value)
				{
					DrawMini(current);
				}
				if ((int)current.type == 7)
				{
					DrawToast();
				}
			}
		}

		public void DrawWorldOverlay()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			if (HaveMe && !((Object)(object)MainCam == (Object)null) && (int)Event.current.type == 7)
			{
				WorldOverlay.Draw(this);
			}
		}

		private void DrawMini(Event ev)
		{
			//IL_0009: 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_0016: 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_0027: Invalid comparison between Unknown and I4
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: 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_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: 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_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			View v = CurrentMiniView();
			MiniRect = v.rect;
			HandleLayoutEdit(ev, v.rect);
			if ((int)ev.type != 7)
			{
				return;
			}
			float value = C.MiniOpacity.Value;
			if (C.MiniTerrain.Value && miniValid && (Object)(object)Cam.Mini != (Object)null)
			{
				if (v.circle && !Gfx.CanMask && Gfx.GLReady)
				{
					Gfx.CircleTex(((Rect)(ref v.rect)).center, ((Rect)(ref v.rect)).width * 0.5f, (Texture)(object)Cam.Mini, new Color(1f, 1f, 1f, value));
				}
				else if (v.circle)
				{
					GUI.DrawTexture(v.rect, (Texture)(object)Cam.Mini, (ScaleMode)0, true, 0f, new Color(1f, 1f, 1f, value), 0f, 0f);
				}
				else
				{
					GUI.DrawTexture(v.rect, (Texture)(object)Cam.Mini, (ScaleMode)0, false, 0f, new Color(1f, 1f, 1f, value), 0f, 0f);
				}
			}
			else
			{
				BackPlate(v, value);
			}
			if (C.MiniRings.Value)
			{
				DrawRings(v);
			}
			if (C.MiniCone.Value)
			{
				DrawCone(v);
			}
			DrawContent(v, full: false);
			if (C.MiniBorder.Value)
			{
				Color val = default(Color);
				((Color)(ref val))..ctor(0.05f, 0.05f, 0.06f, 0.95f);
				Color val2 = BorderColor();
				float value2 = C.MiniBorderW.Value;
				if