Decompiled source of Homebrewery v3.8.62
Homebrewery.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GLTFast; using GLTFast.Loading; using GLTFast.Logging; using GLTFast.Materials; using HarmonyLib; using Marioalexsan.AtlyssGLTF; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Homebrewery")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("3.8.62.0")] [assembly: AssemblyInformationalVersion("3.8.62+7965b73d6b81d177d9780a778b8918310690c887")] [assembly: AssemblyProduct("Homebrewery")] [assembly: AssemblyTitle("Homebrewery")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.8.62.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Homebrewery { internal static class AtlyssGLTF { public const string ModID = "Marioalexsan.AtlyssGLTF"; private static bool? _enabled; public static bool Enabled { get { bool valueOrDefault = _enabled.GetValueOrDefault(); if (!_enabled.HasValue) { valueOrDefault = Chainloader.PluginInfos.ContainsKey("Marioalexsan.AtlyssGLTF"); _enabled = valueOrDefault; } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool GetForceReadableMeshes() { return AtlyssGLTF.ForceReadableMeshes; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static async Task<Mesh[]> ImportGLB(string objectName, string path) { Stopwatch sw = Stopwatch.StartNew(); Mesh[] mesh = Array.Empty<Mesh>(); try { GltfImport gltf = new GltfImport((IDownloadProvider)null, (IDeferAgent)null, (IMaterialGenerator)null, (ICodeLogger)null); Uri uri = new Uri(path); HB.Log(uri, 1); if (await ((GltfImportBase)gltf).Load(uri, new ImportSettings { AnimationMethod = (AnimationMethod)2 }, default(CancellationToken))) { GameObject GO = new GameObject(objectName); if (await ((GltfImportBase)gltf).InstantiateMainSceneAsync(GO.transform, default(CancellationToken))) { IReadOnlyCollection<Mesh> meshes = ((GltfImportBase)gltf).Meshes; int num = 0; Mesh[] array = (Mesh[])(object)new Mesh[meshes.Count]; foreach (Mesh item in meshes) { array[num] = item; num++; } mesh = array; } else { HB.Log("InstantiateMainSceneAsync returned false", 4); } Object.Destroy((Object)(object)GO); } else { HB.Log("LoadGltfBinary returned false", 4); } } catch (Exception ex) { Exception e = ex; HB.Log(e.GetType().Name + " : " + e.Message, 4); } sw.Stop(); HB.Log("ImportGLB(" + objectName + ") took " + sw.ElapsedMilliseconds + "ms\n", 1); return mesh; } internal static async Task GetArmorRender(HB.GLB glb, HB.ArmorRender SAR) { Mesh[] meshes = await ImportGLB(glb.Name, glb.FileI.FullName); if (meshes.Length == 0) { HB.Log(glb.Name + " - Glb file returned no meshes!", 4); } Mesh[] array = meshes; foreach (Mesh mesh in array) { if (!HB.RaceTypes.TryGetValue(((Object)mesh).name, out var t)) { continue; } switch (t) { case HB.RaceType.Byrdle: ((Object)mesh).name = glb.Name + "-Byrdle"; if ((Object)(object)SAR.Byrdle._raceArmorMesh != (Object)null) { Object.Destroy((Object)(object)SAR.Byrdle._raceArmorMesh); } SAR.Byrdle._raceArmorMesh = mesh; break; case HB.RaceType.Chang: ((Object)mesh).name = glb.Name + "-Chang"; if ((Object)(object)SAR.Chang._raceArmorMesh != (Object)null) { Object.Destroy((Object)(object)SAR.Chang._raceArmorMesh); } SAR.Chang._raceArmorMesh = mesh; break; case HB.RaceType.Imp: ((Object)mesh).name = glb.Name + "-Imp"; if ((Object)(object)SAR.Imp._raceArmorMesh != (Object)null) { Object.Destroy((Object)(object)SAR.Imp._raceArmorMesh); } SAR.Imp._raceArmorMesh = mesh; break; case HB.RaceType.Kubold: ((Object)mesh).name = glb.Name + "-Kubold"; if ((Object)(object)SAR.Kubold._raceArmorMesh != (Object)null) { Object.Destroy((Object)(object)SAR.Kubold._raceArmorMesh); } SAR.Kubold._raceArmorMesh = mesh; break; case HB.RaceType.Poon: ((Object)mesh).name = glb.Name + "-Poon"; if ((Object)(object)SAR.Poon._raceArmorMesh != (Object)null) { Object.Destroy((Object)(object)SAR.Poon._raceArmorMesh); } SAR.Poon._raceArmorMesh = mesh; break; default: HB.Log("ArmorRender: " + glb.Name + " - Incorrectly named mesh: '" + ((Object)mesh).name + "'.\nArmorRender Meshes must be named as the Race they are for e.g. 'Byrdle', 'Chang', 'Imp', 'Kubold', 'Poon'.", 4); break; } } HB.aRend.TryAdd(glb.Name, SAR.obj); SAR.Added = true; glb.FileI.Refresh(); } internal static async Task GetMeshPart(HB.GLB glb, HB.MeshPart meshPart) { Mesh[] meshes = await ImportGLB(glb.Name, glb.FileI.FullName); if (meshes.Length == 0) { HB.Log(glb.Name + " - Glb file returned no meshes!", 4); } if (meshes.Length > 1) { HB.Log(glb.Name + " - Glb file returned more than one mesh, we only want one!", 3); } meshPart.obj = meshes[0]; ((Object)meshPart.obj).name = glb.Name; if (HB.aMesh.TryGetValue(glb.Name, out Mesh _)) { Object.Destroy((Object)(object)HB.aMesh[glb.Name]); HB.aMesh[glb.Name] = meshPart.obj; } else { HB.aMesh.Add(glb.Name, meshPart.obj); } meshPart.Added = true; glb.FileI.Refresh(); } internal static async Task GetHair(HB.GLB glb, HB.Hair hair) { Mesh[] meshes = await ImportGLB(glb.Name, glb.FileI.FullName); if (meshes.Length == 0) { HB.Log(glb.Name + " - Glb file returned no meshes!", 4); } Mesh[] array = meshes; foreach (Mesh mesh in array) { if (!HB.RaceTypes.TryGetValue(((Object)mesh).name, out var t)) { continue; } switch (t) { case HB.RaceType.Byrdle: ((Object)mesh).name = glb.Name + "-Byrdle"; if ((Object)(object)hair.obj[t] != (Object)null) { Object.Destroy((Object)(object)hair.obj[t]); } hair.obj[t] = mesh; break; case HB.RaceType.Chang: ((Object)mesh).name = glb.Name + "-Chang"; if ((Object)(object)hair.obj[t] != (Object)null) { Object.Destroy((Object)(object)hair.obj[t]); } hair.obj[t] = mesh; break; case HB.RaceType.Imp: ((Object)mesh).name = glb.Name + "-Imp"; if ((Object)(object)hair.obj[t] != (Object)null) { Object.Destroy((Object)(object)hair.obj[t]); } hair.obj[t] = mesh; break; case HB.RaceType.Kubold: ((Object)mesh).name = glb.Name + "-Kubold"; if ((Object)(object)hair.obj[t] != (Object)null) { Object.Destroy((Object)(object)hair.obj[t]); } hair.obj[t] = mesh; break; case HB.RaceType.Poon: ((Object)mesh).name = glb.Name + "-Poon"; if ((Object)(object)hair.obj[t] != (Object)null) { Object.Destroy((Object)(object)hair.obj[t]); } hair.obj[t] = mesh; break; default: HB.Log("Hair: " + glb.Name + " - Incorrectly named mesh: '" + ((Object)mesh).name + "'.\nHair Meshes must be named as the Race they are for e.g. 'Byrdle', 'Chang', 'Imp', 'Kubold', 'Poon'.", 4); break; } } glb.FileI.Refresh(); } } internal class CFG { public ConfigFile file; public ConfigEntry<int> LogLevel; public ConfigEntry<int> FilterMode; public ConfigEntry<bool> TexCompress; public ConfigEntry<bool> BlinkPatch; public ConfigEntry<int> BlinkPercent; public ConfigEntry<bool> HotkeysOn; public ConfigEntry<bool> BackfillSkin; public ConfigEntry<int> Bumpscosity; public ConfigEntry<int> EasterEggChance; public ConfigEntry<bool> SpreadVanillaParts; public ConfigEntry<int> UpdateMessage; public ConfigEntry<bool> AlwaysShowUpdateMsg; public ConfigEntry<bool> BypassFoodCapacity; public ConfigEntry<bool> CanDieInSanctuary; public ConfigEntry<int> CondenseSmallMods; public ConfigEntry<float> ShopInputDelay; public ConfigEntry<bool> zPartMarkerRestore; public Dictionary<int, ZPartMarker> zPartMarkers; public CFG(ConfigFile Config) { file = Config; LogLevel = Config.Bind<int>("General", "LogLevel", 3, "Homebrewery's log output level:\n-1 cancels all logs.\n0 shows everything - the higher levels exclude the previous levels.\n1 for File path logs.\n2 for Processes.\n3 for Cautions.\n4 for Warnings."); FilterMode = Config.Bind<int>("Texture Creation", "FilterMode", 0, "This config value caches what the Texture Filtering setting was set to last time it was changed so that HB doesn't need to wait for the settings to load.\n0 stands for Point filtering, which the game labels as 'Nearest (Crunchy).'\n1 stands for Bilinear, which the game labels as 'Bilnear (Smooth)', but IMO they should call it 'Blurry as fuck'."); TexCompress = Config.Bind<bool>("Texture Creation", "UseDXT5Compression", false, "Setting this to true will make Homebrewery create Texture2Ds with DXT5 format rather than uncompressed ARGB32, this might have a performance benefit but the compression is kinda ugly."); BlinkPatch = Config.Bind<bool>("Misc", "BlinkPatch", true, "Set this to false if you for some reason don't want the blinking improvement this mod implements (Using the closed eyes texture when the blink 'squish' animation plays)."); BlinkPercent = Config.Bind<int>("Misc", "BlinkPercent", 87, "This integer lets you customise the point in the eye squish blendshape that the eyes will invoke the closed eyes state.\nIt is 87 by default because that seemed alright to me, but it seems to be very FPS dependant and hasn't worked for everyone.\nSet it to a lower number to increase the range. Setting it any higher would be redundant if it already works for you."); HotkeysOn = Config.Bind<bool>("Controls", "HotkeysOn", true, "Controls whether the mod's hotkeys are on by default."); BackfillSkin = Config.Bind<bool>("Misc", "BackfillSkin", true, "Set this to false if you want the mod to NOT backfill missing SkinTextureGroup fields using vanilla textures. This means they will be transparent when absent!"); Bumpscosity = Config.Bind<int>("General", "Bumpscosity", 1, "Adjusts the Bumpscosity."); EasterEggChance = Config.Bind<int>("Misc", "EasterEggChance", 20, "The easter egg odds will be altered by this setting. The default value represents 1 in 20 odds, I think."); SpreadVanillaParts = Config.Bind<bool>("General", "SpreadVanillaParts", true, "This controls whether the mod copies and distributes every race's vanilla parts (eyes, mouths, skins) to the other races."); UpdateMessage = Config.Bind<int>("Misc", "UpdateMessage", 0, "A number the mod checks to simply determine if the mod has updated since the last time it loaded.\nLets me put a little update message up to say what has changed in the current version."); AlwaysShowUpdateMsg = Config.Bind<bool>("Misc", "AlwaysShowUpdateMessage", false, "Set this to true to prevent the UpdateMessage number from changing, so it will always show the message."); BypassFoodCapacity = Config.Bind<bool>("Consumables", "BypassFoodCapacity", false, "Set this to true to never be prevented from eating custom food consumables due to the food capacity stat."); CanDieInSanctuary = Config.Bind<bool>("General", "CanDieInSanctuary", true, "If True, your ZoneType is set to 'Field' rather than 'Safe' in any zone that would normally be 'Safe', meaning you can die there!\n I don't know why I called it '...Sanctuary' instead of '...Sanctum'"); CondenseSmallMods = Config.Bind<int>("HB Shop", "CondenseSmallMods", 0, "If a content pack has less than or equal item count than the number set here, it will have its ModShop removed and the items will be relocated to a new small mods ModShop."); ShopInputDelay = Config.Bind<float>("HB Shop", "ShopInputDelay", 0.25f, "Holding WASD in the mod shop will cycle through the mods and pages, this value is used as an interval so it can't change every single frame. (Min 0.06 / Max 1.0)"); zPartMarkerRestore = Config.Bind<bool>("zPart Markers", "zPartMarkerRestore", true, "Changing this to false will deactivate the automatic part index adjustments when the parts on your character have changed index and desynced."); zPartMarkers = new Dictionary<int, ZPartMarker>(); base..ctor(); } } public class ZPartMarker { public ConfigEntry<string> Name { get; } = HB.Cfg.file.Bind<string>("zPart Markers", "cfgP" + i + "Name", string.Empty, (ConfigDescription)null); public ConfigEntry<string> Eyes { get; } = HB.Cfg.file.Bind<string>("zPart Markers", "cfgP" + i + "EyesPart", string.Empty, (ConfigDescription)null); public ConfigEntry<string> Mouth { get; } = HB.Cfg.file.Bind<string>("zPart Markers", "cfgP" + i + "MouthPart", string.Empty, (ConfigDescription)null); public ConfigEntry<string> Skin { get; } = HB.Cfg.file.Bind<string>("zPart Markers", "cfgP" + i + "SkinPart", string.Empty, (ConfigDescription)null); public ConfigEntry<string> Hair { get; } = HB.Cfg.file.Bind<string>("zPart Markers", "cfgP" + i + "HairPart", string.Empty, (ConfigDescription)null); public ZPartMarker(int i) { } } [BepInPlugin("Homebrewery", "Homebrewery", "3.8.62")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class HB : BaseUnityPlugin { internal enum InstallType { r2ModMan, Manual, Gale } internal class ModFolder { internal string Name; internal readonly DirectoryInfo Dir; private readonly Stopwatch SW = Stopwatch.StartNew(); internal double SW_ms; private readonly List<TypeFolder> TypeFolders = new List<TypeFolder>(); private ModShop? _Shop; internal ModShop Shop { get { return _Shop ?? throw new InvalidOperationException("This ModFolder has no ModShop!"); } set { _Shop = value; } } internal ModFolder(string n, DirectoryInfo d) { Name = n; Dir = d; FindFolders(); Dir.Refresh(); } private void FindFolders() { IEnumerable<DirectoryInfo> enumerable = Dir.EnumerateDirectories(); foreach (DirectoryInfo item in enumerable) { if (FolderTypes.TryGetValue(item.Name, out var value)) { TypeFolders.Add(new TypeFolder(this, value, item)); } } SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal void StoreItem(ItemThing item) { //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected I4, but got Unknown if (_Shop == null) { Shop = new ModShop(Name); ModShops.Add(Shop); } ShopTab shopTab = item.ShopTab; ShopTab val = shopTab; switch ((int)val) { case 0: Shop.Items_Gear.Add(item); break; case 1: Shop.Items_Cons.Add(item); break; case 2: Shop.Items_Trad.Add(item); break; } } internal void Reload(bool nocheck) { foreach (TypeFolder typeFolder in TypeFolders) { typeFolder.Reload(nocheck); } } } internal class ModShop { internal string Name = name.Replace('_', ' '); internal readonly List<ItemThing> Items_Gear = new List<ItemThing>(); internal readonly List<ItemThing> Items_Cons = new List<ItemThing>(); internal readonly List<ItemThing> Items_Trad = new List<ItemThing>(); internal List<ItemThing[]> Items_Gear_Chunks = new List<ItemThing[]>(); internal int Items_Gear_Page = -1; internal List<ItemThing[]> Items_Cons_Chunks = new List<ItemThing[]>(); internal int Items_Cons_Page = -1; internal List<ItemThing[]> Items_Trad_Chunks = new List<ItemThing[]>(); internal int Items_Trad_Page = -1; public ModShop(string name) { } internal void SortThem() { if (Items_Gear.Count != 0) { Items_Gear.Sort(SortByNameAndOffset); } if (Items_Cons.Count != 0) { Items_Cons.Sort(SortByNameAndOffset); } if (Items_Trad.Count != 0) { Items_Trad.Sort(SortByNameAndOffset); } } internal void ChunkThem() { int count = Items_Gear.Count; for (int i = 0; i < count; i += 32) { Items_Gear_Chunks.Add(Items_Gear.Skip(i).Take(32).ToArray()); } if (Items_Gear_Chunks.Count > 0) { Items_Gear_Page = 0; } count = Items_Cons.Count; for (int j = 0; j < count; j += 32) { Items_Cons_Chunks.Add(Items_Cons.Skip(j).Take(32).ToArray()); } if (Items_Cons_Chunks.Count > 0) { Items_Cons_Page = 0; } count = Items_Trad.Count; for (int k = 0; k < count; k += 32) { Items_Trad_Chunks.Add(Items_Trad.Skip(k).Take(32).ToArray()); } if (Items_Trad_Chunks.Count > 0) { Items_Trad_Page = 0; } } internal void NextPage(ShopTab tab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected I4, but got Unknown switch ((int)tab) { case 0: if (Items_Gear_Page != -1) { Items_Gear_Page = (Items_Gear_Page + Items_Gear_Chunks.Count + 1) % Items_Gear_Chunks.Count; } break; case 1: if (Items_Cons_Page != -1) { Items_Cons_Page = (Items_Cons_Page + Items_Cons_Chunks.Count + 1) % Items_Cons_Chunks.Count; } break; case 2: if (Items_Trad_Page != -1) { Items_Trad_Page = (Items_Trad_Page + Items_Trad_Chunks.Count + 1) % Items_Trad_Chunks.Count; } break; case 3: break; } } internal void PrevPage(ShopTab tab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected I4, but got Unknown switch ((int)tab) { case 0: if (Items_Gear_Page != -1) { Items_Gear_Page = (Items_Gear_Page + Items_Gear_Chunks.Count - 1) % Items_Gear_Chunks.Count; } break; case 1: if (Items_Cons_Page != -1) { Items_Cons_Page = (Items_Cons_Page + Items_Cons_Chunks.Count - 1) % Items_Cons_Chunks.Count; } break; case 2: if (Items_Trad_Page != -1) { Items_Trad_Page = (Items_Trad_Page + Items_Trad_Chunks.Count - 1) % Items_Trad_Chunks.Count; } break; case 3: break; } } internal ShopkeepItem[] SupplyThem(ShopTab tab) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected I4, but got Unknown List<ShopkeepItem> list = new List<ShopkeepItem>(); switch ((int)tab) { case 0: if (Items_Gear_Page != -1) { ItemThing[] array3 = Items_Gear_Chunks[Items_Gear_Page]; foreach (ItemThing itemThing3 in array3) { list.Add(itemThing3.ShopItem); } } break; case 1: if (Items_Cons_Page != -1) { ItemThing[] array2 = Items_Cons_Chunks[Items_Cons_Page]; foreach (ItemThing itemThing2 in array2) { list.Add(itemThing2.ShopItem); } } break; case 2: if (Items_Trad_Page != -1) { ItemThing[] array = Items_Trad_Chunks[Items_Trad_Page]; foreach (ItemThing itemThing in array) { list.Add(itemThing.ShopItem); } } break; case 3: return Array.Empty<ShopkeepItem>(); } return list.ToArray(); } } internal class TypeFolder { internal readonly ModFolder Mod; internal readonly FolderType Type; internal readonly DirectoryInfo Dir; private readonly Stopwatch SW = Stopwatch.StartNew(); internal double SW_ms; private List<RaceFolder>? _RaceFolders; private List<ThingFolder>? _ThingFolders; private List<RaceFolder> RaceFolders { get { return _RaceFolders ?? throw new InvalidOperationException("This TypeFolder doesn't have RaceFolders."); } set { _RaceFolders = value; } } private List<ThingFolder> ThingFolders { get { return _ThingFolders ?? throw new InvalidOperationException("This TypeFolder has RaceFolders instead."); } set { _ThingFolders = value; } } public TypeFolder(ModFolder m, FolderType t, DirectoryInfo d) { Mod = m; Type = t; Dir = d; FindFolders(); Dir.Refresh(); } private void FindFolders() { IEnumerable<DirectoryInfo> enumerable = Dir.EnumerateDirectories(); FolderType type = Type; FolderType folderType = type; if (folderType == FolderType.Eyes || folderType == FolderType.Mouth || folderType == FolderType.Skin) { RaceFolders = new List<RaceFolder>(); foreach (DirectoryInfo item in enumerable) { if (RaceTypes.TryGetValue(item.Name, out var value)) { RaceFolders.Add(new RaceFolder(this, value, item)); } } } else { ThingFolders = new List<ThingFolder>(); foreach (DirectoryInfo item2 in enumerable) { ThingFolders.Add(new ThingFolder(this, item2)); } } SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal void Reload(bool nocheck) { if (_ThingFolders != null) { foreach (ThingFolder thingFolder in ThingFolders) { if (FolderCheck(thingFolder.Dir) || nocheck) { thingFolder.Reload(nocheck); } } } if (_RaceFolders == null) { return; } foreach (RaceFolder raceFolder in RaceFolders) { if (FolderCheck(raceFolder.Dir) || nocheck) { raceFolder.Reload(nocheck); } } } } internal class RaceFolder { internal readonly ModFolder Mod; internal readonly TypeFolder TypeF; internal readonly FolderType Type; internal readonly RaceType Race; internal readonly DirectoryInfo Dir; private readonly Stopwatch SW = Stopwatch.StartNew(); internal double SW_ms; private readonly List<ThingFolder> ThingFolders = new List<ThingFolder>(); public RaceFolder(TypeFolder t, RaceType r, DirectoryInfo d) { TypeF = t; Mod = TypeF.Mod; Type = TypeF.Type; Race = r; Dir = d; FindFolders(); Dir.Refresh(); } private void FindFolders() { IEnumerable<DirectoryInfo> enumerable = Dir.EnumerateDirectories(); foreach (DirectoryInfo item in enumerable) { ThingFolders.Add(new ThingFolder(this, item)); } SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal void Reload(bool nocheck) { foreach (ThingFolder thingFolder in ThingFolders) { if (FolderCheck(thingFolder.Dir) || nocheck) { thingFolder.Reload(nocheck); } } } } internal class ThingFolder { internal readonly ModFolder Mod; internal readonly FolderType Type; private RaceFolder? _RaceF; private TypeFolder? _TypeF; internal readonly DirectoryInfo Dir; private readonly Stopwatch SW = Stopwatch.StartNew(); internal double SW_ms; internal Thing? _thing; private readonly Dictionary<PieceType, Piece> Pieces = new Dictionary<PieceType, Piece>(); internal RaceFolder RaceF { get { return _RaceF ?? throw new InvalidOperationException("This ThingFolder has no RaceFolder."); } set { _RaceF = value; } } internal TypeFolder TypeF { get { return _TypeF ?? throw new InvalidOperationException("This ThingFolder has no TypeFolder."); } set { _TypeF = value; } } internal Thing Thing { get { return _thing ?? throw new InvalidOperationException("No Thing in ThingFolder!"); } set { _thing = value; } } public ThingFolder(TypeFolder c, DirectoryInfo d) { TypeF = c; Mod = TypeF.Mod; Type = TypeF.Type; Dir = d; FindFiles(); PutItTogether(); Dir.Refresh(); } public ThingFolder(RaceFolder r, DirectoryInfo d) { RaceF = r; Mod = RaceF.Mod; Type = RaceF.Type; Dir = d; FindFiles(); PutItTogether(); Dir.Refresh(); } internal void MakeItem(string text) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0add: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b65: 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_0dd1: Unknown result type (might be due to invalid IL or missing references) //IL_0de2: Unknown result type (might be due to invalid IL or missing references) //IL_0e4a: Unknown result type (might be due to invalid IL or missing references) //IL_1059: Unknown result type (might be due to invalid IL or missing references) //IL_111d: Unknown result type (might be due to invalid IL or missing references) //IL_112e: Unknown result type (might be due to invalid IL or missing references) //IL_1196: Unknown result type (might be due to invalid IL or missing references) //IL_138e: Unknown result type (might be due to invalid IL or missing references) //IL_1452: Unknown result type (might be due to invalid IL or missing references) //IL_1463: Unknown result type (might be due to invalid IL or missing references) //IL_14cb: Unknown result type (might be due to invalid IL or missing references) //IL_16db: Unknown result type (might be due to invalid IL or missing references) //IL_16ed: Unknown result type (might be due to invalid IL or missing references) //IL_1875: Unknown result type (might be due to invalid IL or missing references) //IL_1939: Unknown result type (might be due to invalid IL or missing references) //IL_194a: Unknown result type (might be due to invalid IL or missing references) //IL_19b2: Unknown result type (might be due to invalid IL or missing references) //IL_19cf: Unknown result type (might be due to invalid IL or missing references) //IL_19d9: Expected O, but got Unknown switch (Type) { case FolderType.Cape: { if (_thing == null) { Thing = new Cape(Mod); } Cape cape = (Cape)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)cape); } catch (Exception ex3) { Log(Mod.Name + " : " + Dir.Name + " => " + ex3.Message, 4); break; } ((ScriptableItem)cape.obj)._itemType = (ItemType)0; ((ScriptableItem)cape.obj)._itemName = cape._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Cape-" + Dir.Name + "</size></color>"; ((Object)cape.obj).name = cape._itemName + "-" + Mod.Name + "-Cape-" + Dir.Name; ((ScriptableItem)cape.obj)._itemRarity = (ItemRarity)4; ((ScriptableItem)cape.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)cape.obj)._itemDescription = cape._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)cape.obj)._destroyOnDrop = false; ((ScriptableItem)cape.obj)._vendorCost = 0; ((ScriptableEquipment)cape.obj)._equipType = (ItemEquipType)0; ((ScriptableArmor)cape.obj)._canDyeArmor = cape._canDyeArmor; ((ScriptableArmor)cape.obj)._colorAdjustParams = cape._colorAdjustParams; if (!cape.Added) { ModelPartAssignments[PieceType.capeMesh].Add(delegate { CapeMesh(cape); }); AddNewItems.Add(delegate { AddNewItem(cape); }); cape.ShopItem._itemNameTag = ((ScriptableItem)cape.obj)._itemName; cape.ShopItem._scriptItem = (ScriptableItem)(object)cape.obj; } break; } case FolderType.Chestpiece: { if (_thing == null) { Thing = new Chestpiece(Mod); } Chestpiece chestpiece = (Chestpiece)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)chestpiece); } catch (Exception ex8) { Log(Mod.Name + " : " + Dir.Name + " => " + ex8.Message, 4); break; } ((ScriptableItem)chestpiece.obj)._itemType = (ItemType)0; ((ScriptableItem)chestpiece.obj)._itemName = chestpiece._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Chestpiece-" + Dir.Name + "</size></color>"; ((Object)chestpiece.obj).name = chestpiece._itemName + "-" + Mod.Name + "-Chestpiece-" + Dir.Name; ((ScriptableItem)chestpiece.obj)._itemRarity = (ItemRarity)4; ((ScriptableItem)chestpiece.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)chestpiece.obj)._itemDescription = chestpiece._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)chestpiece.obj)._destroyOnDrop = false; ((ScriptableItem)chestpiece.obj)._vendorCost = 0; ((ScriptableEquipment)chestpiece.obj)._equipType = (ItemEquipType)0; ((ScriptableArmor)chestpiece.obj)._canDyeArmor = chestpiece._canDyeArmor; ((ScriptableArmor)chestpiece.obj)._colorAdjustParams = chestpiece._colorAdjustParams; chestpiece.obj._lockBoobs = chestpiece._lockBoobs; chestpiece.obj._disableJiggleBoobBones = chestpiece._disableJiggleBoobBones; chestpiece.obj._textureArms = chestpiece._textureArms; chestpiece._shoulderPadDisplayType = Math.Clamp(chestpiece._shoulderPadDisplayType, 0, 3); chestpiece.obj._shoulderPadDisplayType = (ShoulderPadDisplayType)(byte)chestpiece._shoulderPadDisplayType; if (!chestpiece.Added) { ModelPartAssignments[PieceType.neckCollarMesh].Add(delegate { NeckCollarMesh(chestpiece); }); ModelPartAssignments[PieceType.chestRenderDisplay].Add(delegate { ChestRenderDisplay(chestpiece); }); ModelPartAssignments[PieceType.robeSkirtRender].Add(delegate { RobeSkirtRender(chestpiece); }); ModelPartAssignments[PieceType.armCuffRender].Add(delegate { ArmCuffRender(chestpiece); }); ModelPartAssignments[PieceType.shoulderPadMesh].Add(delegate { ShoulderpadMesh(chestpiece); }); AddNewItems.Add(delegate { AddNewItem(chestpiece); }); chestpiece.ShopItem._itemNameTag = ((ScriptableItem)chestpiece.obj)._itemName; chestpiece.ShopItem._scriptItem = (ScriptableItem)(object)chestpiece.obj; } break; } case FolderType.Consumable: { if (_thing == null) { Thing = new Consumable(Mod); } Consumable consumable = (Consumable)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)consumable); } catch (Exception ex4) { Log(Mod.Name + " : " + Dir.Name + " => " + ex4.Message, 4); break; } ((ScriptableItem)consumable.obj)._itemType = (ItemType)1; ((ScriptableItem)consumable.obj)._itemName = consumable._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Consumable-" + Dir.Name + "</size></color>"; ((Object)consumable.obj).name = consumable._itemName + "-" + Mod.Name + "-Consumable-" + Dir.Name; ((ScriptableItem)consumable.obj)._itemRarity = (ItemRarity)0; ((ScriptableItem)consumable.obj)._itemSortTag = (SortTag)7; ((ScriptableItem)consumable.obj)._itemDescription = consumable._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)consumable.obj)._maxStackAmount = 99; ((ScriptableItem)consumable.obj)._destroyOnDrop = false; ((ScriptableItem)consumable.obj)._vendorCost = 0; ((ScriptableConsumable)consumable.obj)._consumableCooldown = Math.Max(1f, consumable.cooldown); ((ScriptableConsumable)consumable.obj)._useOnlyInTown = false; ((ScriptableConsumable)consumable.obj)._consumableObject = ConsumableObject; consumable.obj._healthApply = -Math.Abs(consumable.damage); consumable.obj._selfConditions = Array.Empty<ScriptableCondition>(); if (consumable.extra.Length != 0) { ExtraEffectsActions.Add(delegate { ConsumableExtras(consumable); }); } if (!consumable.Added) { AddNewItems.Add(delegate { AddNewItem(consumable); }); consumable.ShopItem._itemNameTag = ((ScriptableItem)consumable.obj)._itemName; consumable.ShopItem._scriptItem = (ScriptableItem)(object)consumable.obj; } if (consumable.food != 0 && !ConsumableFoodStats.TryAdd(((Object)consumable.obj).name, consumable.food)) { ConsumableFoodStats[((Object)consumable.obj).name] = consumable.food; } break; } case FolderType.Dye: { if (_thing == null) { Thing = new Dye(Mod); } Dye dye = (Dye)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)dye); } catch (Exception ex2) { Log(Mod.Name + " : " + Dir.Name + " => " + ex2.Message, 4); break; } dye.Marker = Mod.Name + "-Dye-" + Dir.Name; ((ScriptableItem)dye.obj)._itemType = (ItemType)1; ((ScriptableItem)dye.obj)._itemName = dye._itemName + "<color=#00000000><size=1>" + dye.Marker + "</size></color>"; ((Object)dye.obj).name = dye._itemName + "-" + dye.Marker; ((ScriptableItem)dye.obj)._itemRarity = (ItemRarity)0; ((ScriptableItem)dye.obj)._itemSortTag = (SortTag)1; ((ScriptableItem)dye.obj)._itemDescription = dye._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)dye.obj)._maxStackAmount = 99; ((ScriptableItem)dye.obj)._destroyOnDrop = false; ((ScriptableItem)dye.obj)._vendorCost = 0; ((ScriptableConsumable)dye.obj)._useOnlyInTown = false; dye.obj._dyeParams = dye._dyeParams; if (!dye.Added) { AddNewItems.Add(delegate { AddNewItem(dye); }); dye.ShopItem._itemNameTag = ((ScriptableItem)dye.obj)._itemName; dye.ShopItem._scriptItem = (ScriptableItem)(object)dye.obj; } break; } case FolderType.Helm: { if (_thing == null) { Thing = new Helm(Mod); } Helm helm = (Helm)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)helm); } catch (Exception ex5) { Log(Mod.Name + " : " + Dir.Name + " => " + ex5.Message, 4); break; } ((ScriptableItem)helm.obj)._itemType = (ItemType)0; ((ScriptableItem)helm.obj)._itemName = helm._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Helm-" + Dir.Name + "</size></color>"; ((Object)helm.obj).name = helm._itemName + "-" + Mod.Name + "-Helm-" + Dir.Name; ((ScriptableItem)helm.obj)._itemRarity = (ItemRarity)4; ((ScriptableItem)helm.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)helm.obj)._itemDescription = helm._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)helm.obj)._destroyOnDrop = false; ((ScriptableItem)helm.obj)._vendorCost = 0; ((ScriptableEquipment)helm.obj)._equipType = (ItemEquipType)0; ((ScriptableArmor)helm.obj)._canDyeArmor = helm._canDyeArmor; ((ScriptableArmor)helm.obj)._colorAdjustParams = helm._colorAdjustParams; helm.obj._blendHelmValue = helm._blendHelmValue; helm.obj._useHelmHairDisplay = helm._useHelmHairDisplay; helm.obj._hideHair = helm._hideHair; helm.obj._hideEars = helm._hideEars; helm.obj._hideMisc = helm._hideMisc; if (!helm.Added) { ModelPartAssignments[PieceType.helmRender].Add(delegate { HelmRender(helm); }); ModelPartAssignments[PieceType.helmOverrideMesh].Add(delegate { HelmOverrideMesh(helm); }); AddNewItems.Add(delegate { AddNewItem(helm); }); helm.ShopItem._itemNameTag = ((ScriptableItem)helm.obj)._itemName; helm.ShopItem._scriptItem = (ScriptableItem)(object)helm.obj; } break; } case FolderType.Leggings: { if (_thing == null) { Thing = new Leggings(Mod); } Leggings leggings = (Leggings)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)leggings); } catch (Exception ex7) { Log(Mod.Name + " : " + Dir.Name + " => " + ex7.Message, 4); break; } ((ScriptableItem)leggings.obj)._itemType = (ItemType)0; ((ScriptableItem)leggings.obj)._itemName = leggings._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Leggings-" + Dir.Name + "</size></color>"; ((Object)leggings.obj).name = leggings._itemName + "-" + Mod.Name + "-Leggings-" + Dir.Name; ((ScriptableItem)leggings.obj)._itemRarity = (ItemRarity)4; ((ScriptableItem)leggings.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)leggings.obj)._itemDescription = leggings._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)leggings.obj)._destroyOnDrop = false; ((ScriptableItem)leggings.obj)._vendorCost = 0; ((ScriptableEquipment)leggings.obj)._equipType = (ItemEquipType)0; ((ScriptableArmor)leggings.obj)._canDyeArmor = leggings._canDyeArmor; ((ScriptableArmor)leggings.obj)._colorAdjustParams = leggings._colorAdjustParams; leggings.obj._textureUpperLegOnly = leggings._textureUpperLegOnly; leggings.obj._textureFeet = leggings._textureFeet; if (!leggings.Added) { ModelPartAssignments[PieceType.legPieceRend1].Add(delegate { LegPieceRender_01(leggings); }); ModelPartAssignments[PieceType.legPieceRend2].Add(delegate { LegPieceRender_02(leggings); }); ModelPartAssignments[PieceType.legPieceRend3].Add(delegate { LegPieceRender_03(leggings); }); ModelPartAssignments[PieceType.legPieceRend4].Add(delegate { LegPieceRender_04(leggings); }); AddNewItems.Add(delegate { AddNewItem(leggings); }); leggings.ShopItem._itemNameTag = ((ScriptableItem)leggings.obj)._itemName; leggings.ShopItem._scriptItem = (ScriptableItem)(object)leggings.obj; } break; } case FolderType.Shield: { if (_thing == null) { Thing = new Shield(Mod); } Shield shield = (Shield)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)shield); } catch (Exception ex9) { Log(Mod.Name + " : " + Dir.Name + " => " + ex9.Message, 4); break; } ((ScriptableItem)shield.obj)._itemType = (ItemType)0; ((ScriptableItem)shield.obj)._itemName = shield._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Shield-" + Dir.Name + "</size></color>"; ((Object)shield.obj).name = shield._itemName + "-" + Mod.Name + "-Shield-" + Dir.Name; ((ScriptableItem)shield.obj)._itemRarity = (ItemRarity)0; ((ScriptableItem)shield.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)shield.obj)._itemDescription = shield._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)shield.obj)._destroyOnDrop = false; ((ScriptableItem)shield.obj)._vendorCost = 0; ((ScriptableEquipment)shield.obj)._equipType = (ItemEquipType)2; shield.obj._blockDamageThreshold = 0; shield.obj._textureColorAdjust = shield._textureColorAdjust; if (!shield.Added) { ModelPartAssignments[PieceType.shieldMesh].Add(delegate { ShieldMesh(shield); }); AddNewItems.Add(delegate { AddNewItem(shield); }); shield.ShopItem._itemNameTag = ((ScriptableItem)shield.obj)._itemName; shield.ShopItem._scriptItem = (ScriptableItem)(object)shield.obj; } break; } case FolderType.TradeItem: { if (_thing == null) { Thing = new TradeItem(Mod); } TradeItem tradeitem = (TradeItem)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)tradeitem); } catch (Exception ex6) { Log(Mod.Name + " : " + Dir.Name + " => " + ex6.Message, 4); break; } ((ScriptableItem)tradeitem.obj)._itemName = tradeitem._itemName + "<color=#00000000><size=1>" + Mod.Name + "-TradeItem-" + Dir.Name + "</size></color>"; ((Object)tradeitem.obj).name = tradeitem._itemName + "-" + Mod.Name + "-TradeItem-" + Dir.Name; ((ScriptableItem)tradeitem.obj)._itemRarity = (ItemRarity)0; ((ScriptableItem)tradeitem.obj)._itemSortTag = (SortTag)9; ((ScriptableItem)tradeitem.obj)._itemDescription = tradeitem._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)tradeitem.obj)._maxStackAmount = 99; ((ScriptableItem)tradeitem.obj)._destroyOnDrop = false; ((ScriptableItem)tradeitem.obj)._vendorCost = 0; TradeItemExtras(tradeitem); if (!tradeitem.Added) { AddNewItems.Add(delegate { AddNewItem(tradeitem); }); tradeitem.ShopItem._itemNameTag = ((ScriptableItem)tradeitem.obj)._itemName; tradeitem.ShopItem._scriptItem = (ScriptableItem)(object)tradeitem.obj; } break; } case FolderType.Weapon: { if (_thing == null) { Thing = new Weapon(Mod); } Weapon weapon = (Weapon)Thing; try { JsonUtility.FromJsonOverwrite(text, (object)weapon); } catch (Exception ex) { Log(Mod.Name + " : " + Dir.Name + " => " + ex.Message, 4); break; } ((ScriptableItem)weapon.obj)._itemType = (ItemType)0; ((ScriptableItem)weapon.obj)._itemName = weapon._itemName + "<color=#00000000><size=1>" + Mod.Name + "-Weapon-" + Dir.Name + "</size></color>"; ((Object)weapon.obj).name = weapon._itemName + "-" + Mod.Name + "-Weapon-" + Dir.Name; ((ScriptableItem)weapon.obj)._itemRarity = (ItemRarity)0; ((ScriptableItem)weapon.obj)._itemSortTag = (SortTag)0; ((ScriptableItem)weapon.obj)._itemDescription = weapon._itemDescription + "\n<color=yellow>[" + Mod.Name + "]</color>"; ((ScriptableItem)weapon.obj)._destroyOnDrop = false; ((ScriptableItem)weapon.obj)._vendorCost = 0; ((ScriptableEquipment)weapon.obj)._equipType = (ItemEquipType)1; ScriptableWeapon obj = weapon.obj; if (obj._weaponConditionSlot == null) { obj._weaponConditionSlot = new ConditionSlot(); } weapon.obj._textureColorAdjust = weapon._textureColorAdjust; obj = weapon.obj; if (obj.weaponMesh == null) { obj.weaponMesh = NothingMesh; } if ((Object)(object)weapon.obj.weaponType == (Object)null) { WeaponActionsActions.Add(delegate { WeaponActions(weapon); }); } else { WeaponActions(weapon); } if (!weapon.Added) { ModelPartAssignments[PieceType.weaponMesh].Add(delegate { WeaponMesh(weapon); }); AddNewItems.Add(delegate { AddNewItem(weapon); }); weapon.ShopItem._itemNameTag = ((ScriptableItem)weapon.obj)._itemName; weapon.ShopItem._scriptItem = (ScriptableItem)(object)weapon.obj; } break; } case FolderType.Eyes: case FolderType.Hair: case FolderType.Mesh: case FolderType.Mouth: case FolderType.Skin: break; } } private void FindFiles() { foreach (FileInfo item in Dir.EnumerateFiles()) { if (item.Extension.Length == 0) { continue; } string text = item.Name.TrimStart('_').Replace(item.Extension, string.Empty); switch (Type) { case FolderType.ArmorRender: case FolderType.Hair: case FolderType.Mesh: if (AtlyssGLTF.Enabled && !Pieces.ContainsKey(PieceType.glb) && item.Extension.Equals(".glb", StringComparison.OrdinalIgnoreCase)) { Pieces.TryAdd(PieceType.glb, new GLB(this, PieceType.glb, item)); } continue; case FolderType.Eyes: { if (item.Extension.Equals(".png", StringComparison.OrdinalIgnoreCase) && PieceTypesEyes.TryGetValue(text, out var value)) { Pieces.TryAdd(value, new PNG(this, value, item)); } continue; } case FolderType.Mouth: case FolderType.Skin: { if (item.Extension.Equals(".png", StringComparison.OrdinalIgnoreCase) && PieceTypes.TryGetValue(text, out var value2)) { Pieces.TryAdd(value2, new PNG(this, value2, item)); } continue; } } PieceType value4; PieceType value5; if (item.Extension.Equals(".txt", StringComparison.OrdinalIgnoreCase)) { if (PieceTypes.TryGetValue(text, out var value3)) { Pieces.TryAdd(value3, new TXT(this, value3, item)); } else if (text.Equals(Dir.Name, StringComparison.OrdinalIgnoreCase)) { Pieces.TryAdd(PieceType.param, new TXT(this, PieceType.param, item)); } } else if (item.Extension.Equals(".png", StringComparison.OrdinalIgnoreCase) && PieceTypes.TryGetValue(text, out value4)) { Pieces.TryAdd(value4, new PNG(this, value4, item)); } else if (item.Extension.Equals(".glb", StringComparison.OrdinalIgnoreCase) && PieceTypes.TryGetValue(text, out value5)) { Pieces.TryAdd(value5, new GLB(this, value5, item)); } } SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } private void PutItTogether() { Piece value; switch (Type) { case FolderType.ArmorRender: break; case FolderType.Cape: { if (_thing == null) { Thing = new Cape(Mod); } Cape cape = (Cape)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG13 = (PNG)value; ((ScriptableItem)cape.obj)._itemIcon = pNG13.Spr; } else { ((ScriptableItem)cape.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.armor, out value)) { PNG pNG14 = (PNG)value; ((ScriptableArmor)cape.obj)._armorTexture = (Texture)(object)pNG14.Tex; } else { ((ScriptableArmor)cape.obj)._armorTexture = (Texture)(object)Texture2D.blackTexture; } break; } case FolderType.Chestpiece: { if (_thing == null) { Thing = new Chestpiece(Mod); } Chestpiece chestpiece = (Chestpiece)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG34 = (PNG)value; ((ScriptableItem)chestpiece.obj)._itemIcon = pNG34.Spr; } else { ((ScriptableItem)chestpiece.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.armor, out value)) { PNG pNG35 = (PNG)value; ((ScriptableArmor)chestpiece.obj)._armorTexture = (Texture)(object)pNG35.Tex; } else { ((ScriptableArmor)chestpiece.obj)._armorTexture = (Texture)(object)Texture2D.blackTexture; } if (Pieces.TryGetValue(PieceType.boobOverride, out value)) { PNG pNG36 = (PNG)value; chestpiece.obj._boobOverrideTexture = (Texture)(object)pNG36.Tex; } if (Pieces.TryGetValue(PieceType.chestRenderTex, out value)) { PNG pNG37 = (PNG)value; chestpiece.obj._chestRenderTexture = (Texture)(object)pNG37.Tex; } if (Pieces.TryGetValue(PieceType.chestRenderBoob, out value)) { PNG pNG38 = (PNG)value; chestpiece.obj._chestRenderBoobTexture = (Texture)(object)pNG38.Tex; } if (Pieces.TryGetValue(PieceType.neckCollarTex, out value)) { PNG pNG39 = (PNG)value; chestpiece.obj._neckCollarTexture = (Texture)(object)pNG39.Tex; } if (Pieces.TryGetValue(PieceType.shoulderPadTex, out value)) { PNG pNG40 = (PNG)value; chestpiece.obj._shoulderpadTexture = (Texture)(object)pNG40.Tex; } if (Pieces.TryGetValue(PieceType.robeSkirtTex, out value)) { PNG pNG41 = (PNG)value; chestpiece.obj._robeSkirtTexture = (Texture)(object)pNG41.Tex; } if (Pieces.TryGetValue(PieceType.legOverlay, out value)) { PNG pNG42 = (PNG)value; chestpiece.obj._legOverlayTexture = (Texture)(object)pNG42.Tex; } break; } case FolderType.Consumable: { if (_thing == null) { Thing = new Consumable(Mod); } Consumable consumable = (Consumable)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG33 = (PNG)value; ((ScriptableItem)consumable.obj)._itemIcon = pNG33.Spr; } else { ((ScriptableItem)consumable.obj)._itemIcon = Sprites["joker"]; } break; } case FolderType.Dye: { if (_thing == null) { Thing = new Dye(Mod); } Dye dye = (Dye)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG15 = (PNG)value; ((ScriptableItem)dye.obj)._itemIcon = pNG15.Spr; } else { ((ScriptableItem)dye.obj)._itemIcon = Sprites["BrokenDye"]; } break; } case FolderType.Eyes: { if (_thing == null) { Thing = new Eyes(Mod); } Eyes eyes = (Eyes)Thing; eyes.Name = Mod.Name + "-" + RaceF.Race.ToString() + "-Eyes-" + Dir.Name; if (Pieces.TryGetValue(PieceType.center, out value)) { PNG pNG16 = (PNG)value; eyes.obj._center = (Texture)(object)pNG16.Tex; if (Pieces.TryGetValue(PieceType.up, out value)) { PNG pNG17 = (PNG)value; eyes.obj._up = (Texture)(object)pNG17.Tex; } else { eyes.obj._up = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.down, out value)) { PNG pNG18 = (PNG)value; eyes.obj._down = (Texture)(object)pNG18.Tex; } else { eyes.obj._down = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.left, out value)) { PNG pNG19 = (PNG)value; eyes.obj._left = (Texture)(object)pNG19.Tex; } else { eyes.obj._left = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.right, out value)) { PNG pNG20 = (PNG)value; eyes.obj._right = (Texture)(object)pNG20.Tex; } else { eyes.obj._right = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.closed, out value)) { PNG pNG21 = (PNG)value; eyes.obj._closed = (Texture)(object)pNG21.Tex; } else { eyes.obj._closed = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.pissed, out value)) { PNG pNG22 = (PNG)value; eyes.obj._pissed = (Texture)(object)pNG22.Tex; } else { eyes.obj._pissed = eyes.obj._center; } if (Pieces.TryGetValue(PieceType.hurt, out value)) { PNG pNG23 = (PNG)value; eyes.obj._hurt = (Texture)(object)pNG23.Tex; } else { eyes.obj._hurt = eyes.obj._center; } if (!eyes.Added) { MakeCondMark(eyes.Name, FolderType.Eyes); if (RaceF.Race == RaceType.HB_ALLRACES) { AddParts[RaceType.Byrdle][FolderType.Eyes].Add(eyes); AddParts[RaceType.Chang][FolderType.Eyes].Add(eyes); AddParts[RaceType.Imp][FolderType.Eyes].Add(eyes); AddParts[RaceType.Kubold][FolderType.Eyes].Add(eyes); AddParts[RaceType.Poon][FolderType.Eyes].Add(eyes); } else { AddParts[RaceF.Race][FolderType.Eyes].Add(eyes); } } } else { Log(eyes.Name + " - Eyes didn't have center.png!", 4); } break; } case FolderType.Hair: break; case FolderType.Helm: { if (_thing == null) { Thing = new Helm(Mod); } Helm helm = (Helm)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG11 = (PNG)value; ((ScriptableItem)helm.obj)._itemIcon = pNG11.Spr; } else { ((ScriptableItem)helm.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.armor, out value)) { PNG pNG12 = (PNG)value; ((ScriptableArmor)helm.obj)._armorTexture = (Texture)(object)pNG12.Tex; } else { ((ScriptableArmor)helm.obj)._armorTexture = (Texture)(object)Texture2D.blackTexture; } break; } case FolderType.Leggings: { if (_thing == null) { Thing = new Leggings(Mod); } Leggings leggings = (Leggings)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG27 = (PNG)value; ((ScriptableItem)leggings.obj)._itemIcon = pNG27.Spr; } else { ((ScriptableItem)leggings.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.armor, out value)) { PNG pNG28 = (PNG)value; ((ScriptableArmor)leggings.obj)._armorTexture = (Texture)(object)pNG28.Tex; } else { ((ScriptableArmor)leggings.obj)._armorTexture = (Texture)(object)Texture2D.blackTexture; } if (Pieces.TryGetValue(PieceType.legPieceTex1, out value)) { PNG pNG29 = (PNG)value; leggings.obj._legPieceTexture_01 = (Texture)(object)pNG29.Tex; } if (Pieces.TryGetValue(PieceType.legPieceTex2, out value)) { PNG pNG30 = (PNG)value; leggings.obj._legPieceTexture_02 = (Texture)(object)pNG30.Tex; } if (Pieces.TryGetValue(PieceType.legPieceTex3, out value)) { PNG pNG31 = (PNG)value; leggings.obj._legPieceTexture_03 = (Texture)(object)pNG31.Tex; } if (Pieces.TryGetValue(PieceType.legPieceTex4, out value)) { PNG pNG32 = (PNG)value; leggings.obj._legPieceTexture_04 = (Texture)(object)pNG32.Tex; } break; } case FolderType.Mesh: break; case FolderType.Mouth: { if (_thing == null) { Thing = new Mouth(Mod); } Mouth mouth = (Mouth)Thing; mouth.Name = Mod.Name + "-" + RaceF.Race.ToString() + "-Mouth-" + Dir.Name; if (Pieces.TryGetValue(PieceType.closed, out value)) { PNG pNG9 = (PNG)value; mouth.obj._closed = (Texture)(object)pNG9.Tex; if (Pieces.TryGetValue(PieceType.open, out value)) { PNG pNG10 = (PNG)value; mouth.obj._open = (Texture)(object)pNG10.Tex; } else { mouth.obj._open = mouth.obj._closed; } if (!mouth.Added) { MakeCondMark(mouth.Name, FolderType.Mouth); if (RaceF.Race == RaceType.HB_ALLRACES) { AddParts[RaceType.Byrdle][FolderType.Mouth].Add(mouth); AddParts[RaceType.Chang][FolderType.Mouth].Add(mouth); AddParts[RaceType.Imp][FolderType.Mouth].Add(mouth); AddParts[RaceType.Kubold][FolderType.Mouth].Add(mouth); AddParts[RaceType.Poon][FolderType.Mouth].Add(mouth); } else { AddParts[RaceF.Race][FolderType.Mouth].Add(mouth); } } } else { Log(mouth.Name + " - Mouth didn't have closed.png!", 4); } break; } case FolderType.Shield: { if (_thing == null) { Thing = new Shield(Mod); } Shield shield = (Shield)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG24 = (PNG)value; ((ScriptableItem)shield.obj)._itemIcon = pNG24.Spr; } else { ((ScriptableItem)shield.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.shieldTex, out value)) { PNG pNG25 = (PNG)value; shield.obj._shieldTexture = (Texture)(object)pNG25.Tex; } else { shield.obj._shieldTexture = (Texture)(object)Texture2D.blackTexture; } break; } case FolderType.Skin: { if (_thing == null) { Thing = new Skin(Mod); } Skin skin = (Skin)Thing; skin.Name = Mod.Name + "-" + RaceF.Race.ToString() + "-Skin-" + Dir.Name; skin.obj[RaceType.Byrdle]._textureGroupTag = string.Empty; skin.obj[RaceType.Chang]._textureGroupTag = string.Empty; skin.obj[RaceType.Imp]._textureGroupTag = string.Empty; skin.obj[RaceType.Kubold]._textureGroupTag = string.Empty; skin.obj[RaceType.Poon]._textureGroupTag = string.Empty; switch (RaceF.Race) { case RaceType.Byrdle: skin.obj[RaceType.Byrdle]._textureGroupTag = skin.Name; break; case RaceType.Chang: skin.obj[RaceType.Chang]._textureGroupTag = skin.Name; break; case RaceType.Imp: skin.obj[RaceType.Imp]._textureGroupTag = skin.Name; break; case RaceType.Kubold: skin.obj[RaceType.Kubold]._textureGroupTag = skin.Name; break; case RaceType.Poon: skin.obj[RaceType.Poon]._textureGroupTag = skin.Name; break; case RaceType.HB_ALLRACES: skin.obj[RaceType.Byrdle]._textureGroupTag = skin.Name; skin.obj[RaceType.Chang]._textureGroupTag = skin.Name; skin.obj[RaceType.Imp]._textureGroupTag = skin.Name; skin.obj[RaceType.Kubold]._textureGroupTag = skin.Name; skin.obj[RaceType.Poon]._textureGroupTag = skin.Name; break; } if (Pieces.TryGetValue(PieceType.body, out value)) { PNG pNG3 = (PNG)value; skin.obj[RaceType.Byrdle]._bodyTexture = (Texture)(object)pNG3.Tex; skin.obj[RaceType.Chang]._bodyTexture = (Texture)(object)pNG3.Tex; skin.obj[RaceType.Imp]._bodyTexture = (Texture)(object)pNG3.Tex; skin.obj[RaceType.Kubold]._bodyTexture = (Texture)(object)pNG3.Tex; skin.obj[RaceType.Poon]._bodyTexture = (Texture)(object)pNG3.Tex; } if (Pieces.TryGetValue(PieceType.leg, out value)) { PNG pNG4 = (PNG)value; skin.obj[RaceType.Byrdle]._legTexture = (Texture)(object)pNG4.Tex; skin.obj[RaceType.Chang]._legTexture = (Texture)(object)pNG4.Tex; skin.obj[RaceType.Imp]._legTexture = (Texture)(object)pNG4.Tex; skin.obj[RaceType.Kubold]._legTexture = (Texture)(object)pNG4.Tex; skin.obj[RaceType.Poon]._legTexture = (Texture)(object)pNG4.Tex; } if (Pieces.TryGetValue(PieceType.head, out value)) { PNG pNG5 = (PNG)value; skin.obj[RaceType.Byrdle]._headTexture = (Texture)(object)pNG5.Tex; skin.obj[RaceType.Chang]._headTexture = (Texture)(object)pNG5.Tex; skin.obj[RaceType.Imp]._headTexture = (Texture)(object)pNG5.Tex; skin.obj[RaceType.Kubold]._headTexture = (Texture)(object)pNG5.Tex; skin.obj[RaceType.Poon]._headTexture = (Texture)(object)pNG5.Tex; } if (Pieces.TryGetValue(PieceType.hair, out value)) { PNG pNG6 = (PNG)value; skin.obj[RaceType.Byrdle]._hairTexture = (Texture)(object)pNG6.Tex; skin.obj[RaceType.Chang]._hairTexture = (Texture)(object)pNG6.Tex; skin.obj[RaceType.Imp]._hairTexture = (Texture)(object)pNG6.Tex; skin.obj[RaceType.Kubold]._hairTexture = (Texture)(object)pNG6.Tex; skin.obj[RaceType.Poon]._hairTexture = (Texture)(object)pNG6.Tex; } if (Pieces.TryGetValue(PieceType.tail, out value)) { PNG pNG7 = (PNG)value; skin.obj[RaceType.Byrdle]._tailTexture = (Texture)(object)pNG7.Tex; skin.obj[RaceType.Chang]._tailTexture = (Texture)(object)pNG7.Tex; skin.obj[RaceType.Imp]._tailTexture = (Texture)(object)pNG7.Tex; skin.obj[RaceType.Kubold]._tailTexture = (Texture)(object)pNG7.Tex; skin.obj[RaceType.Poon]._tailTexture = (Texture)(object)pNG7.Tex; } if (Pieces.TryGetValue(PieceType.ear, out value)) { PNG pNG8 = (PNG)value; skin.obj[RaceType.Byrdle]._earTexture = (Texture)(object)pNG8.Tex; skin.obj[RaceType.Chang]._earTexture = (Texture)(object)pNG8.Tex; skin.obj[RaceType.Imp]._earTexture = (Texture)(object)pNG8.Tex; skin.obj[RaceType.Kubold]._earTexture = (Texture)(object)pNG8.Tex; skin.obj[RaceType.Poon]._earTexture = (Texture)(object)pNG8.Tex; } if ((Object)(object)skin.obj[RaceType.Byrdle]._headTexture != (Object)null && (Object)(object)skin.obj[RaceType.Byrdle]._earTexture == (Object)null) { skin.obj[RaceType.Byrdle]._earTexture = skin.obj[RaceType.Byrdle]._headTexture; } if ((Object)(object)skin.obj[RaceType.Byrdle]._tailTexture != (Object)null && (Object)(object)skin.obj[RaceType.Byrdle]._hairTexture == (Object)null) { skin.obj[RaceType.Byrdle]._hairTexture = skin.obj[RaceType.Byrdle]._tailTexture; } if ((Object)(object)skin.obj[RaceType.Chang]._headTexture != (Object)null && (Object)(object)skin.obj[RaceType.Chang]._hairTexture == (Object)null) { skin.obj[RaceType.Chang]._hairTexture = skin.obj[RaceType.Chang]._headTexture; } if ((Object)(object)skin.obj[RaceType.Imp]._headTexture != (Object)null && (Object)(object)skin.obj[RaceType.Imp]._earTexture == (Object)null) { skin.obj[RaceType.Imp]._earTexture = skin.obj[RaceType.Imp]._headTexture; } if ((Object)(object)skin.obj[RaceType.Poon]._headTexture != (Object)null) { if ((Object)(object)skin.obj[RaceType.Poon]._hairTexture == (Object)null) { skin.obj[RaceType.Poon]._hairTexture = skin.obj[RaceType.Poon]._headTexture; } if ((Object)(object)skin.obj[RaceType.Poon]._earTexture == (Object)null) { skin.obj[RaceType.Poon]._earTexture = skin.obj[RaceType.Poon]._headTexture; } if ((Object)(object)skin.obj[RaceType.Poon]._tailTexture == (Object)null) { skin.obj[RaceType.Poon]._tailTexture = skin.obj[RaceType.Poon]._headTexture; } } if (!skin.Added) { MakeCondMark(skin.Name, FolderType.Skin); if (RaceF.Race == RaceType.HB_ALLRACES) { AddParts[RaceType.Byrdle][FolderType.Skin].Add(skin); AddParts[RaceType.Chang][FolderType.Skin].Add(skin); AddParts[RaceType.Imp][FolderType.Skin].Add(skin); AddParts[RaceType.Kubold][FolderType.Skin].Add(skin); AddParts[RaceType.Poon][FolderType.Skin].Add(skin); } else { AddParts[RaceF.Race][FolderType.Skin].Add(skin); } } break; } case FolderType.TradeItem: { if (_thing == null) { Thing = new TradeItem(Mod); } TradeItem tradeItem = (TradeItem)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG26 = (PNG)value; ((ScriptableItem)tradeItem.obj)._itemIcon = pNG26.Spr; } else { ((ScriptableItem)tradeItem.obj)._itemIcon = Sprites["joker"]; } break; } case FolderType.Weapon: { if (_thing == null) { Thing = new Weapon(Mod); } Weapon weapon = (Weapon)Thing; if (Pieces.TryGetValue(PieceType.icon, out value)) { PNG pNG = (PNG)value; ((ScriptableItem)weapon.obj)._itemIcon = pNG.Spr; } else { ((ScriptableItem)weapon.obj)._itemIcon = Sprites["joker"]; } if (Pieces.TryGetValue(PieceType.weaponTex, out value)) { PNG pNG2 = (PNG)value; weapon.obj.weaponTexture = (Texture)(object)pNG2.Tex; } else { weapon.obj.weaponTexture = (Texture)(object)Texture2D.blackTexture; } break; } } } internal void Reload(bool nocheck) { foreach (Piece value in Pieces.Values) { value.Reload(nocheck); } } } internal abstract class Thing { internal ModFolder Mod { get; } internal virtual FolderType Type { get; } internal bool Added { get; set; } protected Thing(ModFolder m) { Mod = m; Added = false; base..ctor(); } } internal abstract class ItemThing : Thing { public string _itemName = "New Homebrewery Item"; public string _itemDescription = string.Empty; public int sortindex = 0; public string overrideitem = string.Empty; internal ShopkeepItem ShopItem { get; } = new ShopkeepItem { _stockRefreshTimer = 0f, _isInfiniteStock = true, _removeAtEmptyStock = false, _randomizeModifier = false, _isGambleSlot = false }; internal virtual ShopTab ShopTab { get; } = (ShopTab)1; protected ItemThing(ModFolder m) : base(m) { }//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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) } internal class VanillaItem : ItemThing { internal override FolderType Type { get; } internal override ShopTab ShopTab { get; } public VanillaItem(ModFolder m, FolderType f, ShopTab t) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Type = f; ShopTab = t; base..ctor(m); } } internal class Consumable : ItemThing { internal ScriptableStatusConsumable obj = ScriptableObject.CreateInstance<ScriptableStatusConsumable>(); public string extra = string.Empty; public int food = 2; public int damage = 0; public float cooldown = 8f; internal override FolderType Type { get; } = FolderType.Consumable; public Consumable(ModFolder m) : base(m) { } } internal class Dye : ItemThing { internal ScriptableArmorDye obj = ScriptableObject.CreateInstance<ScriptableArmorDye>(); public ColorAdjustShader_Profile _dyeParams = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; internal override FolderType Type { get; } = FolderType.Dye; internal string Marker { get; set; } = string.Empty; public Dye(ModFolder m) : base(m) { }//IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_0039: 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_0054: Expected O, but got Unknown } internal class TradeItem : ItemThing { internal ScriptableTradeItem obj = ScriptableObject.CreateInstance<ScriptableTradeItem>(); public string extra = string.Empty; internal override FolderType Type { get; } = FolderType.TradeItem; internal override ShopTab ShopTab { get; } = (ShopTab)2; public TradeItem(ModFolder m) : base(m) { }//IL_0020: Unknown result type (might be due to invalid IL or missing references) } internal abstract class EquipItemThing : ItemThing { public bool _canDyeArmor = false; public ColorAdjustShader_Profile _colorAdjustParams = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; internal override ShopTab ShopTab { get; } = (ShopTab)0; protected EquipItemThing(ModFolder m) : base(m) { }//IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_003e: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) } internal class Shield : EquipItemThing { internal ScriptableShield obj = ScriptableObject.CreateInstance<ScriptableShield>(); public string _shieldMesh = string.Empty; public ColorAdjustShader_Profile _textureColorAdjust = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; internal override FolderType Type { get; } = FolderType.Shield; public Shield(ModFolder m) : base(m) { }//IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown } internal class Weapon : EquipItemThing { internal ScriptableWeapon obj = ScriptableObject.CreateInstance<ScriptableWeapon>(); public string weaponMesh = string.Empty; public ColorAdjustShader_Profile _textureColorAdjust = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; public string weaponType = string.Empty; public string _weaponProjectileSet = string.Empty; internal override FolderType Type { get; } = FolderType.Weapon; public Weapon(ModFolder m) : base(m) { }//IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown } internal class Cape : EquipItemThing { internal ScriptableCape obj = ScriptableObject.CreateInstance<ScriptableCape>(); public string _capeMesh = string.Empty; internal override FolderType Type { get; } = FolderType.Cape; public Cape(ModFolder m) : base(m) { } } internal class Chestpiece : EquipItemThing { internal ScriptableChestpiece obj = ScriptableObject.CreateInstance<ScriptableChestpiece>(); public bool _lockBoobs = false; public bool _disableJiggleBoobBones = false; public bool _textureArms = true; public int _shoulderPadDisplayType = 0; public string _neckCollarMesh = string.Empty; public string _chestRenderDisplay = string.Empty; public string _robeSkirtRender = string.Empty; public string _armCuffRender = string.Empty; public string _shoulderpadMesh = string.Empty; internal override FolderType Type { get; } = FolderType.Chestpiece; public Chestpiece(ModFolder m) : base(m) { } } internal class Helm : EquipItemThing { internal ScriptableHelm obj = ScriptableObject.CreateInstance<ScriptableHelm>(); public bool _useHelmHairDisplay = false; public bool _hideHair = false; public bool _hideEars = false; public bool _hideMisc = false; public float _blendHelmValue = 0f; public string _helmRender = string.Empty; public string _helmOverrideMesh = string.Empty; internal override FolderType Type { get; } = FolderType.Helm; public Helm(ModFolder m) : base(m) { } } internal class Leggings : EquipItemThing { internal ScriptableLeggings obj = ScriptableObject.CreateInstance<ScriptableLeggings>(); public bool _textureUpperLegOnly = false; public bool _textureFeet = false; public string _legPieceRender_01 = string.Empty; public string _legPieceRender_02 = string.Empty; public string _legPieceRender_03 = string.Empty; public string _legPieceRender_04 = string.Empty; internal override FolderType Type { get; } = FolderType.Leggings; public Leggings(ModFolder m) : base(m) { } } internal class Eyes : Thing { internal string Name = string.Empty; internal EyeTextureGroup obj = new EyeTextureGroup(); internal override FolderType Type { get; } = FolderType.Eyes; public Eyes(ModFolder m) : base(m) { }//IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown } internal class Mouth : Thing { internal string Name = string.Empty; internal MouthTextureGroup obj = new MouthTextureGroup(); internal override FolderType Type { get; } = FolderType.Mouth; public Mouth(ModFolder m) : base(m) { }//IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown } internal class Skin : Thing { internal string Name = string.Empty; internal readonly Dictionary<RaceType, SkinTextureGroup> obj = new Dictionary<RaceType, SkinTextureGroup> { { RaceType.Byrdle, new SkinTextureGroup() }, { RaceType.Chang, new SkinTextureGroup() }, { RaceType.Imp, new SkinTextureGroup() }, { RaceType.Kubold, new SkinTextureGroup() }, { RaceType.Poon, new SkinTextureGroup() } }; internal override FolderType Type { get; } = FolderType.Skin; public Skin(ModFolder m) : base(m) { }//IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown } internal class ArmorRender : Thing { internal ScriptableArmorRender obj = ScriptableObject.CreateInstance<ScriptableArmorRender>(); internal RaceArmorRender Byrdle = new RaceArmorRender { _raceNameTag = "Byrdle", _meshPosition = new Vector3(0f, 0.008f, 0f) }; internal RaceArmorRender Chang = new RaceArmorRender { _raceNameTag = "Chang", _meshPosition = new Vector3(0f, 0.008f, 0f) }; internal RaceArmorRender Imp = new RaceArmorRender { _raceNameTag = "Imp", _meshPosition = new Vector3(0f, 0.008f, 0f) }; internal RaceArmorRender Kubold = new RaceArmorRender { _raceNameTag = "Kubold", _meshPosition = new Vector3(0f, 0.008f, 0f) }; internal RaceArmorRender Poon = new RaceArmorRender { _raceNameTag = "Poon", _meshPosition = new Vector3(0f, 0.008f, 0f) }; internal override FolderType Type { get; } = FolderType.ArmorRender; public ArmorRender(ModFolder m) : base(m) { }//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_0023: Unknown result type (might be due to invalid IL or missing references) //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_0042: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //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_0083: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00a3: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown } internal class Hair : Thing { internal string Name = string.Empty; internal readonly Dictionary<RaceType, Mesh> obj = new Dictionary<RaceType, Mesh> { { RaceType.Byrdle, null }, { RaceType.Chang, null }, { RaceType.Imp, null }, { RaceType.Kubold, null }, { RaceType.Poon, null } }; internal override FolderType Type { get; } = FolderType.Hair; public Hair(ModFolder m) : base(m) { } } internal class MeshPart : Thing { internal Mesh obj = new Mesh(); internal override FolderType Type { get; } = FolderType.Mesh; public MeshPart(ModFolder m) : base(m) { }//IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown } internal abstract class Piece { internal readonly ModFolder Mod; internal string Name = string.Empty; internal readonly ThingFolder ThingF; internal readonly FolderType FType; internal readonly PieceType PType; internal readonly FileInfo FileI; internal readonly Stopwatch SW = Stopwatch.StartNew(); internal double SW_ms; internal Exception? Error; public Piece(ThingFolder f, PieceType t, FileInfo i) { ThingF = f; Mod = ThingF.Mod; FType = ThingF.Type; PType = t; FileI = i; SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal abstract void Reload(bool nocheck); } internal class PNG : Piece { private Texture2D? _Tex; private Sprite? _Spr; internal Texture2D Tex { get { return _Tex ?? Texture2D.blackTexture; } set { _Tex = value; } } internal Sprite Spr { get { return _Spr ?? Sprites["joker"]; } set { _Spr = value; } } public PNG(ThingFolder f, PieceType t, FileInfo i) : base(f, t, i) { Name = FileI.Name.Replace(FileI.Extension, string.Empty); TryLoad(); PNGs.Add(this); FileI.Refresh(); SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal override void Reload(bool nocheck) { DateTime lastAccessTime = FileI.LastAccessTime; FileI.Refresh(); if (FileI.Exists && (lastAccessTime < FileI.LastAccessTime || nocheck)) { TryLoad(); } } internal void FilterMode() { if ((Object)(object)_Tex != (Object)null) { ((Texture)Tex).filterMode = (FilterMode)Cfg.FilterMode.Value; } } private void TryLoad() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_01ac: 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) if (!FileI.Exists) { return; } byte[] array; try { array = File.ReadAllBytes(FileI.FullName); } catch (Exception ex) { Log(ex, 4); Error = ex; return; } FolderType fType = FType; if (1 == 0) { } string text = ((fType != FolderType.Eyes && fType != FolderType.Mouth && fType != FolderType.Skin) ? (ThingF.Dir.Name + "_" + Name) : (ThingF.Dir.Name + "_" + ThingF.RaceF.Dir.Name + "_" + Name)); if (1 == 0) { } string text2 = text; try { if ((Object)(object)_Tex == (Object)null) { Tex = new Texture2D(4, 4, TexFormat, false) { name = text2 + "_Tex", anisoLevel = 16, filterMode = (FilterMode)Cfg.FilterMode.Value, mipMapBias = 0f }; } ImageConversion.LoadImage(Tex, array, false); } catch (Exception ex2) { Log(ex2, 4); Error = ex2; return; } if (PType == PieceType.icon) { Spr = Sprite.Create(Tex, new Rect(0f, 0f, (float)((Texture)Tex).width, (float)((Texture)Tex).height), new Vector2(0.5f, 0.5f)); ((Object)Spr).name = text2 + "_Spr"; } } } internal class TXT : Piece { public TXT(ThingFolder f, PieceType t, FileInfo i) : base(f, t, i) { Name = ThingF.Dir.Name + "_param"; TryLoad(); FileI.Refresh(); SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal override void Reload(bool nocheck) { DateTime lastAccessTime = FileI.LastAccessTime; FileI.Refresh(); if (FileI.Exists && (lastAccessTime < FileI.LastAccessTime || nocheck)) { TryLoad(); } } private void TryLoad() { if (!FileI.Exists) { return; } try { string text = File.ReadAllText(FileI.FullName); ThingF.MakeItem(text); } catch (Exception ex) { Log(ex, 4); Error = ex; } } } internal class GLB : Piece { public GLB(ThingFolder f, PieceType t, FileInfo i) : base(f, t, i) { if (ThingF._thing == null) { switch (FType) { case FolderType.ArmorRender: Name = Mod.Name + "-ArmorRender-" + ThingF.Dir.Name; ThingF.Thing = new ArmorRender(Mod); break; case FolderType.Mesh: Name = Mod.Name + "-Mesh-" + ThingF.Dir.Name; ThingF.Thing = new MeshPart(Mod); break; case FolderType.Hair: Name = Mod.Name + "-Hair-" + ThingF.Dir.Name; ThingF.Thing = new Hair(Mod); break; } } TryLoad(); FileI.Refresh(); SW.Stop(); SW_ms = SW.Elapsed.TotalMilliseconds; } internal override void Reload(bool nocheck) { DateTime lastAccessTime = FileI.LastAccessTime; FileI.Refresh(); if (FileI.Exists && (lastAccessTime < FileI.LastAccessTime || nocheck)) { TryLoad(); } } private void TryLoad() { if (!FileI.Exists) { return; } try { switch (FType) { case FolderType.ArmorRender: ImportArmorRender(this); break; case FolderType.Mesh: ImportMeshPart(this); break; case FolderType.Hair: ImportHair(this); break; } } catch (Exception ex) { Log(ex, 4); Error = ex; } } } internal enum PieceType { Undefined, glb, param, armor, icon, legPieceTex1, legPieceRend1, legPieceTex2, legPieceRend2, legPieceTex3, legPieceRend3, legPieceTex4, legPieceRend4, legOverlay, boobOverride, neckCollarTex, neckCollarMesh, chestRenderTex, chestRenderDisplay, chestRenderBoob, robeSkirtTex, robeSkirtRender, shoulderPadTex, shoulderPadMesh, armCuffRender, shieldTex, shieldMesh, weaponTex, weaponMesh, capeMesh, helmRender, helmOverrideMesh, up, pissed, closed, center, right, left, down, hurt, open, body, leg, head, hair, tail, ear } internal struct RaceStruct { internal RaceType type; internal ScriptablePlayerRace race; internal SkinTextureGroup[] skins; internal EyeTextureGroup[] eyes; internal MouthTextureGroup[] mouth; public RaceStruct(RaceType t, ScriptablePlayerRace r, SkinTextureGroup[] s, EyeTextureGroup[] e, MouthTextureGroup[] m) { type = t; race = r; skins = new ReadOnlySpan<SkinTextureGroup>(s).ToArray(); eyes = new ReadOnlySpan<EyeTextureGroup>(e).ToArray(); mouth = new ReadOnlySpan<MouthTextureGroup>(m).ToArray(); } } internal enum FolderType { Undefined, ArmorRender, Cape, Chestpiece, Consumable, Dye, Eyes, Hair, Helm, Leggings, Mesh, Mouth, Shield, Skin, TradeItem, Weapon } internal enum RaceType { Undefined, Byrdle, Chang, Imp, Kubold, Poon, HB_ALLRACES } private readonly Harmony _harmony = new Harmony("Homebrewery"); internal static InstallType installType = InstallType.r2ModMan; private DirectoryInfo? _Location; private static DirectoryInfo? _Internal; private DirectoryInfo? _HBFiles; private readonly Stopwatch ModsSW = new Stopwatch(); internal double ModsSW_ms; internal static readonly Dictionary<string, ModFolder> ModFolders = new Dictionary<string, ModFolder>(); internal static readonly PieceType[] ArmorRenderTypes = new PieceType[8] { PieceType.chestRenderDisplay, PieceType.robeSkirtRender, PieceType.armCuffRender, PieceType.helmRender, PieceType.legPieceRend1, PieceType.legPieceRend2, PieceType.legPieceRend3, PieceType.legPieceRend4 }; internal static readonly PieceType[] MeshPartTypes = new PieceType[6] { PieceType.capeMesh, PieceType.neckCollarMesh, PieceType.shoulderPadMesh, PieceType.helmOverrideMesh, PieceType.shieldMesh, PieceType.weaponMesh }; internal static readonly List<ModShop> ModShops = new List<ModShop>(); internal static readonly Dictionary<PieceType, List<Action>> ModelPartAssignments = new Dictionary<PieceType, List<Action>> { { PieceType.capeMesh, new List<Action>() }, { PieceType.neckCollarMesh, new List<Action>() }, { PieceType.chestRenderDisplay, new List<Action>() }, { PieceType.robeSkirtRender, new List<Action>() }, { PieceType.armCuffRender, new List<Action>() }, { PieceType.shoulderPadMesh, new List<Action>() }, { PieceType.helmRender, new List<Action>() }, { PieceType.helmOverrideMesh, new List<Action>() }, { PieceType.legPieceRend1, new List<Action>() }, { PieceType.legPieceRend2, new List<Action>() }, { PieceType.legPieceRend3, new List<Action>() }, { PieceType.legPieceRend4, new List<Action>() }, { PieceType.shieldMesh, new List<Action>() }, { PieceType.weaponMesh, new List<Action>() } }; internal static Mesh? _NothingMesh; internal static readonly List<Action> WeaponActionsActions = new List<Action>(); internal static readonly List<Action> ExtraEffectsActions = new List<Action>(); internal static readonly List<Action> AddNewItems = new List<Action>(); internal static readonly List<PNG> PNGs = new List<PNG>(); internal static readonly List<Task> ImportArmorRenderTasks = new List<Task>(); internal static readonly List<Action> PlayerRaceAssignments = new List<Action>(); internal static readonly List<Task> ImportMeshPartTasks = new List<Task>(); internal static readonly List<Task> ImportHairTasks = new List<Task>(); internal static readonly List<Action> HairReplaceActions = new List<Action>(); private static readonly Dictionary<string, PieceType> PieceTypes = new Dictionary<string, PieceType>(StringComparer.OrdinalIgnoreCase) { { "PARAM", PieceType.param }, { "PARAMS", PieceType.param }, { "ITEMICON", PieceType.icon }, { "ICON", PieceType.icon }, { "ARMORTEXTURE", PieceType.armor }, { "ARMOR", PieceType.armor }, { "ARMOURTEXTURE", PieceType.armor }, { "ARMOUR", PieceType.armor }, { "LEGPIECETEXTURE_01", PieceType.legPieceTex1 }, { "LEGPIECETEXTURE01", PieceType.legPieceTex1 }, { "LEGPIECE_01", PieceType.legPieceTex1 }, { "LEGPIECE01", PieceType.legPieceTex1 }, { "LEGPIECETEXTURE_1", PieceType.legPieceTex1 }, { "LEGPIECETEXTURE1", PieceType.legPieceTex1 }, { "LEGPIECE_1", PieceType.legPieceTex1 }, { "LEGPIECE1", PieceType.legPieceTex1 }, { "LEGPIECERENDER_01", PieceType.legPieceRend1 }, { "LEGPIECERENDER01", PieceType.legPieceRend1 }, { "LEGPIECERENDER_1", PieceType.legPieceRend1 }, { "LEGPIECERENDER1", PieceType.legPieceRend1 }, { "LEGPIECEMESH_01", PieceType.legPieceRend1 }, { "LEGPIECEMESH01", PieceType.legPieceRend1 }, { "LEGPIECEMESH_1", PieceType.legPieceRend1 }, { "LEGPIECEMESH1", PieceType.legPieceRend1 }, { "LEGPIECETEXTURE_02", PieceType.legPieceTex2 }, { "LEGPIECETEXTURE02", PieceType.legPieceTex2 }, { "LEGPIECE_02", PieceType.legPieceTex2 }, { "LEGPIECE02", PieceType.legPieceTex2 }, { "LEGPIECETEXTURE_2", PieceType.legPieceTex2 }, { "LEGPIECETEXTURE2", PieceType.legPieceTex2 }, { "LEGPIECE_2", PieceType.legPieceTex2 }, { "LEGPIECE2", PieceType.legPieceTex2 }, { "LEGPIECERENDER_02", PieceType.legPieceRend2 }, { "LEGPIECERENDER02", PieceType.legPieceRend2 }, { "LEGPIECERENDER_2", PieceType.legPieceRend2 }, { "LEGPIECERENDER2", PieceType.legPieceRend2 }, { "LEGPIECEMESH_02", PieceType.legPieceRend2 }, { "LEGPIECEMESH02", PieceType.legPieceRend2 }, { "LEGPIECEMESH_2", PieceType.legPieceRend2 }, { "LEGPIECEMESH2", PieceType.legPieceRend2 }, { "LEGPIECETEXTURE_03", PieceType.legPieceTex3 }, { "LEGPIECETEXTURE03", PieceType.legPieceTex3 }, { "LEGPIECE_03", PieceType.legPieceTex3 }, { "LEGPIECE03", PieceType.legPieceTex3 }, { "LEGPIECETEXTURE_3", PieceType.legPieceTex3 }, { "LEGPIECETEXTURE3", PieceType.legPieceTex3 }, { "LEGPIECE_3", PieceType.legPieceTex3 }, { "LEGPIECE3", PieceType.legPieceTex3 }, { "LEGPIECERENDER_03", PieceType.legPieceRend3 }, { "LEGPIECERENDER03", PieceType.legPieceRend3 }, { "LEGPIECERENDER_3", PieceType.legPieceRend3 }, { "LEGPIECERENDER3", PieceType.legPieceRend3 }, { "LEGPIECEMESH_03", PieceType.legPieceRend3 }, { "LEGPIECEMESH03", PieceType.legPieceRend3 }, { "LEGPIECEMESH_3", PieceType.legPieceRend3 }, { "LEGPIECEMESH3", PieceType.legPieceRend3 }, { "LEGPIECETEXTURE_04", PieceType.legPieceTex4 }, { "LEGPIECETEXTURE04", PieceType.legPieceTex4 }, { "LEGPIECE_04", PieceType.legPieceTex4 }, { "LEGPIECE04", PieceType.legPieceTex4 }, { "LEGPIECETEXTURE_4", PieceType.legPieceTex4 }, { "LEGPIECETEXTURE4", PieceType.legPieceTex4 }, { "LEGPIECE_4", PieceType.legPieceTex4 }, { "LEGPIECE4", PieceType.legPieceTex4 }, { "LEGPIECERENDER_04", PieceType.legPieceRend4 }, { "LEGPIECERENDER04", PieceType.legPieceRend4 }, { "LEGPIECERENDER_4", PieceType.legPieceRend4 }, { "LEGPIECERENDER4", PieceType.legPieceRend4 }, { "LEGPIECEMESH_04", PieceType.legPieceRend4 }, { "LEGPIECEMESH04", PieceType.legPieceRend4 }, { "LEGPIECEMESH_4", PieceType.legPieceRend4 }, { "LEGPIECEMESH4", PieceType.legPieceRend4 }, { "LEGOVERLAY", PieceType.legOverlay }, { "LEGOVERLAYTEXTURE", PieceType.legOverlay }, { "BOOBOVERRIDE", PieceType.boobOverride }, { "BOOBOVERRIDETEXTURE", PieceType.boobOverride }, { "NECKCOLLAR", PieceType.neckCollarTex }, { "NECKCOLLARTEXTURE", PieceType.neckCollarTex }, { "COLLAR", PieceType.neckCollarTex }, { "COLLARTEXTURE", PieceType.neckCollarTex }, { "NECKCOLLARMESH", PieceType.neckCollarMesh }, { "COLLARMESH", PieceType.neckCollarMesh }, { "NECKMESH", PieceType.neckCollarMesh }, { "NECKCOLLARRENDER", PieceType.neckCollarMesh }, { "COLLARRENDER", PieceType.neckCollarMesh }, { "NECKRENDER", PieceType.neckCollarMesh }, { "CHESTRENDER", PieceType.chestRenderTex }, { "CHESTRENDERTEXTURE", PieceType.chestRenderTex }, { "CHESTRENDERDISPLAY", PieceType.chestRenderDisplay }, { "CHESTRENDERMESH", PieceType.chestRenderDisplay }, { "CHESTRENDERBOOB", PieceType.chestRenderBoob }, { "CHESTRENDERBOOBTEXTURE", PieceType.chestRenderBoob }, { "ROBESKIRT", PieceType.robeSkirtTex }, { "ROBESKIRTTEXTURE", PieceType.robeSkirtTex }, { "ROBESKIRTRENDER", PieceType.robeSkirtRender }, { "ROBESKIRTMESH", PieceType.robeSkirtRender }, { "ROBERENDER", PieceType.robeSkirtRender }, { "ROBEMESH", PieceType.robeSkirtRender }, { "SKIRTRENDER", PieceType.robeSkirtRender }, { "SKIRTMESH", PieceType.robeSkirtRender }, { "SHOULDERPAD", PieceType.shoulderPadTex }, { "SHOULDERPADTEXTURE", PieceType.shoulderPadTex }, { "SHOULDERPADMESH", PieceType.shoulderPadMesh }, { "SHOULDERPADRENDER", PieceType.shoulderPadMesh }, { "SHOULDERMESH", PieceType.shoulderPadMesh }, { "SHOULDERRENDER", PieceType.shoulderPadMesh }, { "ARMCUFFMESH", PieceType.armCuffRender }, { "ARMCUFFRENDER", PieceType.armCuffRender }, { "CUFFMESH", PieceType.armCuffRender }, { "CUFFRENDER", PieceType.armCuffRender }, { "ARMMESH", PieceType.armCuffRender }, { "ARMRENDER", PieceType.armCuffRender }, { "SHIELD", PieceType.shieldTex }, { "SHIELDTEXTURE", PieceType.shieldTex }, { "SHIELDMESH", PieceType.shieldMesh }, { "SHIELDRENDER", PieceType.shieldMesh }, { "WEAPON", PieceType.weaponTex }, { "WEAPONTEXTURE", PieceType.weaponTex }, { "WEAPONMESH", PieceType.weaponMesh }, { "WEAPONRENDER", PieceType.weaponMesh }, { "CAPEMESH", PieceType.capeMesh }, { "CAPERENDER", PieceType.capeMesh }, { "HELMMESH", PieceType.helmRender }, { "HELMRENDER", PieceType.helmRender }, { "HELMOVERRIDEMESH", PieceType.helmOverrideMesh }, { "HELMOVERRIDERENDER", PieceType.helmOverrideMesh }, { "SHUT", PieceType.closed }, { "CLOSED", PieceType.closed }, { "BEAK", PieceType.closed }, { "OPEN", PieceType.open }, { "OPENED", PieceType.open }, { "BODY", PieceType.body }, { "CHEST", PieceType.body }, { "TORSO", PieceType.body }, { "LEG", PieceType.leg }, { "LEGS", PieceType.leg }, { "HEAD", PieceType.head }, { "HAIR", PieceType.hair }, { "TAIL", PieceType.tail }, { "EAR", PieceType.ear }, { "EARS", PieceType.ear } }; private static readonly Dictionary<string, PieceType> PieceTypesEyes = new Dictionary<string, PieceType>(StringComparer.OrdinalIgnoreCase) { { "CENTER", PieceType.center }, { "CENTRE", PieceType.center }, { "OPEN", PieceType.center }, { "OPENED", PieceType.center }, { "SHUT", PieceType.closed }, { "CLOSED", PieceType.closed }, { "LEFT", PieceType.left }, { "RIGHT", PieceType.right }, { "UP", PieceType.up }, { "DOWN", PieceType.down }, { "PISSED", PieceType.pissed }, { "ANGRY", PieceType.pissed }, { "MAD", PieceType.pissed }, { "HURT", PieceType.hurt }, { "OOF", PieceType.hurt }, { "DAMAGE", PieceType.hurt }, { "DAMAGED", PieceType.hurt } }; internal static Dictionary<RaceType, Dictionary<FolderType, List<Thing>>> AddParts = new Dictionary<RaceType, Dictionary<FolderType, List<Thing>>> { { RaceType