Decompiled source of CommonCustomsMenuPlugin v1.1.0

CommonCustomsMenuPlugin.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Bounce.Singletons;
using HarmonyLib;
using ModdingTales;
using Newtonsoft.Json;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CommonCustomsMenu")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Nth Dimension")]
[assembly: AssemblyProduct("CommonCustomsMenu")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("CommonCustomsMenu")]
[assembly: ComVisible(false)]
[assembly: Guid("c303405d-e66c-4316-9cdb-4e3ca15c6360")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.1.0.0")]
namespace LordAshes;

[BepInPlugin("org.lordashes.plugins.commoncustomsmenu", "Common Customs Menu Plugin", "1.1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class CommonCustomsMenuPlugin : BaseUnityPlugin
{
	public static class _Internal
	{
		public static class CustomsMenu
		{
			public class RewriteClause
			{
				public string kind { get; set; }

				public string category { get; set; }

				public string header { get; set; }

				public string group { get; set; }

				public string prefix { get; set; }

				public string suffix { get; set; }
			}

			public class AssetInfo
			{
				[NonSerialized]
				public Internal _internal = new Internal();

				public string name { get; set; } = "";


				public string provider { get; set; }

				public string filename { get; set; } = "";


				public string pack { get; set; } = "";


				public string prefab { get; set; } = "";


				public string kind { get; set; } = "";


				public string category { get; set; } = "";


				public string header { get; set; } = "";


				public string groupName { get; set; } = "";


				public string description { get; set; } = "";


				public string tags { get; set; } = "";


				public string author { get; set; } = "";


				public string version { get; set; } = "";


				public string comment { get; set; } = "";


				public float size { get; set; } = 1f;


				public bool hasAnimations { get; set; } = false;


				public bool hasAudio { get; set; } = false;


				public bool hasBlendshapes { get; set; } = false;


				public string[] variants { get; set; } = null;


				public Chain[] chain { get; set; } = null;


				public string[] animationOrder { get; set; } = null;


				public Elements[] blendshapes { get; set; } = null;


				public string attach { get; set; } = "";


				public Compensation adjust { get; set; } = new Compensation();


				public AssetInfo Clone()
				{
					return new AssetInfo
					{
						adjust = adjust,
						animationOrder = animationOrder,
						attach = attach,
						author = author,
						blendshapes = blendshapes,
						category = category,
						chain = chain,
						comment = comment,
						description = description,
						filename = filename,
						groupName = groupName,
						hasAnimations = hasAnimations,
						hasAudio = hasAudio,
						hasBlendshapes = hasBlendshapes,
						header = header,
						kind = kind,
						name = name,
						pack = pack,
						prefab = prefab,
						provider = provider,
						size = size,
						tags = tags,
						variants = variants,
						version = version,
						_internal = _internal
					};
				}
			}

			public enum AnimationStyle
			{
				None = 0,
				Single = 1,
				PingPong = 2,
				Loop = 0x80,
				ClampStart = 0x100,
				ClampNone = 0x200,
				ClampEnd = 0x400
			}

			public class Elements
			{
				[NonSerialized]
				public CreatureBoardAsset target;

				public string name { get; set; } = "No Name";


				public Element[] elements { get; set; }
			}

			public class Element
			{
				public string audio { get; set; }

				public string animation { get; set; }

				public AnimationStyle style { get; set; } = AnimationStyle.None;


				public float delay { get; set; }

				public int blendShapeIndex { get; set; }

				public float start { get; set; }

				public float end { get; set; }

				public float step { get; set; }
			}

			public class Compensation
			{
				public float tX { get; set; } = 0f;


				public float tY { get; set; } = 0f;


				public float tZ { get; set; } = 0f;


				public float rW { get; set; } = Quaternion.identity.w;


				public float rX { get; set; } = Quaternion.identity.x;


				public float rY { get; set; } = Quaternion.identity.y;


				public float rZ { get; set; } = Quaternion.identity.z;


				public float sX { get; set; } = 1f;


				public float sY { get; set; } = 1f;


				public float sZ { get; set; } = 1f;

			}

			public class Chain
			{
				public string prefab { get; set; } = "";


				public float offsetPosX { get; set; } = 0f;


				public float offsetPosY { get; set; } = 0f;


				public float offsetPosZ { get; set; } = 0f;


				public float offsetRotX { get; set; } = 0f;


				public float offsetRotY { get; set; } = 0f;


				public float offsetRotZ { get; set; } = 0f;

			}

			public class Internal
			{
				public PlayerGuid spawnPlayer { get; set; }
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass0_0
			{
				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				public Action<string, string> <>9__2;

				internal void <BuildKindsMenu>b__2(string id, string val)
				{
					_self.menus.items["Kind"].properties["selected"] = id;
					((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets));
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass1_0
			{
				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				public Action<string, string> <>9__4;

				internal void <BuildGroupsMenu>b__4(string id, string val)
				{
					_self.menus.items["Group"].properties["selected"] = id.Substring(0, id.Length - ".Text".Length);
					((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(menus, assets));
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass1_1
			{
				public string kind;

				public string filter;

				internal bool <BuildGroupsMenu>b__0(AssetInfo asset)
				{
					return asset.category == kind && asset.groupName.Contains(filter);
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass2_0
			{
				public string kind;

				public string header;

				public string group;

				public string filter;

				internal bool <BuildAssetsMenu>b__0(AssetInfo asset)
				{
					return asset.category == kind && asset.header == header && asset.groupName == group && asset.name.Contains(filter);
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass2_1
			{
				public AssetInfo asset;

				internal void <BuildAssetsMenu>b__4(string id, string value, int x, int y)
				{
					if (value != "")
					{
						_self.menus.properties["info"] = "   <color=#FFA400>NAME:</color> <color=#EEEEEE>" + asset.name + "</color><color=#FFA400>,</color> <color=#FFA400>TYPE:</color> <color=#EEEEEE>" + asset.kind + "</color><color=#FFA400>,</color> <color=#FFA400>CLASS:</color> <color=#EEEEEE>" + asset.header + "</color><color=#FFA400>,</color> <color=#FFA400>GROUP:</color> <color=#EEEEEE>" + asset.groupName + "</color><color=#FFA400>,</color> <color=#FFA400>VERSION:</color> <color=#EEEEEE>" + ((asset.version != "") ? asset.version : "Unversioned") + "</color><color=#FFA400>,</color> <color=#FFA400>AUTHOR:</color> <color=#EEEEEE>" + ((asset.author != "") ? asset.author : "Uncredited") + "</color><color=#FFA400>,</color> <color=#FFA400>PACK:</color> <color=#EEEEEE>" + asset.pack + "</color><color=#FFA400>,</color> <color=#FFA400>ITEM:</color> <color=#EEEEEE>" + Path.GetFileNameWithoutExtension(asset.prefab) + "</color><color=#FFA400>,</color> <color=#FFA400>ANIMATED:</color> <color=#EEEEEE>" + asset.hasAnimations + "</color><color=#FFA400>,</color> <color=#FFA400>AUDIO:</color> <color=#EEEEEE>" + asset.hasAudio + "</color><color=#FFA400>,</color> <color=#FFA400>MORPHS:</color> <color=#EEEEEE>" + asset.hasBlendshapes + "</color>";
					}
					else
					{
						_self.menus.properties["info"] = "";
					}
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass3_0
			{
				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				internal void <BuildFiltersMenu>b__0(string id, string text)
				{
					_self.menus.items["Filter"].properties["group"] = text;
					((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets));
				}

				internal void <BuildFiltersMenu>b__1(string id, string text)
				{
					_self.menus.items["Filter"].properties["group"] = text;
					((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets));
				}

				internal void <BuildFiltersMenu>b__2(string id, string text)
				{
					_self.menus.items["Filter"].properties["group"] = text;
					((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets));
				}

				internal void <BuildFiltersMenu>b__3(string id, string text)
				{
					_self.menus.items["Filter"].properties["asset"] = text;
					((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(menus, assets));
				}
			}

			[CompilerGenerated]
			private sealed class <>c__DisplayClass4_0
			{
				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				internal void <BuildBadgeSizer>b__0(string id, string val)
				{
					_self.assetBadgesPerRow.Value = (int)((320f - float.Parse(val)) / 320f * 22f + 3f);
					((BaseUnityPlugin)_self).Config.Save();
					LoggingPlugin.LogTrace("Triggering Menu Refresh With " + _self.assetBadgesPerRow.Value + " Badges Per Row");
					((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(menus, assets));
				}
			}

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

				private object <>2__current;

				public Dictionary<string, AssetInfo> results;

				public string providerName;

				private string <assetFile>5__1;

				private Dictionary<string, AssetInfo>.Enumerator <>s__2;

				private KeyValuePair<string, AssetInfo> <result>5__3;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<assetFile>5__1 = null;
					<>s__2 = default(Dictionary<string, AssetInfo>.Enumerator);
					<result>5__3 = default(KeyValuePair<string, AssetInfo>);
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Expected O, but got Unknown
					//IL_0244: Unknown result type (might be due to invalid IL or missing references)
					//IL_024a: Invalid comparison between Unknown and I4
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						break;
					case 1:
						<>1__state = -1;
						break;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					providerName = ((providerName != "Unknown") ? providerName : ((results.Count > 0) ? results.ElementAt(0).Value.provider : " Unknown"));
					LoggingPlugin.LogDebug("Provider " + providerName + " Returned " + results.Count() + " New Assets");
					_self.guiSafe = "AddingAssets";
					<>s__2 = results.GetEnumerator();
					try
					{
						while (<>s__2.MoveNext())
						{
							<result>5__3 = <>s__2.Current;
							if (!_self.assets.ContainsKey(<result>5__3.Key))
							{
								_self.assets.Add(<result>5__3.Key, <result>5__3.Value);
							}
							<result>5__3 = default(KeyValuePair<string, AssetInfo>);
						}
					}
					finally
					{
						((IDisposable)<>s__2).Dispose();
					}
					<>s__2 = default(Dictionary<string, AssetInfo>.Enumerator);
					_self.resposes++;
					LoggingPlugin.LogTrace("Writing Registered Assets File");
					<assetFile>5__1 = Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/org.lordashes.plugins.commoncustomsmenu.assets.json";
					File.WriteAllText(<assetFile>5__1, JsonConvert.SerializeObject((object)_self.assets, (Formatting)1), (CacheType)999);
					if (_self.rewriteScope != 0)
					{
						ApplyRewriter("org.lordashes.plugins.commoncustomsmenu.rewriter.json", ref _self.assets);
					}
					if ((int)LoggingPlugin.GetLogLevel() == 5)
					{
						File.WriteAllText(<assetFile>5__1 + ".memory", JsonConvert.SerializeObject((object)_self.assets, (Formatting)1), (CacheType)999);
					}
					_self.guiSafe = "";
					LoggingPlugin.LogTrace("Creating Filters Menu");
					((MonoBehaviour)_self).StartCoroutine(BuildFiltersMenu(_self.menus, _self.assets));
					LoggingPlugin.LogTrace("Creating Badge Sizer");
					((MonoBehaviour)_self).StartCoroutine(BuildBadgeSizer(_self.menus, _self.assets));
					LoggingPlugin.LogTrace("Creating Kinds Menu");
					((MonoBehaviour)_self).StartCoroutine(BuildKindsMenu(_self.menus, _self.assets));
					LoggingPlugin.LogTrace("Creating Groups Menu");
					((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(_self.menus, _self.assets));
					LoggingPlugin.LogTrace("Creating Assets Menu");
					((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(_self.menus, _self.assets));
					return false;
				}

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

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

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

				private object <>2__current;

				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				private <>c__DisplayClass2_0 <>8__1;

				private Dictionary<string, IMenuItem> <contents>5__2;

				private List<AssetInfo> <items>5__3;

				private string <currentState>5__4;

				private int <cX>5__5;

				private int <cY>5__6;

				private int <badgeSize>5__7;

				private float <badgeTextSize>5__8;

				private int <numRows>5__9;

				private Menu <contentMenu>5__10;

				private List<AssetInfo>.Enumerator <>s__11;

				private <>c__DisplayClass2_1 <>8__12;

				private IMenuItem <badge>5__13;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>8__1 = null;
					<contents>5__2 = null;
					<items>5__3 = null;
					<currentState>5__4 = null;
					<contentMenu>5__10 = null;
					<>s__11 = default(List<AssetInfo>.Enumerator);
					<>8__12 = null;
					<badge>5__13 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
					//IL_07ef: Expected O, but got Unknown
					//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
					//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
					//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
					//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
					int num = <>1__state;
					if (num != 0)
					{
						if (num != 1)
						{
							return false;
						}
						<>1__state = -1;
					}
					else
					{
						<>1__state = -1;
						if (!_self.menus.items.ContainsKey("Kind") || !_self.menus.items["Kind"].properties.ContainsKey("selected") || !_self.menus.items["Group"].properties.ContainsKey("selected"))
						{
							goto IL_090d;
						}
						<>8__1 = new <>c__DisplayClass2_0();
						<>8__1.kind = _self.menus.items["Kind"].properties["selected"].Substring("Kind.".Length);
						<>8__1.group = _self.menus.items["Group"].properties["selected"];
						<>8__1.group = <>8__1.group.Substring(<>8__1.group.IndexOf(".Group.") + ".Group.".Length);
						<>8__1.header = _self.menus.items["Group"].properties["selected"];
						<>8__1.header = <>8__1.header.Substring(0, <>8__1.header.IndexOf(".Group.")).Substring("Header.".Length);
						<>8__1.filter = (_self.menus.items["Filter"].properties.ContainsKey("asset") ? _self.menus.items["Filter"].properties["asset"] : "");
						LoggingPlugin.LogDebug("Building Assets Menu Of Kind '" + <>8__1.kind + "' And Group '" + <>8__1.group + "' And Filter '" + <>8__1.filter + "'");
						<contents>5__2 = new Dictionary<string, IMenuItem>();
						<items>5__3 = (from asset in assets.Values
							where asset.category == <>8__1.kind && asset.header == <>8__1.header && asset.groupName == <>8__1.@group && asset.name.Contains(<>8__1.filter)
							orderby asset.name, asset.version
							select asset).ToList();
						if (<items>5__3.Count() <= 0)
						{
							goto IL_08f7;
						}
						<currentState>5__4 = ((!_self.menus.items.ContainsKey("Content")) ? "closed" : (_self.menus.items["Content"].properties.ContainsKey("status") ? _self.menus.items["Content"].properties["status"] : "closed"));
						<cX>5__5 = 0;
						<cY>5__6 = 0;
						<badgeSize>5__7 = (int)(990f / (float)_self.assetBadgesPerRow.Value);
						LoggingPlugin.LogTrace("Badge Size = 100 x 11 / " + _self.assetBadgesPerRow.Value + " = " + <badgeSize>5__7);
						<badgeTextSize>5__8 = 4f + Math.Min(12f, 132f / (float)_self.assetBadgesPerRow.Value);
						LoggingPlugin.LogTrace("Badge Text = 6 + 10 x 11 / " + _self.assetBadgesPerRow.Value + " = " + <badgeTextSize>5__8);
						<>s__11 = <items>5__3.GetEnumerator();
						try
						{
							while (<>s__11.MoveNext())
							{
								<>8__12 = new <>c__DisplayClass2_1();
								<>8__12.asset = <>s__11.Current;
								LoggingPlugin.LogTrace("Creating Badge For " + <>8__12.asset.name);
								<badge>5__13 = new MenuBadge("Kind." + <>8__1.kind + ".Group." + <>8__1.group + ".Asset." + <>8__12.asset.prefab, <cX>5__5 * (<badgeSize>5__7 + 10), <cY>5__6 * (<badgeSize>5__7 + 35), <badgeSize>5__7, <badgeSize>5__7, <badgeTextSize>5__8, "Portrait." + <>8__12.asset.prefab.Replace("/", ".").Replace("\\", ".") + ".png", "Portrait." + <>8__12.asset.prefab.Replace("/", ".").Replace("\\", ".") + ".png", JsonConvert.SerializeObject((object)<>8__12.asset), <>8__12.asset.name, Color.white, Color.white, Color.clear, Color.clear, delegate(string id, string value)
								{
									AssetInfo assetInfo = JsonConvert.DeserializeObject<AssetInfo>(value);
									try
									{
										LoggingPlugin.LogInfo("Selected Asset:\r\n" + JsonConvert.SerializeObject((object)assetInfo));
										_self.providers[assetInfo.provider].SelectionCallback(assetInfo);
									}
									catch (Exception ex)
									{
										LoggingPlugin.LogWarning("Error Sending Notification To Provider " + assetInfo.provider);
										LoggingPlugin.LogWarning("Details: " + ex.Message);
									}
								}, delegate(string id, string value, int x, int y)
								{
									if (value != "")
									{
										_self.menus.properties["info"] = "   <color=#FFA400>NAME:</color> <color=#EEEEEE>" + <>8__12.asset.name + "</color><color=#FFA400>,</color> <color=#FFA400>TYPE:</color> <color=#EEEEEE>" + <>8__12.asset.kind + "</color><color=#FFA400>,</color> <color=#FFA400>CLASS:</color> <color=#EEEEEE>" + <>8__12.asset.header + "</color><color=#FFA400>,</color> <color=#FFA400>GROUP:</color> <color=#EEEEEE>" + <>8__12.asset.groupName + "</color><color=#FFA400>,</color> <color=#FFA400>VERSION:</color> <color=#EEEEEE>" + ((<>8__12.asset.version != "") ? <>8__12.asset.version : "Unversioned") + "</color><color=#FFA400>,</color> <color=#FFA400>AUTHOR:</color> <color=#EEEEEE>" + ((<>8__12.asset.author != "") ? <>8__12.asset.author : "Uncredited") + "</color><color=#FFA400>,</color> <color=#FFA400>PACK:</color> <color=#EEEEEE>" + <>8__12.asset.pack + "</color><color=#FFA400>,</color> <color=#FFA400>ITEM:</color> <color=#EEEEEE>" + Path.GetFileNameWithoutExtension(<>8__12.asset.prefab) + "</color><color=#FFA400>,</color> <color=#FFA400>ANIMATED:</color> <color=#EEEEEE>" + <>8__12.asset.hasAnimations + "</color><color=#FFA400>,</color> <color=#FFA400>AUDIO:</color> <color=#EEEEEE>" + <>8__12.asset.hasAudio + "</color><color=#FFA400>,</color> <color=#FFA400>MORPHS:</color> <color=#EEEEEE>" + <>8__12.asset.hasBlendshapes + "</color>";
									}
									else
									{
										_self.menus.properties["info"] = "";
									}
								});
								if (!<contents>5__2.ContainsKey(<badge>5__13.id))
								{
									<contents>5__2.Add(<badge>5__13.id, <badge>5__13);
								}
								<cX>5__5++;
								if (<cX>5__5 >= _self.assetBadgesPerRow.Value)
								{
									<cX>5__5 = 0;
									<cY>5__6++;
								}
								<badge>5__13 = null;
								<>8__12 = null;
							}
						}
						finally
						{
							((IDisposable)<>s__11).Dispose();
						}
						<>s__11 = default(List<AssetInfo>.Enumerator);
						<numRows>5__9 = (int)Math.Ceiling((decimal)<contents>5__2.Count / (decimal)_self.assetBadgesPerRow.Value);
						<contentMenu>5__10 = new Menu("Content", 420, 780, 1255, 270, 1250, <numRows>5__9 * (<badgeSize>5__7 + 35));
						<contentMenu>5__10.properties["backColor"] = "000000DD";
						<contentMenu>5__10.properties["status"] = <currentState>5__4;
						<contentMenu>5__10.children = <contents>5__2;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					LoggingPlugin.LogTrace("Applying Assets Menu Of Kind '" + <>8__1.kind + "' And Group '" + <>8__1.group + "'");
					_self.guiSafe = "BuildAssetsMenu";
					if (menus.items.ContainsKey(<contentMenu>5__10.id))
					{
						menus.items[<contentMenu>5__10.id] = <contentMenu>5__10;
					}
					else
					{
						menus.items.Add(<contentMenu>5__10.id, <contentMenu>5__10);
					}
					_self.guiSafe = "";
					<currentState>5__4 = null;
					<contentMenu>5__10 = null;
					goto IL_08f7;
					IL_090d:
					return false;
					IL_08f7:
					<>8__1 = null;
					<contents>5__2 = null;
					<items>5__3 = null;
					goto IL_090d;
				}

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

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

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

				private object <>2__current;

				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				private <>c__DisplayClass4_0 <>8__1;

				private Dictionary<string, IMenuItem> <contents>5__2;

				private int <initScrollPosition>5__3;

				private IMenuItem <scrollBar>5__4;

				private Menu <badgeSizer>5__5;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>8__1 = null;
					<contents>5__2 = null;
					<scrollBar>5__4 = null;
					<badgeSizer>5__5 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
					//IL_0108: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
					//IL_01cc: Expected O, but got Unknown
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>8__1 = new <>c__DisplayClass4_0();
						<>8__1.menus = menus;
						<>8__1.assets = assets;
						LoggingPlugin.LogDebug("Building Badge Sizer");
						<contents>5__2 = new Dictionary<string, IMenuItem>();
						<initScrollPosition>5__3 = (int)(((float)_self.assetBadgesPerRow.Value - 4f) * 320f / 22f);
						LoggingPlugin.LogTrace("ScrollPosition translates " + _self.assetBadgesPerRow.Value + " to " + <initScrollPosition>5__3);
						<scrollBar>5__4 = new ScrollBar("BadgeSize.ScrollBar", 0, 0, 320f, 30f, 16f, 0f, 320 - <initScrollPosition>5__3, 320f, Helpers.MakeColor("FF4A00"), Helpers.MakeColor("000000"), delegate(string id, string val)
						{
							_self.assetBadgesPerRow.Value = (int)((320f - float.Parse(val)) / 320f * 22f + 3f);
							((BaseUnityPlugin)_self).Config.Save();
							LoggingPlugin.LogTrace("Triggering Menu Refresh With " + _self.assetBadgesPerRow.Value + " Badges Per Row");
							((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(<>8__1.menus, <>8__1.assets));
						});
						<contents>5__2.Add(<scrollBar>5__4.id, <scrollBar>5__4);
						<badgeSizer>5__5 = new Menu("BadgeSizer", 800, 750, 320, 30, 320, 30);
						<badgeSizer>5__5.properties["backColor"] = "000000DD";
						<badgeSizer>5__5.children = <contents>5__2;
						break;
					case 1:
						<>1__state = -1;
						break;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					LoggingPlugin.LogTrace("Applying Badge Sizer");
					_self.guiSafe = "BuildBadgeSizer";
					if (<>8__1.menus.items.ContainsKey(<badgeSizer>5__5.id))
					{
						<>8__1.menus.items[<badgeSizer>5__5.id] = <badgeSizer>5__5;
					}
					else
					{
						<>8__1.menus.items.Add(<badgeSizer>5__5.id, <badgeSizer>5__5);
					}
					_self.guiSafe = "";
					return false;
				}

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

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

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

				private object <>2__current;

				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				private <>c__DisplayClass3_0 <>8__1;

				private Dictionary<string, IMenuItem> <contents>5__2;

				private IMenuItem <label1>5__3;

				private IMenuItem <filter1>5__4;

				private IMenuItem <label2>5__5;

				private IMenuItem <filter2>5__6;

				private string <currentState>5__7;

				private Menu <filterMenu>5__8;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>8__1 = null;
					<contents>5__2 = null;
					<label1>5__3 = null;
					<filter1>5__4 = null;
					<label2>5__5 = null;
					<filter2>5__6 = null;
					<currentState>5__7 = null;
					<filterMenu>5__8 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_0089: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
					//IL_0106: Unknown result type (might be due to invalid IL or missing references)
					//IL_016e: Unknown result type (might be due to invalid IL or missing references)
					//IL_01df: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
					//IL_034b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0355: Expected O, but got Unknown
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>8__1 = new <>c__DisplayClass3_0();
						<>8__1.menus = menus;
						<>8__1.assets = assets;
						LoggingPlugin.LogDebug("Building Filters Menu");
						<contents>5__2 = new Dictionary<string, IMenuItem>();
						<label1>5__3 = new MenuLabel("Filter.Group.Label", 20, 20, 200f, 25f, 16f, "Group Filter", Helpers.MakeColor("FF4A00"), null, delegate(string id, string text)
						{
							_self.menus.items["Filter"].properties["group"] = text;
							((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(<>8__1.menus, <>8__1.assets));
						});
						<contents>5__2.Add(<label1>5__3.id, <label1>5__3);
						<filter1>5__4 = new MenuTextInput("Filter.Group", 20, 80, 200f, 25f, 16f, "", Helpers.MakeColor("FF4A00"), Helpers.MakeColor("555555"), delegate(string id, string text)
						{
							_self.menus.items["Filter"].properties["group"] = text;
							((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(<>8__1.menus, <>8__1.assets));
						});
						<contents>5__2.Add(<filter1>5__4.id, <filter1>5__4);
						<label2>5__5 = new MenuLabel("Filter.Asset.Label", 20, 140, 200f, 25f, 16f, "Asset Filter", Helpers.MakeColor("FF4A00"), null, delegate(string id, string text)
						{
							_self.menus.items["Filter"].properties["group"] = text;
							((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(<>8__1.menus, <>8__1.assets));
						});
						<contents>5__2.Add(<label2>5__5.id, <label2>5__5);
						<filter2>5__6 = new MenuTextInput("Filter.Asset", 20, 200, 200f, 25f, 16f, "", Helpers.MakeColor("FF4A00"), Helpers.MakeColor("555555"), delegate(string id, string text)
						{
							_self.menus.items["Filter"].properties["asset"] = text;
							((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(<>8__1.menus, <>8__1.assets));
						});
						<contents>5__2.Add(<filter2>5__6.id, <filter2>5__6);
						<currentState>5__7 = ((!_self.menus.items.ContainsKey("Filter")) ? "closed" : (_self.menus.items["Filter"].properties.ContainsKey("status") ? _self.menus.items["Filter"].properties["status"] : "closed"));
						<filterMenu>5__8 = new Menu("Filter", 1675, 780, 245, 270, 235, 270);
						<filterMenu>5__8.properties["backColor"] = "000000DD";
						<filterMenu>5__8.properties["status"] = <currentState>5__7;
						<filterMenu>5__8.children = <contents>5__2;
						break;
					case 1:
						<>1__state = -1;
						break;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					LoggingPlugin.LogTrace("Applying Filters Menu");
					_self.guiSafe = "BuildFiltersMenu";
					if (<>8__1.menus.items.ContainsKey(<filterMenu>5__8.id))
					{
						<>8__1.menus.items[<filterMenu>5__8.id] = <filterMenu>5__8;
					}
					else
					{
						<>8__1.menus.items.Add(<filterMenu>5__8.id, <filterMenu>5__8);
					}
					_self.guiSafe = "";
					return false;
				}

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

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

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

				private object <>2__current;

				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				private <>c__DisplayClass1_0 <>8__1;

				private <>c__DisplayClass1_1 <>8__2;

				private Dictionary<string, IMenuItem> <contents>5__3;

				private List<global::<>f__AnonymousType0<string, string>> <uniqueCombinations>5__4;

				private string <currentState>5__5;

				private int <cX>5__6;

				private int <cY>5__7;

				private string <lastHeader>5__8;

				private Menu <groupMenu>5__9;

				private List<global::<>f__AnonymousType0<string, string>>.Enumerator <>s__10;

				private global::<>f__AnonymousType0<string, string> <item>5__11;

				private IMenuItem <entry>5__12;

				private IMenuItem <header>5__13;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>8__1 = null;
					<>8__2 = null;
					<contents>5__3 = null;
					<uniqueCombinations>5__4 = null;
					<currentState>5__5 = null;
					<lastHeader>5__8 = null;
					<groupMenu>5__9 = null;
					<>s__10 = default(List<global::<>f__AnonymousType0<string, string>>.Enumerator);
					<item>5__11 = null;
					<entry>5__12 = null;
					<header>5__13 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_0681: Unknown result type (might be due to invalid IL or missing references)
					//IL_068b: Expected O, but got Unknown
					//IL_04c2: 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_04e0: Unknown result type (might be due to invalid IL or missing references)
					//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
					//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_050d: Unknown result type (might be due to invalid IL or missing references)
					//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_03c2: 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_03e0: Unknown result type (might be due to invalid IL or missing references)
					int num = <>1__state;
					if (num != 0)
					{
						if (num != 1)
						{
							return false;
						}
						<>1__state = -1;
					}
					else
					{
						<>1__state = -1;
						<>8__1 = new <>c__DisplayClass1_0();
						<>8__1.menus = menus;
						<>8__1.assets = assets;
						if (!_self.menus.items.ContainsKey("Kind") || !_self.menus.items["Kind"].properties.ContainsKey("selected"))
						{
							goto IL_0897;
						}
						<>8__2 = new <>c__DisplayClass1_1();
						<>8__2.kind = _self.menus.items["Kind"].properties["selected"].Substring("Kind.".Length);
						<>8__2.filter = (_self.menus.items["Filter"].properties.ContainsKey("group") ? _self.menus.items["Filter"].properties["group"] : "");
						LoggingPlugin.LogDebug("Building Group Menu For Kind '" + <>8__2.kind + "' And Filter '" + <>8__2.filter + "'");
						<contents>5__3 = new Dictionary<string, IMenuItem>();
						<uniqueCombinations>5__4 = (from asset in (from asset in <>8__1.assets.Values
								where asset.category == <>8__2.kind && asset.groupName.Contains(<>8__2.filter)
								select new { asset.header, asset.groupName }).Distinct()
							orderby asset.header, asset.groupName
							select asset).ToList();
						if (<uniqueCombinations>5__4.Count() <= 0)
						{
							goto IL_0881;
						}
						<currentState>5__5 = ((!_self.menus.items.ContainsKey("Group")) ? "closed" : (_self.menus.items["Group"].properties.ContainsKey("status") ? _self.menus.items["Group"].properties["status"] : "closed"));
						<cX>5__6 = 0;
						<cY>5__7 = 0;
						<lastHeader>5__8 = "";
						<>s__10 = <uniqueCombinations>5__4.GetEnumerator();
						try
						{
							while (<>s__10.MoveNext())
							{
								<item>5__11 = <>s__10.Current;
								if (<item>5__11.header != <lastHeader>5__8)
								{
									LoggingPlugin.LogTrace("Creating Header " + <item>5__11.header);
									<lastHeader>5__8 = <item>5__11.header;
									<header>5__13 = new MenuText("Header." + <item>5__11.header, 0, <cY>5__7 * 35, 300f, 30f, 16f, <item>5__11.header.ToUpper(), <item>5__11.header, Helpers.MakeColor("E25508"), Helpers.MakeColor("E25508"), Helpers.MakeColor("222222"), Helpers.MakeColor("222222"), null);
									if (!<contents>5__3.ContainsKey(<header>5__13.id))
									{
										<contents>5__3.Add(<header>5__13.id, <header>5__13);
									}
									<cY>5__7++;
									<header>5__13 = null;
								}
								LoggingPlugin.LogTrace("Creating Group " + <item>5__11.groupName);
								<entry>5__12 = new MenuSelectableText("Header." + <item>5__11.header + ".Group." + <item>5__11.groupName, 0, <cY>5__7 * 35, 300f, 30f, 16f, <item>5__11.groupName, <item>5__11.groupName, Helpers.MakeColor("A6A6A6"), Helpers.MakeColor("EEEEEE"), Helpers.MakeColor("111111"), Helpers.MakeColor("030303"), Helpers.MakeColor("3B3B3B"), Helpers.MakeColor("FF6000"), delegate(string id, string val)
								{
									_self.menus.items["Group"].properties["selected"] = id.Substring(0, id.Length - ".Text".Length);
									((MonoBehaviour)_self).StartCoroutine(BuildAssetsMenu(<>8__1.menus, <>8__1.assets));
								});
								if (!<contents>5__3.ContainsKey(<entry>5__12.id))
								{
									<contents>5__3.Add(<entry>5__12.id, <entry>5__12);
								}
								<cY>5__7++;
								<entry>5__12 = null;
								<item>5__11 = null;
							}
						}
						finally
						{
							((IDisposable)<>s__10).Dispose();
						}
						<>s__10 = default(List<global::<>f__AnonymousType0<string, string>>.Enumerator);
						<groupMenu>5__9 = new Menu("Group", 80, 780, 320, 270, 300, 35 * <contents>5__3.Count);
						<groupMenu>5__9.properties["backColor"] = "000000DD";
						<groupMenu>5__9.properties["status"] = <currentState>5__5;
						<groupMenu>5__9.children = <contents>5__3;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					LoggingPlugin.LogTrace("Applying Group Menu For Kind '" + <>8__2.kind + "'");
					_self.guiSafe = "BuildGroupMenu";
					if (<>8__1.menus.items.ContainsKey(<groupMenu>5__9.id))
					{
						<>8__1.menus.items[<groupMenu>5__9.id] = <groupMenu>5__9;
					}
					else
					{
						<>8__1.menus.items.Add(<groupMenu>5__9.id, <groupMenu>5__9);
					}
					_self.guiSafe = "";
					LoggingPlugin.LogTrace("Triggering Group Menu For Kind '" + <>8__2.kind + "' Selection");
					if (<>8__1.menus.items[<groupMenu>5__9.id].children.Count > 0)
					{
						<>8__1.menus.items[<groupMenu>5__9.id].children.ElementAt(1).Value.children.ElementAt(1).Value.Trigger(<>8__1.menus.items[<groupMenu>5__9.id].children.ElementAt(1).Value.children.ElementAt(1).Value.id, "");
					}
					<currentState>5__5 = null;
					<lastHeader>5__8 = null;
					<groupMenu>5__9 = null;
					goto IL_0881;
					IL_0897:
					return false;
					IL_0881:
					<>8__2 = null;
					<contents>5__3 = null;
					<uniqueCombinations>5__4 = null;
					goto IL_0897;
				}

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

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

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

				private object <>2__current;

				public MenuCollection menus;

				public Dictionary<string, AssetInfo> assets;

				private <>c__DisplayClass0_0 <>8__1;

				private Dictionary<string, IMenuItem> <contents>5__2;

				private IEnumerable<string> <uniqueKinds>5__3;

				private string <currentState>5__4;

				private int <cX>5__5;

				private int <cY>5__6;

				private Menu <kindMenu>5__7;

				private IEnumerator<string> <>s__8;

				private string <kind>5__9;

				private IMenuItem <icon>5__10;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>8__1 = null;
					<contents>5__2 = null;
					<uniqueKinds>5__3 = null;
					<currentState>5__4 = null;
					<kindMenu>5__7 = null;
					<>s__8 = null;
					<kind>5__9 = null;
					<icon>5__10 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_037e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0388: Expected O, but got Unknown
					int num = <>1__state;
					if (num != 0)
					{
						if (num != 1)
						{
							return false;
						}
						<>1__state = -1;
					}
					else
					{
						<>1__state = -1;
						<>8__1 = new <>c__DisplayClass0_0();
						<>8__1.menus = menus;
						<>8__1.assets = assets;
						LoggingPlugin.LogDebug("Building Kind Menu (Based On Category)");
						<contents>5__2 = new Dictionary<string, IMenuItem>();
						<uniqueKinds>5__3 = from kind in <>8__1.assets.Values.Select((AssetInfo asset) => asset.category).Distinct()
							orderby kind
							select kind;
						if (<uniqueKinds>5__3.Count() <= 0)
						{
							goto IL_04ed;
						}
						<currentState>5__4 = ((!_self.menus.items.ContainsKey("Kind")) ? "closed" : (_self.menus.items["Kind"].properties.ContainsKey("status") ? _self.menus.items["Kind"].properties["status"] : "closed"));
						<cX>5__5 = 0;
						<cY>5__6 = 0;
						<>s__8 = <uniqueKinds>5__3.GetEnumerator();
						try
						{
							while (<>s__8.MoveNext())
							{
								<kind>5__9 = <>s__8.Current;
								LoggingPlugin.LogTrace("Creating Icon For " + <kind>5__9);
								<icon>5__10 = new MenuTexture("Kind." + <kind>5__9, 0, <cY>5__6 * 35, 32f, 32f, "Kind." + <kind>5__9 + ".png", "Kind." + <kind>5__9 + ".Selected.png", <kind>5__9, delegate(string id, string val)
								{
									_self.menus.items["Kind"].properties["selected"] = id;
									((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(<>8__1.menus, <>8__1.assets));
								}, delegate(string id, string val, int x, int y)
								{
									val = val.Substring("Kind.".Length);
									val = val.Substring(0, val.Length - ".png".Length);
									_self.menus.properties["info"] = "   <color=#FFA400>TYPE:</color> <color=#EEEEEE>" + val + "</color> ";
								});
								if (!<contents>5__2.ContainsKey(<icon>5__10.id))
								{
									<contents>5__2.Add(<icon>5__10.id, <icon>5__10);
								}
								<cY>5__6++;
								<icon>5__10 = null;
								<kind>5__9 = null;
							}
						}
						finally
						{
							if (<>s__8 != null)
							{
								<>s__8.Dispose();
							}
						}
						<>s__8 = null;
						<kindMenu>5__7 = new Menu("Kind", 10, 780, 55, 270, 55, 35 * <contents>5__2.Count);
						<kindMenu>5__7.properties["backColor"] = "000000DD";
						<kindMenu>5__7.properties["status"] = <currentState>5__4;
						<kindMenu>5__7.children = <contents>5__2;
					}
					if (_self.guiSafe != "")
					{
						LoggingPlugin.LogTrace("Waiting On " + _self.guiSafe + " To Finish");
						<>2__current = (object)new WaitForEndOfFrame();
						<>1__state = 1;
						return true;
					}
					LoggingPlugin.LogTrace("Applying Kind Menu");
					_self.guiSafe = "BuildKindMenu";
					if (<>8__1.menus.items.ContainsKey(<kindMenu>5__7.id))
					{
						<>8__1.menus.items[<kindMenu>5__7.id] = <kindMenu>5__7;
					}
					else
					{
						<>8__1.menus.items.Add(<kindMenu>5__7.id, <kindMenu>5__7);
					}
					_self.guiSafe = "";
					LoggingPlugin.LogTrace("Triggering Kind Menu Selection");
					<>8__1.menus.items[<kindMenu>5__7.id].children.ElementAt(0).Value.Trigger(<>8__1.menus.items[<kindMenu>5__7.id].children.ElementAt(0).Value.id, "");
					<currentState>5__4 = null;
					<kindMenu>5__7 = null;
					goto IL_04ed;
					IL_04ed:
					return false;
				}

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

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

			[IteratorStateMachine(typeof(<BuildKindsMenu>d__0))]
			public static IEnumerator BuildKindsMenu(MenuCollection menus, Dictionary<string, AssetInfo> assets)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <BuildKindsMenu>d__0(0)
				{
					menus = menus,
					assets = assets
				};
			}

			[IteratorStateMachine(typeof(<BuildGroupsMenu>d__1))]
			public static IEnumerator BuildGroupsMenu(MenuCollection menus, Dictionary<string, AssetInfo> assets)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <BuildGroupsMenu>d__1(0)
				{
					menus = menus,
					assets = assets
				};
			}

			[IteratorStateMachine(typeof(<BuildAssetsMenu>d__2))]
			public static IEnumerator BuildAssetsMenu(MenuCollection menus, Dictionary<string, AssetInfo> assets)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <BuildAssetsMenu>d__2(0)
				{
					menus = menus,
					assets = assets
				};
			}

			[IteratorStateMachine(typeof(<BuildFiltersMenu>d__3))]
			public static IEnumerator BuildFiltersMenu(MenuCollection menus, Dictionary<string, AssetInfo> assets)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <BuildFiltersMenu>d__3(0)
				{
					menus = menus,
					assets = assets
				};
			}

			[IteratorStateMachine(typeof(<BuildBadgeSizer>d__4))]
			public static IEnumerator BuildBadgeSizer(MenuCollection menus, Dictionary<string, AssetInfo> assets)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <BuildBadgeSizer>d__4(0)
				{
					menus = menus,
					assets = assets
				};
			}

			public static Dictionary<string, AssetInfo> RegisterAssets()
			{
				string text = Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/org.lordashes.plugins.commoncustomsmenu.assets.json";
				Dictionary<string, AssetInfo> dictionary = new Dictionary<string, AssetInfo>();
				if (File.Exists(text))
				{
					string text2 = File.ReadAllText(text, (CacheType)999);
					LoggingPlugin.LogDebug("Registered Assets Loaded");
					dictionary = JsonConvert.DeserializeObject<Dictionary<string, AssetInfo>>(text2);
				}
				else
				{
					LoggingPlugin.LogDebug("No Registered Assets File");
				}
				LoggingPlugin.LogDebug("Found " + dictionary.Keys.Count + " Registered Assets");
				foreach (KeyValuePair<string, Provider> provider in _self.providers)
				{
					try
					{
						LoggingPlugin.LogDebug("Consulting Provider " + provider.Key + " For Assets");
						((MonoBehaviour)_self).StartCoroutine(provider.Value.GetNewAssets(new ReadOnlyDictionary<string, AssetInfo>(dictionary), AssetsUpdate));
					}
					catch
					{
					}
				}
				return dictionary;
			}

			[IteratorStateMachine(typeof(<AssetsUpdate>d__6))]
			public static IEnumerator AssetsUpdate(Dictionary<string, AssetInfo> results, string providerName = "Unknown")
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <AssetsUpdate>d__6(0)
				{
					results = results,
					providerName = providerName
				};
			}

			private static void ApplyRewriter(string rewriterFile, ref Dictionary<string, AssetInfo> assets)
			{
				LoggingPlugin.LogDebug("Processing Rewrites");
				Dictionary<string, RewriteClause> dictionary = new Dictionary<string, RewriteClause>();
				try
				{
					string text = File.ReadAllText(rewriterFile, (CacheType)999);
					dictionary = JsonConvert.DeserializeObject<Dictionary<string, RewriteClause>>(text);
				}
				catch
				{
				}
				LoggingPlugin.LogTrace("Rewrites Has " + dictionary.Count + " Clauses");
				foreach (KeyValuePair<string, AssetInfo> asset in assets)
				{
					LoggingPlugin.LogDebug("> " + AssetInfoSummary(asset.Value));
					string text2 = "";
					if ((_self.rewriteScope & 1) > 0)
					{
						text2 = text2 + asset.Value.name + "|";
					}
					if ((_self.rewriteScope & 2) > 0)
					{
						text2 = text2 + asset.Value.description + "|";
					}
					if ((_self.rewriteScope & 4) > 0)
					{
						text2 = text2 + asset.Value.tags + "|";
					}
					if ((_self.rewriteScope & 8) > 0)
					{
						text2 = text2 + asset.Value.pack + "|";
					}
					if ((_self.rewriteScope & 0x10) > 0)
					{
						text2 = text2 + asset.Value.prefab + "|";
					}
					LoggingPlugin.LogTrace("Processing Item " + text2);
					text2 = text2.ToUpper();
					foreach (KeyValuePair<string, RewriteClause> item in dictionary)
					{
						LoggingPlugin.LogTrace("Processing Clause " + item.Key);
						if (text2.Contains(item.Key.ToUpper()))
						{
							LoggingPlugin.LogTrace("Clause Match");
							if (item.Value.kind != null)
							{
								asset.Value.kind = item.Value.kind;
							}
							if (item.Value.category != null)
							{
								asset.Value.category = item.Value.category;
							}
							if (item.Value.header != null)
							{
								asset.Value.header = item.Value.header;
							}
							if (item.Value.group != null)
							{
								asset.Value.groupName = item.Value.group;
							}
							if (item.Value.prefix != null)
							{
								asset.Value.name = item.Value.prefix + " " + asset.Value.name;
							}
							if (item.Value.suffix != null)
							{
								asset.Value.name = asset.Value.name + " " + item.Value.suffix;
							}
						}
					}
					LoggingPlugin.LogDebug("< " + AssetInfoSummary(asset.Value));
				}
			}

			public static string AssetInfoSummary(AssetInfo item)
			{
				return "Name: " + item.name + ", Kind: " + item.kind + ", Category: " + item.category + ", Header: " + item.header + ", Group: " + item.groupName;
			}
		}

		public interface IMenuItem
		{
			string id { get; set; }

			Rect position { get; set; }

			Dictionary<string, string> properties { get; set; }

			Dictionary<string, IMenuItem> children { get; set; }

			Action<string, string> Trigger { get; set; }

			void Draw(int canvas_x, int canvas_y, bool active = false);
		}

		public class Menu : IMenuItem
		{
			private IMenuItem _scrollbar = null;

			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>();


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger
			{
				get
				{
					return null;
				}
				set
				{
					throw new NotSupportedException();
				}
			}

			public Menu(string id, int x, int y, int width, int height, int canvas_width, int canvas_height)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0207: Unknown result type (might be due to invalid IL or missing references)
				//IL_0216: Unknown result type (might be due to invalid IL or missing references)
				Menu menu = this;
				this.id = id;
				position = new Rect((float)x, (float)y, (float)width, (float)height);
				properties["animationOffsetX"] = "0";
				properties["animationOffsetY"] = "0";
				properties["animationStep"] = "0";
				properties["status"] = "closed";
				properties["themeApplied"] = "false";
				properties["canvas_x"] = "0";
				properties["canvas_y"] = "0";
				LoggingPlugin.LogTrace(this.id + ": Viewport Height: " + height + ", Canvas Height: " + canvas_height + ", Scrollbar: " + (canvas_height > height));
				if (canvas_height > height)
				{
					string text = this.id + ".ScrollBar";
					Rect val = position;
					int x2 = (int)(((Rect)(ref val)).x + (float)width - 10f);
					val = position;
					_scrollbar = new ScrollBar(text, x2, (int)((Rect)(ref val)).y, 10f, height, 10f, 0f, canvas_height - height + 10, canvas_height - height + 10, Helpers.MakeColor("FF4A00"), Helpers.MakeColor("000000"), delegate(string _id, string _value)
					{
						int num = canvas_height - height - (int)float.Parse(_value);
						menu.properties["canvas_y"] = (-1 * num).ToString();
					});
					properties["canvas_y"] = (-1 * (canvas_height - height)).ToString();
				}
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_092a: 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_0956: Unknown result type (might be due to invalid IL or missing references)
				//IL_095b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0982: Unknown result type (might be due to invalid IL or missing references)
				//IL_0987: Unknown result type (might be due to invalid IL or missing references)
				//IL_0997: Unknown result type (might be due to invalid IL or missing references)
				//IL_099c: Unknown result type (might be due to invalid IL or missing references)
				//IL_09b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_09de: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a0e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Expected O, but got Unknown
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Expected O, but got Unknown
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a63: Unknown result type (might be due to invalid IL or missing references)
				//IL_0acb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ad0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
				//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b16: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b34: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b39: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b58: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b5d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b67: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b6c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b92: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b9c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ba1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bc0: 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_0151: Expected O, but got Unknown
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0162: Expected O, but got Unknown
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_017e: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0418: Unknown result type (might be due to invalid IL or missing references)
				//IL_041d: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0516: Unknown result type (might be due to invalid IL or missing references)
				//IL_051b: Unknown result type (might be due to invalid IL or missing references)
				//IL_068e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0693: Unknown result type (might be due to invalid IL or missing references)
				//IL_061a: Unknown result type (might be due to invalid IL or missing references)
				//IL_061f: Unknown result type (might be due to invalid IL or missing references)
				//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0703: Unknown result type (might be due to invalid IL or missing references)
				if (properties.ContainsKey("status") && properties["status"] == "closed")
				{
					return;
				}
				Color black;
				if (properties["themeApplied"] != "true")
				{
					black = Color.black;
					ColorUtility.TryParseHtmlString(properties.ContainsKey("scrollBar") ? ("#" + properties["scrollBar"]) : "#000000FF", ref black);
					GUIStyle val = new GUIStyle(GUI.skin.verticalScrollbar);
					GUIStyle val2 = new GUIStyle(GUI.skin.horizontalScrollbar);
					val.normal.background = Helpers.MakeTexture(black);
					val2.normal.background = Helpers.MakeTexture(black);
					GUI.skin.verticalScrollbar = val;
					GUI.skin.horizontalScrollbar = val2;
					ColorUtility.TryParseHtmlString(properties.ContainsKey("scrollBarThumb") ? ("#" + properties["scrollBarThumb"]) : "#FA4400FF", ref black);
					GUIStyle val3 = new GUIStyle(GUI.skin.verticalScrollbarThumb);
					GUIStyle val4 = new GUIStyle(GUI.skin.horizontalScrollbarThumb);
					val3.normal.background = Helpers.MakeTexture(black);
					val4.normal.background = Helpers.MakeTexture(black);
					GUI.skin.verticalScrollbarThumb = val3;
					GUI.skin.horizontalScrollbarThumb = val4;
					properties["themeApplied"] = "true";
				}
				Rect val5;
				if (int.Parse(properties["animationStep"]) != 0)
				{
					LoggingPlugin.LogTrace("Status: " + (properties.ContainsKey("status") ? properties["status"] : "None") + ", AnimationStep: " + properties["animationStep"] + ", OX: " + properties["animationOffsetX"] + ", OY: " + properties["animationOffsetY"]);
					if (int.Parse(properties["animationOffsetX"]) != 0)
					{
						properties["animationOffsetX"] = (int.Parse(properties["animationOffsetX"]) + int.Parse(properties["animationStep"])).ToString();
					}
					else if (int.Parse(properties["animationOffsetY"]) != 0)
					{
						properties["animationOffsetY"] = (int.Parse(properties["animationOffsetY"]) + int.Parse(properties["animationStep"])).ToString();
					}
					if (properties.ContainsKey("status") && properties["status"] == "closing")
					{
						if (int.Parse(properties["animationOffsetX"]) < 0)
						{
							float num = int.Parse(properties["animationOffsetX"]);
							val5 = position;
							if (num <= -1f * ((Rect)(ref val5)).width)
							{
								LoggingPlugin.LogDebug("Menu " + id + " Viewport Closed (Left Side)");
								properties["animationStep"] = "0";
								Dictionary<string, string> dictionary = properties;
								val5 = position;
								dictionary["animationOffsetX"] = (-1f * ((Rect)(ref val5)).width).ToString();
								properties["animationOffsetY"] = "0";
								properties["status"] = "closed";
								_self.menus.properties.Remove("menuSpeed");
							}
						}
						else if (int.Parse(properties["animationOffsetX"]) > 0)
						{
							float num2 = int.Parse(properties["animationOffsetX"]);
							val5 = position;
							if (num2 >= ((Rect)(ref val5)).width)
							{
								LoggingPlugin.LogDebug("Menu " + id + " Viewport Closed (Right Side)");
								properties["animationStep"] = "0";
								Dictionary<string, string> dictionary2 = properties;
								val5 = position;
								dictionary2["animationOffsetX"] = ((Rect)(ref val5)).width.ToString();
								properties["animationOffsetY"] = "0";
								properties["status"] = "closed";
							}
						}
						else if (int.Parse(properties["animationOffsetY"]) < 0)
						{
							float num3 = int.Parse(properties["animationOffsetY"]);
							val5 = position;
							if (num3 <= -1f * ((Rect)(ref val5)).height)
							{
								LoggingPlugin.LogDebug("Menu " + id + " Viewport Closed (Top Side)");
								properties["animationStep"] = "0";
								properties["animationOffsetX"] = "0";
								Dictionary<string, string> dictionary3 = properties;
								val5 = position;
								dictionary3["animationOffsetY"] = (-1f * ((Rect)(ref val5)).height).ToString();
								properties["status"] = "closed";
							}
						}
						else if (int.Parse(properties["animationOffsetY"]) > 0)
						{
							float num4 = int.Parse(properties["animationOffsetY"]);
							val5 = position;
							if (num4 >= ((Rect)(ref val5)).height)
							{
								LoggingPlugin.LogDebug("Menu " + id + " Viewport Closed (Bottom Side)");
								properties["animationStep"] = "0";
								properties["animationOffsetX"] = "0";
								Dictionary<string, string> dictionary4 = properties;
								val5 = position;
								dictionary4["animationOffsetY"] = ((Rect)(ref val5)).height.ToString();
								properties["status"] = "closed";
							}
						}
					}
					else if (properties.ContainsKey("status") && properties["status"] == "opening")
					{
						if (int.Parse(properties["animationOffsetX"]) != 0)
						{
							if (Math.Abs(int.Parse(properties["animationOffsetX"])) <= Math.Abs(int.Parse(properties["animationStep"])))
							{
								LoggingPlugin.LogDebug("Menu " + id + " Viewport Opened (From Left/Right)");
								properties["animationStep"] = "0";
								properties["animationOffsetX"] = "0";
								properties["animationOffsetY"] = "0";
								properties["status"] = "opened";
							}
						}
						else if (int.Parse(properties["animationOffsetY"]) != 0 && Math.Abs(int.Parse(properties["animationOffsetY"])) <= Math.Abs(int.Parse(properties["animationStep"])))
						{
							LoggingPlugin.LogDebug("Menu " + id + " Viewport Opened (From Top/Bottom)");
							properties["animationStep"] = "0";
							properties["animationOffsetX"] = "0";
							properties["animationOffsetY"] = "0";
							properties["status"] = "opened";
						}
					}
				}
				val5 = position;
				float num5 = ((Rect)(ref val5)).x + (float)int.Parse(properties["animationOffsetX"]) - 10f;
				val5 = position;
				float num6 = ((Rect)(ref val5)).y + (float)int.Parse(properties["animationOffsetY"]) - 10f;
				val5 = position;
				float num7 = ((Rect)(ref val5)).width + 20f;
				val5 = position;
				Rect val6 = default(Rect);
				((Rect)(ref val6))..ctor(num5, num6, num7, ((Rect)(ref val5)).height + 20f);
				val5 = position;
				float num8 = ((Rect)(ref val5)).x + (float)int.Parse(properties["animationOffsetX"]);
				val5 = position;
				float num9 = ((Rect)(ref val5)).y + (float)int.Parse(properties["animationOffsetY"]);
				val5 = position;
				float width = ((Rect)(ref val5)).width;
				val5 = position;
				Rect val7 = default(Rect);
				((Rect)(ref val7))..ctor(num8, num9, width, ((Rect)(ref val5)).height);
				black = Color.clear;
				ColorUtility.TryParseHtmlString(properties.ContainsKey("backColor") ? ("#" + properties["backColor"]) : "#00000000", ref black);
				GUI.DrawTexture(val6, (Texture)(object)Helpers.MakeTexture(black));
				if (_scrollbar != null)
				{
					_scrollbar.Draw(int.Parse(properties["animationOffsetX"]), int.Parse(properties["animationOffsetY"]));
				}
				string[] obj = new string[12]
				{
					"ClipArea: ", null, null, null, null, null, null, null, null, null,
					null, null
				};
				val5 = position;
				obj[1] = ((Rect)(ref val5)).x.ToString();
				obj[2] = ",";
				val5 = position;
				obj[3] = ((Rect)(ref val5)).y.ToString();
				obj[4] = " + ";
				val5 = position;
				obj[5] = ((Rect)(ref val5)).width.ToString();
				obj[6] = ",";
				val5 = position;
				obj[7] = ((Rect)(ref val5)).height.ToString();
				obj[8] = " => ";
				val5 = position;
				float x = ((Rect)(ref val5)).x;
				val5 = position;
				obj[9] = (x + ((Rect)(ref val5)).width).ToString();
				obj[10] = ",";
				val5 = position;
				float y = ((Rect)(ref val5)).y;
				val5 = position;
				obj[11] = (y + ((Rect)(ref val5)).height).ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				GUI.BeginGroup(val7);
				foreach (IMenuItem value in children.Values)
				{
					try
					{
						bool active2 = active || (properties.ContainsKey("selected") && properties["selected"] == value.id);
						LoggingPlugin.LogTrace("Menu " + id + " Drawing " + value.id + ", Selected: " + (properties.ContainsKey("selected") ? properties["selected"] : "None") + " => Active: " + active + " + Selected: " + (properties.ContainsKey("selected") ? properties["selected"] : "None") + " = Result: " + active2);
						value.Draw(int.Parse(properties["canvas_x"]), int.Parse(properties["canvas_y"]), active2);
					}
					catch
					{
					}
				}
				GUI.EndGroup();
			}

			public void Open(bool instant = false)
			{
				//IL_0029: 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)
				properties["animationOffsetX"] = "0";
				Dictionary<string, string> dictionary = properties;
				float num = Screen.height;
				Rect val = position;
				dictionary["animationOffsetY"] = (num - ((Rect)(ref val)).y).ToString();
				properties["animationStep"] = (instant ? "-100" : "-10");
				properties["status"] = "opening";
				LoggingPlugin.LogDebug("Opening Menu " + id + " At Speed " + properties["animationStep"]);
			}

			public void Close(bool instant = false)
			{
				properties["animationOffsetX"] = "0";
				properties["animationOffsetY"] = "5";
				properties["animationStep"] = (instant ? "100" : "10");
				properties["status"] = "closing";
				LoggingPlugin.LogDebug("Closing Menu " + id + " At Speed " + properties["animationStep"]);
			}

			public void Scroll(float percentage)
			{
				((ScrollBar)_scrollbar).Scroll(percentage);
			}
		}

		public class MenuCollection
		{
			public Dictionary<string, IMenuItem> items = new Dictionary<string, IMenuItem>();

			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>();


			public void Draw()
			{
				foreach (KeyValuePair<string, IMenuItem> item in items)
				{
					LoggingPlugin.LogTrace("Drawing Menu " + item.Value.id);
					item.Value.Draw(0, 0);
				}
			}
		}

		public class MenuBadge : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger
			{
				get
				{
					return null;
				}
				set
				{
					throw new NotSupportedException();
				}
			}

			public MenuBadge(string id, int x, int y, float width, float height, float size, string textureName, string selectedTextureName, string selectionInfo, string text, Color? textColor, Color? selectedTextColor, Color? backColor, Color? selectedBackColor, Action<string, string> callback, Action<string, string, int, int> mouseOverCallback)
			{
				//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_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				string text2 = this.id + ".icon";
				Rect val = position;
				int x2 = (int)((Rect)(ref val)).x;
				val = position;
				IMenuItem menuItem = new MenuTexture(text2, x2, (int)((Rect)(ref val)).y, width, height, textureName, selectedTextureName, selectionInfo, callback, mouseOverCallback);
				string text3 = this.id + ".label";
				val = position;
				int x3 = (int)((Rect)(ref val)).x;
				val = position;
				IMenuItem menuItem2 = new MenuLabel(text3, x3, (int)((Rect)(ref val)).y + (int)height, width, 23f, size, text, textColor, backColor, callback);
				children.Add(menuItem.id, menuItem);
				children.Add(menuItem2.id, menuItem2);
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				string[] obj = new string[6] { "Drawing Badge ", id, ". Position: ", null, null, null };
				Rect val = position;
				obj[3] = ((Rect)(ref val)).x.ToString();
				obj[4] = ",";
				val = position;
				obj[5] = ((Rect)(ref val)).y.ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuLabel : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public MenuLabel(string id, int x, int y, float width, float height, float fontSize, string text, Color? textColor, Color? backColor, Action<string, string> callback)
			{
				//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_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				properties["fontSize"] = ((fontSize != 0f) ? fontSize.ToString() : "<Default>");
				properties["text"] = text;
				properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : "<Default>");
				properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : "<Default>");
				Trigger = callback;
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: 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_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_017c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0201: Unknown result type (might be due to invalid IL or missing references)
				//IL_020f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0214: Unknown result type (might be due to invalid IL or missing references)
				//IL_021e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0223: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				GUIStyle val = new GUIStyle(GUI.skin.label);
				Color black = default(Color);
				if (properties["fontColor"] != "<Default>")
				{
					black = Color.black;
					val.active.background = Helpers.MakeTexture(Color.clear);
					val.normal.background = Helpers.MakeTexture(Color.clear);
					ColorUtility.TryParseHtmlString(properties["fontColor"], ref black);
					val.active.textColor = black;
					val.normal.textColor = black;
					LoggingPlugin.LogTrace(id + ": Using Text Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				if (properties["backColor"] != "<Default>")
				{
					ColorUtility.TryParseHtmlString(properties["backColor"], ref black);
					val.active.background = Helpers.MakeTexture(black);
					val.normal.background = Helpers.MakeTexture(black);
					LoggingPlugin.LogTrace(id + ": Using Back Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				string[] obj = new string[10] { "Drawing Menu Entry ", id, ". Position: ", null, null, null, null, null, null, null };
				Rect val2 = position;
				obj[3] = ((Rect)(ref val2)).x.ToString();
				obj[4] = ",";
				val2 = position;
				obj[5] = ((Rect)(ref val2)).y.ToString();
				obj[6] = ", Size: ";
				val2 = position;
				obj[7] = ((Rect)(ref val2)).width.ToString();
				obj[8] = "x";
				val2 = position;
				obj[9] = ((Rect)(ref val2)).height.ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				val2 = position;
				float num = ((Rect)(ref val2)).x + (float)canvas_x;
				val2 = position;
				float num2 = ((Rect)(ref val2)).y + (float)canvas_y;
				val2 = position;
				float width = ((Rect)(ref val2)).width;
				val2 = position;
				Rect val3 = default(Rect);
				((Rect)(ref val3))..ctor(num, num2, width, ((Rect)(ref val2)).height);
				GUI.Label(val3, properties["text"], val);
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuSelectableText : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public MenuSelectableText(string id, int x, int y, float width, float height, float fontSize, string text, string selectionInfo, Color? textColor, Color? selectedTextColor, Color? backColor, Color? selectedBackColor, Color? fillColor, Color? selectedFillColor, Action<string, string> callback)
			{
				//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_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				string text2 = this.id + ".Marker";
				Rect val = position;
				int x2 = (int)((Rect)(ref val)).x;
				val = position;
				IMenuItem menuItem = new MenuRectangle(text2, x2, (int)((Rect)(ref val)).y, 10f, 30f, selectionInfo, fillColor, selectedFillColor, null);
				children.Add(menuItem.id, menuItem);
				string text3 = this.id + ".Text";
				val = position;
				int x3 = (int)((Rect)(ref val)).x + 10;
				val = position;
				IMenuItem menuItem2 = new MenuText(text3, x3, (int)((Rect)(ref val)).y, width - 10f, height, fontSize, text, selectionInfo, textColor, selectedTextColor, backColor, selectedBackColor, callback);
				children.Add(menuItem2.id, menuItem2);
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuText : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public MenuText(string id, int x, int y, float width, float height, float fontSize, string text, string selectionInfo, Color? textColor, Color? selectedTextColor, Color? backColor, Color? selectedBackColor, Action<string, string> callback)
			{
				//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_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				properties["fontSize"] = ((fontSize != 0f) ? fontSize.ToString() : "<Default>");
				properties["text"] = text;
				properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : "<Default>");
				properties["selectedColor"] = (selectedTextColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedTextColor.Value)) : "<Default>");
				properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : "<Default>");
				properties["selectedBackColor"] = (selectedBackColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedBackColor.Value)) : "<Default>");
				properties["selectionInfo"] = selectionInfo;
				Trigger = callback;
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_009c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0211: Unknown result type (might be due to invalid IL or missing references)
				//IL_0216: Unknown result type (might be due to invalid IL or missing references)
				//IL_0236: Unknown result type (might be due to invalid IL or missing references)
				//IL_023b: Unknown result type (might be due to invalid IL or missing references)
				//IL_025c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0261: Unknown result type (might be due to invalid IL or missing references)
				//IL_026f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_0282: Unknown result type (might be due to invalid IL or missing references)
				//IL_0287: Unknown result type (might be due to invalid IL or missing references)
				//IL_0291: Unknown result type (might be due to invalid IL or missing references)
				//IL_0296: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				GUIStyle val = new GUIStyle(GUI.skin.button);
				if (properties["backColor"] != "<Default>" && properties["selectedBackColor"] != "<Default>")
				{
					Color black = Color.black;
					ColorUtility.TryParseHtmlString(active ? properties["selectedBackColor"] : properties["backColor"], ref black);
					val.active.background = Helpers.MakeTexture(black);
					val.normal.background = Helpers.MakeTexture(black);
					LoggingPlugin.LogTrace(id + ": Using Background Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				if (properties["fontColor"] != "<Default>" && properties["selectedColor"] != "<Default>")
				{
					Color black = Color.black;
					ColorUtility.TryParseHtmlString(active ? properties["selectedColor"] : properties["fontColor"], ref black);
					val.active.textColor = black;
					val.normal.textColor = black;
					LoggingPlugin.LogTrace(id + ": Using Text Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				val.alignment = (TextAnchor)3;
				val.fontStyle = (FontStyle)1;
				string[] obj = new string[14]
				{
					"Drawing Menu Text ", id, ". Position: ", null, null, null, null, null, null, null,
					null, null, null, null
				};
				Rect val2 = position;
				obj[3] = ((Rect)(ref val2)).x.ToString();
				obj[4] = ",";
				val2 = position;
				obj[5] = ((Rect)(ref val2)).y.ToString();
				obj[6] = " + ";
				obj[7] = canvas_x.ToString();
				obj[8] = ",";
				obj[9] = canvas_y.ToString();
				obj[10] = ", Size: ";
				val2 = position;
				obj[11] = ((Rect)(ref val2)).width.ToString();
				obj[12] = "x";
				val2 = position;
				obj[13] = ((Rect)(ref val2)).height.ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				val2 = position;
				float num = ((Rect)(ref val2)).x + (float)canvas_x;
				val2 = position;
				float num2 = ((Rect)(ref val2)).y + (float)canvas_y;
				val2 = position;
				float width = ((Rect)(ref val2)).width;
				val2 = position;
				Rect val3 = default(Rect);
				((Rect)(ref val3))..ctor(num, num2, width, ((Rect)(ref val2)).height);
				if (GUI.Button(val3, properties["text"], val) && Trigger != null)
				{
					Trigger(id, properties["selectionInfo"]);
				}
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuRectangle : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public MenuRectangle(string id, int x, int y, float width, float height, string selectionInfo, Color? fillColor, Color? selectedFillColor, Action<string, string> callback)
			{
				//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_0051: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				properties["fillColor"] = (fillColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(fillColor.Value)) : "<Default>");
				properties["selectedFillColor"] = (selectedFillColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedFillColor.Value)) : "<Default>");
				properties["selectionInfo"] = selectionInfo;
				Trigger = callback;
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_016b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0179: Unknown result type (might be due to invalid IL or missing references)
				//IL_017e: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0191: Unknown result type (might be due to invalid IL or missing references)
				//IL_019b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				GUIStyle val = new GUIStyle(GUI.skin.button);
				if (properties["fillColor"] != "<Default>" && properties["selectedFillColor"] != "<Default>")
				{
					Color black = Color.black;
					ColorUtility.TryParseHtmlString(active ? properties["selectedFillColor"] : properties["fillColor"], ref black);
					val.normal.background = Helpers.MakeTexture(black);
					LoggingPlugin.LogTrace(id + ": Using Fill Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				string[] obj = new string[10] { "Drawing Rectangle ", id, ". Position: ", null, null, null, null, null, null, null };
				Rect val2 = position;
				obj[3] = ((Rect)(ref val2)).x.ToString();
				obj[4] = ",";
				val2 = position;
				obj[5] = ((Rect)(ref val2)).y.ToString();
				obj[6] = ", Size: ";
				val2 = position;
				obj[7] = ((Rect)(ref val2)).width.ToString();
				obj[8] = "x";
				val2 = position;
				obj[9] = ((Rect)(ref val2)).height.ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				val2 = position;
				float num = ((Rect)(ref val2)).x + (float)canvas_x;
				val2 = position;
				float num2 = ((Rect)(ref val2)).y + (float)canvas_y;
				val2 = position;
				float width = ((Rect)(ref val2)).width;
				val2 = position;
				Rect val3 = default(Rect);
				((Rect)(ref val3))..ctor(num, num2, width, ((Rect)(ref val2)).height);
				if (GUI.Button(val3, "", val) && Trigger != null)
				{
					Trigger(id, properties["selectionInfo"]);
				}
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuTextInput : IMenuItem
		{
			private string _inputText = string.Empty;

			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public MenuTextInput(string id, int x, int y, float width, float height, float fontSize, string text, Color? textColor, Color? backColor, Action<string, string> callback)
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				properties["fontSize"] = ((fontSize != 0f) ? fontSize.ToString() : "<Default>");
				_inputText = text;
				properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : "<Default>");
				properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : "<Default>");
				Trigger = callback;
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: 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_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_013e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0143: Unknown result type (might be due to invalid IL or missing references)
				//IL_0161: Unknown result type (might be due to invalid IL or missing references)
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Unknown result type (might be due to invalid IL or missing references)
				//IL_0207: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_021a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0228: 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_0237: Unknown result type (might be due to invalid IL or missing references)
				//IL_023c: Unknown result type (might be due to invalid IL or missing references)
				//IL_024a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				GUIStyle val = new GUIStyle(GUI.skin.textField);
				if (properties["backColor"] != "<Default>")
				{
					Color black = Color.black;
					ColorUtility.TryParseHtmlString(properties["backColor"], ref black);
					val.active.background = Helpers.MakeTexture(black);
					val.normal.background = Helpers.MakeTexture(black);
					LoggingPlugin.LogTrace(id + ": Using Background Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				if (properties["fontColor"] != "<Default>")
				{
					Color black = Color.black;
					ColorUtility.TryParseHtmlString(properties["fontColor"], ref black);
					val.active.textColor = black;
					val.normal.textColor = black;
					LoggingPlugin.LogTrace(id + ": Using Text Color: " + ColorUtility.ToHtmlStringRGBA(black));
				}
				val.alignment = (TextAnchor)3;
				val.fontStyle = (FontStyle)1;
				string[] obj = new string[14]
				{
					"Drawing Menu Text Input ", id, ". Position: ", null, null, null, null, null, null, null,
					null, null, null, null
				};
				Rect val2 = position;
				obj[3] = ((Rect)(ref val2)).x.ToString();
				obj[4] = ",";
				val2 = position;
				obj[5] = ((Rect)(ref val2)).y.ToString();
				obj[6] = " + ";
				obj[7] = canvas_x.ToString();
				obj[8] = ",";
				obj[9] = canvas_y.ToString();
				obj[10] = ", Size: ";
				val2 = position;
				obj[11] = ((Rect)(ref val2)).width.ToString();
				obj[12] = "x";
				val2 = position;
				obj[13] = ((Rect)(ref val2)).height.ToString();
				LoggingPlugin.LogTrace(string.Concat(obj));
				GUI.SetNextControlName(id);
				val2 = position;
				float num = ((Rect)(ref val2)).x + (float)canvas_x;
				val2 = position;
				float num2 = ((Rect)(ref val2)).y + (float)canvas_y;
				val2 = position;
				float width = ((Rect)(ref val2)).width;
				val2 = position;
				Rect val3 = default(Rect);
				((Rect)(ref val3))..ctor(num, num2, width, ((Rect)(ref val2)).height);
				string text = GUI.TextField(val3, _inputText, val);
				if (_inputText != text)
				{
					_inputText = text;
					Trigger(id, text);
				}
				foreach (IMenuItem value in children.Values)
				{
					value.Draw(canvas_x, canvas_y, active);
				}
			}
		}

		public class MenuTexture : IMenuItem
		{
			public string id { get; set; } = "";


			public Rect position { get; set; } = Rect.zero;


			public Dictionary<string, string> properties { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);


			public Dictionary<string, IMenuItem> children { get; set; } = new Dictionary<string, IMenuItem>();


			public Action<string, string> Trigger { get; set; } = null;


			public Action<string, string, int, int> MouseOver { get; set; } = null;


			private string _mouseOverName { get; set; } = "";


			public MenuTexture(string id, int x, int y, float width, float height, string textureName, string selectedTextureName, string selectionInfo, Action<string, string> callback, Action<string, string, int, int> mouseOverCallback = null)
			{
				//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_0063: Unknown result type (might be due to invalid IL or missing references)
				this.id = id;
				position = new Rect((float)x, (float)y, width, height);
				properties["textureName"] = textureName;
				properties["selectedTextureName"] = selectedTextureName;
				properties["selectionInfo"] = selectionInfo;
				Trigger = callback;
				Trigger = callback;
				MouseOver = mouseOverCallback;
			}

			public void Draw(int canvas_x, int canvas_y, bool active = false)
			{
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: 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_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Unknown result type (might be due