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 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("CoreAssets_CCM")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Nth Dimension")] [assembly: AssemblyProduct("CoreAssets_CCM")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("CoreAssets_CCM")] [assembly: ComVisible(false)] [assembly: Guid("c303405d-e66c-4316-9cdb-4e3ca15c6360")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("2.0.0.0")] namespace LordAshes; [BepInPlugin("org.lordashes.plugins.coreassets.ccm", "Core Assets Plugin", "2.0.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class CoreAssetsPlugin : BaseUnityPlugin { public static class Provider { public enum DbContentKind : uint { Tile = 1u, Prop = 2u, Creature = 4u, RESERVED_0 = 8u, Slab = 0x10u } private class ContentInfo { public string Id { get; set; } public string Name { get; set; } public IconData Icon { get; set; } } private class IconData { public int AtlasIndex { get; set; } public Region Region { get; set; } } private class Region { public string serializedVersion { get; set; } public float x { get; set; } public float y { get; set; } public float width { get; set; } public float height { get; set; } } private class IconsAtlas { public string Path { get; set; } } private class ContentData { public string Name { get; set; } public List Creatures { get; set; } public List Props { get; set; } public List IconsAtlases { get; set; } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ReadOnlyDictionary existingAssets; public Func, string, IEnumerator> callback; 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() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; _callback = callback; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; ((MonoBehaviour)_self).StartCoroutine(SendCollectedAssetList(existingAssets)); 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__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ReadOnlyDictionary existingAssets; private Dictionary 5__1; private Dictionary 5__2; private IEnumerable 5__3; private IEnumerator <>s__4; private object 5__5; private List.Enumerator <>s__6; private object 5__7; private string 5__8; private string 5__9; private string 5__10; private string
5__11; private string 5__12; private object 5__13; private string 5__14; private IEnumerable 5__15; private string 5__16; private string 5__17; private IEnumerator <>s__18; private object 5__19; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 3) <= 1u) { try { } finally { <>m__Finally1(); } } 5__1 = null; 5__2 = null; 5__3 = null; <>s__4 = null; 5__5 = null; <>s__6 = default(List.Enumerator); 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null;
5__11 = null; 5__12 = null; 5__13 = null; 5__14 = null; 5__15 = null; 5__16 = null; 5__17 = null; <>s__18 = null; 5__19 = null; <>1__state = -2; } private bool MoveNext() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Expected O, but got Unknown //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Expected O, but got Unknown //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (registerNew) { LoggingPlugin.LogInfo("Waiting For Core Assets To Be Detected"); _counter = 0; goto IL_00b4; } LoggingPlugin.LogInfo("Skipping Registering Of New Core Assets"); _db.Clear(); goto IL_00e0; case 1: <>1__state = -1; _counter++; goto IL_00b4; case 2: { <>1__state = -1; 5__1 = new Dictionary(); 5__2 = new Dictionary(); object value = Reflection.Execute(m_GetRegisteredPackInfo, (object)null, new object[0], 0); 5__3 = value as IEnumerable; if (5__3 != null) { <>s__4 = 5__3.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; LoggingPlugin.LogDebug(f_PackId.GetValue(5__5)?.ToString() + ": " + f_OptionalName.GetValue(5__5)); 5__2.Add(f_PackId.GetValue(5__5).ToString(), f_OptionalName.GetValue(5__5).ToString()); 5__5 = null; } } finally { if (<>s__4 is IDisposable disposable2) { disposable2.Dispose(); } } <>s__4 = null; } <>s__6 = _db.GetEnumerator(); <>1__state = -3; goto IL_0894; } case 3: <>1__state = -3; if (5__9.ToLower().Trim() == "creature" || 5__9.ToLower().Trim() == "prop") { 5__12 = GetId(5__7); if (!existingAssets.ContainsKey(5__12)) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; } goto IL_0867; } goto IL_086f; case 4: { <>1__state = -3; if (5__7 != null) { 5__13 = p_DataPackId.GetValue(5__7); if (
5__11 == "") {
5__11 = (5__2.ContainsKey(5__13.ToString()) ? 5__2[5__13.ToString()] : "CORE"); } 5__14 = ""; object value = f_Tags.GetValue(5__7); 5__15 = value as IEnumerable; if (5__15 != null) { <>s__18 = 5__15.GetEnumerator(); try { while (<>s__18.MoveNext()) { 5__19 = <>s__18.Current; 5__14 = 5__14 + 5__19?.ToString() + ","; 5__19 = null; } } finally { if (<>s__18 is IDisposable disposable) { disposable.Dispose(); } } <>s__18 = null; if (5__14.EndsWith(",")) { 5__14 = 5__14.Substring(0, 5__14.Length - 1); } } 5__16 = MakeUnique(5__12, 5__1.Keys.ToList()); 5__17 = MakeUnique(5__8, 5__1.Values.Select((AssetInfo a) => a.name).ToList()); Dictionary dictionary = 5__1; string key = 5__16; AssetInfo val = new AssetInfo(); val.provider = "COREASSETS"; val.pack = (5__2.ContainsKey(5__13.ToString()) ? 5__2[5__13.ToString()] : "CORE"); val.prefab = 5__17; val.filename = 5__12; val.kind = 5__9; val.category = 5__9; val.header =
5__11; val.name = ToSpaceBasedCamelCase(5__8); val.description = f_Description.GetValue(5__7).ToString(); val.author = "BouncyRock"; val.groupName = ToSpaceBasedCamelCase(5__10); val.comment = 5__13.ToString() + "," + f_SourceLocalPackId.GetValue(5__13).ToString() + "," + f_PackSource.GetValue(5__13).ToString(); val.tags = 5__14; val.hasAnimations = false; val.hasAudio = false; val.hasBlendshapes = false; dictionary.Add(key, val); 5__13 = null; 5__14 = null; 5__15 = null; 5__16 = null; 5__17 = null; } else { LoggingPlugin.LogInfo("Null AssetDB Entry"); } goto IL_0867; } IL_088c: 5__7 = null; goto IL_0894; IL_00e0: LoggingPlugin.LogInfo("Packing Asset Results"); _self.notification = "Registering... [Provider: COREASSETS]"; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; IL_0894: if (<>s__6.MoveNext()) { 5__7 = <>s__6.Current; if ((uint)f_Kind.GetValue(5__7) == 4 || (uint)f_Kind.GetValue(5__7) == 2) { LoggingPlugin.LogDebug("Adding Asset: Group='" + ToSpaceBasedCamelCase(f_GroupName.GetValue(5__7).ToString()) + "' Name='" + ToSpaceBasedCamelCase(f_Name.GetValue(5__7).ToString()) + "'"); 5__8 = f_Name.GetValue(5__7).ToString(); 5__9 = f_Kind.GetValue(5__7).ToString(); 5__10 = f_GroupName.GetValue(5__7).ToString();
5__11 = ""; if (5__10.ToUpper() == "COMMUNITY") {
5__11 = "[MOD.IO]"; 5__10 = "All Assets"; } if (5__10.ToUpper() == "LOCAL") {
5__11 = "[LOCAL]"; 5__10 = "All Assets"; } _self.notification = "Registering... [Provider: COREASSETS, Group: " + 5__10 + ", Name: " + 5__8 + "]"; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 3; return true; } goto IL_088c; } <>m__Finally1(); <>s__6 = default(List.Enumerator); LoggingPlugin.LogInfo("Posting Asset Results"); _self.notification = null; ((MonoBehaviour)_self).StartCoroutine(_callback((from kvp in 5__1 orderby kvp.Value.header, kvp.Value.category, kvp.Value.name select kvp).ToDictionary((KeyValuePair kvp) => kvp.Key, (KeyValuePair kvp) => kvp.Value), "CoreAssets")); return false; IL_00b4: if (_db.Count == 0) { LoggingPlugin.LogInfo("Waited " + _counter + " Seconds"); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } goto IL_00e0; IL_0867: 5__12 = null; goto IL_086f; IL_086f: 5__8 = null; 5__9 = null; 5__10 = null;
5__11 = null; goto IL_088c; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__6).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static int _counter = 5; public static List _db = new List(); private static Func, string, IEnumerator> _callback = null; [IteratorStateMachine(typeof(d__4))] public static IEnumerator GetNewAssets(ReadOnlyDictionary existingAssets, Func, string, IEnumerator> callback) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { existingAssets = existingAssets, callback = callback }; } [IteratorStateMachine(typeof(d__5))] private static IEnumerator SendCollectedAssetList(ReadOnlyDictionary existingAssets) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { existingAssets = existingAssets }; } public static void SpawnNewAsset(AssetInfo info) { LoggingPlugin.LogInfo("Spawning " + ((object)info)?.ToString() + " Based On Stored Guid " + info.prefab); LoggingPlugin.LogInfo("Closing CCM"); CommonCustomsMenuPlugin._self.Close(); try { LoggingPlugin.LogInfo("Getting DM Entry"); object obj = _db.Where((object entry) => GetId(entry) == info.filename).First(); LoggingPlugin.LogInfo((obj != null) ? obj.ToString() : "Null"); LoggingPlugin.LogInfo("Getting InternedContentAddress"); object value = Reflection.Field(Reflection.Type("DbEntry", (string[])null, (string[])null, 0), "DataAddress", (string)null).GetValue(obj); LoggingPlugin.LogInfo("Getting CreatureDataV4"); object obj2 = Reflection.New(Reflection.Type("CreatureDataV4", (string[])null, (string[])null, 0), new object[1] { value }); LoggingPlugin.LogInfo("Switching To Creature Place Tool"); Reflection.Execute(Reflection.Method(Reflection.Type("CreatureSpawnerBoardTool", (string[])null, (string[])null, 0), "SwitchCreatureTool", (string[])null), (object)null, new object[3] { obj2, false, false }, 0); } catch (Exception ex) { LoggingPlugin.LogWarning("Unable to find " + info.prefab + " in core assets database"); LoggingPlugin.LogWarning("Details: " + ex.Message); } } public static string GetId(object entry) { return p_DataPackId.GetValue(entry).ToString().Replace(":", "") + "-+-" + f_DataAddress.GetValue(entry).ToString().Replace(":", ""); } public static string ToSpaceBasedCamelCase(string raw) { raw = ((raw == null || raw.Trim() == "") ? "content" : raw.ToLower()); string text = raw.Substring(0, 1).ToUpper(); if (raw.Length > 1) { for (int i = 1; i < raw.Length; i++) { text = ((!(raw.Substring(i - 1, 1) == " ")) ? (text + raw.Substring(i, 1)) : (text + raw.Substring(i, 1).ToUpper())); } } return text; } private static Dictionary GetCoreAssets() { Dictionary dictionary = new Dictionary(); string[] directories = Directory.GetDirectories(Paths.GameRootPath + "/TaleWeaver/"); foreach (string text in directories) { if (text.Contains("-")) { string text2 = File.ReadAllText(text + "/index.json", (CacheType)999); ContentData value = JsonConvert.DeserializeObject(text2); dictionary.Add(text, value); } } return dictionary; } public static string MakeUnique(string entry, List takenEntries) { string text = entry; int num = 0; while (takenEntries.Contains(text)) { if (text.IndexOf(".") > -1) { text = text.Substring(0, text.LastIndexOf(".")); } num++; text = text + "." + num.ToString("00"); } return text; } } public static class Utility { private static PropertyInfo isLoadingProp; private static PropertyInfo inBoardProp; public static bool isBoardLoaded() { try { if (inBoardProp == null) { inBoardProp = Reflection.Property(_BoardSessionManager, "InBoard", (string)null); } if (isLoadingProp == null) { isLoadingProp = Reflection.Property(_BoardSessionManager, "IsLoading", (string)null); } bool flag = false; try { flag = (bool)inBoardProp.GetValue(null); } catch { } bool flag2 = false; try { flag2 = (bool)isLoadingProp.GetValue(null); } catch { } return flag && !flag2; } catch (Exception ex) { Reflection.CatchFullError(ex); return false; } } public static float ParseFloat(string value) { return float.Parse(value, CultureInfo.InvariantCulture); } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private object 5__1; private object 5__2; private int 5__3; private IEnumerable 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; 5__2 = null; goto IL_0190; case 2: { <>1__state = -1; goto IL_0190; } IL_0190: 5__1 = null; break; } 5__1 = null; try { 5__1 = Reflection.Property(_SimpleSingletonBehaviourAssetDb, "Instance", (string)null).GetValue(null); } catch { } if (5__1 != null) { 5__2 = f_dbEntriesList.GetValue(5__1); 5__3 = (int)Reflection.Property(5__2.GetType(), "Length", (string)null).GetValue(5__2); if (5__3 > 0) { 5__4 = 5__2 as IEnumerable; if (5__4 != null) { LoggingPlugin.LogDebug("Found " + 5__3 + " Core Assets"); Provider._db.AddRange(5__4.Cast()); } else { LoggingPlugin.LogDebug("Blist is not enumerable"); } return false; } LoggingPlugin.LogDebug("AssetDB Is Empty"); <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; } LoggingPlugin.LogDebug("unable To Get AssetDB Instance"); <>2__current = (object)new WaitForSeconds(10f); <>1__state = 2; 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(); } } [CompilerGenerated] private sealed class d__39 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public CoreAssetsPlugin <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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 { MethodInfo displayInfoText = m_DisplayInfoText; object[] array = new object[5]; DiagnosticLevel logLevel = LoggingPlugin.GetLogLevel(); array[0] = "Core Assets Plugin: Using '" + ((object)(DiagnosticLevel)(ref logLevel)).ToString() + "' diagnostics.\r\nUse 'Info' for better performance"; array[1] = 10; array[2] = Type.Missing; array[3] = Type.Missing; array[4] = Type.Missing; Reflection.Execute(displayInfoText, (object)null, array, 0); Reflection.Execute(m_DisplayInfoText, (object)null, new object[5] { "Core Assets Plugin: Use 'Debug' or 'Trace' for\r\ntroubleshooting only.", 10, Type.Missing, Type.Missing, Type.Missing }, 0); } catch { goto IL_00c8; } return false; IL_00c8: <>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 static Type _AssetDb = Reflection.Type("AssetDb", (string[])null, (string[])null, 0); public static Type _BoardSessionManager = Reflection.Type("BoardSessionManager", (string[])null, (string[])null, 0); public static Type _DataPackId = Reflection.Type("InternedPackId", (string[])null, (string[])null, 0); public static Type _DbEntry = Reflection.Type("DbEntry", (string[])null, (string[])null, 0); public static Type _RegisteredPackInfo = Reflection.Type("RegisteredPackInfo", (string[])null, (string[])null, 0); public static Type _SimpleSingletonBehaviourAssetDb = Reflection.ClosedType("SimpleSingletonBehaviour`1", "AssetDb", (string[])null, (string[])null); public static Type _SystemMessage = Reflection.Type("SystemMessage", (string[])null, (string[])null, 0); public static MethodInfo m_DisplayInfoText = Reflection.Method(_SystemMessage, "DisplayInfoText", (string[])null); public static MethodInfo m_GetRegisteredPackInfo = Reflection.Method(_AssetDb, "GetRegisteredPackInfo", (string[])null); public static PropertyInfo p_DataPackId = Reflection.Property(_DbEntry, "DataPackId", (string)null); public static FieldInfo f_DataAddress = Reflection.Field(_DbEntry, "DataAddress", (string)null); public static FieldInfo f_Description = Reflection.Field(_DbEntry, "Description", (string)null); public static FieldInfo f_dbEntriesList = Reflection.Field(_AssetDb, "_dbEntriesList", (string)null); public static FieldInfo f_GroupName = Reflection.Field(_DbEntry, "GroupName", (string)null); public static FieldInfo f_Kind = Reflection.Field(_DbEntry, "Kind", (string)null); public static FieldInfo f_Name = Reflection.Field(_DbEntry, "Name", (string)null); public static FieldInfo f_OptionalName = Reflection.Field(_RegisteredPackInfo, "OptionalName", (string)null); public static FieldInfo f_PackId = Reflection.Field(_RegisteredPackInfo, "PackId", (string)null); public static FieldInfo f_PackSource = Reflection.Field(_DataPackId, "PackSource", (string)null); public static FieldInfo f_SourceLocalPackId = Reflection.Field(_DataPackId, "SourceLocalPackId", (string)null); public static FieldInfo f_Tags = Reflection.Field(_DbEntry, "Tags", (string)null); public const string Name = "Core Assets Plugin"; public const string Guid = "org.lordashes.plugins.coreassets.ccm"; public const string Version = "2.0.0.0"; public const string Author = "Lord Ashes"; public static CoreAssetsPlugin _self = null; private string notification = null; public byte[] defaultIcon = ImageConversion.EncodeToPNG(Image.LoadTexture("org.lordashes.plugins.coreassets.ccm.Default.png", (CacheType)999)); public string cacheFolder = CommonCustomsMenuPlugin.GetCacheFolder(); public static ConfigEntry registerNewConfig; public static bool registerNew = true; private Rect registrationMessagePos = Rect.zero; private GUIStyle registrationMessageStyle = new GUIStyle(); 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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(); LoggingPlugin.LogInfo(assemblyQualifiedName + ": Active. (Diagnostic Mode = " + ((object)(DiagnosticLevel)(ref logLevel)).ToString() + ")"); registerNewConfig = ((BaseUnityPlugin)this).Config.Bind("Settings", "Register Missing Core Assets", true, (ConfigDescription)null); registerNew = registerNewConfig.Value; registerNewConfig.Value = false; ((BaseUnityPlugin)this).Config.Save(); string text = CommonCustomsMenuPlugin.RegisterProviderV2("COREASSETS", "Core Talespire minis", "2.0.0.0", (Func, Func, string, IEnumerator>, IEnumerator>)Provider.GetNewAssets, (Action)Provider.SpawnNewAsset); string[] array = text.Split(new char[1] { ',' }); LoggingPlugin.LogDebug("Setting Registration Content"); registrationMessagePos = new Rect((float)int.Parse(array[0]), (float)int.Parse(array[1]), (float)(Screen.width - int.Parse(array[0])), (float)(Screen.height - int.Parse(array[1]))); registrationMessageStyle.fontSize = int.Parse(array[2]); registrationMessageStyle.fontStyle = (FontStyle)1; registrationMessageStyle.active.textColor = Color.white; registrationMessageStyle.normal.textColor = Color.white; ConstructorInfo constructorInfo = AccessTools.Constructor(_AssetDb, Type.EmptyTypes, false); if (constructorInfo == null) { throw new Exception("AssetDb constructor not found"); } new Harmony("org.lordashes.plugins.coreassets.ccm").Patch((MethodBase)constructorInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(CoreAssetsPlugin).GetMethod("Postfix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ModdingUtils.AddPluginToMenuList((BaseUnityPlugin)(object)this, "Lord Ashes'"); } public static void Postfix(object __instance) { LoggingPlugin.LogDebug("Starting Seek Of AssetDb Items"); ((MonoBehaviour)_self).StartCoroutine(GetAssetDBEntries()); } [IteratorStateMachine(typeof(d__37))] private static IEnumerator GetAssetDBEntries() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0); } private void OnGUI() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (notification != null) { GUI.Label(registrationMessagePos, notification, registrationMessageStyle); } } [IteratorStateMachine(typeof(d__39))] private IEnumerator WarnAboutLogLevel() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this }; } }