Decompiled source of SignLink v1.0.3

plugins/SignLink.dll

Decompiled a day ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PetyusPolisz.Kit;
using SignLink.Animation;
using SignLink.Patches;
using SignLink.Pictures;
using SignLink.Presets;
using SignLink.Signs;
using SignLink.UI;
using SignLink.UI.Sources;
using Splatform;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("assembly_valheim")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("PetyusPolisz")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright (c) 2026 ChesTeRcs")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3")]
[assembly: AssemblyProduct("SignLink")]
[assembly: AssemblyTitle("SignLink")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[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 PetyusPolisz.Kit
{
	internal static class Armed
	{
		private const float Seconds = 4f;

		private static string armed;

		private static float at;

		public static bool Button(IDeferred w, string key, string label, string sure, GUIStyle style, params GUILayoutOption[] opts)
		{
			bool flag = armed == key && Time.unscaledTime - at < 4f;
			if (!Widgets.Button(flag ? sure : label, style, opts))
			{
				return false;
			}
			if (flag)
			{
				armed = null;
				return true;
			}
			w.Later(delegate
			{
				armed = key;
				at = Time.unscaledTime;
			});
			return false;
		}

		public static void Disarm()
		{
			armed = null;
		}
	}
	internal static class FineStep
	{
		public static float Of(float step, string format)
		{
			int num = format.IndexOf('.');
			int num2 = 0;
			if (num >= 0)
			{
				for (int i = num + 1; i < format.Length && (format[i] == '0' || format[i] == '#'); i++)
				{
					num2++;
				}
			}
			double val = Math.Pow(10.0, -num2);
			return (float)Math.Min(step, Math.Max((double)step / 5.0, val));
		}

		public static float Notch(float value, float wheel, float step, string format, float lo, float hi, Func<float, float> snap)
		{
			if (snap == null || wheel == 0f || float.IsNaN(wheel))
			{
				return Nudge(value, wheel, step, format, lo, hi);
			}
			float num = snap(value);
			if (!(num > 0f))
			{
				num = value;
			}
			float num2 = num;
			for (int i = 0; i < 5000; i++)
			{
				float num3 = Nudge(num2, wheel, step, format, lo, hi);
				if (num3 == num2)
				{
					break;
				}
				num2 = num3;
				float num4 = snap(num2);
				if (num4 > 0f && ((wheel < 0f) ? (num4 > num + 1E-05f) : (num4 < num - 1E-05f)))
				{
					return num4;
				}
			}
			return num;
		}

		public static float Settle(float was, float got, Func<float, float> snap, bool dragged, float step, float lo, float hi)
		{
			if (snap == null || Math.Abs(got - was) < 0.0001f)
			{
				return got;
			}
			float num = snap(was);
			float num2 = snap(got);
			if (!(num > 0f) || !(num2 > 0f))
			{
				return got;
			}
			int num3 = Math.Sign(got - was);
			if (!dragged && Math.Sign(num2 - num) != num3)
			{
				num2 = Notch(num, -num3, step, "0.#", lo, hi, snap);
			}
			return Math.Max(lo, Math.Min(hi, num2));
		}

		public static float Nudge(float value, float wheel, float step, string format, float lo, float hi)
		{
			if (wheel == 0f || float.IsNaN(wheel))
			{
				return value;
			}
			double num = Of(step, format);
			double num2 = (double)value / num;
			double val = Math.Round(((wheel < 0f) ? (Math.Floor(num2 + 0.001) + 1.0) : (Math.Ceiling(num2 - 0.001) - 1.0)) * num, 6);
			return (float)Math.Max(lo, Math.Min(hi, val));
		}
	}
	internal static class HotkeyText
	{
		private static readonly string[] Order = new string[5] { "Ctrl", "Alt", "Shift", "Cmd", "Win" };

		public static string[] Parts(string main, IEnumerable<string> modifiers)
		{
			if (string.IsNullOrEmpty(main) || main == "None")
			{
				return new string[0];
			}
			List<string> list = new List<string>();
			foreach (string item in modifiers ?? new string[0])
			{
				string text = Name(item);
				if (text.Length > 0 && !list.Contains(text))
				{
					list.Add(text);
				}
			}
			list.Sort((string a, string b) => Rank(a).CompareTo(Rank(b)));
			list.Add(Name(main));
			return list.ToArray();
		}

		public static string Combo(string main, IEnumerable<string> modifiers)
		{
			return string.Join(" + ", Parts(main, modifiers));
		}

		private static int Rank(string name)
		{
			int num = Array.IndexOf(Order, name);
			if (num >= 0)
			{
				return num;
			}
			return Order.Length;
		}

		public static string Name(string key)
		{
			if (string.IsNullOrEmpty(key) || key == "None")
			{
				return "";
			}
			switch (key)
			{
			case "LeftShift":
			case "RightShift":
				return "Shift";
			case "LeftControl":
			case "RightControl":
				return "Ctrl";
			case "LeftAlt":
			case "RightAlt":
			case "AltGr":
				return "Alt";
			case "LeftApple":
			case "RightApple":
			case "LeftCommand":
			case "RightCommand":
				return "Cmd";
			case "LeftWindows":
			case "RightWindows":
				return "Win";
			case "Return":
				return "Enter";
			case "KeypadEnter":
				return "Num Enter";
			case "Escape":
				return "Esc";
			case "BackQuote":
				return "`";
			case "UpArrow":
				return "Up";
			case "DownArrow":
				return "Down";
			case "LeftArrow":
				return "Left";
			case "RightArrow":
				return "Right";
			default:
				if (key.StartsWith("Alpha", StringComparison.Ordinal) && key.Length == 6 && char.IsDigit(key[5]))
				{
					return key.Substring(5);
				}
				if (key.StartsWith("Keypad", StringComparison.Ordinal) && key.Length > 6)
				{
					return "Num " + Spaced(key.Substring(6));
				}
				return Spaced(key);
			}
		}

		private static string Spaced(string s)
		{
			StringBuilder stringBuilder = new StringBuilder(s.Length + 4);
			for (int i = 0; i < s.Length; i++)
			{
				if (i > 0 && char.IsUpper(s[i]) && char.IsLower(s[i - 1]))
				{
					stringBuilder.Append(' ');
				}
				stringBuilder.Append(s[i]);
			}
			return stringBuilder.ToString();
		}
	}
	internal interface IDeferred
	{
		void Later(Action a);
	}
	internal interface IWindowLook
	{
		float TextScale { get; }

		float WidthShare { get; }

		float HeightShare { get; }

		float Opacity { get; }

		float X { get; set; }

		float Y { get; set; }

		void Resizing(float widthShare, float heightShare);

		void Resized();
	}
	internal sealed class KitWindow : IDeferred
	{
		private readonly int id;

		private readonly IWindowLook look;

		private readonly Action<string> logInfo;

		private readonly Action<string> logWarning;

		private Rect rect = new Rect(60f, 60f, 620f, 640f);

		private readonly List<Action> later = new List<Action>();

		private readonly List<int> laterFrames = new List<int>();

		private bool placed;

		private bool logOpen;

		private bool overSaid;

		private float drawnWidth;

		private float drawnHeight;

		private float savedX;

		private float savedY;

		public const float TitleRule = 37f;

		private float topMin;

		private float bodyMin;

		private float viewHeight;

		private bool steady;

		private static readonly GUILayoutOption[] NoOptions = (GUILayoutOption[])(object)new GUILayoutOption[0];

		public Vector2 Scroll;

		private Widgets.Scope topScope;

		private float footKeep = -1f;

		private float footWidth = -1f;

		private float footScale = -1f;

		private int footFor = int.MinValue;

		private int gripId;

		private bool resizing;

		private int dragEdges;

		private Rect dragFrom;

		private Vector2 gripFrom;

		private Vector2 dragPlace;

		public Vector2 Size => ((Rect)(ref rect)).size;

		public float Width => ((Rect)(ref rect)).width;

		public bool Waiting => later.Count > 0;

		private static Vector2 Mouse => new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);

		public KitWindow(int id, IWindowLook look, Action<string> logInfo, Action<string> logWarning)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			this.id = id;
			this.look = look;
			this.logInfo = logInfo ?? ((Action<string>)delegate
			{
			});
			this.logWarning = logWarning ?? ((Action<string>)delegate
			{
			});
		}

		public void Later(Action a)
		{
			later.Add(a);
			laterFrames.Add(Time.frameCount);
		}

		public void RunLater(bool all, Action<Exception> failed)
		{
			if (later.Count == 0)
			{
				return;
			}
			int frameCount = Time.frameCount;
			List<Action> list = new List<Action>();
			int num = 0;
			while (num < later.Count)
			{
				if (all || laterFrames[num] < frameCount)
				{
					list.Add(later[num]);
					later.RemoveAt(num);
					laterFrames.RemoveAt(num);
				}
				else
				{
					num++;
				}
			}
			foreach (Action item in list)
			{
				try
				{
					item();
				}
				catch (Exception obj)
				{
					failed?.Invoke(obj);
				}
			}
		}

		public void RunAll(Action<Exception> failed)
		{
			for (int i = 0; i < 8; i++)
			{
				if (later.Count <= 0)
				{
					break;
				}
				RunLater(all: true, failed);
			}
			later.Clear();
			laterFrames.Clear();
		}

		public void Opened()
		{
			logOpen = true;
		}

		public void Layout()
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			float scale = Mathf.Clamp((float)Screen.height / 1080f * look.TextScale, 0.5f, 3f);
			WindowSizing.Size(Screen.width, Screen.height, look.WidthShare, look.HeightShare, scale, out var w, out var h, out var s);
			((Rect)(ref rect)).width = w;
			((Rect)(ref rect)).height = h;
			if (resizing)
			{
				((Rect)(ref rect)).position = dragPlace;
			}
			Widgets.Scale = s;
			Widgets.ContentWidth = w / s - 64f;
			Widgets.HeightFactor = Mathf.Clamp(h / s / 760f, 1f, 1.6f);
			Theme.Ensure(s, look.Opacity);
			if (!placed)
			{
				placed = true;
				if (look.X >= 0f)
				{
					((Rect)(ref rect)).x = look.X;
				}
				if (look.Y >= 0f)
				{
					((Rect)(ref rect)).y = look.Y;
				}
				savedX = ((Rect)(ref rect)).x;
				savedY = ((Rect)(ref rect)).y;
			}
			if (logOpen)
			{
				logOpen = false;
				overSaid = false;
				drawnWidth = (drawnHeight = 0f);
				logInfo($"window: open at text scale {s:0.00}, {w:0} x {h:0} px at {((Rect)(ref rect)).x:0},{((Rect)(ref rect)).y:0} on {Screen.width} x {Screen.height}");
			}
		}

		public void Show(WindowFunction draw, Func<string> wideWhere = null)
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Invalid comparison between Unknown and I4
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Invalid comparison between Unknown and I4
			((Rect)(ref rect)).x = Mathf.Clamp(((Rect)(ref rect)).x, 0f, Mathf.Max(0f, (float)Screen.width - Mathf.Max(((Rect)(ref rect)).width, drawnWidth)));
			((Rect)(ref rect)).y = Mathf.Clamp(((Rect)(ref rect)).y, 0f, Mathf.Max(0f, (float)Screen.height - Mathf.Max(((Rect)(ref rect)).height, drawnHeight)));
			float width = ((Rect)(ref rect)).width;
			rect = GUILayout.Window(id, rect, draw, "", Theme.Window, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(((Rect)(ref rect)).width),
				GUILayout.Height(((Rect)(ref rect)).height)
			});
			if ((int)Event.current.type == 7)
			{
				drawnWidth = ((Rect)(ref rect)).width;
				drawnHeight = ((Rect)(ref rect)).height;
				if (((Rect)(ref rect)).width > width + 1f && !overSaid)
				{
					overSaid = true;
					logWarning($"window: drawn {((Rect)(ref rect)).width:0} px wide, {((Rect)(ref rect)).width - width:0} px over its width " + "(a row on " + (wideWhere?.Invoke() ?? "it") + " is wider than the window)");
				}
			}
			if ((int)Event.current.type == 7 && GUIUtility.hotControl == 0 && (Mathf.Abs(((Rect)(ref rect)).x - savedX) > 0.5f || Mathf.Abs(((Rect)(ref rect)).y - savedY) > 0.5f))
			{
				SavePlace();
			}
		}

		public bool Covers(Vector2 at)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			Rect val = new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, Mathf.Max(((Rect)(ref rect)).width, drawnWidth), Mathf.Max(((Rect)(ref rect)).height, drawnHeight));
			return ((Rect)(ref val)).Contains(at);
		}

		private void SavePlace()
		{
			savedX = ((Rect)(ref rect)).x;
			savedY = ((Rect)(ref rect)).y;
			look.X = Mathf.Round(((Rect)(ref rect)).x);
			look.Y = Mathf.Round(((Rect)(ref rect)).y);
		}

		public void BeginDraw()
		{
			ResizeEdges();
		}

		public void EndDraw()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			EdgeMarks();
			GUI.DragWindow(new Rect(0f, 0f, 10000f, Widgets.U(37f)));
			if ((int)Event.current.rawType == 0 && GUIUtility.keyboardControl != 0 && GUIUtility.hotControl != GUIUtility.keyboardControl)
			{
				Widgets.DropFocus();
			}
		}

		public void TitleBar(string name, string version, string[] right, bool warn)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004c: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			float num = Widgets.U(12f);
			float num2 = Widgets.U(6f);
			float num3 = Widgets.U(30f);
			float num4 = ((Rect)(ref rect)).width - Widgets.U(12f);
			GUIContent val = new GUIContent(name);
			GUIContent val2 = new GUIContent(version);
			float x = Theme.TitleName.CalcSize(val).x;
			float x2 = Theme.TitleVersion.CalcSize(val2).x;
			GUI.Label(new Rect(num, num2, x, num3), val, Theme.TitleName);
			GUI.Label(new Rect(num + x + Widgets.U(7f), num2, x2, num3 - Widgets.U(5f)), val2, Theme.TitleVersion);
			float num5 = num + x + Widgets.U(7f) + x2 + Widgets.U(28f);
			float num6 = num4 - num5;
			if (right == null || right.Length == 0 || num6 < Widgets.U(40f))
			{
				return;
			}
			GUIStyle val3 = (warn ? Theme.TitleAreaOver : Theme.TitleArea);
			GUIContent val4 = new GUIContent(right[^1]);
			for (int i = 0; i < right.Length; i++)
			{
				GUIContent val5 = new GUIContent(right[i]);
				if (val3.CalcSize(val5).x <= num6)
				{
					val4 = val5;
					break;
				}
			}
			GUI.Label(new Rect(num5, num2, num6, num3), val4, Theme.Fitted(val3, val4, num6));
		}

		public void BeginTop()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			if ((int)Event.current.type == 8)
			{
				steady = GUIUtility.hotControl != 0 || GUIUtility.keyboardControl != 0;
			}
			topScope = Widgets.Vertical((GUILayoutOption[])((!steady || !(topMin > 0f)) ? ((Array)NoOptions) : ((Array)new GUILayoutOption[1] { GUILayout.MinHeight(topMin) })));
		}

		public void EndTop()
		{
			topScope.Dispose();
			Measure(ref topMin);
		}

		public void Body(Action draw)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Invalid comparison between Unknown and I4
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			Scroll = GUILayout.BeginScrollView(Scroll, false, false, GUIStyle.none, GUI.skin.verticalScrollbar, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			using (new Widgets.Scope(2))
			{
				float num = WindowSizing.BodyLeast(Scroll.y, viewHeight, bodyMin, steady);
				using (Widgets.Vertical((GUILayoutOption[])((!(num > 0f)) ? ((Array)NoOptions) : ((Array)new GUILayoutOption[1] { GUILayout.MinHeight(num) }))))
				{
					Widgets.BodyView = ((viewHeight > 0f) ? new Rect?(new Rect(-10000f, Scroll.y, 20000f, viewHeight)) : ((Rect?)null));
					try
					{
						draw();
					}
					finally
					{
						Widgets.BodyView = null;
					}
				}
				Measure(ref bodyMin);
			}
			if ((int)Event.current.type == 7)
			{
				Rect lastRect = GUILayoutUtility.GetLastRect();
				viewHeight = ((Rect)(ref lastRect)).height;
			}
		}

		public void Footer(int what, Action draw)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Invalid comparison between Unknown and I4
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			if ((int)Event.current.type == 8 && (what != footFor || Mathf.Abs(((Rect)(ref rect)).width - footWidth) > 0.5f || Widgets.Scale != footScale))
			{
				footFor = what;
				footWidth = ((Rect)(ref rect)).width;
				footScale = Widgets.Scale;
				footKeep = 0f;
			}
			using (Widgets.Vertical(Theme.Section, (GUILayoutOption[])((!(footKeep > 0f)) ? ((Array)NoOptions) : ((Array)new GUILayoutOption[1] { GUILayout.MinHeight(footKeep) }))))
			{
				draw();
			}
			if ((int)Event.current.type == 7)
			{
				float num = footKeep;
				Rect lastRect = GUILayoutUtility.GetLastRect();
				footKeep = Mathf.Max(num, ((Rect)(ref lastRect)).height);
			}
		}

		public bool CloseRow(string[] keys)
		{
			using (Widgets.Horizontal())
			{
				Widgets.Keys(keys);
				return Widgets.Button("Close", Theme.Button, Widgets.W(90f));
			}
		}

		private void Measure(ref float least)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			//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)
			if ((int)Event.current.type == 7)
			{
				Rect lastRect = GUILayoutUtility.GetLastRect();
				float height = ((Rect)(ref lastRect)).height;
				least = (steady ? Mathf.Max(least, height) : height);
			}
		}

		private int EdgesAt(Vector2 p)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			if (p.x < 0f || p.y < 0f || p.x > ((Rect)(ref rect)).width || p.y > ((Rect)(ref rect)).height)
			{
				return 0;
			}
			float num = Widgets.U(7f);
			float num2 = Widgets.U(16f);
			bool flag = p.x <= num2;
			bool flag2 = p.x >= ((Rect)(ref rect)).width - num2;
			bool flag3 = p.y <= num2;
			bool flag4 = p.y >= ((Rect)(ref rect)).height - num2;
			if ((flag || flag2) && (flag3 || flag4))
			{
				return (flag ? 1 : 2) | (flag3 ? 4 : 8);
			}
			return (int)(((p.x <= num) ? 1u : 0u) | (uint)((p.x >= ((Rect)(ref rect)).width - num) ? 2 : 0) | (uint)((p.y <= num) ? 4 : 0)) | ((p.y >= ((Rect)(ref rect)).height - num) ? 8 : 0);
		}

		private void ResizeEdges()
		{
			//IL_001b: 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: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Invalid comparison between Unknown and I4
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Invalid comparison between Unknown and I4
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Invalid comparison between Unknown and I4
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: 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_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Invalid comparison between Unknown and I4
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Event current = Event.current;
			gripId = GUIUtility.GetControlID((FocusType)2);
			if (!resizing)
			{
				if ((int)current.type == 0 && current.button == 0)
				{
					int num = EdgesAt(current.mousePosition);
					if (num != 0)
					{
						resizing = true;
						dragEdges = num;
						GUIUtility.hotControl = gripId;
						gripFrom = Mouse;
						dragFrom = rect;
						dragPlace = ((Rect)(ref rect)).position;
						current.Use();
					}
				}
			}
			else if (!Input.GetMouseButton(0))
			{
				StopResize();
				if ((int)current.type == 1)
				{
					current.Use();
				}
			}
			else
			{
				Vector2 val = Mouse - gripFrom;
				float minW = Mathf.Max(620f * Widgets.Scale, 0.2f * (float)Screen.width);
				float minH = Mathf.Max(560f * Widgets.Scale, 0.4f * (float)Screen.height);
				WindowSizing.Drag(((Rect)(ref dragFrom)).x, ((Rect)(ref dragFrom)).y, ((Rect)(ref dragFrom)).width, ((Rect)(ref dragFrom)).height, val.x, val.y, dragEdges, minW, minH, Screen.width, Screen.height, out var nx, out var ny, out var nw, out var nh);
				if ((int)current.type == 7)
				{
					dragPlace = new Vector2(nx, ny);
					look.Resizing(nw / (float)Screen.width, nh / (float)Screen.height);
				}
				if ((int)current.type == 3 || (int)current.type == 1)
				{
					current.Use();
				}
			}
		}

		public void StopResize()
		{
			if (resizing)
			{
				resizing = false;
				if (GUIUtility.hotControl == gripId)
				{
					GUIUtility.hotControl = 0;
				}
				look.Resized();
			}
		}

		private void EdgeMarks()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			//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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			if ((int)Event.current.type != 7)
			{
				return;
			}
			Color color = GUI.color;
			float num = Mathf.Max(2f, Widgets.U(2.5f));
			GUI.color = new Color(1f, 1f, 1f, resizing ? 0.9f : 0.45f);
			for (int i = 0; i < 3; i++)
			{
				for (int j = 0; j <= i; j++)
				{
					GUI.DrawTexture(new Rect(((Rect)(ref rect)).width - num * 2f * (float)(j + 1), ((Rect)(ref rect)).height - num * 2f * (float)(i - j + 1), num, num), (Texture)(object)Texture2D.whiteTexture);
				}
			}
			int num2 = (resizing ? dragEdges : ((GUIUtility.hotControl == 0) ? EdgesAt(Event.current.mousePosition) : 0));
			if (num2 != 0)
			{
				float num3 = Mathf.Max(2f, Widgets.U(3f));
				GUI.color = new Color(0.98f, 0.76f, 0.36f, resizing ? 0.95f : 0.7f);
				if ((num2 & 1) != 0)
				{
					GUI.DrawTexture(new Rect(0f, 0f, num3, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture);
				}
				if ((num2 & 2) != 0)
				{
					GUI.DrawTexture(new Rect(((Rect)(ref rect)).width - num3, 0f, num3, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture);
				}
				if ((num2 & 4) != 0)
				{
					GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref rect)).width, num3), (Texture)(object)Texture2D.whiteTexture);
				}
				if ((num2 & 8) != 0)
				{
					GUI.DrawTexture(new Rect(0f, ((Rect)(ref rect)).height - num3, ((Rect)(ref rect)).width, num3), (Texture)(object)Texture2D.whiteTexture);
				}
			}
			GUI.color = new Color(0.98f, 0.76f, 0.36f, 0.45f);
			GUI.DrawTexture(new Rect(Widgets.U(12f), Widgets.U(37f), ((Rect)(ref rect)).width - Widgets.U(24f), Mathf.Max(1f, Widgets.U(1.5f))), (Texture)(object)Texture2D.whiteTexture);
			GUI.color = color;
		}
	}
	internal sealed class ListRows
	{
		public const int Spare = 2;

		private float[] tops = new float[0];

		private float[] bottoms = new float[0];

		private int measured = -1;

		private int count = -1;

		private object list;

		private float width;

		private float scale;

		private float fix;

		private bool full;

		public int First { get; private set; }

		public int Last { get; private set; } = -1;

		public float Above { get; private set; }

		public float Below { get; private set; }

		public void Plan(int lines, float scrollY, float viewH, object of, float contentWidth, float uiScale)
		{
			if (lines != count || of != list || contentWidth != width || uiScale != scale)
			{
				count = lines;
				list = of;
				width = contentWidth;
				scale = uiScale;
				measured = -1;
				fix = 0f;
			}
			full = measured != count;
			if (full)
			{
				if (tops.Length < count)
				{
					tops = new float[count];
					bottoms = new float[count];
				}
				First = 0;
				Last = count - 1;
				float above = (Below = 0f);
				Above = above;
			}
			else
			{
				int i;
				for (i = 0; i < count - 1 && bottoms[i] < scrollY; i++)
				{
				}
				int j;
				for (j = i; j + 1 < count && tops[j + 1] <= scrollY + viewH; j++)
				{
				}
				First = Math.Max(0, i - 2);
				Last = Math.Min(count - 1, j + 2);
				Above = ((First > 0) ? Math.Max(0f, tops[First] - tops[0] + fix) : 0f);
				Below = ((Last < count - 1) ? (bottoms[count - 1] - bottoms[Last]) : 0f);
			}
		}

		public bool Span(int i, out float top, out float bottom)
		{
			top = (bottom = 0f);
			if (i < 0 || i >= count || measured != count)
			{
				return false;
			}
			top = tops[i];
			bottom = bottoms[i];
			return true;
		}

		public void Reveal(int i, ref float scrollY, float viewH)
		{
			if (Span(i, out var top, out var bottom))
			{
				if (top < scrollY)
				{
					scrollY = top;
				}
				else if (bottom > scrollY + viewH)
				{
					scrollY = bottom - viewH;
				}
			}
		}

		public void Saw(int i, float top, float bottom)
		{
			if (i < 0 || i >= count)
			{
				return;
			}
			if (full)
			{
				tops[i] = top;
				bottoms[i] = bottom;
				if (i == count - 1)
				{
					measured = count;
				}
			}
			else if (i == First && First > 0)
			{
				fix = Math.Max(-64f, Math.Min(64f, fix - (top - tops[First])));
			}
		}
	}
	internal static class Meter
	{
		private sealed class Fitted
		{
			public float Room;

			public float Scale;

			public string Got;
		}

		public static readonly Color Back = new Color(0.07f, 0.065f, 0.06f, 1f);

		public static readonly Color Good = new Color(0.55f, 0.85f, 0.45f, 1f);

		public static readonly Color Near = new Color(0.98f, 0.76f, 0.36f, 1f);

		public static readonly Color Over = new Color(1f, 0.45f, 0.35f, 1f);

		public static readonly Color Info = new Color(0.7f, 0.67f, 0.6f, 1f);

		private static readonly GUIContent measured = new GUIContent();

		private static readonly Dictionary<string, Fitted> fitted = new Dictionary<string, Fitted>();

		public static void Bar(string label, long now, long after, long limit, Color c, params string[] wordings)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Invalid comparison between Unknown and I4
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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)
			using (Widgets.Horizontal())
			{
				GUILayout.Label(label, Theme.SmallLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { Widgets.W(52f) });
				using (Widgets.Vertical(Widgets.W(Widgets.ContentWidth * 0.32f)))
				{
					Widgets.Space(7f);
					Rect rect = GUILayoutUtility.GetRect(Widgets.U(60f), Widgets.U(10f), (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.ExpandWidth(true),
						Widgets.H(10f)
					});
					if ((int)Event.current.type == 7)
					{
						Fill(rect, 1f, Back);
						Fill(rect, Mathf.Clamp01((float)after / (float)limit), new Color(c.r, c.g, c.b, 0.45f));
						Fill(rect, Mathf.Clamp01((float)now / (float)limit), c);
					}
				}
				Widgets.Space(8f);
				Color contentColor = GUI.contentColor;
				GUI.contentColor = c;
				float num = Widgets.ContentWidth - 30f - 52f - Widgets.ContentWidth * 0.32f - 20f;
				GUILayout.Label(Fitting(num, wordings), Theme.SmallLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { Widgets.W(num) });
				GUI.contentColor = contentColor;
			}
		}

		private static string Fitting(float room, params string[] wordings)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			if (fitted.TryGetValue(wordings[0], out var value) && Mathf.Abs(room - value.Room) < 0.5f && Widgets.Scale == value.Scale)
			{
				return value.Got;
			}
			string text = wordings[^1];
			foreach (string text2 in wordings)
			{
				measured.text = text2;
				if (Theme.SmallLabel.CalcSize(measured).x <= Widgets.U(room))
				{
					text = text2;
					break;
				}
			}
			if (fitted.Count > 64)
			{
				fitted.Clear();
			}
			fitted[wordings[0]] = new Fitted
			{
				Room = room,
				Scale = Widgets.Scale,
				Got = text
			};
			return text;
		}

		private static void Fill(Rect r, float part, Color c)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (!(part <= 0f))
			{
				Color color = GUI.color;
				GUI.color = c;
				GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width * part, ((Rect)(ref r)).height), (Texture)(object)Texture2D.whiteTexture);
				GUI.color = color;
			}
		}
	}
	internal sealed class TextHistory
	{
		public const int Most = 100;

		public const double Group = 1.0;

		private readonly List<string> undo = new List<string>();

		private readonly List<string> redo = new List<string>();

		private string current;

		private double lastAt = double.NegativeInfinity;

		private bool typing;

		public string Current => current ?? "";

		public bool CanUndo => undo.Count > 0;

		public bool CanRedo => redo.Count > 0;

		public void Seen(string text, double now, bool discrete = false)
		{
			text = text ?? "";
			if (current == null)
			{
				current = text;
			}
			else
			{
				if (text == current)
				{
					return;
				}
				if (discrete || !typing || now - lastAt > 1.0)
				{
					undo.Add(current);
					if (undo.Count > 100)
					{
						undo.RemoveAt(0);
					}
				}
				current = text;
				redo.Clear();
				lastAt = now;
				typing = !discrete;
			}
		}

		public string Undo()
		{
			if (!CanUndo)
			{
				return Current;
			}
			redo.Add(Current);
			current = undo[undo.Count - 1];
			undo.RemoveAt(undo.Count - 1);
			typing = false;
			return current;
		}

		public string Redo()
		{
			if (!CanRedo)
			{
				return Current;
			}
			undo.Add(Current);
			current = redo[redo.Count - 1];
			redo.RemoveAt(redo.Count - 1);
			typing = false;
			return current;
		}

		public void Reset(string text)
		{
			undo.Clear();
			redo.Clear();
			current = text ?? "";
			typing = false;
		}
	}
	internal static class Theme
	{
		private sealed class FitMemo
		{
			public int Width;

			public GUIStyle Style;
		}

		public static GUIStyle Window;

		public static GUIStyle Section;

		public static GUIStyle Header;

		public static GUIStyle Label;

		public static GUIStyle Small;

		public static GUIStyle Warn;

		public static GUIStyle Good;

		public static GUIStyle Notice;

		public static GUIStyle Button;

		public static GUIStyle Next;

		public static GUIStyle Tab;

		public static GUIStyle Field;

		public static GUIStyle Area;

		public static GUIStyle Item;

		public static GUIStyle ItemRich;

		public static GUIStyle BoxText;

		public static GUIStyle TitleName;

		public static GUIStyle TitleVersion;

		public static GUIStyle TitleArea;

		public static GUIStyle TitleAreaOver;

		public static GUIStyle Chip;

		public static GUIStyle SmallLabel;

		public static GUIStyle Fold;

		public static GUIStyle FoldOn;

		public static GUIStyle ViewEmpty;

		public static GUIStyle ViewText;

		public static GUIStyle SideNote;

		public static GUIStyle SubHeader;

		public static GUIStyle ListEmpty;

		public static GUIStyle CheckText;

		public static GUIStyle ButtonDown;

		public static GUIStyle ButtonGap;

		public static GUIStyle KeyCap;

		public static GUIStyle KeyHint;

		public static GUIStyle SmallButton;

		public static GUIStyle ButtonLess;

		public static GUIStyle NextLess;

		public static GUIStyle ButtonGo;

		public static GUIStyle SmallGo;

		public static GUIStyle Toggle;

		public static GUIStyle Slider;

		public static GUIStyle Thumb;

		private static Texture2D bg;

		private static Texture2D panel;

		private static Texture2D button;

		private static Texture2D hover;

		private static Texture2D active;

		private static Texture2D accent;

		private static Texture2D field;

		private static Texture2D fieldOn;

		private static Texture2D thumb;

		private static Texture2D thumbHover;

		private static Texture2D thumbActive;

		private static Texture2D toggleOff;

		private static Texture2D toggleOn;

		private static Texture2D next;

		private static Texture2D nextHover;

		private static Texture2D nextActive;

		private static int built = -1;

		private static int builtScale = -1;

		private static int builtOpacity = -1;

		private static readonly Color Text = new Color(0.9f, 0.87f, 0.8f);

		private static readonly Color Amber = new Color(0.98f, 0.76f, 0.36f);

		private static readonly Dictionary<GUIStyle, Dictionary<int, GUIStyle>> variants = new Dictionary<GUIStyle, Dictionary<int, GUIStyle>>();

		private static readonly Dictionary<GUIStyle, Dictionary<string, FitMemo>> fits = new Dictionary<GUIStyle, Dictionary<string, FitMemo>>();

		public static int SmallSize { get; private set; } = 14;

		public static void Release()
		{
			Texture2D[] array = (Texture2D[])(object)new Texture2D[16]
			{
				bg, panel, button, hover, active, accent, field, fieldOn, thumb, thumbHover,
				thumbActive, toggleOff, toggleOn, next, nextHover, nextActive
			};
			foreach (Texture2D val in array)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					Object.Destroy((Object)(object)val);
				}
			}
			bg = (panel = (button = (hover = (active = (accent = (field = (fieldOn = (thumb = (thumbHover = (thumbActive = (toggleOff = (toggleOn = (next = (nextHover = (nextActive = null)))))))))))))));
			built = (builtScale = (builtOpacity = -1));
		}

		public static GUIStyle Fitted(GUIStyle style, GUIContent c, float width)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			if (style == null || width <= 1f || Event.current == null || (int)Event.current.type == 8)
			{
				return style;
			}
			string key = c.text ?? "";
			int num = Mathf.RoundToInt(width * 2f);
			if (!fits.TryGetValue(style, out var value))
			{
				value = (fits[style] = new Dictionary<string, FitMemo>());
			}
			if (value.TryGetValue(key, out var value2) && value2.Width == num)
			{
				return value2.Style;
			}
			GUIStyle val = FitNow(style, c, width);
			if (value2 == null)
			{
				if (value.Count >= 512)
				{
					value.Clear();
				}
				value2 = (value[key] = new FitMemo());
			}
			value2.Width = num;
			value2.Style = val;
			return val;
		}

		private static GUIStyle FitNow(GUIStyle style, GUIContent c, float width)
		{
			//IL_0002: 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)
			if (style.CalcSize(c).x <= width + 0.5f)
			{
				return style;
			}
			int num = ((style.fontSize > 0) ? style.fontSize : 16);
			int num2 = Mathf.Max(11, Mathf.RoundToInt((float)num * 0.7f));
			for (int num3 = num; num3 >= num2; num3--)
			{
				GUIStyle val = Variant(style, num3, wrap: false);
				if (val.CalcSize(c).x <= width + 0.5f)
				{
					return val;
				}
			}
			return Variant(style, num2, wrap: true);
		}

		private static GUIStyle Variant(GUIStyle style, int fontSize, bool wrap)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			if (!variants.TryGetValue(style, out var value))
			{
				value = (variants[style] = new Dictionary<int, GUIStyle>());
			}
			int key = fontSize * 2 + (wrap ? 1 : 0);
			if (value.TryGetValue(key, out var value2))
			{
				return value2;
			}
			value2 = new GUIStyle(style)
			{
				fontSize = fontSize,
				wordWrap = wrap,
				clipping = (TextClipping)1
			};
			value2.padding = new RectOffset(Mathf.Max(1, style.padding.left / 3), Mathf.Max(1, style.padding.right / 3), style.padding.top, style.padding.bottom);
			return value[key] = value2;
		}

		private static Texture2D Solid(Color c)
		{
			//IL_0004: 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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false)
			{
				hideFlags = (HideFlags)61
			};
			val.SetPixel(0, 0, c);
			val.Apply();
			return val;
		}

		public static void Ensure(float scale, float opacity = 1f)
		{
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Expected O, but got Unknown
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Expected O, but got Unknown
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Expected O, but got Unknown
			//IL_04db: 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_0500: Expected O, but got Unknown
			//IL_0505: Expected O, but got Unknown
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Expected O, but got Unknown
			//IL_056b: Expected O, but got Unknown
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Expected O, but got Unknown
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_0648: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Expected O, but got Unknown
			//IL_0657: Expected O, but got Unknown
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_067f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_068b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Expected O, but got Unknown
			//IL_069c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Expected O, but got Unknown
			//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Expected O, but got Unknown
			//IL_0714: Expected O, but got Unknown
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0732: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_0765: Expected O, but got Unknown
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0791: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Expected O, but got Unknown
			//IL_07d1: Expected O, but got Unknown
			//IL_07d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0824: Expected O, but got Unknown
			//IL_0829: Expected O, but got Unknown
			//IL_0842: Unknown result type (might be due to invalid IL or missing references)
			//IL_0851: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_085d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0864: Unknown result type (might be due to invalid IL or missing references)
			//IL_0895: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Expected O, but got Unknown
			//IL_089f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08da: Expected O, but got Unknown
			//IL_08df: Expected O, but got Unknown
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0911: Unknown result type (might be due to invalid IL or missing references)
			//IL_0916: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_092f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0936: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_096e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0978: Expected O, but got Unknown
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b3: Expected O, but got Unknown
			//IL_09b8: Expected O, but got Unknown
			//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2a: Expected O, but got Unknown
			//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a65: Expected O, but got Unknown
			//IL_0a6a: Expected O, but got Unknown
			//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9c: Expected O, but got Unknown
			//IL_0ab5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ace: Expected O, but got Unknown
			//IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b00: Expected O, but got Unknown
			//IL_0b0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b59: Expected O, but got Unknown
			//IL_0b59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b68: Expected O, but got Unknown
			//IL_0b6d: Expected O, but got Unknown
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb0: Expected O, but got Unknown
			//IL_0bdd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c16: Expected O, but got Unknown
			//IL_0c1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c25: Expected O, but got Unknown
			//IL_0c39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c64: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9f: Expected O, but got Unknown
			//IL_0ca4: Expected O, but got Unknown
			//IL_0cb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cde: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d19: Expected O, but got Unknown
			//IL_0d1e: Expected O, but got Unknown
			//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2d: Expected O, but got Unknown
			//IL_0d41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5a: Expected O, but got Unknown
			//IL_0d62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d94: Expected O, but got Unknown
			//IL_0db7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e18: Expected O, but got Unknown
			//IL_0e1d: Expected O, but got Unknown
			//IL_0e22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e74: Expected O, but got Unknown
			//IL_0e79: Expected O, but got Unknown
			//IL_0e7e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e88: Expected O, but got Unknown
			//IL_0ea6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec6: Expected O, but got Unknown
			//IL_0ee4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f04: Expected O, but got Unknown
			//IL_0f18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f64: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd0: Expected O, but got Unknown
			//IL_0fd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1001: Unknown result type (might be due to invalid IL or missing references)
			//IL_100b: Expected O, but got Unknown
			//IL_1010: Expected O, but got Unknown
			//IL_1015: Unknown result type (might be due to invalid IL or missing references)
			//IL_101a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1021: Unknown result type (might be due to invalid IL or missing references)
			//IL_1052: Unknown result type (might be due to invalid IL or missing references)
			//IL_105c: Expected O, but got Unknown
			//IL_1061: Expected O, but got Unknown
			//IL_106b: Unknown result type (might be due to invalid IL or missing references)
			//IL_107a: Unknown result type (might be due to invalid IL or missing references)
			//IL_107f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1091: Unknown result type (might be due to invalid IL or missing references)
			//IL_1098: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a4: Expected O, but got Unknown
			//IL_10a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f7: Expected O, but got Unknown
			//IL_10f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1112: Unknown result type (might be due to invalid IL or missing references)
			//IL_111c: Expected O, but got Unknown
			//IL_1121: Expected O, but got Unknown
			//IL_1135: Unknown result type (might be due to invalid IL or missing references)
			//IL_1199: Unknown result type (might be due to invalid IL or missing references)
			//IL_119e: Unknown result type (might be due to invalid IL or missing references)
			//IL_119f: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_11c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11cd: Expected O, but got Unknown
			//IL_11d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1208: Unknown result type (might be due to invalid IL or missing references)
			//IL_1212: Expected O, but got Unknown
			//IL_1217: Expected O, but got Unknown
			//IL_1271: Unknown result type (might be due to invalid IL or missing references)
			//IL_1276: Unknown result type (might be due to invalid IL or missing references)
			//IL_1277: Unknown result type (might be due to invalid IL or missing references)
			//IL_127e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1280: Unknown result type (might be due to invalid IL or missing references)
			//IL_1281: Unknown result type (might be due to invalid IL or missing references)
			//IL_1288: Unknown result type (might be due to invalid IL or missing references)
			//IL_1299: Unknown result type (might be due to invalid IL or missing references)
			//IL_129e: Unknown result type (might be due to invalid IL or missing references)
			//IL_12b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_12b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_12bf: Expected O, but got Unknown
			//IL_12bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_12f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_12fa: Expected O, but got Unknown
			//IL_12ff: Expected O, but got Unknown
			//IL_1359: Unknown result type (might be due to invalid IL or missing references)
			//IL_135e: Unknown result type (might be due to invalid IL or missing references)
			//IL_135f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1366: Unknown result type (might be due to invalid IL or missing references)
			//IL_1368: Unknown result type (might be due to invalid IL or missing references)
			//IL_1369: Unknown result type (might be due to invalid IL or missing references)
			//IL_1370: Unknown result type (might be due to invalid IL or missing references)
			//IL_137c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1381: Unknown result type (might be due to invalid IL or missing references)
			//IL_138d: Expected O, but got Unknown
			//IL_1401: Unknown result type (might be due to invalid IL or missing references)
			//IL_1406: Unknown result type (might be due to invalid IL or missing references)
			//IL_1418: Unknown result type (might be due to invalid IL or missing references)
			//IL_141f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1426: Unknown result type (might be due to invalid IL or missing references)
			//IL_142d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1461: Unknown result type (might be due to invalid IL or missing references)
			//IL_146b: Expected O, but got Unknown
			//IL_146b: Unknown result type (might be due to invalid IL or missing references)
			//IL_149c: Unknown result type (might be due to invalid IL or missing references)
			//IL_14a6: Expected O, but got Unknown
			//IL_14a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_14bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c6: Expected O, but got Unknown
			//IL_14c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_14d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_14e1: Expected O, but got Unknown
			//IL_1532: Unknown result type (might be due to invalid IL or missing references)
			//IL_159b: Unknown result type (might be due to invalid IL or missing references)
			//IL_15bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_15c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_15d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_15da: Unknown result type (might be due to invalid IL or missing references)
			//IL_15e4: Expected O, but got Unknown
			//IL_15e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1615: Unknown result type (might be due to invalid IL or missing references)
			//IL_161f: Expected O, but got Unknown
			//IL_1624: Expected O, but got Unknown
			//IL_167e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1683: Unknown result type (might be due to invalid IL or missing references)
			//IL_1696: Unknown result type (might be due to invalid IL or missing references)
			//IL_16a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b8: Expected O, but got Unknown
			//IL_16bd: Expected O, but got Unknown
			int instanceID = ((Object)GUI.skin).GetInstanceID();
			int num = Mathf.RoundToInt(scale * 100f);
			int num2 = Mathf.RoundToInt(Mathf.Clamp(opacity, 0.5f, 1f) * 100f);
			if (built == instanceID && builtScale == num && builtOpacity == num2 && Window != null && Object.op_Implicit((Object)(object)bg))
			{
				return;
			}
			built = instanceID;
			variants.Clear();
			fits.Clear();
			builtScale = num;
			if (!Object.op_Implicit((Object)(object)bg) || builtOpacity != num2)
			{
				builtOpacity = num2;
				float num3 = (float)num2 / 100f;
				Texture2D[] array = (Texture2D[])(object)new Texture2D[14]
				{
					bg, panel, button, hover, active, accent, field, fieldOn, thumb, thumbHover,
					thumbActive, next, nextHover, nextActive
				};
				foreach (Texture2D val in array)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						Object.Destroy((Object)(object)val);
					}
				}
				bg = Solid(new Color(0.11f, 0.1f, 0.09f, num3));
				panel = Solid(new Color(0.16f, 0.15f, 0.13f, num3));
				button = Solid(new Color(0.27f, 0.23f, 0.18f, num3));
				hover = Solid(new Color(0.36f, 0.3f, 0.22f, num3));
				active = Solid(new Color(0.55f, 0.4f, 0.18f, num3));
				accent = Solid(new Color(0.62f, 0.45f, 0.18f, num3));
				field = Framed(new Color(0.07f, 0.065f, 0.06f, num3), new Color(0.45f, 0.37f, 0.26f, 1f));
				fieldOn = Framed(new Color(0.07f, 0.065f, 0.06f, num3), Amber);
				thumb = Framed(new Color(0.36f, 0.3f, 0.22f, num3), new Color(0.62f, 0.45f, 0.18f, 1f));
				thumbHover = Framed(new Color(0.45f, 0.37f, 0.26f, num3), Amber);
				thumbActive = Framed(new Color(0.55f, 0.4f, 0.18f, num3), Amber);
				float num4 = Mathf.Max(num3, 0.9f);
				next = Solid(new Color(0.86f, 0.6f, 0.16f, num4));
				nextHover = Solid(new Color(0.97f, 0.73f, 0.27f, num4));
				nextActive = Solid(new Color(0.7f, 0.48f, 0.12f, num4));
			}
			float alpha = (float)num2 / 100f;
			Window = new GUIStyle(GUI.skin.window)
			{
				padding = new RectOffset(R(12f), R(12f), R(44f), R(16f)),
				fontSize = F(23f),
				fontStyle = (FontStyle)1
			};
			Window.contentOffset = new Vector2(0f, (float)(R(7f) - Window.padding.top));
			GUIStyleState[] array2 = (GUIStyleState[])(object)new GUIStyleState[6] { Window.normal, Window.onNormal, Window.focused, Window.onFocused, Window.hover, Window.onHover };
			foreach (GUIStyleState obj in array2)
			{
				obj.background = bg;
				obj.textColor = Amber;
			}
			Section = new GUIStyle(GUI.skin.box)
			{
				padding = new RectOffset(R(12f), R(12f), R(10f), R(10f)),
				margin = new RectOffset(0, 0, R(2f), R(8f))
			};
			Section.normal.background = panel;
			Header = new GUIStyle(GUI.skin.label)
			{
				fontSize = F(17f),
				fontStyle = (FontStyle)1,
				margin = new RectOffset(0, 0, R(10f), R(4f))
			};
			Fold = new GUIStyle(Header)
			{
				alignment = (TextAnchor)3,
				wordWrap = false
			};
			Fold.hover.textColor = Amber;
			Header.normal.textColor = Amber;
			Label = new GUIStyle(GUI.skin.label)
			{
				fontSize = F(16f),
				wordWrap = true
			};
			Label.normal.textColor = Text;
			SmallSize = F(14f);
			Small = new GUIStyle(Label)
			{
				fontSize = SmallSize,
				margin = new RectOffset(R(4f), R(4f), R(2f), R(8f))
			};
			Small.normal.textColor = new Color(0.7f, 0.67f, 0.6f);
			BoxText = new GUIStyle(Small)
			{
				alignment = (TextAnchor)4,
				wordWrap = false
			};
			ViewEmpty = new GUIStyle(Small)
			{
				alignment = (TextAnchor)4,
				wordWrap = true,
				padding = new RectOffset(R(10f), R(10f), R(6f), R(6f)),
				margin = new RectOffset(0, 0, R(2f), R(6f))
			};
			ViewEmpty.normal.background = panel;
			ViewText = new GUIStyle(Label)
			{
				alignment = (TextAnchor)4,
				wordWrap = true,
				padding = ViewEmpty.padding,
				margin = ViewEmpty.margin
			};
			ViewText.normal.background = panel;
			SideNote = new GUIStyle(Small)
			{
				alignment = (TextAnchor)3,
				wordWrap = true,
				margin = new RectOffset(R(12f), R(4f), R(2f), R(2f))
			};
			ListEmpty = new GUIStyle(Label)
			{
				alignment = (TextAnchor)4,
				wordWrap = true,
				padding = new RectOffset(R(8f), R(8f), R(8f), R(8f))
			};
			ListEmpty.normal.textColor = new Color(0.86f, 0.82f, 0.74f);
			CheckText = new GUIStyle(Label)
			{
				alignment = (TextAnchor)3,
				wordWrap = true,
				padding = new RectOffset(R(2f), R(4f), R(3f), R(3f)),
				margin = new RectOffset(R(2f), R(2f), R(3f), R(3f))
			};
			CheckText.hover.textColor = Amber;
			CheckText.active.textColor = Amber;
			KeyCap = new GUIStyle(GUI.skin.box)
			{
				fontSize = F(15f),
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)4,
				wordWrap = false,
				padding = new RectOffset(R(9f), R(9f), R(3f), R(4f)),
				margin = new RectOffset(R(2f), R(2f), R(4f), R(4f))
			};
			KeyCap.normal.textColor = Amber;
			KeyHint = new GUIStyle(KeyCap)
			{
				fontSize = F(12f),
				fontStyle = (FontStyle)0,
				padding = new RectOffset(R(5f), R(5f), R(1f), R(2f)),
				margin = new RectOffset(R(1f), R(1f), R(3f), R(3f))
			};
			KeyHint.normal.textColor = new Color(0.7f, 0.67f, 0.6f);
			Warn = new GUIStyle(Label);
			Warn.normal.textColor = new Color(1f, 0.45f, 0.35f);
			Good = new GUIStyle(Label);
			Good.normal.textColor = new Color(0.55f, 0.85f, 0.45f);
			Notice = new GUIStyle(Label);
			Notice.normal.textColor = Amber;
			TitleName = new GUIStyle(GUI.skin.label)
			{
				fontSize = F(23f),
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)3,
				wordWrap = false,
				padding = new RectOffset(0, 0, 0, 0),
				margin = new RectOffset(0, 0, 0, 0)
			};
			TitleName.normal.textColor = Amber;
			TitleVersion = new GUIStyle(TitleName)
			{
				fontSize = F(14f),
				fontStyle = (FontStyle)0,
				alignment = (TextAnchor)6
			};
			TitleVersion.normal.textColor = new Color(Amber.r, Amber.g, Amber.b, 0.65f);
			TitleArea = new GUIStyle(TitleName)
			{
				fontSize = F(17f),
				alignment = (TextAnchor)5,
				clipping = (TextClipping)1
			};
			TitleAreaOver = new GUIStyle(TitleArea);
			TitleAreaOver.normal.textColor = Warn.normal.textColor;
			Button = new GUIStyle(GUI.skin.button)
			{
				fontSize = F(16f),
				padding = new RectOffset(R(10f), R(10f), R(5f), R(5f))
			};
			Set(Button, button, hover, active, Text);
			SmallButton = new GUIStyle(Button)
			{
				fontSize = F(13f),
				padding = new RectOffset(R(8f), R(8f), R(2f), R(3f))
			};
			ButtonDown = new GUIStyle(Button);
			Set(ButtonDown, active, active, active, Text);
			ButtonGap = new GUIStyle(Button);
			Set(ButtonGap, null, null, null, Text);
			Next = new GUIStyle(Button)
			{
				fontStyle = (FontStyle)1,
				fontSize = F(17f)
			};
			Set(Next, next, nextHover, nextActive, new Color(0.13f, 0.09f, 0.04f));
			ButtonLess = new GUIStyle(Button)
			{
				fontSize = F(15f),
				padding = new RectOffset(R(9f), R(9f), R(4f), R(4f))
			};
			NextLess = new GUIStyle(Next)
			{
				fontSize = F(15f),
				padding = new RectOffset(R(9f), R(9f), R(4f), R(4f))
			};
			ButtonGo = new GUIStyle(Button);
			Set(ButtonGo, next, nextHover, nextActive, Next.normal.textColor);
			SmallGo = new GUIStyle(SmallButton)
			{
				fontStyle = (FontStyle)1
			};
			Set(SmallGo, next, nextHover, nextActive, Next.normal.textColor);
			Tab = new GUIStyle(Button)
			{
				fontStyle = (FontStyle)1
			};
			Set(Tab, button, hover, active, Text);
			Tab.onNormal.background = accent;
			Tab.onHover.background = accent;
			GUIStyleState onNormal = Tab.onNormal;
			Color textColor = (Tab.onHover.textColor = Color.white);
			onNormal.textColor = textColor;
			Chip = new GUIStyle(Tab)
			{
				fontSize = F(13f),
				fontStyle = (FontStyle)0,
				padding = new RectOffset(R(8f), R(8f), R(2f), R(3f)),
				margin = new RectOffset(R(2f), R(2f), R(3f), R(3f))
			};
			SubHeader = new GUIStyle(Label)
			{
				fontStyle = (FontStyle)1,
				margin = new RectOffset(R(4f), R(4f), R(4f), R(2f))
			};
			SubHeader.normal.textColor = Amber;
			SmallLabel = new GUIStyle(Label)
			{
				fontSize = F(13f),
				wordWrap = false,
				alignment = (TextAnchor)3
			};
			Item = new GUIStyle(Button)
			{
				alignment = (TextAnchor)3,
				wordWrap = true,
				padding = new RectOffset(R(10f), R(10f), R(6f), R(6f)),
				margin = new RectOffset(0, 0, R(1f), R(1f))
			};
			Set(Item, panel, hover, active, Text);
			GUIStyleState onNormal2 = Item.onNormal;
			GUIStyleState onHover = Item.onHover;
			Texture2D val2 = (Item.onActive.background = accent);
			Texture2D background = (onHover.background = val2);
			onNormal2.background = background;
			GUIStyleState onNormal3 = Item.onNormal;
			GUIStyleState onHover2 = Item.onHover;
			Color val5 = (Item.onActive.textColor = Color.white);
			textColor = (onHover2.textColor = val5);
			onNormal3.textColor = textColor;
			ItemRich = new GUIStyle(Item)
			{
				richText = true
			};
			FoldOn = new GUIStyle(Fold)
			{
				padding = new RectOffset(R(6f), R(6f), R(2f), R(2f))
			};
			GUIStyleState normal = FoldOn.normal;
			GUIStyleState obj2 = FoldOn.hover;
			val2 = (FoldOn.active.background = accent);
			background = (obj2.background = val2);
			normal.background = background;
			GUIStyleState normal2 = FoldOn.normal;
			GUIStyleState obj3 = FoldOn.hover;
			val5 = (FoldOn.active.textColor = Color.white);
			textColor = (obj3.textColor = val5);
			normal2.textColor = textColor;
			Field = new GUIStyle(GUI.skin.textField)
			{
				fontSize = F(16f),
				border = new RectOffset(2, 2, 2, 2),
				padding = new RectOffset(R(6f), R(6f), R(4f), R(4f))
			};
			GUIStyleState normal3 = Field.normal;
			background = (Field.hover.background = field);
			normal3.background = background;
			Field.focused.background = fieldOn;
			GUIStyleState normal4 = Field.normal;
			GUIStyleState obj4 = Field.hover;
			val5 = (Field.focused.textColor = Text);
			textColor = (obj4.textColor = val5);
			normal4.textColor = textColor;
			Area = new GUIStyle(Field)
			{
				wordWrap = true
			};
			int num5 = R(18f);
			int num6 = R(4f);
			if (Object.op_Implicit((Object)(object)toggleOff))
			{
				Object.Destroy((Object)(object)toggleOff);
			}
			if (Object.op_Implicit((Object)(object)toggleOn))
			{
				Object.Destroy((Object)(object)toggleOn);
			}
			toggleOff = ToggleBox(num5, num6, on: false, alpha);
			toggleOn = ToggleBox(num5, num6, on: true, alpha);
			Toggle = new GUIStyle(GUI.skin.toggle)
			{
				fontSize = F(16f),
				alignment = (TextAnchor)3,
				wordWrap = false,
				imagePosition = (ImagePosition)3,
				padding = new RectOffset(num5 + R(8f), R(4f), R(3f), R(3f)),
				margin = new RectOffset(R(2f), R(2f), R(3f), R(3f)),
				border = new RectOffset(num5, 1, num6 + num5 / 2 - 1, num6 + num5 / 2 - 1),
				fixedHeight = 0f,
				fixedWidth = 0f
			};
			array2 = (GUIStyleState[])(object)new GUIStyleState[4] { Toggle.normal, Toggle.hover, Toggle.active, Toggle.focused };
			foreach (GUIStyleState obj5 in array2)
			{
				obj5.background = toggleOff;
				obj5.textColor = Text;
			}
			array2 = (GUIStyleState[])(object)new GUIStyleState[4] { Toggle.onNormal, Toggle.onHover, Toggle.onActive, Toggle.onFocused };
			foreach (GUIStyleState obj6 in array2)
			{
				obj6.background = toggleOn;
				obj6.textColor = Text;
			}
			Slider = new GUIStyle(GUI.skin.horizontalSlider)
			{
				fixedHeight = R(22f),
				border = new RectOffset(2, 2, 2, 2),
				margin = new RectOffset(R(4f), R(4f), R(2f), R(2f))
			};
			GUIStyleState normal5 = Slider.normal;
			GUIStyleState obj7 = Slider.hover;
			GUIStyleState obj8 = Slider.active;
			Texture2D val12 = (Slider.focused.background = field);
			val2 = (obj8.background = val12);
			background = (obj7.background = val2);
			normal5.background = background;
			Thumb = new GUIStyle(GUI.skin.horizontalSliderThumb)
			{
				fixedWidth = R(16f),
				fixedHeight = R(22f),
				border = new RectOffset(2, 2, 2, 2)
			};
			GUIStyleState normal6 = Thumb.normal;
			background = (Thumb.focused.background = thumb);
			normal6.background = background;
			Thumb.hover.background = thumbHover;
			Thumb.active.background = thumbActive;
			int F(float basePx)
			{
				return Mathf.Max(12, Mathf.RoundToInt(basePx * scale));
			}
			int R(float x)
			{
				return Mathf.RoundToInt(x * scale);
			}
		}

		private static Texture2D ToggleBox(int box, int pad, bool on, float alpha)
		{
			//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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: 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)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			int num = box + 2;
			int num2 = box + 2 * pad;
			int num3 = Mathf.Max(2, box / 5);
			Texture2D val = new Texture2D(num, num2, (TextureFormat)4, false)
			{
				hideFlags = (HideFlags)61,
				filterMode = (FilterMode)0
			};
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0f, 0f, 0f, 0f);
			Color val3 = default(Color);
			((Color)(ref val3))..ctor(0.45f, 0.37f, 0.26f, 1f);
			Color val4 = default(Color);
			((Color)(ref val4))..ctor(0.07f, 0.065f, 0.06f, alpha);
			for (int i = 0; i < num2; i++)
			{
				for (int j = 0; j < num; j++)
				{
					int num4 = i - pad;
					Color val5 = val2;
					if (j < box && num4 >= 0 && num4 < box)
					{
						bool num5 = j == 0 || j == box - 1 || num4 == 0 || num4 == box - 1;
						bool flag = on && j >= num3 && j < box - num3 && num4 >= num3 && num4 < box - num3;
						val5 = (num5 ? val3 : (flag ? Amber : val4));
					}
					val.SetPixel(j, i, val5);
				}
			}
			val.Apply();
			return val;
		}

		private static Texture2D Framed(Color inner, Color frame)
		{
			//IL_0004: 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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0035: 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)
			Texture2D val = new Texture2D(5, 5, (TextureFormat)4, false)
			{
				hideFlags = (HideFlags)61,
				filterMode = (FilterMode)0
			};
			for (int i = 0; i < 5; i++)
			{
				for (int j = 0; j < 5; j++)
				{
					val.SetPixel(j, i, (j == 0 || i == 0 || j == 4 || i == 4) ? frame : inner);
				}
			}
			val.Apply();
			return val;
		}

		private static void Set(GUIStyle s, Texture2D normal, Texture2D hov, Texture2D act, Color text)
		{
			//IL_0048: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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)
			s.normal.background = normal;
			s.hover.background = hov;
			s.active.background = act;
			s.focused.background = normal;
			GUIStyleState normal2 = s.normal;
			GUIStyleState obj = s.hover;
			GUIStyleState obj2 = s.active;
			Color val = (s.focused.textColor = text);
			Color val3 = (obj2.textColor = val);
			Color textColor = (obj.textColor = val3);
			normal2.textColor = textColor;
		}
	}
	internal static class Widgets
	{
		public readonly struct Scope : IDisposable
		{
			private readonly int kind;

			public Scope(int kind)
			{
				this.kind = kind;
			}

			public void Dispose()
			{
				try
				{
					if (kind == 0)
					{
						GUILayout.EndHorizontal();
					}
					else if (kind == 1)
					{
						GUILayout.EndVertical();
					}
					else
					{
						GUILayout.EndScrollView();
					}
				}
				catch (Exception)
				{
				}
			}
		}

		private static readonly GUIContent label = new GUIContent();

		private static readonly ConditionalWeakTable<string[], GUIContent[]> labels = new ConditionalWeakTable<string[], GUIContent[]>();

		private static readonly string[] OnOffNames = new string[2] { "On", "Off" };

		private static readonly Dictionary<string, bool> folds = new Dictionary<string, bool>();

		private static readonly HashSet<string> flips = new HashSet<string>();

		public static float Scale = 1f;

		private static readonly Dictionary<float, GUILayoutOption> widths = new Dictionary<float, GUILayoutOption>();

		private static readonly Dictionary<float, GUILayoutOption> heights = new Dictionary<float, GUILayoutOption>();

		private static float optionsScale = float.NaN;

		private const int MostOptions = 512;

		public static float ContentWidth = 556f;

		public static float HeightFactor = 1f;

		private static bool focusDropWanted;

		public static Rect? BodyView;

		private static readonly Dictionary<string, string> buffers = new Dictionary<string, string>();

		private static readonly Dictionary<string, string> typedFrom = new Dictionary<string, string>();

		private static readonly Dictionary<string, float> returned = new Dictionary<string, float>();

		public static int Notched;

		public static int Slid;

		private static readonly GUIContent SliderSize = new GUIContent("mmmm");

		private static string slidKey;

		private static float slidRaw;

		private static int slidHot;

		public static float ChangedAt = -10f;

		private static readonly Dictionary<string, float> keyTops = new Dictionary<string, float>();

		private static float keyTopScale;

		public const string WheelKey = "Shift+wheel";

		public static float LabelW => Mathf.Clamp(ContentWidth * 0.34f, 110f, 190f);

		public static float RestW => ContentWidth - LabelW - 10f;

		public static bool Narrow => ContentWidth < 560f;

		public static bool Button(string text, GUIStyle style, params GUILayoutOption[] options)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			label.text = text;
			Rect rect = GUILayoutUtility.GetRect(label, style, options);
			return GUI.Button(rect, label, Theme.Fitted(style, label, ((Rect)(ref rect)).width));
		}

		public static GUILayoutOption[] Wide(float height)
		{
			return (GUILayoutOption[])(object)new GUILayoutOption[3]
			{
				H(height),
				GUILayout.MinWidth(U(60f)),
				GUILayout.ExpandWidth(true)
			};
		}

		private static GUIContent[] Labels(string[] texts)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			GUIContent[] value = labels.GetValue(texts, (string[] t) => (GUIContent[])(object)new GUIContent[t.Length]);
			for (int num = 0; num < texts.Length; num++)
			{
				if (value[num] == null)
				{
					value[num] = new GUIContent(texts[num]);
				}
				else if ((object)value[num].text != texts[num])
				{
					value[num].text = texts[num];
				}
			}
			return value;
		}

		public static int Toolbar(int selected, string[] texts, GUIStyle style, params GUILayoutOption[] options)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			GUIContent[] cs;
			float each;
			float gap;
			GUIStyle fitted;
			Rect val = Strip(texts, style, options, out cs, out each, out gap, out fitted);
			if (texts.Length == 0)
			{
				return selected;
			}
			return GUI.Toolbar(val, selected, cs, fitted);
		}

		public static int Tabs(int selected, string[] texts, bool[] usable, GUIStyle style, params GUILayoutOption[] options)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			GUIContent[] cs;
			float each;
			float gap;
			GUIStyle fitted;
			Rect val = Strip(texts, style, options, out cs, out each, out gap, out fitted);
			bool enabled = GUI.enabled;
			int result = selected;
			for (int i = 0; i < texts.Length; i++)
			{
				GUI.enabled = enabled && (usable == null || i >= usable.Length || usable[i]);
				if (GUI.Toggle(new Rect(((Rect)(ref val)).x + (float)i * (each + gap), ((Rect)(ref val)).y, each, ((Rect)(ref val)).height), selected == i, cs[i], fitted) && selected != i)
				{
					result = i;
				}
			}
			GUI.enabled = enabled;
			return result;
		}

		private static Rect Strip(string[] texts, GUIStyle style, GUILayoutOption[] options, out GUIContent[] cs, out float each, out float gap, out GUIStyle fitted)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			cs = Labels(texts);
			float num = 0f;
			float num2 = 0f;
			int num3 = 0;
			for (int i = 0; i < texts.Length; i++)
			{
				Vector2 val = style.CalcSize(cs[i]);
				if (val.x > num)
				{
					num = val.x;
					num3 = i;
				}
				num2 = Mathf.Max(num2, val.y);
			}
			gap = Mathf.Max(style.margin.left, style.margin.right);
			Rect rect = GUILayoutUtility.GetRect(num * (float)texts.Length + gap * (float)Math.Max(0, texts.Length - 1), num2, style, options);
			each = ((texts.Length == 0) ? 0f : ((((Rect)(ref rect)).width - gap * (float)(texts.Length - 1)) / (float)texts.Length));
			fitted = ((texts.Length == 0) ? style : Theme.Fitted(style, cs[num3], each));
			return rect;
		}

		public static int Choice(string rowLabel, int selected, string[] names, float most = 0f, GUIStyle style = null)
		{
			using (Horizontal())
			{
				GUILayout.Label(rowLabel, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { W(LabelW) });
				int result = Toolbar(selected, names, style ?? Theme.Chip, W((most > 0f) ? Mathf.Min(most, RestW) : RestW));
				GUILayout.FlexibleSpace();
				return result;
			}
		}

		public static bool OnOff(string rowLabel, bool on, GUIStyle style = null)
		{
			return Choice(rowLabel, (!on) ? 1 : 0, OnOffNames, 200f, style) == 0;
		}

		public static bool Toggle(bool value, string text, GUIStyle style, params GUILayoutOption[] options)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			label.text = text;
			Rect rect = GUILayoutUtility.GetRect(label, style, options);
			return GUI.Toggle(rect, value, label, Theme.Fitted(style, label, ((Rect)(ref rect)).width));
		}

		public static bool NextButton(string label, float height = 36f, float width = 0f, bool less = false)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			GUILayoutOption[] options = (GUILayoutOption[])((!(width > 0f)) ? ((Array)Wide(height)) : ((Array)new GUILayoutOption[2]
			{
				H(height),
				W(width)
			}));
			if (!GUI.enabled)
			{
				return Button(label, less ? Theme.ButtonLess : Theme.Button, options);
			}
			Color backgroundColor = GUI.backgroundColor;
			GUI.backgroundColor = Glow();
			bool result = Button(label, less ? Theme.NextLess : Theme.Next, options);
			GUI.backgroundColor = backgroundColor;
			return result;
		}

		private static Color Glow()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			float num = 0.84f + 0.16f * (0.5f + 0.5f * Mathf.Sin(Time.unscaledTime * 2.4f));
			return new Color(num, num, num, 1f);
		}

		public static bool SmallGoButton(string label, params GUILayoutOption[] options)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (!GUI.enabled)
			{
				return Button(label, Theme.SmallButton, options);
			}
			Color backgroundColor = GUI.backgroundColor;
			GUI.backgroundColor = Glow();
			bool result = Button(label, Theme.SmallGo, options);
			GUI.backgroundColor = backgroundColor;
			return result;
		}

		public static GUILayoutOption MinW(float x)
		{
			return GUILayout.MinWidth(U(x));
		}

		public static void Space(float x)
		{
			GUILayout.Space(U(x));
		}

		public static bool Foldout(string key, string title, bool open = true, bool usable = true)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			if (folds.TryGetValue(key, out var value))
			{
				open = value;
			}
			if ((int)Event.current.type == 8 && flips.Remove(key))
			{
				folds[key] = (open = !open);
			}
			bool num = open && usable;
			bool enabled = GUI.enabled;
			GUI.enabled = enabled && usable;
			if (Button((num ? "▾  " : "▸  ") + title, Theme.Fold))
			{
				flips.Add(key);
			}
			GUI.enabled = enabled;
			return num;
		}

		public static void Rule()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Max(1f, U(1.5f));
			Rect rect = GUILayoutUtility.GetRect(U(10f), num, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(num)
			});
			if ((int)Event.current.type == 7)
			{
				Color color = GUI.color;
				GUI.color = new Color(0.98f, 0.76f, 0.36f, 0.45f);
				GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture);
				GUI.color = color;
			}
		}

		public static bool Check(bool value, string text)
		{
			bool result = value;
			using (Horizontal())
			{
				if (GUILayout.Toggle(value, GUIContent.none, Theme.Toggle, (GUILayoutOption[])(object)new GUILayoutOption[1] { W(30f) }) != value)
				{
					result = !value;
				}
				if (GUILayout.Button(text, Theme.CheckText, Array.Empty<GUILayoutOption>()))
				{
					result = !value;
				}
			}
			return result;
		}

		public static int Row(string label, params string[] buttons)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			int result = -1;
			float[] array = new float[buttons.Length];
			float num = 0f;
			for (int i = 0; i < buttons.Length; i++)
			{
				array[i] = Math.Max(U(70f), Theme.Button.CalcSize(new GUIContent(buttons[i])).x + U(16f));
				num += array[i] + U(4f);
			}
			using (Horizontal(Theme.Section))
			{
				GUILayout.Label(label, Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(U(ContentWidth - 40f) - num) });
				for (int j = 0; j < buttons.Length; j++)
				{
					if (GUILayout.Button(buttons[j], Theme.Button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(array[j]) }))
					{
						result = j;
					}
				}
				return result;
			}
		}

		public static float U(float x)
		{
			return x * Scale;
		}

		public static GUILayoutOption W(float x)
		{
			return Option(widths, x, width: true);
		}

		public static GUILayoutOption H(float x)
		{
			return Option(heights, x, width: false);
		}

		private static GUILayoutOption Option(Dictionary<float, GUILayoutOption> cache, float x, bool width)
		{
			if (optionsScale != Scale)
			{
				widths.Clear();
				heights.Clear();
				optionsScale = Scale;
			}
			if (cache.TryGetValue(x, out var value))
			{
				return value;
			}
			if (cache.Count >= 512)
			{
				cache.Clear();
			}
			return cache[x] = (width ? GUILayout.Width(U(x)) : GUILayout.Height(U(x)));
		}

		public static float Tall(float height)
		{
			return height * HeightFactor;
		}

		public static void DropFocus()
		{
			focusDropWanted = true;
		}

		public static void ApplyFocusDrop()
		{
			if (focusDropWanted && GUIUtility.hotControl == 0)
			{
				focusDropWanted = false;
				GUIUtility.keyboardControl = 0;
			}
		}

		public static Scope Horizontal(params GUILayoutOption[] opts)
		{
			GUILayout.BeginHorizontal(opts);
			return new Scope(0);
		}

		public static Scope Horizontal(GUIStyle style, params GUILayoutOption[] opts)
		{
			GUILayout.BeginHorizontal(style, opts);
			return new Scope(0);
		}

		public static Scope Vertical(params GUILayoutOption[] opts)
		{
			GUILayout.BeginVertical(opts);
			return new Scope(1);
		}

		public static Scope Vertical(GUIStyle style, params GUILayoutOption[] opts)
		{
			GUILayout.BeginVertical(style, opts);
			return new Scope(1);
		}

		public static Scope Scroll(ref Vector2 pos, float height)
		{
			//IL_0002: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			pos = GUILayout.BeginScrollView(pos, false, false, GUIStyle.none, GUI.skin.verticalScrollbar, Theme.Section, (GUILayoutOption[])(object)new GUILayoutOption[1] { H(Tall(height)) });
			return new Scope(2);
		}

		public static bool PictureItem(bool selected, Texture2D thumb, string label, float width, string boxText = "", bool openWhenSelected = false)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			using (Horizontal())
			{
				Rect rect = GUILayoutUtility.GetRect(U(56f), U(44f), (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					W(56f),
					H(44f)
				});
				if (Object.op_Implicit((Object)(object)thumb))
				{
					GUI.DrawTexture(rect, (Texture)(object)thumb, (ScaleMode)2);
				}
				else
				{
					GUI.Box(rect, GUIContent.none, Theme.Section);
					if (boxText.Length > 0)
					{
						GUI.Label(rect, boxText, Theme.BoxText);
					}
				}
				return GUILayout.Toggle(selected, label, Theme.Item, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					W(width - 62f),
					H(44f)
				}) != selected && (openWhenSelected || !selected);
			}
		}

		public static void EmptyList(string text)
		{
			using (Vertical(Theme.Section))
			{
				GUILayout.Label(text, Theme.ListEmpty, Array.Empty<GUILayoutOption>());
			}
		}

		public static float SizeRows(string key, float pct, Vector2 naturalM, Func<double, double> scale = null)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			bool dragged;
			float num = SizeRowsRaw(key, pct, naturalM, scale, out dragged);
			if (scale == null)
			{
				return num;
			}
			return FineStep.Settle(pct, num, (float p) => (float)(scale((double)p / 100.0) * 100.0), dragged, 5f, 25f, 400f);
		}

		private static float SizeRowsRaw(string key, float pct, Vector2 naturalM, Func<double, double> scale, out bool dragged)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_