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 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 © 2026")] [assembly: AssemblyTrademark("CommonCustomsMenu")] [assembly: ComVisible(false)] [assembly: Guid("c303405d-e66c-4316-9cdb-4e3ca15c6360")] [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.3.0.0")] namespace LordAshes; [BepInPlugin("org.lordashes.plugins.commoncustomsmenu", "Common Customs Menu Plugin", "1.3.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 assets; public Action <>9__2; internal void 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 assets; public Action <>9__4; internal void 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 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 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 b__4(string id, string value, int x, int y) { if (value != "") { _self.menus.properties["info"] = " NAME: " + asset.name + ", TYPE: " + asset.kind + ", CLASS: " + asset.header + ", GROUP: " + asset.groupName + ", VERSION: " + ((asset.version != "") ? asset.version : "Unversioned") + ", AUTHOR: " + ((asset.author != "") ? asset.author : "Uncredited") + ", PACK: " + asset.pack + ", ITEM: " + Path.GetFileNameWithoutExtension(asset.prefab) + ", ANIMATED: " + asset.hasAnimations + ", AUDIO: " + asset.hasAudio + ", MORPHS: " + asset.hasBlendshapes + ""; } else { _self.menus.properties["info"] = ""; } } } [CompilerGenerated] private sealed class <>c__DisplayClass3_0 { public MenuCollection menus; public Dictionary assets; internal void b__0(string id, string text) { _self.menus.items["Filter"].properties["group"] = text; ((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets)); } internal void b__1(string id, string text) { _self.menus.items["Filter"].properties["group"] = text; ((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets)); } internal void b__2(string id, string text) { _self.menus.items["Filter"].properties["group"] = text; ((MonoBehaviour)_self).StartCoroutine(BuildGroupsMenu(menus, assets)); } internal void 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 assets; internal void 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 d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Dictionary results; public string providerName; private string 5__1; private Dictionary.Enumerator <>s__2; private KeyValuePair 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>s__2 = default(Dictionary.Enumerator); 5__3 = default(KeyValuePair); <>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()) { 5__3 = <>s__2.Current; if (!_self.assets.ContainsKey(5__3.Key)) { _self.assets.Add(5__3.Key, 5__3.Value); } 5__3 = default(KeyValuePair); } } finally { ((IDisposable)<>s__2).Dispose(); } <>s__2 = default(Dictionary.Enumerator); _self.resposes++; LoggingPlugin.LogTrace("Writing Registered Assets File"); 5__1 = Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/org.lordashes.plugins.commoncustomsmenu.assets.json"; File.WriteAllText(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(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 d__2 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public MenuCollection menus; public Dictionary assets; private <>c__DisplayClass2_0 <>8__1; private Dictionary 5__2; private List 5__3; private string 5__4; private int 5__5; private int 5__6; private int 5__7; private float 5__8; private int 5__9; private Menu 5__10; private List.Enumerator <>s__11; private <>c__DisplayClass2_1 <>8__12; private IMenuItem 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__10 = null; <>s__11 = default(List.Enumerator); <>8__12 = null; 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 + "'"); 5__2 = new Dictionary(); 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 (5__3.Count() <= 0) { goto IL_08f7; } 5__4 = ((!_self.menus.items.ContainsKey("Content")) ? "closed" : (_self.menus.items["Content"].properties.ContainsKey("status") ? _self.menus.items["Content"].properties["status"] : "closed")); 5__5 = 0; 5__6 = 0; 5__7 = (int)(990f / (float)_self.assetBadgesPerRow.Value); LoggingPlugin.LogTrace("Badge Size = 100 x 11 / " + _self.assetBadgesPerRow.Value + " = " + 5__7); 5__8 = 4f + Math.Min(12f, 132f / (float)_self.assetBadgesPerRow.Value); LoggingPlugin.LogTrace("Badge Text = 6 + 10 x 11 / " + _self.assetBadgesPerRow.Value + " = " + 5__8); <>s__11 = 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); 5__13 = new MenuBadge("Kind." + <>8__1.kind + ".Group." + <>8__1.group + ".Asset." + <>8__12.asset.prefab, 5__5 * (5__7 + 10), 5__6 * (5__7 + 35), 5__7, 5__7, 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(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"] = " NAME: " + <>8__12.asset.name + ", TYPE: " + <>8__12.asset.kind + ", CLASS: " + <>8__12.asset.header + ", GROUP: " + <>8__12.asset.groupName + ", VERSION: " + ((<>8__12.asset.version != "") ? <>8__12.asset.version : "Unversioned") + ", AUTHOR: " + ((<>8__12.asset.author != "") ? <>8__12.asset.author : "Uncredited") + ", PACK: " + <>8__12.asset.pack + ", ITEM: " + Path.GetFileNameWithoutExtension(<>8__12.asset.prefab) + ", ANIMATED: " + <>8__12.asset.hasAnimations + ", AUDIO: " + <>8__12.asset.hasAudio + ", MORPHS: " + <>8__12.asset.hasBlendshapes + ""; } else { _self.menus.properties["info"] = ""; } }); if (!5__2.ContainsKey(5__13.id)) { 5__2.Add(5__13.id, 5__13); } 5__5++; if (5__5 >= _self.assetBadgesPerRow.Value) { 5__5 = 0; 5__6++; } 5__13 = null; <>8__12 = null; } } finally { ((IDisposable)<>s__11).Dispose(); } <>s__11 = default(List.Enumerator); 5__9 = (int)Math.Ceiling((decimal)5__2.Count / (decimal)_self.assetBadgesPerRow.Value); 5__10 = new Menu("Content", 420, 780, 1255, 270, 1250, 5__9 * (5__7 + 35)); 5__10.properties["backColor"] = "000000DD"; 5__10.properties["status"] = 5__4; 5__10.children = 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(5__10.id)) { menus.items[5__10.id] = 5__10; } else { menus.items.Add(5__10.id, 5__10); } _self.guiSafe = ""; 5__4 = null; 5__10 = null; goto IL_08f7; IL_090d: return false; IL_08f7: <>8__1 = null; 5__2 = null; 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 d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public MenuCollection menus; public Dictionary assets; private <>c__DisplayClass4_0 <>8__1; private Dictionary 5__2; private int 5__3; private IMenuItem 5__4; private Menu 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__4 = null; 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"); 5__2 = new Dictionary(); 5__3 = (int)(((float)_self.assetBadgesPerRow.Value - 4f) * 320f / 22f); LoggingPlugin.LogTrace("ScrollPosition translates " + _self.assetBadgesPerRow.Value + " to " + 5__3); 5__4 = new ScrollBar("BadgeSize.ScrollBar", 0, 0, 320f, 30f, 16f, 0f, 320 - 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)); }); 5__2.Add(5__4.id, 5__4); 5__5 = new Menu("BadgeSizer", 800, 750, 320, 30, 320, 30); 5__5.properties["backColor"] = "000000DD"; 5__5.children = 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(5__5.id)) { <>8__1.menus.items[5__5.id] = 5__5; } else { <>8__1.menus.items.Add(5__5.id, 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 d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public MenuCollection menus; public Dictionary assets; private <>c__DisplayClass3_0 <>8__1; private Dictionary 5__2; private IMenuItem 5__3; private IMenuItem 5__4; private IMenuItem 5__5; private IMenuItem 5__6; private string 5__7; private Menu 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 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"); 5__2 = new Dictionary(); 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)); }); 5__2.Add(5__3.id, 5__3); 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)); }); 5__2.Add(5__4.id, 5__4); 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)); }); 5__2.Add(5__5.id, 5__5); 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)); }); 5__2.Add(5__6.id, 5__6); 5__7 = ((!_self.menus.items.ContainsKey("Filter")) ? "closed" : (_self.menus.items["Filter"].properties.ContainsKey("status") ? _self.menus.items["Filter"].properties["status"] : "closed")); 5__8 = new Menu("Filter", 1675, 780, 245, 270, 235, 270); 5__8.properties["backColor"] = "000000DD"; 5__8.properties["status"] = 5__7; 5__8.children = 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(5__8.id)) { <>8__1.menus.items[5__8.id] = 5__8; } else { <>8__1.menus.items.Add(5__8.id, 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 d__1 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public MenuCollection menus; public Dictionary assets; private <>c__DisplayClass1_0 <>8__1; private <>c__DisplayClass1_1 <>8__2; private Dictionary 5__3; private Listf__AnonymousType0> 5__4; private string 5__5; private int 5__6; private int 5__7; private string 5__8; private Menu 5__9; private Listf__AnonymousType0>.Enumerator <>s__10; private global::<>f__AnonymousType0 5__11; private IMenuItem 5__12; private IMenuItem
5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>8__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__8 = null; 5__9 = null; <>s__10 = default(Listf__AnonymousType0>.Enumerator); 5__11 = null; 5__12 = null;
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 + "'"); 5__3 = new Dictionary(); 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 (5__4.Count() <= 0) { goto IL_0881; } 5__5 = ((!_self.menus.items.ContainsKey("Group")) ? "closed" : (_self.menus.items["Group"].properties.ContainsKey("status") ? _self.menus.items["Group"].properties["status"] : "closed")); 5__6 = 0; 5__7 = 0; 5__8 = ""; <>s__10 = 5__4.GetEnumerator(); try { while (<>s__10.MoveNext()) { 5__11 = <>s__10.Current; if (5__11.header != 5__8) { LoggingPlugin.LogTrace("Creating Header " + 5__11.header); 5__8 = 5__11.header;
5__13 = new MenuText("Header." + 5__11.header, 0, 5__7 * 35, 300f, 30f, 16f, 5__11.header.ToUpper(), 5__11.header, Helpers.MakeColor("E25508"), Helpers.MakeColor("E25508"), Helpers.MakeColor("222222"), Helpers.MakeColor("222222"), null); if (!5__3.ContainsKey(
5__13.id)) { 5__3.Add(
5__13.id,
5__13); } 5__7++;
5__13 = null; } LoggingPlugin.LogTrace("Creating Group " + 5__11.groupName); 5__12 = new MenuSelectableText("Header." + 5__11.header + ".Group." + 5__11.groupName, 0, 5__7 * 35, 300f, 30f, 16f, 5__11.groupName, 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 (!5__3.ContainsKey(5__12.id)) { 5__3.Add(5__12.id, 5__12); } 5__7++; 5__12 = null; 5__11 = null; } } finally { ((IDisposable)<>s__10).Dispose(); } <>s__10 = default(Listf__AnonymousType0>.Enumerator); 5__9 = new Menu("Group", 80, 780, 320, 270, 300, 35 * 5__3.Count); 5__9.properties["backColor"] = "000000DD"; 5__9.properties["status"] = 5__5; 5__9.children = 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(5__9.id)) { <>8__1.menus.items[5__9.id] = 5__9; } else { <>8__1.menus.items.Add(5__9.id, 5__9); } _self.guiSafe = ""; LoggingPlugin.LogTrace("Triggering Group Menu For Kind '" + <>8__2.kind + "' Selection"); if (<>8__1.menus.items[5__9.id].children.Count > 0) { <>8__1.menus.items[5__9.id].children.ElementAt(1).Value.children.ElementAt(1).Value.Trigger(<>8__1.menus.items[5__9.id].children.ElementAt(1).Value.children.ElementAt(1).Value.id, ""); } 5__5 = null; 5__8 = null; 5__9 = null; goto IL_0881; IL_0897: return false; IL_0881: <>8__2 = null; 5__3 = null; 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 d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public MenuCollection menus; public Dictionary assets; private <>c__DisplayClass0_0 <>8__1; private Dictionary 5__2; private IEnumerable 5__3; private string 5__4; private int 5__5; private int 5__6; private Menu 5__7; private IEnumerator <>s__8; private string 5__9; private IMenuItem 5__10; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__7 = null; <>s__8 = null; 5__9 = null; 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)"); 5__2 = new Dictionary(); 5__3 = from kind in <>8__1.assets.Values.Select((AssetInfo asset) => asset.category).Distinct() orderby kind select kind; if (5__3.Count() <= 0) { goto IL_04ed; } 5__4 = ((!_self.menus.items.ContainsKey("Kind")) ? "closed" : (_self.menus.items["Kind"].properties.ContainsKey("status") ? _self.menus.items["Kind"].properties["status"] : "closed")); 5__5 = 0; 5__6 = 0; <>s__8 = 5__3.GetEnumerator(); try { while (<>s__8.MoveNext()) { 5__9 = <>s__8.Current; LoggingPlugin.LogTrace("Creating Icon For " + 5__9); 5__10 = new MenuTexture("Kind." + 5__9, 0, 5__6 * 35, 32f, 32f, "Kind." + 5__9 + ".png", "Kind." + 5__9 + ".Selected.png", 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"] = " TYPE: " + val + " "; }); if (!5__2.ContainsKey(5__10.id)) { 5__2.Add(5__10.id, 5__10); } 5__6++; 5__10 = null; 5__9 = null; } } finally { if (<>s__8 != null) { <>s__8.Dispose(); } } <>s__8 = null; 5__7 = new Menu("Kind", 10, 780, 55, 270, 55, 35 * 5__2.Count); 5__7.properties["backColor"] = "000000DD"; 5__7.properties["status"] = 5__4; 5__7.children = 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(5__7.id)) { <>8__1.menus.items[5__7.id] = 5__7; } else { <>8__1.menus.items.Add(5__7.id, 5__7); } _self.guiSafe = ""; LoggingPlugin.LogTrace("Triggering Kind Menu Selection"); <>8__1.menus.items[5__7.id].children.ElementAt(0).Value.Trigger(<>8__1.menus.items[5__7.id].children.ElementAt(0).Value.id, ""); 5__4 = null; 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(d__0))] public static IEnumerator BuildKindsMenu(MenuCollection menus, Dictionary assets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { menus = menus, assets = assets }; } [IteratorStateMachine(typeof(d__1))] public static IEnumerator BuildGroupsMenu(MenuCollection menus, Dictionary assets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { menus = menus, assets = assets }; } [IteratorStateMachine(typeof(d__2))] public static IEnumerator BuildAssetsMenu(MenuCollection menus, Dictionary assets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { menus = menus, assets = assets }; } [IteratorStateMachine(typeof(d__3))] public static IEnumerator BuildFiltersMenu(MenuCollection menus, Dictionary assets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { menus = menus, assets = assets }; } [IteratorStateMachine(typeof(d__4))] public static IEnumerator BuildBadgeSizer(MenuCollection menus, Dictionary assets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { menus = menus, assets = assets }; } public static Dictionary RegisterAssets() { string text = Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/org.lordashes.plugins.commoncustomsmenu.assets.json"; Dictionary dictionary = new Dictionary(); if (File.Exists(text)) { string text2 = File.ReadAllText(text, (CacheType)999); LoggingPlugin.LogDebug("Registered Assets Loaded"); dictionary = JsonConvert.DeserializeObject>(text2); } else { LoggingPlugin.LogDebug("No Registered Assets File"); } LoggingPlugin.LogDebug("Found " + dictionary.Keys.Count + " Registered Assets"); foreach (KeyValuePair provider in _self.providers) { try { LoggingPlugin.LogDebug("Consulting Provider " + provider.Key + " For Assets"); ((MonoBehaviour)_self).StartCoroutine(provider.Value.GetNewAssets(new ReadOnlyDictionary(dictionary), AssetsUpdate)); } catch { } } return dictionary; } [IteratorStateMachine(typeof(d__6))] public static IEnumerator AssetsUpdate(Dictionary results, string providerName = "Unknown") { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { results = results, providerName = providerName }; } private static void ApplyRewriter(string rewriterFile, ref Dictionary assets) { LoggingPlugin.LogDebug("Processing Rewrites"); Dictionary dictionary = new Dictionary(); try { string text = File.ReadAllText(rewriterFile, (CacheType)999); dictionary = JsonConvert.DeserializeObject>(text); } catch { } LoggingPlugin.LogTrace("Rewrites Has " + dictionary.Count + " Clauses"); foreach (KeyValuePair 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 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 properties { get; set; } Dictionary children { get; set; } Action 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 properties { get; set; } = new Dictionary(); public Dictionary children { get; set; } = new Dictionary(); public Action 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_0cdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0d08: Unknown result type (might be due to invalid IL or missing references) //IL_0d0d: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Unknown result type (might be due to invalid IL or missing references) //IL_0d39: Unknown result type (might be due to invalid IL or missing references) //IL_0d49: Unknown result type (might be due to invalid IL or missing references) //IL_0d4e: Unknown result type (might be due to invalid IL or missing references) //IL_0d65: Unknown result type (might be due to invalid IL or missing references) //IL_0d6a: Unknown result type (might be due to invalid IL or missing references) //IL_0d8b: Unknown result type (might be due to invalid IL or missing references) //IL_0d90: Unknown result type (might be due to invalid IL or missing references) //IL_0db1: Unknown result type (might be due to invalid IL or missing references) //IL_0db6: Unknown result type (might be due to invalid IL or missing references) //IL_0dc0: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: 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_0ec3: Unknown result type (might be due to invalid IL or missing references) //IL_0ec8: 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_0f04: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f6d: Unknown result type (might be due to invalid IL or missing references) //IL_0f72: Unknown result type (might be due to invalid IL or missing references) //IL_0f90: Unknown result type (might be due to invalid IL or missing references) //IL_0f95: Unknown result type (might be due to invalid IL or missing references) //IL_0fb3: Unknown result type (might be due to invalid IL or missing references) //IL_0fb8: Unknown result type (might be due to invalid IL or missing references) //IL_0fd6: Unknown result type (might be due to invalid IL or missing references) //IL_0fdb: Unknown result type (might be due to invalid IL or missing references) //IL_0ffa: Unknown result type (might be due to invalid IL or missing references) //IL_0fff: Unknown result type (might be due to invalid IL or missing references) //IL_1009: Unknown result type (might be due to invalid IL or missing references) //IL_100e: Unknown result type (might be due to invalid IL or missing references) //IL_102f: Unknown result type (might be due to invalid IL or missing references) //IL_1034: Unknown result type (might be due to invalid IL or missing references) //IL_103e: Unknown result type (might be due to invalid IL or missing references) //IL_1043: Unknown result type (might be due to invalid IL or missing references) //IL_1062: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056a: 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_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: 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_0604: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_093a: Unknown result type (might be due to invalid IL or missing references) //IL_093f: Unknown result type (might be due to invalid IL or missing references) //IL_0973: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) 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"; } if (menuViewPort > -1) { if (properties.ContainsKey("status") && properties["status"] == "closing") { LoggingPlugin.LogTrace("Viewport Override: Setting closed state"); properties["animationStep"] = "0"; properties["animationOffsetX"] = "0"; properties["animationOffsetY"] = "0"; properties["status"] = "closed"; } if (properties.ContainsKey("status") && properties["status"] == "opening") { LoggingPlugin.LogTrace("Viewport Override: Setting opened state"); properties["animationStep"] = "0"; properties["animationOffsetX"] = "0"; properties["animationOffsetY"] = "0"; properties["status"] = "opened"; } } 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(); LoggingPlugin.LogTrace("Updated OX = " + properties["animationOffsetX"]); } else if (int.Parse(properties["animationOffsetY"]) != 0) { properties["animationOffsetY"] = (int.Parse(properties["animationOffsetY"]) + int.Parse(properties["animationStep"])).ToString(); LoggingPlugin.LogTrace("Updated OY = " + properties["animationOffsetY"]); } if (properties.ContainsKey("status") && properties["status"] == "closing") { LoggingPlugin.LogTrace("Menu Closing"); if (int.Parse(properties["animationOffsetX"]) < 0) { LoggingPlugin.LogTrace("Menu Animation X < 0"); string text = int.Parse(properties["animationOffsetX"]).ToString(); val5 = position; LoggingPlugin.LogTrace(text + " 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) { LoggingPlugin.LogTrace("Menu Animation X > 0"); string text2 = int.Parse(properties["animationOffsetX"]).ToString(); val5 = position; LoggingPlugin.LogTrace(text2 + " >?= " + ((Rect)(ref val5)).width); 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 dictionary2 = properties; val5 = position; dictionary2["animationOffsetX"] = ((Rect)(ref val5)).width.ToString(); properties["animationOffsetY"] = "0"; properties["status"] = "closed"; } } else if (int.Parse(properties["animationOffsetY"]) < 0) { LoggingPlugin.LogTrace("Menu Animation Y < 0"); string text3 = int.Parse(properties["animationOffsetY"]).ToString(); val5 = position; LoggingPlugin.LogTrace(text3 + " dictionary3 = properties; val5 = position; dictionary3["animationOffsetY"] = (-1f * ((Rect)(ref val5)).height).ToString(); properties["status"] = "closed"; } } else if (int.Parse(properties["animationOffsetY"]) > 0) { LoggingPlugin.LogTrace("Menu Animation Y > 0"); string text4 = int.Parse(properties["animationOffsetY"]).ToString(); val5 = position; LoggingPlugin.LogTrace(text4 + " >?= " + ((Rect)(ref val5)).height); 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 dictionary4 = properties; val5 = position; dictionary4["animationOffsetY"] = ((Rect)(ref val5)).height.ToString(); properties["status"] = "closed"; } } } else if (properties.ContainsKey("status") && properties["status"] == "opening") { LoggingPlugin.LogTrace("Menu Opening"); if (int.Parse(properties["animationOffsetX"]) != 0) { LoggingPlugin.LogTrace("Menu Animation X != 0"); LoggingPlugin.LogTrace(Math.Abs(int.Parse(properties["animationOffsetX"])) + " -1) { LoggingPlugin.LogTrace("Viewport Override: Using force ViewPort position"); ((Rect)(ref val7)).y = menuViewPort; } LoggingPlugin.LogTrace("ViewPort: " + ((Rect)(ref val7)).x + "," + ((Rect)(ref val7)).y + " + " + ((Rect)(ref val7)).width + "," + ((Rect)(ref val7)).height + " => " + (((Rect)(ref val7)).x + ((Rect)(ref val7)).width) + "," + (((Rect)(ref val7)).y + ((Rect)(ref val7)).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 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 items = new Dictionary(); public Dictionary properties { get; set; } = new Dictionary(); public void Draw() { foreach (KeyValuePair 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action 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 callback, Action 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action 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 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() : ""); properties["text"] = text; properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : ""); properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : ""); 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"] != "") { 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"] != "") { 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action 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 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action 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 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() : ""); properties["text"] = text; properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : ""); properties["selectedColor"] = (selectedTextColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedTextColor.Value)) : ""); properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : ""); properties["selectedBackColor"] = (selectedBackColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedBackColor.Value)) : ""); 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"] != "" && properties["selectedBackColor"] != "") { 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"] != "" && properties["selectedColor"] != "") { 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action Trigger { get; set; } = null; public MenuRectangle(string id, int x, int y, float width, float height, string selectionInfo, Color? fillColor, Color? selectedFillColor, Action 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)) : ""); properties["selectedFillColor"] = (selectedFillColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(selectedFillColor.Value)) : ""); 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"] != "" && properties["selectedFillColor"] != "") { 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action 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 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() : ""); _inputText = text; properties["fontColor"] = (textColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(textColor.Value)) : ""); properties["backColor"] = (backColor.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(backColor.Value)) : ""); 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"] != "") { 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"] != "") { 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 properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action Trigger { get; set; } = null; public Action 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 callback, Action 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 to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) string[] obj = new string[14] { "Drawing Texture ", id, " (", properties["textureName"], "). Active: ", active.ToString(), ", Position: ", null, null, null, null, null, null, null }; Rect val = position; obj[7] = ((Rect)(ref val)).x.ToString(); obj[8] = ","; val = position; obj[9] = ((Rect)(ref val)).y.ToString(); obj[10] = ", Size: "; val = position; obj[11] = ((Rect)(ref val)).width.ToString(); obj[12] = "x"; val = position; obj[13] = ((Rect)(ref val)).height.ToString(); LoggingPlugin.LogTrace(string.Concat(obj)); val = position; float num = ((Rect)(ref val)).x + (float)canvas_x; val = position; float num2 = ((Rect)(ref val)).y + (float)canvas_y; val = position; float width = ((Rect)(ref val)).width; val = position; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num, num2, width, ((Rect)(ref val)).height); if (GUI.Button(val2, "") && Trigger != null) { Trigger(id, properties["selectionInfo"]); } GUI.DrawTexture(val2, (Texture)(object)(active ? Helpers.GetTexture(properties["selectedTextureName"]) : Helpers.GetTexture(properties["textureName"]))); Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val2)).Contains(mousePosition) && _mouseOverName == "") { _mouseOverName = id; if (MouseOver != null) { MouseOver(id, properties["textureName"], (int)mousePosition.x, (int)mousePosition.y); } } else if (!((Rect)(ref val2)).Contains(mousePosition) && _mouseOverName != "") { _mouseOverName = ""; if (MouseOver != null) { MouseOver(id, "", (int)mousePosition.x, (int)mousePosition.y); } } foreach (IMenuItem value in children.Values) { value.Draw(canvas_x, canvas_y, active); } } } public class ScrollBar : IMenuItem { private float _scrollPosition = 0f; public string id { get; set; } = ""; public Rect position { get; set; } = Rect.zero; public Dictionary properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase); public Dictionary children { get; set; } = new Dictionary(); public Action Trigger { get; set; } = null; public ScrollBar(string id, int x, int y, float width, float height, float size, float min, float value, float max, Color? slider, Color? scrollBar, Action 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_00d1: 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) this.id = id; position = new Rect((float)x, (float)y, width, height); properties["size"] = size.ToString(); properties["min"] = min.ToString(); properties["max"] = max.ToString(); properties["slider"] = (slider.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(slider.Value)) : ""); properties["scrollBar"] = (scrollBar.HasValue ? ("#" + ColorUtility.ToHtmlStringRGBA(scrollBar.Value)) : ""); Trigger = callback; properties["themeApplied"] = "false"; _scrollPosition = value; LoggingPlugin.LogTrace("Creating ScrollBar " + this.id + " With " + min + "<" + value + "<" + max); } public void Draw(int canvas_x, int canvas_y, bool active = false) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0223: 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_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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) float num = 0f; string[] obj = new string[10] { "Drawing ScrollBar ", id, ". Position: ", null, null, null, null, null, null, null }; Rect val = position; obj[3] = ((Rect)(ref val)).x.ToString(); obj[4] = ","; val = position; obj[5] = ((Rect)(ref val)).y.ToString(); obj[6] = ", Size: "; val = position; obj[7] = ((Rect)(ref val)).width.ToString(); obj[8] = "x"; val = position; obj[9] = ((Rect)(ref val)).height.ToString(); LoggingPlugin.LogTrace(string.Concat(obj)); if (properties["themeApplied"] != "true") { if (properties["scrollBar"] != "") { Color black = Color.black; ColorUtility.TryParseHtmlString(properties["scrollBar"], ref black); GUIStyle val2 = new GUIStyle(GUI.skin.verticalScrollbar); val2.normal.background = Helpers.MakeTexture(black); GUI.skin.verticalScrollbar = val2; GUI.skin.horizontalScrollbar = val2; } if (properties["slider"] != "") { Color black2 = Color.black; ColorUtility.TryParseHtmlString(properties["slider"], ref black2); GUIStyle val3 = new GUIStyle(GUI.skin.verticalScrollbarThumb); val3.normal.background = Helpers.MakeTexture(black2); GUI.skin.verticalScrollbarThumb = val3; GUI.skin.horizontalScrollbarThumb = val3; } properties["themeApplied"] = "true"; } val = position; float num2 = ((Rect)(ref val)).x + (float)canvas_x; val = position; float num3 = ((Rect)(ref val)).y + (float)canvas_y; val = position; float width = ((Rect)(ref val)).width; val = position; Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(num2, num3, width, ((Rect)(ref val)).height); val = position; float height = ((Rect)(ref val)).height; val = position; num = ((!(height >= ((Rect)(ref val)).width)) ? GUI.HorizontalScrollbar(val4, _scrollPosition, float.Parse(properties["size"], CultureInfo.InvariantCulture), float.Parse(properties["max"], CultureInfo.InvariantCulture), float.Parse(properties["min"], CultureInfo.InvariantCulture)) : GUI.VerticalScrollbar(val4, _scrollPosition, float.Parse(properties["size"], CultureInfo.InvariantCulture), float.Parse(properties["max"], CultureInfo.InvariantCulture), float.Parse(properties["min"], CultureInfo.InvariantCulture))); if (num != _scrollPosition) { _scrollPosition = num; if (Trigger != null) { Trigger(id, _scrollPosition.ToString()); } LoggingPlugin.LogTrace("ScrollBar " + id + " Scrolled To " + properties["min"] + "<" + num + "<" + properties["max"]); } foreach (IMenuItem value in children.Values) { value.Draw(canvas_x, canvas_y, active); } } public void Scroll(float percentage) { _scrollPosition = percentage * float.Parse(properties["max"]) / 100f; } } } public static class SafeCalls { public static bool InvokeWithSuccessBool(string methodOwner, string method, object[] parameters, object instance = null) { try { Type type = Type.GetType(methodOwner); int num = 0; Exception ex = null; MethodInfo[] array = (from mi in type.GetRuntimeMethods() where mi.Name == method select mi).ToArray(); MethodInfo[] array2 = array; foreach (MethodInfo methodInfo in array2) { try { methodInfo.Invoke(instance, parameters); } catch (Exception ex2) { num++; ex = ex2; } } if (num == array.Length) { return false; } return true; } catch (Exception ex3) { LoggingPlugin.LogWarning("Exception Calling " + methodOwner + "." + method); LoggingPlugin.LogWarning("Exception Details: " + ex3.Message); return false; } } public static void Invoke(string methodOwner, string method, object[] parameters, object instance = null) { try { Type type = Type.GetType(methodOwner); int num = 0; Exception ex = null; MethodInfo[] array = (from mi in type.GetRuntimeMethods() where mi.Name == method select mi).ToArray(); MethodInfo[] array2 = array; foreach (MethodInfo methodInfo in array2) { try { methodInfo.Invoke(instance, parameters); } catch (Exception ex2) { num++; ex = ex2; } } if (num == array.Length) { throw ex; } } catch (Exception ex3) { LoggingPlugin.LogWarning("Exception Calling " + methodOwner + "." + method); LoggingPlugin.LogWarning("Exception Details: " + ex3.Message); } } public static T Invoke(string methodOwner, string method, object[] parameters, object instance = null) { try { Type type = Type.GetType(methodOwner); int num = 0; Exception ex = null; MethodInfo[] array = (from mi in type.GetRuntimeMethods() where mi.Name == method select mi).ToArray(); T val = default(T); MethodInfo[] array2 = array; foreach (MethodInfo methodInfo in array2) { try { return (T)methodInfo.Invoke(instance, parameters); } catch (Exception ex2) { num++; ex = ex2; } } if (num == array.Length) { throw ex; } } catch (Exception ex3) { LoggingPlugin.LogWarning("Exception Calling " + methodOwner + "." + method); LoggingPlugin.LogWarning("Exception Details: " + ex3.Message); } return default(T); } } public static class Utility { private static GameInput gameInputInstance; private static MethodInfo gameInputDisable; private static MethodInfo gameInputEnable; public static bool isBoardLoaded() { return SimpleSingletonBehaviour.HasInstance && SingletonStateMBehaviour>.HasInstance && !BoardSessionManager.IsLoading; } public static float ParseFloat(string value) { return float.Parse(value, CultureInfo.InvariantCulture); } public static GameObject FindInHierarchy(GameObject start, string seekName) { List results = new List(); bool done = false; Traverse(start.transform, seekName, null, single: true, ref results, ref done); return (results.Count > 0) ? results.ElementAt(0) : null; } public static GameObject FindInHierarchyViaPartialName(GameObject start, string seekName) { List results = new List(); bool done = false; Traverse(start.transform, seekName, null, single: true, ref results, ref done, partial: true); return (results.Count > 0) ? results.ElementAt(0) : null; } public static GameObject[] FindAllInHierarchy(GameObject start, string seekName) { List results = new List(); bool done = false; Traverse(start.transform, seekName, null, single: false, ref results, ref done); return results.ToArray(); } public static GameObject[] FindAllInHierarchyViaPartialName(GameObject start, string seekName) { List results = new List(); bool done = false; Traverse(start.transform, seekName, null, single: false, ref results, ref done, partial: true); return results.ToArray(); } public static GameObject FindWithComponentInHierarchy(GameObject start, string seekType) { List results = new List(); bool done = false; Traverse(start.transform, null, seekType, single: true, ref results, ref done); return (results.Count > 0) ? results.ElementAt(0) : null; } public static GameObject[] FindAllWithComponentInHierarchy(GameObject start, string seekType) { List results = new List(); bool done = false; Traverse(start.transform, null, seekType, single: false, ref results, ref done); return results.ToArray(); } public static void Traverse(Transform root, string seekName, string seekType, bool single, ref List results, ref bool done, bool partial = false) { try { if ((seekName == null || seekName == ((Object)((Component)root).gameObject).name || (partial && ((Object)((Component)root).gameObject).name.Contains(seekName))) && (seekType == null || (Object)(object)((Component)root).GetComponent(seekType) != (Object)null)) { LoggingPlugin.LogTrace("Matched '" + ((Object)((Component)root).gameObject).name + "'"); results.Add(((Component)root).gameObject); if (single) { done = true; return; } } foreach (Transform item in ExtensionMethods.Children(root)) { if (!done) { Traverse(item, seekName, seekType, single, ref results, ref done, partial); } } } catch { } } public static object LookUp(in Dictionary dictionary, string key) { foreach (KeyValuePair item in dictionary) { if (item.Key.ToUpper() == key.ToUpper()) { return item.Value; } } return null; } public static void PostOnMainPage(BaseUnityPlugin plugin) { string text = "Lord Ashes" + ("Lord Ashes".ToUpper().EndsWith("S") ? "'" : "'s"); ModdingUtils.AddPluginToMenuList(plugin, text); } public static void GameInputEnabled(bool setting) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown if (gameInputInstance == null || gameInputDisable == null || gameInputEnable == null) { try { gameInputInstance = null; gameInputDisable = null; gameInputEnable = null; ControllerManager val = default(ControllerManager); SimpleSingletonBehaviour.TryGetInstance(ref val); if ((Object)(object)val != (Object)null) { LoggingPlugin.LogDebug("ControllerManager = " + (object)val); gameInputInstance = (GameInput)(from f in typeof(ControllerManager).GetRuntimeFields() where f.Name == "_gameInput" select f).FirstOrDefault().GetValue(val); gameInputDisable = (from m in typeof(GameInput).GetMethods() where m.Name == "Disable" select m).ElementAt(0); gameInputEnable = (from m in typeof(GameInput).GetMethods() where m.Name == "Enable" select m).ElementAt(0); LoggingPlugin.LogDebug("Successfully Obtained References To Game Input"); } else { LoggingPlugin.LogWarning("Unable to obtain ControllerManager instance"); } } catch { LoggingPlugin.LogWarning("Unable To Get Game Input Reference Or Reference To One Of Its Methods"); } } if (gameInputInstance != null || gameInputDisable != null || gameInputEnable != null) { if (setting) { LoggingPlugin.LogDebug("Enabling Game Input"); gameInputEnable.Invoke(gameInputInstance, new object[0]); } else { LoggingPlugin.LogDebug("Disabling Game Input"); gameInputDisable.Invoke(gameInputInstance, new object[0]); } } } } private class Provider { public string description { get; set; } = ""; public Func, Func, string, IEnumerator>, IEnumerator> GetNewAssets { get; set; } = null; public Action<_Internal.CustomsMenu.AssetInfo> SelectionCallback { get; set; } = null; } public enum RewriteScope { off = 0, name = 1, description = 2, tags = 4, pack = 8, prefab = 0x10 } public static class Helpers { private static Dictionary textureCache = new Dictionary(StringComparer.OrdinalIgnoreCase); public static Texture2D GetTexture(string textureName) { if (!textureCache.ContainsKey(textureName)) { if (File.Exists(Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/" + textureName)) { LoggingPlugin.LogTrace("Texture Request '" + textureName + "' From Cache"); textureCache[textureName] = Image.LoadTexture(Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/" + textureName, (CacheType)999); } else if (File.Exists(textureName)) { LoggingPlugin.LogTrace("Texture Request '" + textureName + "' From CustomData"); textureCache[textureName] = Image.LoadTexture(textureName, (CacheType)999); } else { LoggingPlugin.LogTrace("Texture Request '" + textureName + "' From Default"); textureCache[textureName] = Image.LoadTexture("org.lordashes.plugins.commoncustomsmenu.default.png", (CacheType)999); } } return textureCache[textureName]; } public static Color MakeColor(string code) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Color clear = Color.clear; if (code.Substring(0, 1) != "#") { code = "#" + code; } ColorUtility.TryParseHtmlString(code, ref clear); return clear; } public static Texture2D MakeTexture(Color color, int width = 1, int height = 1) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) string key = ColorUtility.ToHtmlStringRGBA(color); if (!textureCache.ContainsKey(key)) { Texture2D val = new Texture2D(width, height); Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < array.Length; i++) { array[i] = color; } val.SetPixels(array); val.Apply(); textureCache.Add(key, val); } return textureCache[key]; } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; public CommonCustomsMenuPlugin <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; LoggingPlugin.LogDebug("Waiting For Asset Providers To Register"); <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; LoggingPlugin.LogDebug("Requesting Providers' Assets"); <>4__this.assets = _Internal.CustomsMenu.RegisterAssets(); LoggingPlugin.LogDebug("Providers' Asset Requests Spawned. Have " + <>4__this.assets.Count + " Already Registered Assets"); break; case 2: <>1__state = -1; break; } if (<>4__this.resposes < <>4__this.providers.Count()) { LoggingPlugin.LogDebug("Waiting On Provider Responses (Got " + <>4__this.resposes + " of " + <>4__this.providers.Count() + ")"); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } LoggingPlugin.LogDebug("Received All Provider Responses (Got " + <>4__this.resposes + " of " + <>4__this.providers.Count() + ")"); LoggingPlugin.LogInfo(<>4__this.assets.Count + " Registered Assets"); SystemMessage.DisplayInfoText("Asset Registration Complete.\r\nYou May Begin.", 2.5f, 0f, (Action)null); initialized = 1; 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 d__27 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public CommonCustomsMenuPlugin <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__27(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } try { DiagnosticLevel logLevel = LoggingPlugin.GetLogLevel(); SystemMessage.DisplayInfoText("Common Customs Menu Plugin: Using '" + ((object)(DiagnosticLevel)(ref logLevel)).ToString() + "' diagnostics.\r\nUse 'Info' for better performance", 10f, 0f, (Action)null); SystemMessage.DisplayInfoText("Common Customs Menu Plugin: Use 'Debug' or 'Trace' for\r\ntroubleshooting only.", 10f, 0f, (Action)null); } catch { goto IL_0074; } return false; IL_0074: <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string Name = "Common Customs Menu Plugin"; public const string Guid = "org.lordashes.plugins.commoncustomsmenu"; public const string Version = "1.3.0.0"; public const string Author = "Lord Ashes"; public static CommonCustomsMenuPlugin _self = null; public static int initialized = 0; private KeyboardShortcut menuToggleTrigger; private ConfigEntry assetBadgesPerRow; private float pluginsRegistrationComplete = 5f; private Dictionary assets = new Dictionary(); public string guiSafe = ""; private Dictionary providers = new Dictionary(); private int resposes = 0; private _Internal.MenuCollection menus = new _Internal.MenuCollection(); private Rect infoBar = new Rect(0f, 1055f, 1920f, 25f); private bool animateOpening = true; private int rewriteScope = 31; private static string registrationMessageSpecs = "60,120,16,30"; private static int menuViewPort = -1; private GUIStyle invisibleButton = null; private void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0197: Invalid comparison between Unknown and I4 //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown _self = this; LoggingPlugin.SetLogLevel(((BaseUnityPlugin)this).Config.Bind("Settings", "Diagnostic Level", (DiagnosticLevel)3, (ConfigDescription)null).Value); string? assemblyQualifiedName = ((object)this).GetType().AssemblyQualifiedName; DiagnosticLevel logLevel = LoggingPlugin.GetLogLevel(); Debug.Log((object)(assemblyQualifiedName + ": Active. (Diagnostic Mode = " + ((object)(DiagnosticLevel)(ref logLevel)).ToString() + ")")); menuToggleTrigger = ((BaseUnityPlugin)this).Config.Bind("Hotkeys", "Menu Toggle Trigger", new KeyboardShortcut((KeyCode)278, Array.Empty()), (ConfigDescription)null).Value; assetBadgesPerRow = ((BaseUnityPlugin)this).Config.Bind("Settings", "Number Of Asset Badges Per Row", 11, (ConfigDescription)null); animateOpening = ((BaseUnityPlugin)this).Config.Bind("Settings", "Animate Opening", true, (ConfigDescription)null).Value; pluginsRegistrationComplete = ((BaseUnityPlugin)this).Config.Bind("Settings", "Plugin Registration Complete", 5f, (ConfigDescription)null).Value; rewriteScope = ((BaseUnityPlugin)this).Config.Bind("Settings", "Rewrite Scope Value", rewriteScope, (ConfigDescription)null).Value; registrationMessageSpecs = ((BaseUnityPlugin)this).Config.Bind("Settings", "Registration Message Specs", registrationMessageSpecs, (ConfigDescription)null).Value; menuViewPort = ((BaseUnityPlugin)this).Config.Bind("Settings", "Menu Viewport Rect", -1, (ConfigDescription)null).Value; if (!Directory.Exists(Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/")) { Directory.CreateDirectory(Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/"); } if ((int)LoggingPlugin.GetLogLevel() >= 4) { ((MonoBehaviour)this).StartCoroutine(WarnAboutLogLevel()); } Harmony val = new Harmony("org.lordashes.plugins.commoncustomsmenu"); val.PatchAll(); ((MonoBehaviour)this).StartCoroutine(GetProvidersAssets(pluginsRegistrationComplete)); Utility.PostOnMainPage((BaseUnityPlugin)(object)this); } [IteratorStateMachine(typeof(d__26))] private IEnumerator GetProvidersAssets(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this, delay = delay }; } [IteratorStateMachine(typeof(d__27))] private IEnumerator WarnAboutLogLevel() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__27(0) { <>4__this = this }; } private void OnGUI() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_016c: 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_018a: Unknown result type (might be due to invalid IL or missing references) if (initialized == 1) { invisibleButton = new GUIStyle(GUI.skin.button); invisibleButton.active.textColor = Color.clear; invisibleButton.normal.textColor = Color.clear; invisibleButton.active.background = Helpers.MakeTexture(Color.clear); invisibleButton.normal.background = Helpers.MakeTexture(Color.clear); initialized = 2; } else { if (initialized != 2) { return; } if (guiSafe != "") { LoggingPlugin.LogTrace("No Gui Update Due To " + _self.guiSafe + " In Progress"); return; } guiSafe = "Gui"; try { menus.Draw(); if (menus.items.ElementAt(0).Value.properties["status"] == "opened") { GUI.DrawTexture(infoBar, (Texture)(object)Helpers.MakeTexture(Color.black)); GUIStyle val = new GUIStyle(GUI.skin.label) { richText = true }; val.active.textColor = Color.white; val.normal.textColor = Color.white; GUI.Label(infoBar, menus.properties.ContainsKey("info") ? menus.properties["info"] : "", val); } } catch (Exception ex) { LoggingPlugin.LogError(ex.Message); } guiSafe = ""; } } private void Update() { if (!((KeyboardShortcut)(ref menuToggleTrigger)).IsUp()) { return; } if (assets.Count > 0) { if (menus.items["Kind"].properties.ContainsKey("status") && menus.items["Kind"].properties["status"] == "closed") { LoggingPlugin.LogDebug("Requesting Menu Open Via Keyboard"); Open(); } else if (menus.items["Kind"].properties.ContainsKey("status") && menus.items["Kind"].properties["status"] == "opened") { LoggingPlugin.LogDebug("Requesting Menu Close Via Keyboard"); Close(); } } else { SystemMessage.DisplayInfoText("Common Customs Menu:\r\nNo Custom Assets Registered", 2.5f, 0f, (Action)null); } } public void Open() { LoggingPlugin.LogDebug("Opening Menu. Disabling Game Input."); Utility.GameInputEnabled(setting: false); ((_Internal.Menu)menus.items["Kind"]).Open(!animateOpening); ((_Internal.Menu)menus.items["Group"]).Open(!animateOpening); ((_Internal.Menu)menus.items["Content"]).Open(!animateOpening); ((_Internal.Menu)menus.items["Filter"]).Open(!animateOpening); ((_Internal.Menu)menus.items["BadgeSizer"]).Open(!animateOpening); } public void Close() { LoggingPlugin.LogDebug("Closing Menu. Enabling Game Input."); Utility.GameInputEnabled(setting: true); ((_Internal.Menu)menus.items["Kind"]).Close(!animateOpening); ((_Internal.Menu)menus.items["Group"]).Close(!animateOpening); ((_Internal.Menu)menus.items["Content"]).Close(!animateOpening); ((_Internal.Menu)menus.items["Filter"]).Close(!animateOpening); ((_Internal.Menu)menus.items["BadgeSizer"]).Close(!animateOpening); } public static string RegisterProviderV2(string providerName, string providerDescription, string providerVersion, Func, Func, string, IEnumerator>, IEnumerator> getAssetsCallback, Action<_Internal.CustomsMenu.AssetInfo> selectionCallback) { LoggingPlugin.LogDebug("Including Assets From Provider " + providerName + " (Version " + providerVersion + ") For " + providerDescription); string[] array = registrationMessageSpecs.Split(new char[1] { ',' }); array[1] = (int.Parse(array[1]) + _self.providers.Count * int.Parse(array[3])).ToString(); _self.providers.Add(providerName, new Provider { description = providerDescription, GetNewAssets = getAssetsCallback, SelectionCallback = selectionCallback }); return string.Join(",", array); } public static ReadOnlyCollection<_Internal.CustomsMenu.AssetInfo> GetAssets() { return new ReadOnlyCollection<_Internal.CustomsMenu.AssetInfo>(_self.assets.Values.ToList()); } public static string GetCacheFolder() { return Paths.PluginPath + "/.cache/org.lordashes.plugins.commoncustomsmenu/"; } }