Decompiled source of Wallhacks v1.0.2

Wallhacks.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Wallhacks
{
	[BepInPlugin("com.example.wallhacks", "Wallhacks", "1.0.1")]
	public class WallhacksPlugin : BaseUnityPlugin
	{
		private enum Cat
		{
			Mobs,
			Pickables,
			Rocks,
			Trees,
			Items,
			Fish,
			Chests,
			Dungeons
		}

		private class Entry
		{
			public Cat Cat;

			public string Prefab;

			public bool On;

			public Color Color;

			public bool Box = true;

			public bool Label = true;

			public bool Tracer;

			public bool Touched;

			public bool Alert;

			public int AlertStars;
		}

		private class Target
		{
			public GameObject Go;

			public Entry E;

			public Bounds B;

			public bool Dynamic;

			public Collider[] Cols;

			public Renderer[] Rends;

			public string Name;

			public float Max;

			public int Stars;
		}

		internal static bool MenuOpen;

		internal static bool Typing;

		private static readonly string[] TabNames = new string[9] { "Mobs", "Pickables", "Ores/Rocks", "Trees", "Items", "Fish", "Chests", "Dungeons", "Settings" };

		private static readonly string[] TabLabels = new string[9] { "Mobs", "Pickups", "Ores", "Trees", "Items", "Fish", "Chests", "Dungeons", "Settings" };

		private static readonly Color[] DefaultColors = (Color[])(object)new Color[8]
		{
			Color.red,
			Color.green,
			Color.cyan,
			new Color(1f, 0.6f, 0f),
			Color.white,
			new Color(0.35f, 0.7f, 1f),
			new Color(1f, 0.84f, 0.2f),
			new Color(0.75f, 0.55f, 1f)
		};

		private static readonly Color[] Presets = (Color[])(object)new Color[8]
		{
			Color.red,
			Color.green,
			Color.blue,
			Color.yellow,
			Color.cyan,
			Color.magenta,
			new Color(1f, 0.6f, 0f),
			Color.white
		};

		private static readonly Color[] AccentColors = (Color[])(object)new Color[6]
		{
			new Color(0.3f, 0.6f, 1f),
			new Color(0.15f, 0.78f, 0.72f),
			new Color(0.35f, 0.8f, 0.4f),
			new Color(0.62f, 0.45f, 1f),
			new Color(1f, 0.6f, 0.2f),
			new Color(1f, 0.35f, 0.45f)
		};

		private static readonly Dictionary<string, string> FriendlyNames = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
		{
			{ "Fish1", "Perch" },
			{ "Fish2", "Pike" },
			{ "Fish3", "Tuna" },
			{ "Fish4_cave", "Tetra" },
			{ "Fish5", "Trollfish" },
			{ "Fish6", "Giant Herring" },
			{ "Fish7", "Grouper" },
			{ "Fish8", "Coral Cod" },
			{ "Fish9", "Anglerfish" },
			{ "Fish10", "Northern Salmon" },
			{ "Fish11", "Magmafish" },
			{ "Fish12", "Pufferfish" }
		};

		private ConfigEntry<KeyCode> _menuKey;

		private ConfigEntry<KeyCode> _toggleKey;

		private Rect _window = new Rect(40f, 40f, 480f, 660f);

		private Vector2 _scroll;

		private Rect _searchRect;

		private bool _dragging;

		private Vector3 _dragStartMouse;

		private Vector2 _dragStartPos;

		private int _tab;

		private int _tabReq;

		private Entry _editing;

		private Entry _editReq;

		private string _search = "";

		private string _searchView = "";

		private int _accentIdx;

		private int _builtAccent = -1;

		private float _scale = 1f;

		private float _scalePending = 1f;

		private int _enabledCount;

		private bool _showAll = true;

		private int _style;

		private float _thick = 2f;

		private bool _healthBars = true;

		private bool _showStars = true;

		private readonly Entry _tombEntry = new Entry
		{
			Cat = Cat.Items,
			Prefab = "Player_tombstone",
			On = true,
			Color = new Color(1f, 0.35f, 0.9f),
			Box = true,
			Label = true,
			Tracer = true
		};

		private bool _alertOn = true;

		private bool _alertMsg = true;

		private bool _alertSound = true;

		private float _alertVol = 0.4f;

		private readonly HashSet<int> _alerted = new HashSet<int>();

		private Component _audio;

		private object _beep;

		private MethodInfo _playOneShot;

		private float _lastBeep;

		private readonly float[] _maxDist = new float[8] { 300f, 150f, 150f, 150f, 100f, 100f, 150f, 400f };

		private readonly Dictionary<string, Entry> _entries = new Dictionary<string, Entry>();

		private readonly Dictionary<Cat, List<Entry>> _lists = new Dictionary<Cat, List<Entry>>();

		private readonly Dictionary<Cat, Dictionary<string, Entry>> _active = new Dictionary<Cat, Dictionary<string, Entry>>();

		private readonly Dictionary<string, string[]> _saved = new Dictionary<string, string[]>();

		private readonly List<Target> _targets = new List<Target>();

		private readonly HashSet<GameObject> _seen = new HashSet<GameObject>();

		private bool _listBuilt;

		private float _nextScan;

		private Texture2D _pixel;

		private Texture2D _circle;

		private GUISkin _skin;

		private readonly List<Texture2D> _texes = new List<Texture2D>();

		private GUIStyle _sWin;

		private GUIStyle _sCard;

		private GUIStyle _sRow;

		private GUIStyle _sRowOn;

		private GUIStyle _sTitle;

		private GUIStyle _sSub;

		private GUIStyle _sTab;

		private GUIStyle _sTabOn;

		private GUIStyle _sBtn;

		private GUIStyle _sBtnSmall;

		private GUIStyle _sBtnAccent;

		private GUIStyle _sSeg;

		private GUIStyle _sSegOn;

		private GUIStyle _sField;

		private GUIStyle _sHint;

		private GUIStyle _sNameOn;

		private GUIStyle _sNameOff;

		private GUIStyle _sText;

		private GUIStyle _sDim;

		private GUIStyle _sValue;

		private GUIStyle _sSection;

		private GUIStyle _sFoot;

		private GUIStyle _sH1;

		private GUIStyle _sPill;

		private GUIStyle _sTrack;

		private GUIStyle _labelStyle;

		private GUIStyle _sChip;

		private GUIStyle _sChipOn;

		private static readonly string[] DungeonSeeds = new string[8] { "Burial Chamber", "Sunken Crypt", "Troll Cave", "Frost Cave", "Infested Mine", "Dvergr Dungeon", "Dungeon Entrance", "Dungeon Exit" };

		private static HashSet<int> _charLayers;

		private Color Accent => AccentColors[Mathf.Clamp(_accentIdx, 0, AccentColors.Length - 1)];

		private string SavePath => Path.Combine(Paths.ConfigPath, "Wallhacks.settings.txt");

		private static string Display(Entry e)
		{
			if (!FriendlyNames.TryGetValue(e.Prefab, out var value))
			{
				return e.Prefab;
			}
			return value;
		}

		private void Awake()
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			_menuKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "MenuKey", (KeyCode)289, "Open/close the menu");
			_toggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)290, "Show/hide the whole overlay");
			foreach (Cat value in Enum.GetValues(typeof(Cat)))
			{
				_lists[value] = new List<Entry>();
				_active[value] = new Dictionary<string, Entry>();
			}
			_pixel = new Texture2D(1, 1);
			_pixel.SetPixel(0, 0, Color.white);
			_pixel.Apply();
			Load();
			SetupAudio();
			new Harmony("com.example.wallhacks").PatchAll();
		}

		private void OnDestroy()
		{
			Save();
		}

		private void Update()
		{
			//IL_0013: 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)
			if (!MenuOpen)
			{
				Typing = false;
			}
			if (Input.GetKeyDown(_menuKey.Value))
			{
				MenuOpen = !MenuOpen;
				if (!MenuOpen)
				{
					Save();
				}
			}
			if (Input.GetKeyDown(_toggleKey.Value))
			{
				_showAll = !_showAll;
			}
			if (!_listBuilt && (Object)(object)ZNetScene.instance != (Object)null)
			{
				BuildList();
			}
			if ((Object)(object)Player.m_localPlayer == (Object)null)
			{
				return;
			}
			bool num = Time.time >= _nextScan;
			if (num || MenuOpen)
			{
				RebuildActive();
			}
			if (num)
			{
				_nextScan = Time.time + 0.75f;
				if (_showAll || _alertOn)
				{
					RefreshTargets();
				}
				if (_alertOn)
				{
					CheckAlerts();
				}
			}
		}

		private void RebuildActive()
		{
			foreach (Dictionary<string, Entry> value in _active.Values)
			{
				value.Clear();
			}
			int num = 0;
			foreach (Entry value2 in _entries.Values)
			{
				if (value2.On)
				{
					_active[value2.Cat][value2.Prefab] = value2;
					num++;
				}
			}
			_enabledCount = num;
		}

		private static Cat? Classify(GameObject go)
		{
			if ((Object)(object)go.GetComponent<Player>() != (Object)null)
			{
				return null;
			}
			if ((Object)(object)go.GetComponent<TombStone>() != (Object)null)
			{
				return null;
			}
			if ((Object)(object)go.GetComponent<Fish>() != (Object)null)
			{
				return Cat.Fish;
			}
			if ((Object)(object)go.GetComponent<Character>() != (Object)null)
			{
				return Cat.Mobs;
			}
			if ((Object)(object)go.GetComponent<Pickable>() != (Object)null)
			{
				return Cat.Pickables;
			}
			if ((Object)(object)go.GetComponent<MineRock>() != (Object)null || (Object)(object)go.GetComponent<MineRock5>() != (Object)null)
			{
				return Cat.Rocks;
			}
			if ((Object)(object)go.GetComponent<TreeBase>() != (Object)null || (Object)(object)go.GetComponent<TreeLog>() != (Object)null)
			{
				return Cat.Trees;
			}
			if ((Object)(object)go.GetComponent<Container>() != (Object)null)
			{
				return Cat.Chests;
			}
			if ((Object)(object)go.GetComponent<Destructible>() != (Object)null)
			{
				return Cat.Rocks;
			}
			if ((Object)(object)go.GetComponent<ItemDrop>() != (Object)null)
			{
				return Cat.Items;
			}
			return null;
		}

		private void BuildList()
		{
			//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)
			foreach (GameObject prefab in ZNetScene.instance.m_prefabs)
			{
				if ((Object)(object)prefab == (Object)null)
				{
					continue;
				}
				Cat? cat = Classify(prefab);
				if (!cat.HasValue)
				{
					continue;
				}
				string key = cat.Value.ToString() + ":" + ((Object)prefab).name;
				if (!_entries.ContainsKey(key))
				{
					Entry entry = new Entry
					{
						Cat = cat.Value,
						Prefab = ((Object)prefab).name,
						Color = DefaultColors[(int)cat.Value]
					};
					if (_saved.TryGetValue(key, out var value))
					{
						ApplySaved(entry, value);
					}
					_entries[key] = entry;
					_lists[cat.Value].Add(entry);
				}
			}
			string[] dungeonSeeds = DungeonSeeds;
			foreach (string name in dungeonSeeds)
			{
				GetDungeonEntry(name);
			}
			foreach (List<Entry> value2 in _lists.Values)
			{
				value2.Sort((Entry a, Entry b) => string.Compare(Display(a), Display(b), StringComparison.OrdinalIgnoreCase));
			}
			_listBuilt = true;
		}

		private void RefreshTargets()
		{
			_targets.Clear();
			_seen.Clear();
			Scan<Pickable>(Cat.Pickables, (Func<Pickable, bool>)((Pickable p) => !IsPicked(p)));
			Scan<MineRock>(Cat.Rocks, (Func<MineRock, bool>)null);
			Scan<MineRock5>(Cat.Rocks, (Func<MineRock5, bool>)null);
			Scan<Destructible>(Cat.Rocks, (Func<Destructible, bool>)null);
			Scan<TreeBase>(Cat.Trees, (Func<TreeBase, bool>)null);
			Scan<TreeLog>(Cat.Trees, (Func<TreeLog, bool>)null);
			Scan<ItemDrop>(Cat.Items, (Func<ItemDrop, bool>)null);
			Scan<Fish>(Cat.Fish, (Func<Fish, bool>)null);
			Scan<Container>(Cat.Chests, (Func<Container, bool>)null);
			ScanTomb();
			ScanDungeons();
		}

		private void Scan<T>(Cat cat, Func<T, bool> filter = null) where T : Component
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<string, Entry> dictionary = _active[cat];
			if (dictionary.Count == 0)
			{
				return;
			}
			Vector3 position = ((Component)Player.m_localPlayer).transform.position;
			float num = _maxDist[(int)cat];
			T[] array = Object.FindObjectsByType<T>((FindObjectsSortMode)0);
			foreach (T val in array)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				GameObject gameObject = ((Component)val).gameObject;
				if (!_seen.Contains(gameObject) && dictionary.TryGetValue(Utils.GetPrefabName(gameObject), out var value) && !(Vector3.Distance(position, gameObject.transform.position) > num) && (filter == null || filter(val)) && GetBounds(gameObject, out var b))
				{
					_seen.Add(gameObject);
					Target target = new Target
					{
						Go = gameObject,
						E = value,
						B = b,
						Dynamic = (cat == Cat.Fish || cat == Cat.Items)
					};
					if (cat == Cat.Fish)
					{
						target.Stars = FishStars(gameObject);
					}
					if (target.Dynamic)
					{
						target.Cols = gameObject.GetComponentsInChildren<Collider>();
						target.Rends = gameObject.GetComponentsInChildren<Renderer>();
					}
					_targets.Add(target);
				}
			}
		}

		private static bool IsMyTomb(TombStone ts)
		{
			try
			{
				object value = Traverse.Create((object)ts).Method("IsOwner", Array.Empty<object>()).GetValue();
				return !(value is bool) || (bool)value;
			}
			catch
			{
				return true;
			}
		}

		private void ScanTomb()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if (!_tombEntry.On)
			{
				return;
			}
			TombStone[] array = Object.FindObjectsByType<TombStone>((FindObjectsSortMode)0);
			foreach (TombStone val in array)
			{
				if (!((Object)(object)val == (Object)null) && IsMyTomb(val))
				{
					GameObject gameObject = ((Component)val).gameObject;
					if (!_seen.Contains(gameObject) && GetBounds(gameObject, out var b))
					{
						_seen.Add(gameObject);
						_targets.Add(new Target
						{
							Go = gameObject,
							E = _tombEntry,
							B = b,
							Name = "Your Tombstone",
							Max = 100000f
						});
					}
				}
			}
		}

		private static string KnownDungeon(string name)
		{
			string text = name.ToLowerInvariant();
			if (text.Contains("sunkencrypt"))
			{
				return "Sunken Crypt";
			}
			if (text.Contains("crypt"))
			{
				return "Burial Chamber";
			}
			if (text.Contains("trollcave"))
			{
				return "Troll Cave";
			}
			if (text.Contains("mountaincave"))
			{
				return "Frost Cave";
			}
			if (text.Contains("excavation") || text.Contains("infestedmine"))
			{
				return "Infested Mine";
			}
			if (text.Contains("dvergr"))
			{
				return "Dvergr Dungeon";
			}
			return null;
		}

		private static string DungeonName(Teleport tp, Location[] locs)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)tp).transform.position;
			if (position.y > 3000f)
			{
				return "Dungeon Exit";
			}
			string text = null;
			float num = 80f;
			foreach (Location val in locs)
			{
				if (!((Object)(object)val == (Object)null))
				{
					float num2 = Vector3.Distance(((Component)val).transform.position, position);
					if (num2 < num)
					{
						num = num2;
						text = ((Object)((Component)val).gameObject).name;
					}
				}
			}
			if (text == null)
			{
				Transform val2 = ((Component)tp).transform;
				while ((Object)(object)val2 != (Object)null)
				{
					if (KnownDungeon(((Object)val2).name) != null)
					{
						text = ((Object)val2).name;
						break;
					}
					val2 = val2.parent;
				}
			}
			string text2 = ((text != null) ? KnownDungeon(text) : null);
			if (text2 != null)
			{
				return text2;
			}
			if (text == null)
			{
				return "Dungeon Entrance";
			}
			return "Dungeon: " + text.Replace("(Clone)", "").Trim();
		}

		private Entry GetDungeonEntry(string name)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			string key = Cat.Dungeons.ToString() + ":" + name;
			if (_entries.TryGetValue(key, out var value))
			{
				return value;
			}
			value = new Entry
			{
				Cat = Cat.Dungeons,
				Prefab = name,
				On = true,
				Color = DefaultColors[7]
			};
			if (_saved.TryGetValue(key, out var value2))
			{
				ApplySaved(value, value2);
			}
			_entries[key] = value;
			_lists[Cat.Dungeons].Add(value);
			_lists[Cat.Dungeons].Sort((Entry a, Entry b) => string.Compare(a.Prefab, b.Prefab, StringComparison.OrdinalIgnoreCase));
			return value;
		}

		private void ScanDungeons()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)Player.m_localPlayer).transform.position;
			float num = _maxDist[7];
			Location[] array = null;
			Teleport[] array2 = Object.FindObjectsByType<Teleport>((FindObjectsSortMode)0);
			foreach (Teleport val in array2)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				GameObject gameObject = ((Component)val).gameObject;
				if (!_seen.Contains(gameObject) && !(Vector3.Distance(position, gameObject.transform.position) > num))
				{
					if (array == null)
					{
						array = Object.FindObjectsByType<Location>((FindObjectsSortMode)0);
					}
					string name = DungeonName(val, array);
					Entry dungeonEntry = GetDungeonEntry(name);
					if (dungeonEntry.On && GetBounds(gameObject, out var b))
					{
						((Bounds)(ref b)).Expand(1.5f);
						_seen.Add(gameObject);
						_targets.Add(new Target
						{
							Go = gameObject,
							E = dungeonEntry,
							B = b,
							Name = name
						});
					}
				}
			}
		}

		private void SetupAudio()
		{
			try
			{
				Type type = Type.GetType("UnityEngine.AudioSource, UnityEngine.AudioModule");
				Type type2 = Type.GetType("UnityEngine.AudioClip, UnityEngine.AudioModule");
				if (!(type == null) && !(type2 == null))
				{
					int num = 44100;
					int num2 = (int)((float)num * 0.32f);
					float[] array = new float[num2];
					for (int i = 0; i < num2; i++)
					{
						float num3 = (float)i / (float)num;
						bool num4 = num3 < 0.15f;
						float num5 = (num4 ? 880f : 1320f);
						float num6 = (num4 ? num3 : (num3 - 0.15f));
						float num7 = (num4 ? 0.15f : 0.17f);
						float num8 = Mathf.Clamp01(num6 / 0.01f) * Mathf.Clamp01((num7 - num6) / 0.05f);
						array[i] = Mathf.Sin((float)Math.PI * 2f * num5 * num3) * num8 * 0.5f;
					}
					object obj = type2.GetMethod("Create", new Type[5]
					{
						typeof(string),
						typeof(int),
						typeof(int),
						typeof(int),
						typeof(bool)
					}).Invoke(null, new object[5] { "mf_beep", num2, 1, num, false });
					type2.GetMethod("SetData", new Type[2]
					{
						typeof(float[]),
						typeof(int)
					}).Invoke(obj, new object[2] { array, 0 });
					Component val = ((Component)this).gameObject.AddComponent(type);
					type.GetProperty("playOnAwake").SetValue(val, false, null);
					type.GetProperty("spatialBlend").SetValue(val, 0f, null);
					_playOneShot = type.GetMethod("PlayOneShot", new Type[2]
					{
						type2,
						typeof(float)
					});
					_audio = val;
					_beep = obj;
				}
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Alert sound unavailable: " + ex.Message));
			}
		}

		private static string Compass(Vector3 d)
		{
			//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)
			float num = Mathf.Atan2(d.x, d.z) * 57.29578f;
			if (num < 0f)
			{
				num += 360f;
			}
			return (new string[8] { "N", "NE", "E", "SE", "S", "SW", "W", "NW" })[Mathf.RoundToInt(num / 45f) % 8];
		}

		private void RaiseAlert(int id, string name, int stars, Vector3 pos, float dist)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if (!_alerted.Add(id))
			{
				return;
			}
			string text = name + ((stars > 0) ? (" " + new string('*', stars)) : "") + "  " + Compass(pos - ((Component)Player.m_localPlayer).transform.position) + "  " + Mathf.RoundToInt(dist) + "m";
			if (_alertMsg)
			{
				try
				{
					((Character)Player.m_localPlayer).Message((MessageType)2, "Found: " + text, 0, (Sprite)null, false);
				}
				catch
				{
				}
			}
			if (_alertSound && (Object)(object)_audio != (Object)null && _beep != null && _playOneShot != null && Time.unscaledTime - _lastBeep > 0.4f)
			{
				try
				{
					_playOneShot.Invoke(_audio, new object[2] { _beep, _alertVol });
				}
				catch
				{
				}
				_lastBeep = Time.unscaledTime;
			}
		}

		private void CheckAlerts()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_020c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Player.m_localPlayer == (Object)null)
			{
				return;
			}
			Vector3 position = ((Component)Player.m_localPlayer).transform.position;
			if (_alerted.Count > 5000)
			{
				_alerted.Clear();
			}
			Dictionary<string, Entry> dictionary = _active[Cat.Mobs];
			if (dictionary.Count > 0)
			{
				foreach (Character allCharacter in Character.GetAllCharacters())
				{
					if ((Object)(object)allCharacter == (Object)null || allCharacter is Player || allCharacter.IsDead() || !dictionary.TryGetValue(Utils.GetPrefabName(((Component)allCharacter).gameObject), out var value) || !value.Alert)
					{
						continue;
					}
					float num = Vector3.Distance(position, ((Component)allCharacter).transform.position);
					if (!(num > _maxDist[0]))
					{
						int num2 = Mathf.Max(0, allCharacter.GetLevel() - 1);
						if (num2 >= value.AlertStars)
						{
							RaiseAlert(((Object)((Component)allCharacter).gameObject).GetInstanceID(), Display(value), num2, ((Component)allCharacter).transform.position, num);
						}
					}
				}
			}
			foreach (Target target in _targets)
			{
				if (!((Object)(object)target.Go == (Object)null) && target.E.On && target.E.Alert)
				{
					float num3 = Vector3.Distance(position, target.Go.transform.position);
					float num4 = ((target.Max > 0f) ? target.Max : _maxDist[(int)target.E.Cat]);
					if (!(num3 > num4) && target.Stars >= target.E.AlertStars)
					{
						RaiseAlert(((Object)target.Go).GetInstanceID(), target.Name ?? Display(target.E), target.Stars, target.Go.transform.position, num3);
					}
				}
			}
		}

		private static int FishStars(GameObject go)
		{
			int num = 1;
			try
			{
				ItemDrop component = go.GetComponent<ItemDrop>();
				if ((Object)(object)component != (Object)null && component.m_itemData != null)
				{
					num = Mathf.Max(num, component.m_itemData.m_quality);
				}
				ZNetView component2 = go.GetComponent<ZNetView>();
				if ((Object)(object)component2 != (Object)null && component2.IsValid())
				{
					ZDO zDO = component2.GetZDO();
					if (zDO != null)
					{
						num = Mathf.Max(num, zDO.GetInt("quality", 1));
					}
				}
			}
			catch
			{
			}
			return Mathf.Clamp(num - 1, 0, 10);
		}

		private static bool IsPicked(Pickable p)
		{
			try
			{
				return Traverse.Create((object)p).Field("m_picked").GetValue<bool>();
			}
			catch
			{
				return false;
			}
		}

		private static Bounds LiveBounds(Target t)
		{
			//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_0036: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00c8: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			Bounds result = t.B;
			bool flag = false;
			Collider[] cols = t.Cols;
			foreach (Collider val in cols)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (!flag)
					{
						result = val.bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref result)).Encapsulate(val.bounds);
					}
				}
			}
			if (!flag)
			{
				Renderer[] rends = t.Rends;
				foreach (Renderer val2 in rends)
				{
					if (!((Object)(object)val2 == (Object)null))
					{
						if (!flag)
						{
							result = val2.bounds;
							flag = true;
						}
						else
						{
							((Bounds)(ref result)).Encapsulate(val2.bounds);
						}
					}
				}
			}
			if (!flag && (Object)(object)t.Go != (Object)null)
			{
				((Bounds)(ref result))..ctor(t.Go.transform.position + Vector3.up * 0.5f, Vector3.one);
			}
			return result;
		}

		private static bool IsCharacterLayer(int layer)
		{
			if (_charLayers == null)
			{
				_charLayers = new HashSet<int>();
				for (int i = 0; i < 32; i++)
				{
					string text = LayerMask.LayerToName(i);
					if (!string.IsNullOrEmpty(text) && text.StartsWith("character", StringComparison.OrdinalIgnoreCase))
					{
						_charLayers.Add(i);
					}
				}
			}
			return _charLayers.Contains(layer);
		}

		private static bool GetCharacterBounds(Character ch, out Bounds b)
		{
			//IL_0001: 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_0050: 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_00b8: 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_0104: 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)
			b = default(Bounds);
			bool flag = false;
			Collider[] componentsInChildren = ((Component)ch).GetComponentsInChildren<Collider>();
			Collider[] array = componentsInChildren;
			foreach (Collider val in array)
			{
				if (!((Object)(object)val == (Object)null) && !val.isTrigger && val.enabled && IsCharacterLayer(((Component)val).gameObject.layer))
				{
					if (!flag)
					{
						b = val.bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref b)).Encapsulate(val.bounds);
					}
				}
			}
			if (flag)
			{
				return true;
			}
			array = componentsInChildren;
			foreach (Collider val2 in array)
			{
				if (!((Object)(object)val2 == (Object)null) && !val2.isTrigger && val2.enabled)
				{
					if (!flag)
					{
						b = val2.bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref b)).Encapsulate(val2.bounds);
					}
				}
			}
			if (flag)
			{
				return true;
			}
			SkinnedMeshRenderer[] componentsInChildren2 = ((Component)ch).GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val3 in componentsInChildren2)
			{
				if (!((Object)(object)val3 == (Object)null))
				{
					if (!flag)
					{
						b = ((Renderer)val3).bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref b)).Encapsulate(((Renderer)val3).bounds);
					}
				}
			}
			if (flag)
			{
				return true;
			}
			return GetBounds(((Component)ch).gameObject, out b);
		}

		private static bool GetBounds(GameObject go, out Bounds b)
		{
			//IL_0001: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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: 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_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_0080: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			b = default(Bounds);
			bool flag = false;
			Collider[] componentsInChildren = go.GetComponentsInChildren<Collider>();
			foreach (Collider val in componentsInChildren)
			{
				if (!((Object)(object)val == (Object)null))
				{
					if (!flag)
					{
						b = val.bounds;
						flag = true;
					}
					else
					{
						((Bounds)(ref b)).Encapsulate(val.bounds);
					}
				}
			}
			if (!flag)
			{
				Renderer[] componentsInChildren2 = go.GetComponentsInChildren<Renderer>();
				foreach (Renderer val2 in componentsInChildren2)
				{
					if (!((Object)(object)val2 == (Object)null))
					{
						if (!flag)
						{
							b = val2.bounds;
							flag = true;
						}
						else
						{
							((Bounds)(ref b)).Encapsulate(val2.bounds);
						}
					}
				}
			}
			if (!flag)
			{
				b = new Bounds(go.transform.position + Vector3.up * 0.5f, Vector3.one);
				flag = true;
			}
			return flag;
		}

		private Texture2D Rounded(int r, Color fill, Color border, int bw)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_00c2: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			int num = r * 2 + 4;
			Texture2D val = new Texture2D(num, num, (TextureFormat)4, false);
			((Object)val).hideFlags = (HideFlags)61;
			((Texture)val).filterMode = (FilterMode)1;
			((Texture)val).wrapMode = (TextureWrapMode)1;
			Color[] array = (Color[])(object)new Color[num * num];
			for (int i = 0; i < num; i++)
			{
				for (int j = 0; j < num; j++)
				{
					float num2 = (float)j + 0.5f;
					float num3 = (float)i + 0.5f;
					float num4 = Mathf.Clamp(num2, (float)r, (float)(num - r));
					float num5 = Mathf.Clamp(num3, (float)r, (float)(num - r));
					float num6 = Mathf.Sqrt((num2 - num4) * (num2 - num4) + (num3 - num5) * (num3 - num5));
					float num7 = Mathf.Clamp01((float)r - num6 + 0.5f);
					float num8 = ((bw > 0) ? Mathf.Clamp01((float)(r - bw) - num6 + 0.5f) : 1f);
					Color val2 = Color.Lerp(border, fill, num8);
					val2.a *= num7;
					array[i * num + j] = val2;
				}
			}
			val.SetPixels(array);
			val.Apply();
			_texes.Add(val);
			return val;
		}

		private Texture2D MakeCircle(int s)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//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)
			Texture2D val = new Texture2D(s, s, (TextureFormat)4, false);
			((Object)val).hideFlags = (HideFlags)61;
			((Texture)val).filterMode = (FilterMode)1;
			((Texture)val).wrapMode = (TextureWrapMode)1;
			float num = (float)s / 2f;
			Color[] array = (Color[])(object)new Color[s * s];
			for (int i = 0; i < s; i++)
			{
				for (int j = 0; j < s; j++)
				{
					float num2 = (float)j + 0.5f - num;
					float num3 = (float)i + 0.5f - num;
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					array[i * s + j] = new Color(1f, 1f, 1f, Mathf.Clamp01(num - num4 + 0.5f));
				}
			}
			val.SetPixels(array);
			val.Apply();
			_texes.Add(val);
			return val;
		}

		private static void SetBg(GUIStyle s, Texture2D n, Texture2D h = null, Texture2D a = null)
		{
			if ((Object)(object)h == (Object)null)
			{
				h = n;
			}
			if ((Object)(object)a == (Object)null)
			{
				a = n;
			}
			s.normal.background = n;
			s.onNormal.background = n;
			s.hover.background = h;
			s.onHover.background = h;
			s.active.background = a;
			s.onActive.background = a;
			s.focused.background = n;
			s.onFocused.background = n;
		}

		private static void SetText(GUIStyle s, Color c, Color? hover = null)
		{
			//IL_000e: 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)
			//IL_0013: 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_0026: 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_003e: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			Color textColor = (hover.HasValue ? hover.Value : c);
			s.normal.textColor = c;
			s.onNormal.textColor = c;
			s.hover.textColor = textColor;
			s.onHover.textColor = textColor;
			s.active.textColor = textColor;
			s.onActive.textColor = textColor;
			s.focused.textColor = c;
			s.onFocused.textColor = c;
		}

		private static GUIStyle MakeStyle(Texture2D n, Texture2D h, Texture2D a, int border, int pl, int pr, int pt, int pb)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000e: 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_001d: Expected O, but got Unknown
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0031: Expected O, but got Unknown
			GUIStyle val = new GUIStyle();
			SetBg(val, n, h, a);
			val.border = new RectOffset(border, border, border, border);
			val.padding = new RectOffset(pl, pr, pt, pb);
			return val;
		}

		private static Color Mul(Color c, float f)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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)
			return new Color(c.r * f, c.g * f, c.b * f, 1f);
		}

		private void EnsureStyles()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			if ((Object)(object)_skin == (Object)null)
			{
				_skin = Object.Instantiate<GUISkin>(GUI.skin);
				((Object)_skin).hideFlags = (HideFlags)61;
				BuildStyles();
			}
			else if (_builtAccent != _accentIdx && (int)Event.current.type == 8)
			{
				BuildStyles();
			}
		}

		private void BuildStyles()
		{
			//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_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Expected O, but got Unknown
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Expected O, but got Unknown
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: 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_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Expected O, but got Unknown
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Expected O, but got Unknown
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Expected O, but got Unknown
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Expected O, but got Unknown
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Expected O, but got Unknown
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Expected O, but got Unknown
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Expected O, but got Unknown
			//IL_0377: 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_038e: 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_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Expected O, but got Unknown
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Expected O, but got Unknown
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Expected O, but got Unknown
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Expected O, but got Unknown
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Expected O, but got Unknown
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Expected O, but got Unknown
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Expected O, but got Unknown
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_058a: Expected O, but got Unknown
			//IL_0594: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Expected O, but got Unknown
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0647: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Expected O, but got Unknown
			//IL_0673: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Expected O, but got Unknown
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_0689: Unknown result type (might be due to invalid IL or missing references)
			//IL_0694: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a1: Expected O, but got Unknown
			//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b5: Expected O, but got Unknown
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d9: Expected O, but got Unknown
			//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ed: Expected O, but got Unknown
			//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_070e: Expected O, but got Unknown
			//IL_0718: Unknown result type (might be due to invalid IL or missing references)
			//IL_0722: Expected O, but got Unknown
			//IL_0728: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_073d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0747: Expected O, but got Unknown
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Unknown result type (might be due to invalid IL or missing references)
			//IL_075d: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_076b: Unknown result type (might be due to invalid IL or missing references)
			//IL_076d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0817: Unknown result type (might be due to invalid IL or missing references)
			//IL_081c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0839: Unknown result type (might be due to invalid IL or missing references)
			//IL_083e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_0852: Expected O, but got Unknown
			//IL_0868: Unknown result type (might be due to invalid IL or missing references)
			//IL_0881: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0908: Unknown result type (might be due to invalid IL or missing references)
			//IL_0909: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0936: Expected O, but got Unknown
			//IL_0946: Unknown result type (might be due to invalid IL or missing references)
			//IL_0950: Expected O, but got Unknown
			//IL_0955: Unknown result type (might be due to invalid IL or missing references)
			//IL_095f: Expected O, but got Unknown
			//IL_0963: Unknown result type (might be due to invalid IL or missing references)
			//IL_096d: Expected O, but got Unknown
			//IL_0989: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Expected O, but got Unknown
			//IL_09a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ad: Expected O, but got Unknown
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bc: Expected O, but got Unknown
			//IL_09c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ca: Expected O, but got Unknown
			//IL_0a38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Expected O, but got Unknown
			//IL_0a47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a51: Expected O, but got Unknown
			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a60: Expected O, but got Unknown
			//IL_0a64: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6e: Expected O, but got Unknown
			//IL_0a87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			foreach (Texture2D tex in _texes)
			{
				if ((Object)(object)tex != (Object)null)
				{
					Object.Destroy((Object)(object)tex);
				}
			}
			_texes.Clear();
			_builtAccent = _accentIdx;
			Color accent = Accent;
			Color fill = default(Color);
			((Color)(ref fill))..ctor(0.07f, 0.078f, 0.098f, 0.97f);
			Color border = default(Color);
			((Color)(ref border))..ctor(0.2f, 0.23f, 0.3f, 1f);
			Color val = default(Color);
			((Color)(ref val))..ctor(0.115f, 0.126f, 0.157f, 1f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.17f, 0.19f, 0.24f, 1f);
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(0.17f, 0.19f, 0.24f, 1f);
			Color val4 = default(Color);
			((Color)(ref val4))..ctor(0.23f, 0.26f, 0.33f, 1f);
			Color val5 = default(Color);
			((Color)(ref val5))..ctor(0.13f, 0.15f, 0.19f, 1f);
			Color fill2 = default(Color);
			((Color)(ref fill2))..ctor(0.055f, 0.06f, 0.078f, 1f);
			Color val6 = default(Color);
			((Color)(ref val6))..ctor(0.91f, 0.93f, 0.97f, 1f);
			Color val7 = default(Color);
			((Color)(ref val7))..ctor(0.58f, 0.63f, 0.72f, 1f);
			_circle = MakeCircle(32);
			_sWin = MakeStyle(Rounded(10, fill, border, 1), null, null, 10, 16, 16, 14, 10);
			_sCard = MakeStyle(Rounded(8, val, val2, 1), null, null, 8, 12, 12, 10, 10);
			_sCard.margin = new RectOffset(0, 0, 0, 8);
			_sRow = MakeStyle(Rounded(7, val, val2, 1), null, null, 7, 14, 8, 6, 6);
			_sRow.margin = new RectOffset(0, 0, 0, 4);
			_sRowOn = MakeStyle(Rounded(7, Color.Lerp(val, accent, 0.12f), Color.Lerp(val2, accent, 0.5f), 1), null, null, 7, 14, 8, 6, 6);
			_sRowOn.margin = new RectOffset(0, 0, 0, 4);
			_sTitle = new GUIStyle
			{
				fontSize = 17,
				fontStyle = (FontStyle)1,
				richText = true,
				alignment = (TextAnchor)3
			};
			SetText(_sTitle, val6);
			_sSub = new GUIStyle
			{
				fontSize = 11,
				alignment = (TextAnchor)3
			};
			SetText(_sSub, val7);
			_sText = new GUIStyle
			{
				fontSize = 13,
				alignment = (TextAnchor)3
			};
			SetText(_sText, val6);
			_sH1 = new GUIStyle
			{
				fontSize = 13,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)3
			};
			SetText(_sH1, val6);
			_sDim = new GUIStyle
			{
				fontSize = 12,
				alignment = (TextAnchor)3
			};
			SetText(_sDim, val7);
			_sValue = new GUIStyle
			{
				fontSize = 12,
				alignment = (TextAnchor)5
			};
			SetText(_sValue, val7);
			_sSection = new GUIStyle
			{
				fontSize = 10,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)3
			};
			_sSection.margin = new RectOffset(2, 0, 6, 4);
			SetText(_sSection, val7);
			_sFoot = new GUIStyle
			{
				fontSize = 10,
				alignment = (TextAnchor)3
			};
			SetText(_sFoot, val7);
			_sHint = new GUIStyle
			{
				fontSize = 12,
				alignment = (TextAnchor)3
			};
			_sHint.padding = new RectOffset(11, 0, 0, 0);
			SetText(_sHint, new Color(val7.r, val7.g, val7.b, 0.7f));
			_sTab = new GUIStyle
			{
				fontSize = 12,
				alignment = (TextAnchor)4,
				fixedHeight = 30f
			};
			_sTab.padding = new RectOffset(4, 4, 0, 2);
			SetText(_sTab, val7, val6);
			_sTabOn = new GUIStyle(_sTab)
			{
				fontStyle = (FontStyle)1
			};
			SetText(_sTabOn, val6);
			Texture2D n = Rounded(6, val3, val3, 0);
			Texture2D h = Rounded(6, val4, val4, 0);
			Texture2D a = Rounded(6, val5, val5, 0);
			_sBtn = MakeStyle(n, h, a, 6, 12, 12, 0, 0);
			_sBtn.fontSize = 12;
			_sBtn.alignment = (TextAnchor)4;
			_sBtn.fixedHeight = 26f;
			SetText(_sBtn, val6);
			_sBtnSmall = new GUIStyle(_sBtn)
			{
				fontSize = 11,
				fixedHeight = 20f
			};
			_sBtnSmall.padding = new RectOffset(8, 8, 0, 0);
			Color val8 = Mul(accent, 0.88f);
			Color val9 = Color.Lerp(accent, Color.white, 0.18f);
			val9.a = 1f;
			Color val10 = Mul(accent, 0.68f);
			_sBtnAccent = MakeStyle(Rounded(6, val8, val8, 0), Rounded(6, val9, val9, 0), Rounded(6, val10, val10, 0), 6, 12, 12, 0, 0);
			_sBtnAccent.fontSize = 12;
			_sBtnAccent.fontStyle = (FontStyle)1;
			_sBtnAccent.alignment = (TextAnchor)4;
			_sBtnAccent.fixedHeight = 26f;
			SetText(_sBtnAccent, Color.white);
			_sSeg = new GUIStyle(_sBtn);
			_sSegOn = new GUIStyle(_sBtnAccent);
			_sChip = new GUIStyle(_sBtn)
			{
				fixedHeight = 22f,
				fontSize = 11
			};
			_sChip.padding = new RectOffset(0, 0, 0, 0);
			_sChipOn = new GUIStyle(_sBtnAccent)
			{
				fixedHeight = 22f,
				fontSize = 11
			};
			_sChipOn.padding = new RectOffset(0, 0, 0, 0);
			_sNameOff = new GUIStyle
			{
				fontSize = 12,
				alignment = (TextAnchor)3,
				clipping = (TextClipping)1
			};
			_sNameOff.padding = new RectOffset(8, 4, 0, 0);
			SetText(_sNameOff, val7, val6);
			_sNameOn = new GUIStyle(_sNameOff);
			SetText(_sNameOn, val6, val6);
			Texture2D val11 = Rounded(6, fill2, val2, 1);
			Texture2D background = Rounded(6, fill2, accent, 1);
			_sField = MakeStyle(val11, val11, val11, 6, 11, 11, 0, 0);
			_sField.focused.background = background;
			_sField.onFocused.background = background;
			_sField.fontSize = 12;
			_sField.alignment = (TextAnchor)3;
			_sField.clipping = (TextClipping)1;
			SetText(_sField, val6);
			_sPill = MakeStyle(Rounded(9, Color.white, Color.white, 0), null, null, 9, 0, 0, 0, 0);
			_sTrack = MakeStyle(Rounded(3, Color.white, Color.white, 0), null, null, 3, 0, 0, 0, 0);
			_labelStyle = new GUIStyle
			{
				fontSize = 12,
				fontStyle = (FontStyle)1
			};
			Texture2D n2 = Rounded(4, new Color(1f, 1f, 1f, 0.05f), new Color(1f, 1f, 1f, 0.05f), 0);
			Texture2D n3 = Rounded(4, new Color(0.34f, 0.38f, 0.46f, 1f), new Color(0.34f, 0.38f, 0.46f, 1f), 0);
			Texture2D h2 = Rounded(4, new Color(0.46f, 0.51f, 0.61f, 1f), new Color(0.46f, 0.51f, 0.61f, 1f), 0);
			Texture2D a2 = Rounded(4, accent, accent, 0);
			GUIStyle verticalScrollbar = _skin.verticalScrollbar;
			SetBg(verticalScrollbar, n2);
			verticalScrollbar.border = new RectOffset(4, 4, 4, 4);
			verticalScrollbar.fixedWidth = 8f;
			verticalScrollbar.padding = new RectOffset(0, 0, 0, 0);
			verticalScrollbar.margin = new RectOffset(6, 0, 0, 0);
			verticalScrollbar.overflow = new RectOffset(0, 0, 0, 0);
			GUIStyle verticalScrollbarThumb = _skin.verticalScrollbarThumb;
			SetBg(verticalScrollbarThumb, n3, h2, a2);
			verticalScrollbarThumb.border = new RectOffset(4, 4, 4, 4);
			verticalScrollbarThumb.fixedWidth = 8f;
			verticalScrollbarThumb.padding = new RectOffset(0, 0, 0, 0);
			verticalScrollbarThumb.margin = new RectOffset(0, 0, 0, 0);
			verticalScrollbarThumb.overflow = new RectOffset(0, 0, 0, 0);
			GUIStyle[] array = (GUIStyle[])(object)new GUIStyle[4] { _skin.verticalScrollbarUpButton, _skin.verticalScrollbarDownButton, _skin.horizontalScrollbarLeftButton, _skin.horizontalScrollbarRightButton };
			foreach (GUIStyle obj in array)
			{
				SetBg(obj, null);
				obj.fixedWidth = 0f;
				obj.fixedHeight = 0f;
				obj.padding = new RectOffset(0, 0, 0, 0);
				obj.margin = new RectOffset(0, 0, 0, 0);
				obj.border = new RectOffset(0, 0, 0, 0);
				obj.overflow = new RectOffset(0, 0, 0, 0);
			}
			_skin.settings.cursorColor = Color.white;
			_skin.settings.selectionColor = new Color(accent.r, accent.g, accent.b, 0.35f);
		}

		private bool Switch(bool value)
		{
			//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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Invalid comparison between Unknown and I4
			//IL_0098: 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_00bc: 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_00cc: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(36f, 20f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(36f),
				GUILayout.Height(20f)
			});
			Event current = Event.current;
			if ((int)current.type == 0 && current.button == 0 && ((Rect)(ref rect)).Contains(current.mousePosition))
			{
				value = !value;
				GUI.changed = true;
				current.Use();
			}
			if ((int)current.type == 7)
			{
				Rect val = default(Rect);
				((Rect)(ref val))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + 1f, 36f, 18f);
				Color color = GUI.color;
				GUI.color = (Color)(value ? Accent : new Color(0.27f, 0.3f, 0.37f, 1f));
				_sPill.Draw(val, GUIContent.none, false, false, false, false);
				GUI.color = Color.white;
				GUI.DrawTexture(new Rect(value ? (((Rect)(ref val)).xMax - 16f) : (((Rect)(ref val)).x + 2f), ((Rect)(ref val)).y + 2f, 14f, 14f), (Texture)(object)_circle);
				GUI.color = color;
			}
			return value;
		}

		private float Slider(float value, float min, float max, Color fill)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected I4, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Invalid comparison between Unknown and I4
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: 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_0297: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(10f, 20f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(20f)
			});
			int controlID = GUIUtility.GetControlID((FocusType)2);
			Event current = Event.current;
			float num = ((Rect)(ref rect)).x + 7f;
			float num2 = ((Rect)(ref rect)).xMax - 7f;
			EventType typeForControl = current.GetTypeForControl(controlID);
			switch ((int)typeForControl)
			{
			default:
				if ((int)typeForControl == 7)
				{
					float num3 = Mathf.InverseLerp(min, max, value);
					float num4 = Mathf.Lerp(num, num2, num3);
					Rect val = default(Rect);
					((Rect)(ref val))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).center.y - 3f, ((Rect)(ref rect)).width, 6f);
					Color color = GUI.color;
					GUI.color = new Color(0.22f, 0.25f, 0.31f, 1f);
					_sTrack.Draw(val, GUIContent.none, false, false, false, false);
					GUI.color = fill;
					_sTrack.Draw(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, Mathf.Max(6f, num4 - ((Rect)(ref val)).x), 6f), GUIContent.none, false, false, false, false);
					float num5 = ((GUIUtility.hotControl == controlID || ((Rect)(ref rect)).Contains(current.mousePosition)) ? 16f : 14f);
					GUI.color = new Color(0f, 0f, 0f, 0.35f);
					GUI.DrawTexture(new Rect(num4 - num5 / 2f, ((Rect)(ref rect)).center.y - num5 / 2f + 1f, num5, num5), (Texture)(object)_circle);
					GUI.color = Color.white;
					GUI.DrawTexture(new Rect(num4 - num5 / 2f, ((Rect)(ref rect)).center.y - num5 / 2f, num5, num5), (Texture)(object)_circle);
					GUI.color = color;
				}
				break;
			case 0:
				if (current.button == 0 && ((Rect)(ref rect)).Contains(current.mousePosition))
				{
					GUIUtility.hotControl = controlID;
					value = Mathf.Lerp(min, max, Mathf.InverseLerp(num, num2, current.mousePosition.x));
					GUI.changed = true;
					current.Use();
				}
				break;
			case 3:
				if (GUIUtility.hotControl == controlID)
				{
					value = Mathf.Lerp(min, max, Mathf.InverseLerp(num, num2, current.mousePosition.x));
					GUI.changed = true;
					current.Use();
				}
				break;
			case 1:
				if (GUIUtility.hotControl == controlID)
				{
					GUIUtility.hotControl = 0;
					current.Use();
				}
				break;
			case 2:
				break;
			}
			return Mathf.Clamp(value, min, max);
		}

		private bool ColorDot(Color c, float size, bool selected)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Invalid comparison between Unknown and I4
			//IL_005e: 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_003b: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(size, size, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(size),
				GUILayout.Height(size)
			});
			Event current = Event.current;
			bool result = false;
			if ((int)current.type == 0 && current.button == 0 && ((Rect)(ref rect)).Contains(current.mousePosition))
			{
				result = true;
				current.Use();
			}
			if ((int)current.type == 7)
			{
				bool flag = ((Rect)(ref rect)).Contains(current.mousePosition);
				Color color = GUI.color;
				GUI.color = (Color)(selected ? Color.white : new Color(1f, 1f, 1f, flag ? 0.55f : 0.25f));
				GUI.DrawTexture(rect, (Texture)(object)_circle);
				GUI.color = c;
				float num = (selected ? 3.5f : (flag ? 1.5f : 2f));
				GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + num, ((Rect)(ref rect)).y + num, ((Rect)(ref rect)).width - 2f * num, ((Rect)(ref rect)).height - 2f * num), (Texture)(object)_circle);
				GUI.color = color;
			}
			return result;
		}

		private int Segmented(int sel, params string[] labels)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < labels.Length; i++)
			{
				if (i > 0)
				{
					GUILayout.Space(4f);
				}
				if (GUILayout.Button(labels[i], (i == sel) ? _sSegOn : _sSeg, Array.Empty<GUILayoutOption>()))
				{
					sel = i;
				}
			}
			GUILayout.EndHorizontal();
			return sel;
		}

		private void Divider()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_0039: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(1f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(1f)
			});
			if ((int)Event.current.type == 7)
			{
				Color color = GUI.color;
				GUI.color = new Color(1f, 1f, 1f, 0.08f);
				GUI.DrawTexture(rect, (Texture)(object)_pixel);
				GUI.color = color;
			}
		}

		private static bool ApproxEq(Color a, Color b)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			return Mathf.Abs(a.r - b.r) + Mathf.Abs(a.g - b.g) + Mathf.Abs(a.b - b.b) < 0.03f;
		}

		private void OnGUI()
		{
			//IL_0278: 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_0019: Invalid comparison between Unknown and I4
			//IL_0077: 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_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_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Invalid comparison between Unknown and I4
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Player.m_localPlayer == (Object)null)
			{
				return;
			}
			if ((int)Event.current.type == 8)
			{
				if (_tab != _tabReq)
				{
					_scroll = Vector2.zero;
				}
				_tab = _tabReq;
				_editing = _editReq;
				_searchView = _search;
				if (GUIUtility.hotControl == 0)
				{
					_scale = _scalePending;
				}
			}
			EnsureStyles();
			GUISkin skin = GUI.skin;
			Matrix4x4 matrix = GUI.matrix;
			GUI.skin = _skin;
			try
			{
				if (MenuOpen)
				{
					if (_dragging)
					{
						if (Input.GetMouseButton(0))
						{
							Vector3 mousePosition = Input.mousePosition;
							((Rect)(ref _window)).x = _dragStartPos.x + (mousePosition.x - _dragStartMouse.x) / _scale;
							((Rect)(ref _window)).y = _dragStartPos.y - (mousePosition.y - _dragStartMouse.y) / _scale;
						}
						else
						{
							_dragging = false;
						}
					}
					float num = Mathf.Min(660f, (float)Screen.height / _scale - 20f);
					GUI.matrix = Matrix4x4.Scale(new Vector3(_scale, _scale, 1f));
					_window = GUILayout.Window(98123, _window, new WindowFunction(DrawWindow), GUIContent.none, _sWin, (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.Width(480f),
						GUILayout.Height(num)
					});
					((Rect)(ref _window)).x = Mathf.Clamp(((Rect)(ref _window)).x, 0f, Mathf.Max(0f, (float)Screen.width / _scale - ((Rect)(ref _window)).width));
					((Rect)(ref _window)).y = Mathf.Clamp(((Rect)(ref _window)).y, 0f, Mathf.Max(0f, (float)Screen.height / _scale - ((Rect)(ref _window)).height));
					GUI.matrix = matrix;
					Typing = _tab != TabNames.Length - 1 && GUI.GetNameOfFocusedControl() == "mf_search";
				}
				else
				{
					Typing = false;
					_dragging = false;
				}
				if ((int)Event.current.type == 7 && _showAll)
				{
					DrawAll();
				}
			}
			finally
			{
				GUI.matrix = matrix;
				GUI.skin = skin;
			}
		}

		private void DrawWindow(int id)
		{
			//IL_0085: 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_0097: 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)
			//IL_012f: Invalid comparison between Unknown and I4
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			DrawHeader();
			Divider();
			GUILayout.Space(8f);
			DrawTabs();
			GUILayout.Space(8f);
			bool flag = _tab == TabNames.Length - 1;
			if (flag)
			{
				DrawSettings();
			}
			else
			{
				DrawList((Cat)_tab);
			}
			if (_editing != null && !flag)
			{
				DrawEditor();
			}
			GUILayout.Space(6f);
			Divider();
			GUILayout.Space(4f);
			DrawFooter();
			if ((int)Event.current.type == 0 && !((Rect)(ref _searchRect)).Contains(Event.current.mousePosition))
			{
				GUI.FocusControl((string)null);
			}
			Event current = Event.current;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(0f, 0f, ((Rect)(ref _window)).width, 62f);
			if ((int)current.type == 0 && current.button == 0 && ((Rect)(ref val)).Contains(current.mousePosition))
			{
				_dragging = true;
				_dragStartMouse = Input.mousePosition;
				_dragStartPos = new Vector2(((Rect)(ref _window)).x, ((Rect)(ref _window)).y);
				current.Use();
			}
			if ((int)current.type != 7)
			{
				return;
			}
			bool num = _dragging || ((Rect)(ref val)).Contains(current.mousePosition);
			float num2 = ((Rect)(ref _window)).width / 2f;
			Color color = GUI.color;
			GUI.color = (num ? new Color(0.3f, 0.34f, 0.43f, 1f) : new Color(0.17f, 0.19f, 0.24f, 1f));
			_sTrack.Draw(new Rect(num2 - 30f, 2f, 60f, 16f), GUIContent.none, false, false, false, false);
			GUI.color = (num ? new Color(1f, 1f, 1f, 0.9f) : new Color(1f, 1f, 1f, 0.35f));
			for (int i = 0; i < 2; i++)
			{
				for (int j = 0; j < 6; j++)
				{
					GUI.DrawTexture(new Rect(num2 - 17.5f + (float)j * 6f, 5.5f + (float)i * 5.5f, 3.5f, 3.5f), (Texture)(object)_circle);
				}
			}
			GUI.color = color;
		}

		private void DrawHeader()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			string text = ColorUtility.ToHtmlStringRGB(Accent);
			GUILayout.Label("WALL<color=#" + text + ">HACKS</color>", _sTitle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mobs, plants, ores, trees & items", _sSub, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.FlexibleSpace();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Overlay", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.Space(6f);
			_showAll = Switch(_showAll);
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
		}

		private void DrawTabs()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Invalid comparison between Unknown and I4
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < TabNames.Length; i++)
			{
				bool flag = _tab == i;
				if (GUILayout.Button(TabLabels[i], flag ? _sTabOn : _sTab, Array.Empty<GUILayoutOption>()))
				{
					_tabReq = i;
				}
				if (flag && (int)Event.current.type == 7)
				{
					Rect lastRect = GUILayoutUtility.GetLastRect();
					Color color = GUI.color;
					GUI.color = Accent;
					GUI.DrawTexture(new Rect(((Rect)(ref lastRect)).x + 8f, ((Rect)(ref lastRect)).yMax - 2f, ((Rect)(ref lastRect)).width - 16f, 2f), (Texture)(object)_pixel);
					GUI.color = color;
				}
			}
			GUILayout.EndHorizontal();
			Divider();
		}

		private void DrawList(Cat cat)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_0093: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Invalid comparison between Unknown and I4
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			Event current = Event.current;
			if ((int)current.type == 4 && ((int)current.keyCode == 13 || (int)current.keyCode == 271 || (int)current.keyCode == 27) && GUI.GetNameOfFocusedControl() == "mf_search")
			{
				GUI.FocusControl((string)null);
				current.Use();
			}
			GUI.SetNextControlName("mf_search");
			_search = GUILayout.TextField(_search, 40, _sField, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) });
			Rect val = (_searchRect = GUILayoutUtility.GetLastRect());
			if ((int)Event.current.type == 7 && string.IsNullOrEmpty(_search) && GUI.GetNameOfFocusedControl() != "mf_search")
			{
				GUI.Label(val, "Search " + TabNames[(int)cat].ToLowerInvariant() + "...", _sHint);
			}
			if (!string.IsNullOrEmpty(_searchView))
			{
				GUILayout.Space(4f);
				if (GUILayout.Button("Clear", _sBtn, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(56f),
					GUILayout.Height(28f)
				}))
				{
					_search = "";
					GUI.FocusControl((string)null);
				}
			}
			GUILayout.EndHorizontal();
			string q = _searchView;
			List<Entry> list = _lists[cat].Where((Entry x) => string.IsNullOrEmpty(q) || x.Prefab.IndexOf(q, StringComparison.OrdinalIgnoreCase) >= 0 || Display(x).IndexOf(q, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
			int num = 0;
			foreach (Entry item in _lists[cat])
			{
				if (item.On)
				{
					num++;
				}
			}
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Enable shown", _sBtnAccent, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }))
			{
				foreach (Entry item2 in list)
				{
					item2.On = true;
					item2.Touched = true;
				}
			}
			GUILayout.Space(4f);
			if (GUILayout.Button("Disable all", _sBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }))
			{
				foreach (Entry item3 in _lists[cat])
				{
					item3.On = false;
					item3.Touched = true;
				}
			}
			GUILayout.FlexibleSpace();
			GUILayout.Label(num + " / " + _lists[cat].Count + " on", _sDim, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			_scroll = GUILayout.BeginScrollView(_scroll, false, false, GUIStyle.none, _skin.verticalScrollbar, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			if (list.Count == 0)
			{
				GUILayout.Space(20f);
				GUILayout.Label((_lists[cat].Count == 0) ? "Nothing loaded yet." : "No matches.", _sDim, Array.Empty<GUILayoutOption>());
			}
			foreach (Entry item4 in list)
			{
				bool flag = item4.On;
				GUILayout.BeginHorizontal(item4.On ? _sRowOn : _sRow, Array.Empty<GUILayoutOption>());
				item4.On = Switch(item4.On);
				if (GUILayout.Button(RowLabel(item4), item4.On ? _sNameOn : _sNameOff, (GUILayoutOption[])(object)new GUILayoutOption[3]
				{
					GUILayout.Height(20f),
					GUILayout.MinWidth(10f),
					GUILayout.ExpandWidth(true)
				}))
				{
					item4.On = !item4.On;
				}
				if (ColorDot(item4.Color, 20f, selected: false))
				{
					_editReq = item4;
				}
				GUILayout.Space(4f);
				if (GUILayout.Button("Edit", _sBtnSmall, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(44f),
					GUILayout.Height(20f)
				}))
				{
					_editReq = item4;
				}
				GUILayout.EndHorizontal();
				if (item4.On != flag)
				{
					item4.Touched = true;
				}
				if (item4.On && (int)Event.current.type == 7)
				{
					Rect lastRect = GUILayoutUtility.GetLastRect();
					Color color = GUI.color;
					GUI.color = Accent;
					GUI.DrawTexture(new Rect(((Rect)(ref lastRect)).x + 5f, ((Rect)(ref lastRect)).y + 8f, 3f, ((Rect)(ref lastRect)).height - 16f), (Texture)(object)_pixel);
					GUI.color = color;
				}
			}
			GUILayout.EndScrollView();
		}

		private float ColorSlider(string label, float v, Color fill)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _sDim, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(14f),
				GUILayout.Height(20f)
			});
			v = Slider(v, 0f, 1f, fill);
			GUILayout.Label(Mathf.RoundToInt(v * 255f).ToString(), _sValue, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(30f),
				GUILayout.Height(20f)
			});
			GUILayout.EndHorizontal();
			return v;
		}

		private static string RowLabel(Entry e)
		{
			string text = Display(e);
			if (!e.Alert)
			{
				return text;
			}
			return text + ((e.AlertStars > 0) ? ("   [alert " + e.AlertStars + "*+]") : "   [alert]");
		}

		private void ColorPickerFor(Entry e)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00c4: 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_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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < Presets.Length; i++)
			{
				if (ColorDot(Presets[i], 22f, ApproxEq(e.Color, Presets[i])))
				{
					e.Color = Presets[i];
				}
				GUILayout.Space(3f);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			Color color = e.Color;
			color.r = ColorSlider("R", color.r, new Color(1f, 0.4f, 0.4f));
			color.g = ColorSlider("G", color.g, new Color(0.4f, 0.9f, 0.5f));
			color.b = ColorSlider("B", color.b, new Color(0.45f, 0.6f, 1f));
			e.Color = color;
		}

		private void DrawEditor()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00e1: 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)
			//IL_010d: 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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(6f);
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			ColorDot(_editing.Color, 22f, selected: true);
			GUILayout.Space(6f);
			GUILayout.Label(Display(_editing), _sH1, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) });
			GUILayout.FlexibleSpace();
			GUILayout.Label(TabNames[(int)_editing.Cat], _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) });
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUI.changed = false;
			Color color = _editing.Color;
			color.r = ColorSlider("R", color.r, new Color(1f, 0.4f, 0.4f));
			color.g = ColorSlider("G", color.g, new Color(0.4f, 0.9f, 0.5f));
			color.b = ColorSlider("B", color.b, new Color(0.45f, 0.6f, 1f));
			_editing.Color = color;
			GUILayout.Space(4f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < Presets.Length; i++)
			{
				if (ColorDot(Presets[i], 22f, ApproxEq(_editing.Color, Presets[i])))
				{
					_editing.Color = Presets[i];
					_editing.Touched = true;
				}
				GUILayout.Space(3f);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Box", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.Space(4f);
			_editing.Box = Switch(_editing.Box);
			GUILayout.Space(16f);
			GUILayout.Label("Name", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.Space(4f);
			_editing.Label = Switch(_editing.Label);
			GUILayout.Space(16f);
			GUILayout.Label("Line", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.Space(4f);
			_editing.Tracer = Switch(_editing.Tracer);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Alert", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.Space(4f);
			_editing.Alert = Switch(_editing.Alert);
			if (_editing.Cat == Cat.Mobs || _editing.Cat == Cat.Fish)
			{
				GUILayout.Space(16f);
				GUILayout.Label("Min stars", _sDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
				GUILayout.Space(4f);
				for (int j = 0; j <= 4; j++)
				{
					if (GUILayout.Button(j.ToString(), (j == _editing.AlertStars) ? _sChipOn : _sChip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(28f) }))
					{
						_editing.AlertStars = j;
						_editing.Touched = true;
					}
					GUILayout.Space(2f);
				}
			}
			GUILayout.EndHorizontal();
			if (GUI.changed)
			{
				_editing.Touched = true;
			}
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Color to all " + TabNames[(int)_editing.Cat], _sBtn, Array.Empty<GUILayoutOption>()))
			{
				foreach (Entry item in _lists[_editing.Cat])
				{
					item.Color = _editing.Color;
					item.Touched = true;
				}
			}
			GUILayout.Space(4f);
			if (GUILayout.Button("Done", _sBtnAccent, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }))
			{
				_editReq = null;
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
		}

		private void DrawSettings()
		{
			//IL_0002: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0649: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a2: Unknown result type (might be due to invalid IL or missing references)
			_scroll = GUILayout.BeginScrollView(_scroll, false, false, GUIStyle.none, _skin.verticalScrollbar, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			GUILayout.Label("OVERLAY", _sSection, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show overlay  (" + ((object)_toggleKey.Value/*cast due to .constrained prefix*/).ToString() + ")", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_showAll = Switch(_showAll);
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.Label("Box style", _sDim, Array.Empty<GUILayoutOption>());
			GUILayout.Space(2f);
			_style = Segmented(_style, "Full box", "Corners");
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Line thickness", _sText, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Label(_thick.ToString("0.0"), _sValue, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			_thick = Slider(_thick, 1f, 6f, Accent);
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mob health bars", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_healthBars = Switch(_healthBars);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mob & fish level stars", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_showStars = Switch(_showStars);
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.Label("ALERTS", _sSection, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Alerts on", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_alertOn = Switch(_alertOn);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Screen message", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_alertMsg = Switch(_alertMsg);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Sound", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_alertSound = Switch(_alertSound);
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Volume", _sText, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Label(Mathf.RoundToInt(_alertVol * 100f) + "%", _sValue, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			_alertVol = Slider(_alertVol, 0f, 1f, Accent);
			GUILayout.Space(8f);
			if (GUILayout.Button("Test alert", _sBtn, Array.Empty<GUILayoutOption>()))
			{
				RaiseAlert(DateTime.Now.Ticks.GetHashCode(), "Test", 4, ((Component)Player.m_localPlayer).transform.position + Vector3.forward * 10f, 10f);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Turn on Alert in an entry's Edit card.", _sFoot, Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mobs and fish can have a minimum star level.", _sFoot, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.Label("YOUR TOMBSTONE", _sSection, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mark my tombstone", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_tombEntry.On = Switch(_tombEntry.On);
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Guide line", _sText, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(20f) });
			GUILayout.FlexibleSpace();
			_tombEntry.Tracer = Switch(_tombEntry.Tracer);
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.Label("Color", _sDim, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			ColorPickerFor(_tombEntry);
			GUILayout.EndVertical();
			GUILayout.Label("MAX DISTANCE", _sSection, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			foreach (Cat value in Enum.GetValues(typeof(Cat)))
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label(TabNames[(int)value], _sText, Array.Empty<GUILayoutOption>());
				GUILayout.FlexibleSpace();
				GUILayout.Label(Mathf.RoundToInt(_maxDist[(int)value]) + " m", _sValue, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				_maxDist[(int)value] = Slider(_maxDist[(int)value], 20f, 600f, Accent);
				if ((int)value < _maxDist.Length - 1)
				{
					GUILayout.Space(4f);
				}
			}
			GUILayout.EndVertical();
			GUILayout.Label("MENU", _sSection, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sCard, Array.Empty<GUILayoutOption>());
			GUILayout.Label("Accent color", _sDim, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < AccentColors.Length; i++)
			{
				if (ColorDot(AccentColors[i], 24f, i == _accentIdx))
				{
					_accentIdx = i;
				}
				GUILayout.Space(4f);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Menu size", _sText, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Label(_scalePending.ToString("0.00") + "x", _sValue, Array.Empty<GUILayoutOption>());
			GUILayout.