Decompiled source of Homebrewery v2.0.0
Homebrewery.dll
Decompiled 4 days 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.Cryptography; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Mirror; using UnityEngine; using UnityEngine.Networking; [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(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("Homebrewery")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0")] [assembly: AssemblyProduct("Homebrewery")] [assembly: AssemblyTitle("Homebrewery")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 { public static class StringExtensions { public static string FCap(this string input) { return input[0].ToString().ToUpper() + input.Substring(1).ToLower(); } } [BepInPlugin("Homebrewery", "Homebrewery", "2.0.0")] public class HB : BaseUnityPlugin { public class hbFolder { public object this[string key] { get { try { return GetType().GetProperty(key).GetValue(this); } catch (Exception ex) { Log("Problem with setting '" + key + "' in hbFolder instance!\n" + ex.Message, 4); return ""; } } set { try { GetType().GetProperty(key).SetValue(this, value); } catch (Exception ex) { Log("Problem with setting '" + key + "' : '" + value?.ToString() + "' in hbFolder instance!\n" + ex.Message, 4); } } } public string name { get; set; } public string type { get; set; } public string race { get; set; } public List<string> contents { get; set; } public string path { get; set; } public string source { get; set; } = modFolderName; public bool done { get; set; } = false; public object thing { get; set; } public hbParam param { get; set; } public hbImage itemIcon { get; set; } public hbImage armor { get; set; } public hbImage legPieceTexture_01 { get; set; } public hbImage legPieceTexture_02 { get; set; } public hbImage legPieceTexture_03 { get; set; } public hbImage legPieceTexture_04 { get; set; } public hbImage legOverlay { get; set; } public hbImage boobOverride { get; set; } public hbImage neckCollar { get; set; } public hbImage chestRender { get; set; } public hbImage chestRenderBoob { get; set; } public hbImage robeSkirt { get; set; } public hbImage shoulderPad { get; set; } public hbImage shield { get; set; } public hbImage up { get; set; } public hbImage pissed { get; set; } public hbImage center { get; set; } public hbImage right { get; set; } public hbImage left { get; set; } public hbImage down { get; set; } public hbImage hurt { get; set; } public hbImage closed { get; set; } public hbImage open { get; set; } public string textureGroupTag { get; set; } public hbImage body { get; set; } public hbImage leg { get; set; } public hbImage head { get; set; } public hbImage hair { get; set; } public hbImage tail { get; set; } public hbImage ear { get; set; } } public class hbParam { public string _itemName = "New Homebrewery Item"; public string _itemDescription = ""; public ColorAdjustShader_Profile _dyeParams = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; public bool _canDyeArmor = true; public ColorAdjustShader_Profile _colorAdjustParams = new ColorAdjustShader_Profile { _hue = 0f, _saturation = 1f, _brightness = 0f, _contrast = 1f }; public bool _lockBoobs = false; public bool _disableJiggleBoobBones = false; public string _neckCollarMesh; public string _chestRenderDisplay; public string _robeSkirtRender; public string _armCuffRender; public bool _textureArms = true; public ShoulderPadDisplayType _shoulderPadDisplayType = (ShoulderPadDisplayType)0; public string _shoulderpadMesh; public string _helmRender; public string _helmOverrideMesh; public float _blendHelmValue = 0f; public bool _useHelmHairDisplay; public bool _hideHair = false; public bool _hideEars = false; public bool _hideMisc = false; public string _legPieceRender_01; public string _legPieceRender_02; public string _legPieceRender_03; public string _legPieceRender_04; public bool _textureUpperLegOnly = false; public bool _textureFeet = true; public string _capeMesh; public string _shieldMesh; public object this[string key] { get { try { return GetType().GetProperty(key).GetValue(this); } catch (Exception ex) { Log("Problem with getting '" + key + "' in hbParam instance!\n" + ex.Message, 4); return ""; } } set { try { GetType().GetProperty(key.FCap()).SetValue(this, value); } catch (Exception ex) { Log("Problem with setting '" + key + "' : '" + value?.ToString() + "' in hbParam instance!\n" + ex.Message, 4); } } } public string name { get; set; } public string path { get; set; } public hbFolder folder { get; set; } public string json { get; set; } public string hash { get; set; } public ItemType _itemType { get; set; } = (ItemType)0; public SortTag _itemSortTag { get; set; } = (SortTag)0; public int _maxStackAmount { get; set; } = 1; public int _vendorCost { get; set; } = 10; public ItemRarity _itemRarity { get; set; } = (ItemRarity)4; public int _levelRequirement { get; set; } = 0; public float _consumableCooldown { get; set; } = 1.5f; public bool _useOnlyInTown { get; set; } = false; public GameObject _consumableObject { get; set; } public int _equipmentLevel { get; set; } = 1; public ItemEquipType _equipType { get; set; } = (ItemEquipType)0; } public class hbImage { public Texture2D tex = new Texture2D(4, 4, (TextureFormat)12, false) { name = "Blank Texture", anisoLevel = 16, filterMode = filter, mipMapBias = 0f }; public string name { get; set; } public string field { get; set; } public bool sprite { get; set; } = false; public string path { get; set; } public hbFolder folder { get; set; } public string hash { get; set; } public bool done { get; set; } = false; public Sprite spr { get; set; } } private readonly Harmony _harmony = new Harmony("Homebrewery"); public static string modFolderName = "Catman-Homebrewery"; private string folderPath; private string internalPath; private string modsPath; public static readonly List<string> itemFolders = new List<string>(6) { "Dye", "Chestpiece", "Leggings", "Helm", "Cape", "Shield" }; private readonly Dictionary<string, List<string>> itemFields = new Dictionary<string, List<string>> { { "Dye", new List<string>() }, { "Leggings", new List<string>(5) { "armor", "legPieceTexture_01", "legPieceTexture_02", "legPieceTexture_03", "legPieceTexture_04" } }, { "Chestpiece", new List<string>(8) { "armor", "legOverlay", "boobOverride", "neckCollar", "chestRender", "chestRenderBoob", "robeSkirt", "shoulderPad" } }, { "Helm", new List<string>(1) { "armor" } }, { "Cape", new List<string>(1) { "armor" } }, { "Shield", new List<string>(1) { "shield" } } }; public static readonly List<string> partFolders = new List<string>(3) { "Eyes", "Mouth", "Skin" }; private readonly Dictionary<string, List<string>> partFields = new Dictionary<string, List<string>> { { "Eyes", new List<string>(8) { "up", "pissed", "closed", "center", "right", "left", "down", "hurt" } }, { "Mouth", new List<string>(2) { "open", "closed" } }, { "Skin", new List<string>(6) { "body", "leg", "head", "hair", "tail", "ear" } } }; public static readonly List<string> races = new List<string>(5) { "Byrdle", "Chang", "Imp", "Kubold", "Poon" }; private readonly List<string> raceFolders; public static readonly Dictionary<string, List<hbFolder>> hbDir = new Dictionary<string, List<hbFolder>>(); private static readonly HashSet<string> hbFolds = new HashSet<string>(); public static readonly List<hbFolder> hbItemTable = new List<hbFolder>(); public static readonly Dictionary<string, List<hbFolder>> hbPartTable = new Dictionary<string, List<hbFolder>>(); public static List<hbImage> hbImages = new List<hbImage>(); public static List<hbParam> hbParams = new List<hbParam>(); private static ConfigEntry<int> cfgLogLevel; private static ConfigEntry<int> cfgFilterMode; public static FilterMode filter = (FilterMode)0; private static ConfigEntry<bool> cfgEnforceTexSize; private static ConfigEntry<bool> cfgBlinkPatch; public static bool blink = true; private static ConfigEntry<int> cfgBlinkPercent; public static int blinkPercent = 87; private static ConfigEntry<bool> cfgHotkeysOn; public static bool hotkeysOn = true; private static ConfigEntry<bool> cfgBackfillSkin; private static ConfigEntry<int> cfgBumpscosity; public static ConfigEntry<int> cfgEasterEggChance; public static ConfigEntry<bool> cfgSpreadVanillaParts; private static ConfigEntry<bool> cfgUnhideSecretString; public static ConfigEntry<int> cfgUpdateMessage; public static readonly int updateCount = 1; private static readonly string updateString = "Thank you for using Homebrewery 2.0.0!\nThe Thunderstore release version, finally! Glad to have this done before my 30th bday on Feb 24th... I'll use these messages to point out new features, once each update. Check the User Manual, it should have the info you'll need!\nDefault key to close lexicon popups is 'T'\nPress LControl + P to open the HB Phone!"; public static bool shownUpdateMessage = false; public static Dictionary<string, List<AudioClip>> hbSFX = new Dictionary<string, List<AudioClip>>(); public static Dictionary<string, Sprite> hbSprites = new Dictionary<string, Sprite>(); public static Dictionary<string, ScriptableArmorRender> aRend = new Dictionary<string, ScriptableArmorRender>(); public static Dictionary<string, Mesh> aMesh = new Dictionary<string, Mesh>(); public static Dictionary<string, byte[]> backfill = new Dictionary<string, byte[]>(); public static GameManager gm; public static ScriptableArmorDye testDye; public static DialogManager dm; public static PlayerRaceModel ccm; public static PlayerLexicon pl; public static Sprite shopIcon = Resources.Load<Sprite>("_graphic/_ui/_currencyBagIco"); public static ScriptableShopkeep shopKeep_skritGamble = Resources.Load<ScriptableShopkeep>("_prefab/_entity/_npc/_skrit/shopKeep_skritGamble"); public static ScriptableShopkeep hbShopKeep; public static Dictionary<ItemType, List<ShopkeepItem>> hbShopkeepItems = new Dictionary<ItemType, List<ShopkeepItem>> { { (ItemType)0, new List<ShopkeepItem>() }, { (ItemType)1, new List<ShopkeepItem>() }, { (ItemType)2, new List<ShopkeepItem>() } }; internal static ManualLogSource Logger; private bool playing; public static readonly Dictionary<string, PlayerRaceModel> playerRaceModels = new Dictionary<string, PlayerRaceModel>(); public static readonly Dictionary<string, int> vanPartsGrabbed = new Dictionary<string, int>(); public static readonly Dictionary<string, List<EyeTextureGroup>> eyes = new Dictionary<string, List<EyeTextureGroup>>(); public static readonly Dictionary<string, List<MouthTextureGroup>> mouths = new Dictionary<string, List<MouthTextureGroup>>(); public static readonly Dictionary<string, List<SkinTextureGroup>> skins = new Dictionary<string, List<SkinTextureGroup>>(); public static readonly Dictionary<string, List<Mesh>> hairs = new Dictionary<string, List<Mesh>>(); public static readonly Dictionary<string, List<SkinnedMeshRenderer>> ears = new Dictionary<string, List<SkinnedMeshRenderer>>(); public static readonly Dictionary<string, List<MeshRenderer>> miscs = new Dictionary<string, List<MeshRenderer>>(); public static readonly Dictionary<string, List<SkinnedMeshRenderer>> miscskinneds = new Dictionary<string, List<SkinnedMeshRenderer>>(); public static readonly Dictionary<string, List<SkinnedMeshRenderer>> tails = new Dictionary<string, List<SkinnedMeshRenderer>>(); public static void Log<T>(T t, int l = 0) { if (cfgLogLevel.Value == -1) { return; } switch (l) { case 1: if (cfgLogLevel.Value <= 1) { Logger.LogDebug((object)t); } break; case 2: if (cfgLogLevel.Value <= 2) { Logger.LogMessage((object)t); } break; case 3: if (cfgLogLevel.Value <= 3) { ManualLogSource logger2 = Logger; T val = t; logger2.LogWarning((object)(val?.ToString() + "\n")); } break; case 4: { ManualLogSource logger = Logger; T val = t; logger.LogError((object)(val?.ToString() + "\n")); break; } default: Logger.LogMessage((object)t); break; } } private static void cfgBinds(ConfigFile Config) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) cfgLogLevel = 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."); cfgFilterMode = Config.Bind<int>("Texture Creation", "FilterMode", 0, "Use this to set what you want the texture filter variable to default to, the mod tries to set it when the game loads by checking the settings but sometimes fails.\nThis config setting will determine what it will use if it doesn't succeed. (It will update the variable if you change the setting in-game though).\n0 for Point filtering, which the game labels as 'Nearest (Crunchy).'\n1 for Bilinear, which the game labels as 'Bilnear (Smooth)', but IMO they should call it 'Blurry as fuck'."); filter = (FilterMode)cfgFilterMode.Value; cfgEnforceTexSize = Config.Bind<bool>("Texture Creation", "EnforceTexSize", true, "Sets whether Homebrewery will validate texture sizes and aspect ratios, for consistency with *most* of the vanilla ones."); cfgBlinkPatch = 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)."); blink = cfgBlinkPatch.Value; cfgBlinkPercent = 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."); blink = cfgBlinkPatch.Value; cfgHotkeysOn = Config.Bind<bool>("Controls", "HotkeysOn", true, "Controls whether the mod's hotkeys are on by default."); hotkeysOn = cfgHotkeysOn.Value; cfgBackfillSkin = 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!"); cfgBumpscosity = Config.Bind<int>("General", "Bumpscosity", 1, "Adjusts the Bumpscosity."); cfgEasterEggChance = 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."); cfgSpreadVanillaParts = Config.Bind<bool>("General", "SpreadVanillaParts", true, "This controls whether the mod copies and distributes every race's vanilla parts (eyes, mouths, skins etc) to the other races."); cfgUnhideSecretString = Config.Bind<bool>("Debug", "UnhideSecretString", false, "Set to true not format the secret string in item names to try and hide it.\nTHIS WILL BREAK ALL CURRENTLY STORED/EQUIPPED ITEMS since the formatting is part of the item name too."); cfgUpdateMessage = 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."); } private static bool tryGetFilterMode(bool secondAttempt = false) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!secondAttempt) { Log("Trying to get _textureFilterSetting.", 2); } else { Log("Trying to get _textureFilterSetting again.", 2); } try { filter = (FilterMode)SettingsManager._current._settingsProfile._textureFilterSetting; Log("Got it: " + ((object)(FilterMode)(ref filter)).ToString() + "\n", 2); return true; } catch { if (!secondAttempt) { Log("Didn't get FilterMode setting on first attempt, will try again before it is needed!", 3); } else { Log("Still didn't get _textureFilterSetting. Using default from config: " + ((object)(FilterMode)(ref filter)).ToString(), 3); } return false; } } private void Bumpscosity() { int[] array = new int[7] { 0, 1, 12, 50, 76, 100, 1000 }; cfgBumpscosity.Value = array[Random.Range(0, 6)]; int value = cfgBumpscosity.Value; int num = value; if (num < 50) { if (num > 0) { if (num < 12) { if (num == 1) { Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a single bumpscosit. Still, it'll have to do.\n"); } else { Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a few bumpscosits. Still, it'll have to do.\n"); } } else { Log("Just a light breeze of bumpscosity in here at the moment, not bad. I personally enjoy a bit more bumpscosity, but at this amount it's absolutely reasonable.\n"); } } else { Log("Dear me, where did all the bumpscosity go? Quite unnerving in here with all of it gone.\n"); } } else if (num < 100) { if (num < 76) { Log("Ahh, quite a pleasant amount of bumpscosity we've got today, wouldn't you say? Very enjoyable.\n"); } else { Log("Well, the bumpscosity in here is really getting up there, isn't it?\nNo matter, the story must carry on no matter how much or how little bumpscosity there is.\n"); } } else if (num < 1000) { Log("Who turned up the bumpscosity so high?\nI like bumpscosity as much as the next person, but a hundred is quite a lot, wouldn't you say?\n"); } else { Log("My god, the bumpscosity in here is absolutely overwhelming.\nA thousand?! You people have got to be nuts!\nHow can you stand this much bumpscosity?\n"); } } private void Awake() { //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_0808: Expected O, but got Unknown //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Expected O, but got Unknown Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2); Logger = ((BaseUnityPlugin)this).Logger; cfgBinds(((BaseUnityPlugin)this).Config); Log("Waking up..."); Bumpscosity(); blinkPercent = Mathf.Clamp(cfgBlinkPercent.Value, 1, 99); Log("Checking for Mod Manager type install", 2); folderPath = Path.Combine(Paths.ConfigPath, "HomebreweryFiles"); internalPath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Internal"); modsPath = Paths.PluginPath; modFolderName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location).Replace(Paths.PluginPath + "\\", ""); if (!Directory.Exists(folderPath) || !Directory.Exists(internalPath)) { Log("Checking for manual install instead", 2); folderPath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "config", "HomebreweryFiles"); internalPath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "plugins", "Internal"); if (!Directory.Exists(folderPath) || !Directory.Exists(internalPath)) { Log("The 'HomebreweryFiles' or 'Internal' folder could not be found by the plugin, so there's no files to work with.\nHomebrewery will cease functioning now to prevent errors!", 4); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); return; } } Log("Mod's folder is called: " + modFolderName); Log("folderPath should be: " + folderPath); Log("internalPath should be: " + internalPath); Log("modsPath should be: " + modsPath + "\n"); bool flag = tryGetFilterMode(); itemFolders.Sort(); partFolders.Sort(); raceFolders.Sort(); races.Sort(); Log("Loading backfill texture data", 1); foreach (string race in races) { foreach (string item3 in partFields["Skin"]) { string text = race + "-" + item3; string path = Path.Combine(internalPath, "Backfill", text.ToLower() + ".png"); if (File.Exists(path)) { backfill.Add(text.ToLower(), File.ReadAllBytes(path)); } else { backfill.Add(text.ToLower(), Array.Empty<byte>()); } } } List<Mesh> list = new List<Mesh>(); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/00_armor/_neck/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/00_armor/_shoulderpads/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/00_armor/_helm/_halos")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/00_armor/_cape/")); list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/00_armor/_shield/")); IEnumerable<Mesh> enumerable = new <>z__ReadOnlyList<Mesh>(list); foreach (Mesh item4 in enumerable) { aMesh.Add(((Object)item4).name, item4); } Log("Meshes:\n" + string.Join(", ", aMesh.Keys), 1); hbSprites.Add("based", makeImage(internalPath, "based", sprite: true).spr); hbSprites.Add("nokia", makeImage(internalPath, "Nokia_3310", sprite: true).spr); hbSprites.Add("brokendye", makeImage(internalPath, "BrokenDye", sprite: true).spr); hbSprites.Add("joker", makeImage(internalPath, "joker", sprite: true).spr); hbSprites.Add("chargen", Resources.Load<Sprite>("_graphic/_ui/_charactercreationicons/customizeIco_body")); if (!flag) { tryGetFilterMode(secondAttempt: true); } Log("Searching for other mods inside 'plugins' with HB content in them!"); List<string> list2 = new List<string>(); foreach (string item5 in Directory.EnumerateDirectories(modsPath)) { if (!(item5 == modFolderName)) { if (Directory.Exists(Path.Combine(item5, "HomebreweryFiles"))) { list2.Add(Path.Combine(item5, "HomebreweryFiles")); } else if (Directory.Exists(Path.Combine(item5, "plugins", "HomebreweryFiles"))) { list2.Add(Path.Combine(item5, "plugins", "HomebreweryFiles")); } } } if (list2.Count > 0) { Log("Folders:\n" + string.Join("\n", list2).Replace(modsPath, "") + "\n"); } else { Log("None found!\n"); } string text2 = folderPath; List<string> list3 = list2; int num = 0; string[] array = new string[1 + list3.Count]; array[num] = text2; num++; foreach (string item6 in list3) { array[num] = item6; num++; } string[] array2 = array; Log("contentFolders:\n" + string.Join("\n", array2) + "\n", 1); Log("Setting up hbDir - itemFolders", 2); foreach (string itemFolder in itemFolders) { hbDir.Add(itemFolder, new List<hbFolder>()); string[] array3 = array2; foreach (string text3 in array3) { if (FindCustoms(text3, itemFolder, out var found) != null) { Log("Folders:\n" + string.Join("\n", found).Replace(text3, "") + "\n", 1); string text4 = text3.Replace(modsPath, ""); getItems(source: (!(text4 == folderPath)) ? text4.Split(new char[1] { '\\' })[1] : modFolderName, itemTargs: found.ToArray(), path: text3); } } } foreach (string race2 in races) { hbPartTable.Add(race2, new List<hbFolder>()); } hbFolder item = new hbFolder { name = "hbByrdleBeakTex_01", type = "Mouth", race = "Byrdle", thing = (object)new MouthTextureGroup { _closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01"), _open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01") }, done = true }; hbPartTable["Byrdle"].Add(item); hbFolder item2 = new hbFolder { name = "hbInvisBeak", type = "Mouth", race = "Byrdle", thing = (object)new MouthTextureGroup { _closed = (Texture)(object)Texture2D.blackTexture, _open = (Texture)(object)Texture2D.blackTexture }, done = true }; hbPartTable["Byrdle"].Add(item2); Log("Setting up hbDir - partFolders", 2); foreach (string partFolder in partFolders) { hbDir.Add(partFolder, new List<hbFolder>()); foreach (string raceFolder in raceFolders) { string part = Path.Combine(partFolder, raceFolder); string[] array4 = array2; foreach (string text5 in array4) { if (FindCustoms(text5, part, out var found2) != null) { Log("Folders:\n" + string.Join("\n", found2).Replace(text5, "") + "\n", 1); getParts(found2.ToArray(), text5); } } } } Log("Getting SFX", 2); string path2 = Path.Combine(internalPath, "SFX"); hbSFX.Add("phone", new List<AudioClip>()); List<string> list4 = new List<string>(2) { Path.Combine(path2, "hitsound.mp3"), Path.Combine(path2, "killsound.mp3") }; for (int k = 0; k <= 9; k++) { list4.Add(Path.Combine(path2, "phone", "0" + k + ".mp3")); } getSFX(list4.ToArray()); _harmony.PatchAll(); Log("_harmony.PatchAll() done"); Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1); } private async void getParts(string[] itemTargs, string path) { List<Task> tasks = new List<Task>(); foreach (string targ in itemTargs) { tasks.Add(getPart(targ, path)); } await Task.WhenAll(tasks); } private Task getPart(string targ, string path) { Stopwatch stopwatch = Stopwatch.StartNew(); string text = targ.Replace(path, ""); string text2 = text.Split(new char[1] { '\\' })[1]; string text3 = text.Split(new char[1] { '\\' })[2]; string text4 = text.Split(new char[1] { '\\' })[3]; string[] source = new string[1] { text3 }; if (text2 == "Skin" && text3 == "HB_ALLRACES") { source = races.ToArray(); } foreach (string item in source.ToList()) { text3 = item; Log("getPart - " + text3 + " " + text2 + ": " + text4, 2); hbFolder hbFolder = new hbFolder { name = text4, type = text2, race = text3, path = targ, contents = partFields[text2].ToList() }; if (hbFolder.contents.Count > 0) { Log("Looking for: " + string.Join(", ", hbFolder.contents), 1); foreach (string item2 in partFields[text2]) { hbFolder[item2] = (hbImage)getItemField(item2, hbFolder); } } if (checkTexGroup(hbFolder)) { Log("Marking partFold as done.", 1); hbFolder.done = true; } else { Log("Not marking partFold as done.", 1); } if (hbFolder.done) { makeObject(hbFolder); } Log("Adding to hbDir.", 1); hbDir[text2].Add(hbFolder); hbFolds.Add(targ); if (hbFolder.race != "HB_ALLRACES") { hbPartTable[hbFolder.race].Add(hbFolder); continue; } if (hbFolder.type != "Mouth") { foreach (string race in races) { hbPartTable[race].Add(hbFolder); } continue; } foreach (string race2 in races) { if (!(race2 == "Byrdle")) { hbPartTable[race2].Add(hbFolder); } } } stopwatch.Stop(); Log(text + " took " + stopwatch.ElapsedMilliseconds + "ms\n", 1); return Task.CompletedTask; } private bool checkTexGroup(hbFolder partFold) { string type = partFold.type; if (1 == 0) { } bool result = type switch { "Eyes" => checkEyeGroup(partFold), "Mouth" => checkMouthGroup(partFold), "Skin" => checkSkinGroup(partFold), _ => false, }; if (1 == 0) { } return result; } private bool checkEyeGroup(hbFolder partFold) { Log("checkEyeGroup()", 1); if (!partFold.center.done) { Log("Eyes parts cannot be missing 'center' state!", 4); return false; } byte[] array = File.ReadAllBytes(partFold.center.path); if (!partFold.up.done) { Log("Missing 'up' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.up.tex, array, true); } if (!partFold.down.done) { Log("Missing 'down' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.down.tex, array, true); } if (!partFold.left.done) { Log("Missing 'left' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.left.tex, array, true); } if (!partFold.right.done) { Log("Missing 'right' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.right.tex, array, true); } if (!partFold.pissed.done) { Log("Missing 'pissed' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.pissed.tex, array, true); } if (!partFold.hurt.done) { Log("Missing 'hurt' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.hurt.tex, array, true); } if (!partFold.closed.done) { Log("Missing 'closed' Eye state being subbed with 'center' state", 3); ImageConversion.LoadImage(partFold.closed.tex, array, true); } return true; } private bool checkMouthGroup(hbFolder partFold) { Log("checkMouthGroup()", 1); if (!partFold.closed.done) { if (partFold.race != "Byrdle") { Log("Mouth parts cannot be missing 'closed' state!", 4); return false; } Log("Byrdle 'Mouth' parts cannot be missing the Beak image!", 4); return false; } byte[] array = File.ReadAllBytes(partFold.closed.path); if (!partFold.open.done) { if (partFold.race != "Byrdle") { Log("Missing 'open' Mouth state being subbed with 'closed' state", 3); } else { Log("Copying Byrdle Beak image to 'open' state.", 2); } ImageConversion.LoadImage(partFold.closed.tex, array, true); } return true; } private bool checkSkinGroup(hbFolder partFold) { Log("checkSkinGroup()", 1); if (!partFold.head.done && !partFold.body.done && !partFold.leg.done && !partFold.hair.done && !partFold.ear.done && !partFold.tail.done) { Log(partFold.name + " did not have a single 'done' texture!", 4); return false; } if (partFold.head.done && partFold.body.done && partFold.leg.done && partFold.hair.done && partFold.ear.done && partFold.tail.done) { Log("All six textures provided for " + partFold.name, 1); return true; } switch (partFold.race) { default: Log(partFold.race + " skins that don't contain all six images will use vanilla textures for backfilling.", 2); break; case "Poon": { if (!partFold.head.done) { Log("Poon SkinTextureGroups typically share the Head texture to the Hair, Ear and Tail.\nSince there isn't one in this custom set, all absent images will be backfilled by vanilla ones.", 2); break; } byte[] array2 = File.ReadAllBytes(partFold.head.path); if (!partFold.hair.done) { Log("Unprovided Poon Hair texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.hair.tex, array2, true); } if (!partFold.ear.done) { Log("Unprovided Poon Ear texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.ear.tex, array2, true); } if (!partFold.tail.done) { Log("Unprovided Poon Tail texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.tail.tex, array2, true); } if (!partFold.body.done || !partFold.leg.done) { Log("Unprovided Poon Body/Leg texture will be backfilled by vanilla ones.", 2); } break; } case "Byrdle": if (!partFold.tail.done) { Log("Byrdle SkinTextureGroups typically share the Tail texture to the Hair.\nSince the Tail texture is absent, it will be backfilled by a vanilla Tail texture.\n", 2); if (!partFold.hair.done) { Log("Unprovided Byrdle Hair texture will be backfilled by a vanilla Hair texture.", 2); } } else if (!partFold.hair.done) { byte[] array3 = File.ReadAllBytes(partFold.tail.path); Log("Unprovided Byrdle Hair texture being subbed with given Tail texture.", 2); ImageConversion.LoadImage(partFold.hair.tex, array3, true); } if (!partFold.head.done) { Log("Byrdle SkinTextureGroups typically share the Head texture to the Ear.\nSince the Head texture is absent, it will be backfilled by a vanilla Head texture.\n", 2); if (!partFold.ear.done) { Log("Unprovided Byrdle Ear texture will be backfilled by a vanilla Ear texture.", 2); } } else if (!partFold.ear.done) { byte[] array4 = File.ReadAllBytes(partFold.head.path); Log("Unprovided Byrdle Ear texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.ear.tex, array4, true); } if (!partFold.body.done || !partFold.leg.done) { Log("Unprovided Byrdle Body/Leg texture will be backfilled by vanilla ones.", 3); } break; case "Imp": if (!partFold.head.done) { Log("Imp SkinTextureGroups typically share the Head texture to the Ear.\nSince the Head texture is absent, it will be backfilled by a vanilla Head texture.\n", 2); if (!partFold.ear.done) { Log("Unprovided Imp Ear texture will be backfilled by a vanilla Ear texture.", 2); } } else if (!partFold.ear.done) { byte[] array5 = File.ReadAllBytes(partFold.head.path); Log("Unprovided Imp Ear texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.ear.tex, array5, true); } if (!partFold.body.done || !partFold.leg.done || !partFold.hair.done || !partFold.tail.done) { Log("Unprovided Imp Body/Leg/Hair/Tail texture will be backfilled by vanilla ones.", 2); } break; case "Chang": if (!partFold.head.done) { Log("Chang SkinTextureGroups typically share the Head texture to the Hair.\nSince the Head texture is absent, it will be backfilled by a vanilla Head texture.\n", 2); if (!partFold.hair.done) { Log("Unprovided Chang Hair texture will be backfilled by a vanilla Hair texture.", 2); } } else if (!partFold.hair.done) { byte[] array = File.ReadAllBytes(partFold.head.path); Log("Unprovided Chang Hair texture being subbed with given Head texture.", 2); ImageConversion.LoadImage(partFold.hair.tex, array, true); } if (!partFold.body.done || !partFold.leg.done || !partFold.ear.done || !partFold.tail.done) { Log("Unprovided Chang Body/Leg/Ear/Tail texture will be backfilled by vanilla ones.", 2); } break; } return true; } private async void getItems(string[] itemTargs, string path, string source) { List<Task> tasks = new List<Task>(); foreach (string targ in itemTargs) { tasks.Add(getItem(targ, path, source)); } await Task.WhenAll(tasks); } private Task getItem(string targ, string path, string source) { Stopwatch stopwatch = Stopwatch.StartNew(); string text = targ.Replace(path, ""); string text2 = text.Split(new char[1] { '\\' })[1]; string text3 = text.Split(new char[1] { '\\' })[2]; Log("getItem - " + text2 + ": " + text3, 2); hbFolder hbFolder = new hbFolder { name = text3, type = text2, path = targ, source = source, contents = itemFields[text2].ToList() }; if (source == modFolderName) { hbFolder.source = "Catman-Homebrewery"; } Log("Looking for: itemIcon", 1); hbFolder.itemIcon = (hbImage)getItemField("itemIcon", hbFolder); if (!hbFolder.itemIcon.done) { hbImage itemIcon = hbFolder.itemIcon; if (1 == 0) { } Sprite spr = ((!(text2 == "Dye")) ? hbSprites["joker"] : hbSprites["brokendye"]); if (1 == 0) { } itemIcon.spr = spr; } if (hbFolder.contents.Count > 0) { Log("Looking for: " + string.Join(", ", hbFolder.contents), 1); foreach (string item in itemFields[text2]) { hbFolder[item] = (hbImage)getItemField(item, hbFolder); } } Log("Looking for: param", 1); hbFolder.param = (hbParam)getItemField("param", hbFolder); if (hbFolder.param != null) { makeObject(hbFolder); Log("Marking itemFold as done.", 1); hbFolder.done = true; } Log("Adding to hbDir.", 1); hbDir[text2].Add(hbFolder); hbFolds.Add(targ); hbItemTable.Add(hbFolder); stopwatch.Stop(); Log(text + " took " + stopwatch.ElapsedMilliseconds + "ms\n", 1); return Task.CompletedTask; } private object getItemField(string targ, hbFolder itemFold) { if (1 == 0) { } object result = ((targ == "param") ? ((object)getParam(targ, itemFold)) : ((object)((!(targ == "itemIcon")) ? getImage(targ, itemFold) : getImage(targ, itemFold, sprite: true)))); if (1 == 0) { } return result; } private object makeScriptableObject(hbFolder itemFold) { string type = itemFold.type; if (1 == 0) { } object result; switch (type) { case "Dye": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableArmorDye>()); result = obj2; break; } case "Cape": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableCape>()); result = obj2; break; } case "Helm": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableHelm>()); result = obj2; break; } case "Leggings": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableLeggings>()); result = obj2; break; } case "Chestpiece": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableChestpiece>()); result = obj2; break; } case "Shield": { object obj2 = (itemFold.thing = ScriptableObject.CreateInstance<ScriptableShield>()); result = obj2; break; } default: result = null; break; } if (1 == 0) { } return result; } private void makeObject(hbFolder itemFold) { //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Expected O, but got Unknown //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_0b46: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) //IL_0b6d: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0ba0: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bd5: Expected O, but got Unknown //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Expected O, but got Unknown //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_080d: Expected O, but got Unknown //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_0b08: Unknown result type (might be due to invalid IL or missing references) //IL_0b19: Unknown result type (might be due to invalid IL or missing references) //IL_0b2c: Expected O, but got Unknown //IL_0bef: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0c05: Unknown result type (might be due to invalid IL or missing references) //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c49: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Unknown result type (might be due to invalid IL or missing references) //IL_0c68: Expected O, but got Unknown Log("makeObject() for " + itemFold.type + ": " + itemFold.name, 1); switch (itemFold.type) { default: Log("Not handling " + itemFold.type + " yet...", 2); break; case "Dye": { Log("Dye", 1); ScriptableArmorDye val2 = (ScriptableArmorDye)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)1; itemFold.param._itemSortTag = (SortTag)1; itemFold.param._itemRarity = (ItemRarity)0; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val2); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val2)._itemType = (ItemType)1; ((ScriptableItem)val2)._itemSortTag = (SortTag)1; ((ScriptableItem)val2)._itemRarity = (ItemRarity)0; Log("Setting _itemIcon", 1); ((ScriptableItem)val2)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val2; break; } case "Cape": { Log("Cape", 1); ScriptableCape val4 = (ScriptableCape)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)0; itemFold.param._itemRarity = (ItemRarity)4; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val4); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val4)._itemType = (ItemType)0; ((ScriptableItem)val4)._itemRarity = (ItemRarity)4; Log("Checking _capeMesh", 1); if (itemFold.param._capeMesh != "") { if (aMesh.ContainsKey(itemFold.param._capeMesh)) { Log("_capeMesh is OK", 1); val4._capeMesh = aMesh[itemFold.param._capeMesh]; } else { Log(itemFold.name + " - _capeMesh name is invalid, field will be considered blank!", 4); itemFold.param._capeMesh = ""; } } else { Log(itemFold.name + " - Cape has no _capeMesh, so it will not display in-game!", 4); } Log("Setting _armorTexture and _itemIcon", 1); ((ScriptableArmor)val4)._armorTexture = (Texture)(object)itemFold.armor.tex; ((ScriptableItem)val4)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val4; break; } case "Shield": { Log("Shield", 1); ScriptableShield val3 = (ScriptableShield)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)0; itemFold.param._itemRarity = (ItemRarity)0; itemFold.param._equipType = (ItemEquipType)2; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val3); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val3)._itemType = (ItemType)0; ((ScriptableItem)val3)._itemRarity = (ItemRarity)0; ((ScriptableEquipment)val3)._equipType = (ItemEquipType)2; val3._blockDamageThreshold = 0; Log("Checking _shieldMesh", 1); if (itemFold.param._shieldMesh != "") { if (aMesh.ContainsKey(itemFold.param._shieldMesh)) { Log("_shieldMesh is OK", 1); val3._shieldMesh = aMesh[itemFold.param._shieldMesh]; } else { Log(itemFold.name + " - _shieldMesh name is invalid, field will be considered blank!", 4); itemFold.param._shieldMesh = ""; } } else { Log(itemFold.name + " - Shield has no _shieldMesh, so it will not display in-game!", 4); } Log("Setting _shieldTexture and _itemIcon", 1); val3._shieldTexture = (Texture)(object)itemFold.shield.tex; ((ScriptableItem)val3)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val3; break; } case "Helm": { Log("Helm", 1); ScriptableHelm val6 = (ScriptableHelm)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)0; itemFold.param._itemRarity = (ItemRarity)4; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val6); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val6)._itemType = (ItemType)0; ((ScriptableItem)val6)._itemRarity = (ItemRarity)4; Log("Checking _helmOverrideMesh", 1); if (itemFold.param._helmOverrideMesh != "" && !aMesh.ContainsKey(itemFold.param._helmOverrideMesh)) { Log(itemFold.name + " - _helmOverrideMesh name is invalid, field will be considered blank!", 4); itemFold.param._helmOverrideMesh = ""; } if (itemFold.param._helmRender == "halo" || itemFold.param._helmRender == "halo_01") { if (itemFold.param._helmOverrideMesh != "") { val6._helmOverrideMesh = aMesh[itemFold.param._helmOverrideMesh]; } else { Log(itemFold.name + " - Halo type Helm has no _helmOverrideMesh, so it will not display in-game!", 4); } } Log("Setting _armorTexture and _itemIcon", 1); ((ScriptableArmor)val6)._armorTexture = (Texture)(object)itemFold.armor.tex; ((ScriptableItem)val6)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val6; break; } case "Leggings": { Log("Leggings", 1); ScriptableLeggings val5 = (ScriptableLeggings)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)0; itemFold.param._itemRarity = (ItemRarity)4; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val5); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val5)._itemType = (ItemType)0; ((ScriptableItem)val5)._itemRarity = (ItemRarity)4; Log("Setting textures", 1); val5._legPieceTexture_01 = (Texture)(object)itemFold.legPieceTexture_01.tex; val5._legPieceTexture_02 = (Texture)(object)itemFold.legPieceTexture_02.tex; val5._legPieceTexture_03 = (Texture)(object)itemFold.legPieceTexture_03.tex; val5._legPieceTexture_04 = (Texture)(object)itemFold.legPieceTexture_04.tex; Log("Setting _armorTexture and _itemIcon", 1); ((ScriptableArmor)val5)._armorTexture = (Texture)(object)itemFold.armor.tex; ((ScriptableItem)val5)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val5; break; } case "Chestpiece": { Log("Chestpiece", 1); ScriptableChestpiece val = (ScriptableChestpiece)makeScriptableObject(itemFold); itemFold.param._itemType = (ItemType)0; itemFold.param._itemRarity = (ItemRarity)4; Log("makeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val); Log("makeObject did FromJsonOverwrite", 1); ((ScriptableItem)val)._itemType = (ItemType)0; ((ScriptableItem)val)._itemRarity = (ItemRarity)4; if (!itemFold.boobOverride.done && itemFold.armor.done) { Log("Loading armorTexture into boobOverrideTexture", 1); ImageConversion.LoadImage(itemFold.boobOverride.tex, File.ReadAllBytes(itemFold.armor.path), true); } Log("Setting textures", 1); val._legOverlayTexture = (Texture)(object)itemFold.legOverlay.tex; val._boobOverrideTexture = (Texture)(object)itemFold.boobOverride.tex; val._neckCollarTexture = (Texture)(object)itemFold.neckCollar.tex; val._chestRenderTexture = (Texture)(object)itemFold.chestRender.tex; val._robeSkirtTexture = (Texture)(object)itemFold.robeSkirt.tex; val._shoulderpadTexture = (Texture)(object)itemFold.shoulderPad.tex; Log("Checking _neckCollarMesh", 1); if (itemFold.param._neckCollarMesh != "" && !aMesh.ContainsKey(itemFold.param._neckCollarMesh)) { Log(itemFold.name + " - _neckCollarMesh name is invalid, field will be considered blank!", 4); itemFold.param._neckCollarMesh = ""; } if (itemFold.param._neckCollarMesh != "") { val._neckCollarMesh = aMesh[itemFold.param._neckCollarMesh]; } else { Log(itemFold.name + " - Chestpiece has no _neckCollarMesh, so it will not display in-game!", 2); } Log("Checking _shoulderPadMesh", 1); if (itemFold.param._shoulderpadMesh != "" && !aMesh.ContainsKey(itemFold.param._shoulderpadMesh)) { Log(itemFold.name + " - _shoulderpadMesh name is invalid, field will be considered blank!", 4); itemFold.param._shoulderpadMesh = ""; } if (itemFold.param._shoulderpadMesh != "") { val._shoulderpadMesh = aMesh[itemFold.param._shoulderpadMesh]; } else { Log(itemFold.name + " - Chestpiece has no _shoulderpadMesh, so they/it will not display in-game!", 2); } Log("Setting _armorTexture and _itemIcon", 1); ((ScriptableArmor)val)._armorTexture = (Texture)(object)itemFold.armor.tex; ((ScriptableItem)val)._itemIcon = itemFold.itemIcon.spr; Log("Storing item in itemFold.thing", 1); itemFold.thing = val; break; } case "Mouth": { Log("Mouth", 1); MouthTextureGroup thing3 = new MouthTextureGroup { _closed = (Texture)(object)itemFold.closed.tex, _open = (Texture)(object)itemFold.open.tex }; itemFold.thing = thing3; break; } case "Eyes": { Log("Eyes", 1); EyeTextureGroup thing2 = new EyeTextureGroup { _closed = (Texture)(object)itemFold.closed.tex, _center = (Texture)(object)itemFold.center.tex, _down = (Texture)(object)itemFold.down.tex, _up = (Texture)(object)itemFold.up.tex, _right = (Texture)(object)itemFold.right.tex, _left = (Texture)(object)itemFold.left.tex, _hurt = (Texture)(object)itemFold.hurt.tex, _pissed = (Texture)(object)itemFold.pissed.tex }; itemFold.thing = thing2; break; } case "Skin": { Log("Skin", 1); SkinTextureGroup thing = new SkinTextureGroup { _bodyTexture = (Texture)(object)itemFold.body.tex, _earTexture = (Texture)(object)itemFold.ear.tex, _hairTexture = (Texture)(object)itemFold.hair.tex, _headTexture = (Texture)(object)itemFold.head.tex, _legTexture = (Texture)(object)itemFold.leg.tex, _tailTexture = (Texture)(object)itemFold.tail.tex, _textureGroupTag = itemFold.name }; itemFold.thing = thing; break; } } } private void remakeObject(hbFolder itemFold) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Expected O, but got Unknown //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Expected O, but got Unknown //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) Log("remakeObject() for " + itemFold.type + ": " + itemFold.name, 1); switch (itemFold.type) { default: Log("Not re-handling " + itemFold.type + " yet...", 2); break; case "Dye": { Log("Dye", 1); ScriptableArmorDye val4 = (ScriptableArmorDye)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val4); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val4)._itemType = (ItemType)1; ((ScriptableItem)val4)._itemSortTag = (SortTag)1; ((ScriptableItem)val4)._itemRarity = (ItemRarity)0; break; } case "Cape": { Log("Cape", 1); ScriptableCape val3 = (ScriptableCape)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val3); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val3)._itemType = (ItemType)0; ((ScriptableItem)val3)._itemRarity = (ItemRarity)4; Log("Checking _capeMesh", 1); if (itemFold.param._capeMesh != "") { if (aMesh.ContainsKey(itemFold.param._capeMesh)) { Log("_capeMesh is OK", 1); val3._capeMesh = aMesh[itemFold.param._capeMesh]; } else { Log(itemFold.name + " - _capeMesh name is invalid, field will be considered blank!", 4); itemFold.param._capeMesh = ""; } } else { Log(itemFold.name + " - Cape has no _capeMesh, so it will not display in-game!", 4); } break; } case "Shield": { Log("Shield", 1); ScriptableShield val6 = (ScriptableShield)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val6); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val6)._itemType = (ItemType)0; ((ScriptableItem)val6)._itemRarity = (ItemRarity)0; Log("Checking _shieldMesh", 1); if (itemFold.param._shieldMesh != "") { if (aMesh.ContainsKey(itemFold.param._shieldMesh)) { Log("_shieldMesh is OK", 1); val6._shieldMesh = aMesh[itemFold.param._capeMesh]; } else { Log(itemFold.name + " - _shieldMesh name is invalid, field will be considered blank!", 4); itemFold.param._shieldMesh = ""; } } else { Log(itemFold.name + " - Shield has no _shieldMesh, so it will not display in-game!", 4); } break; } case "Helm": { Log("Helm", 1); ScriptableHelm val5 = (ScriptableHelm)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val5); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val5)._itemType = (ItemType)0; ((ScriptableItem)val5)._itemRarity = (ItemRarity)4; Log("Checking _helmRender", 1); if (itemFold.param._helmRender == "") { Log(itemFold.name + " - Helm does not have a _helmRender, so nothing will be displayed!", 4); } else if (!aRend.ContainsKey(itemFold.param._helmRender)) { Log(itemFold.name + " - _helmRender name is invalid! Not changing current _helmRender!", 4); } else { val5._helmRender = aRend[itemFold.param._helmRender]; } Log("Checking _helmOverrideMesh", 1); if (itemFold.param._helmOverrideMesh != "" && !aMesh.ContainsKey(itemFold.param._helmOverrideMesh)) { Log(itemFold.name + " - _helmOverrideMesh name is invalid, field will be considered blank!", 4); itemFold.param._helmOverrideMesh = ""; } if (itemFold.param._helmRender == "halo" || itemFold.param._helmRender == "halo_01") { if (itemFold.param._helmOverrideMesh != "") { val5._helmOverrideMesh = aMesh[itemFold.param._helmOverrideMesh]; } else { Log(itemFold.name + " - Halo type Helm has no _helmOverrideMesh, so it will not display in-game!", 4); } } break; } case "Leggings": { Log("Leggings", 1); ScriptableLeggings val2 = (ScriptableLeggings)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val2); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val2)._itemType = (ItemType)0; ((ScriptableItem)val2)._itemRarity = (ItemRarity)4; Log("Checking _legPieceRender01", 1); if (itemFold.param._legPieceRender_01 == "") { Log(itemFold.name + " - Leggings does not have a _legPieceRender_01, so nothing would be displayed!", 4); } else if (!aRend.ContainsKey(itemFold.param._legPieceRender_01)) { Log(itemFold.name + " - _legPieceRender_01 name is invalid! Not changing current ArmorRender!", 4); } else { val2._legPieceRender_01 = aRend[itemFold.param._legPieceRender_01]; } Log("Checking _legPieceRender02", 1); if (itemFold.param._legPieceRender_02 == "") { Log(itemFold.name + " - Leggings does not have a _legPieceRender_02, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._legPieceRender_02)) { Log(itemFold.name + " - _legPieceRender_02 name is invalid! Not changing current ArmorRender!", 4); } else { val2._legPieceRender_02 = aRend[itemFold.param._legPieceRender_02]; } Log("Checking _legPieceRender03", 1); if (itemFold.param._legPieceRender_03 == "") { Log(itemFold.name + " - Leggings does not have a _legPieceRender_03, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._legPieceRender_03)) { Log(itemFold.name + " - _legPieceRender_03 name is invalid! Not changing current ArmorRender!", 4); } else { val2._legPieceRender_03 = aRend[itemFold.param._legPieceRender_03]; } Log("Checking _legPieceRender04", 1); if (itemFold.param._legPieceRender_04 == "") { Log(itemFold.name + " - Leggings does not have a _legPieceRender_04, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._legPieceRender_04)) { Log(itemFold.name + " - _legPieceRender_04 name is invalid! Not changing current ArmorRender!", 4); } else { val2._legPieceRender_04 = aRend[itemFold.param._legPieceRender_04]; } break; } case "Chestpiece": { Log("Chestpiece", 1); ScriptableChestpiece val = (ScriptableChestpiece)itemFold.thing; Log("remakeObject doing FromJsonOverwrite", 1); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson((object)itemFold.param), (object)val); Log("remakeObject did FromJsonOverwrite", 1); ((ScriptableItem)val)._itemType = (ItemType)0; ((ScriptableItem)val)._itemRarity = (ItemRarity)4; Log("Checking _neckCollarMesh", 1); if (itemFold.param._neckCollarMesh != "" && !aMesh.ContainsKey(itemFold.param._neckCollarMesh)) { Log(itemFold.name + " - _neckCollarMesh name is invalid, field will be considered blank!", 4); itemFold.param._neckCollarMesh = ""; } if (itemFold.param._neckCollarMesh != "") { val._neckCollarMesh = aMesh[itemFold.param._neckCollarMesh]; } else { Log(itemFold.name + " - Chestpiece has no _neckCollarMesh, so it will not display in-game!", 2); } Log("Checking _shoulderPadMesh", 1); if (itemFold.param._shoulderpadMesh != "" && !aMesh.ContainsKey(itemFold.param._shoulderpadMesh)) { Log(itemFold.name + " - _shoulderpadMesh name is invalid, field will be considered blank!", 4); itemFold.param._shoulderpadMesh = ""; } if (itemFold.param._shoulderpadMesh != "") { val._shoulderpadMesh = aMesh[itemFold.param._shoulderpadMesh]; } else { Log(itemFold.name + " - Chestpiece has no _shoulderpadMesh, so they/it will not display in-game!", 2); } Log("Checking _chestRenderDisplay", 1); if (itemFold.param._chestRenderDisplay == "") { Log(itemFold.name + " - Chestpiece does not have a _chestRenderDisplay, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._chestRenderDisplay)) { Log(itemFold.name + " - _chestRenderDisplay name is invalid! Not changing current ArmorRender!", 4); } else { val._chestRenderDisplay = aRend[itemFold.param._chestRenderDisplay]; } Log("Checking _robeSkirtRender", 1); if (itemFold.param._robeSkirtRender == "") { Log(itemFold.name + " - Chestpiece does not have a _robeSkirtRender, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._robeSkirtRender)) { Log(itemFold.name + " - _robeSkirtRender name is invalid! Not changing current ArmorRender!", 4); } else { val._robeSkirtRender = aRend[itemFold.param._robeSkirtRender]; } Log("Checking _armCuffRender", 1); if (itemFold.param._armCuffRender == "") { Log(itemFold.name + " - Chestpiece does not have a _armCuffRender, hopefully this is intentional!", 2); } else if (!aRend.ContainsKey(itemFold.param._armCuffRender)) { Log(itemFold.name + " - _armCuffRender name is invalid! Not changing current ArmorRender!", 4); } else { val._armCuffRender = aRend[itemFold.param._armCuffRender]; } break; } } } private hbParam getParam(string targ, hbFolder Fold) { Log("getParam() for " + Fold.type + ": " + Fold.name, 1); hbParam hbParam = new hbParam { name = Fold.name + "_" + targ, folder = Fold }; hbParams.Add(hbParam); string[] array = new string[7] { Path.Combine(Fold.path, targ), Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, targ) + "s", Path.Combine(Fold.path, targ.FCap() + "s"), Path.Combine(Fold.path, Fold.name), Path.Combine(Fold.path, Fold.name.FCap()), Path.Combine(Fold.path, Fold.name.ToLower()) }; string[] array2 = array; foreach (string text in array2) { if (File.Exists(text + ".txt")) { hbParam.path = text + ".txt"; Log("par.path is: " + hbParam.path, 1); break; } } if (hbParam.path == "" || hbParam.path == null) { Log("Didn't find '" + hbParam.name + "'. Item cannot be created!", 4); return null; } try { hbParam.json = File.ReadAllText(hbParam.path); byte[] buffer = File.ReadAllBytes(hbParam.path); using MD5 mD = MD5.Create(); hbParam.hash = Convert.ToBase64String(mD.ComputeHash(buffer)); } catch (Exception ex) { Log("Something went wrong with reading the txt file! Item cannot be created!", 4); Log(ex.Message, 4); return null; } Log("getParam doing FromJsonOverwrite", 1); try { JsonUtility.FromJsonOverwrite(hbParam.json, (object)hbParam); } catch (Exception ex2) { Log("Something is wrong with the JSON! Item cannot be created!", 4); Log(ex2.Message, 4); return null; } if (!cfgUnhideSecretString.Value) { hbParam hbParam2 = hbParam; hbParam2._itemName = hbParam2._itemName + "<color=#00000000><size=1>" + Fold.source + "-" + Fold.type + "-" + Fold.name + "</size></color>"; } else { hbParam hbParam2 = hbParam; hbParam2._itemName = hbParam2._itemName + Fold.source + "-" + Fold.type + "-" + Fold.name; } Log(hbParam._itemName, 1); return hbParam; } private hbImage getImage(string targ, hbFolder Fold, bool sprite = false) { //IL_1090: Unknown result type (might be due to invalid IL or missing references) //IL_109f: Unknown result type (might be due to invalid IL or missing references) Log("getImage(" + targ + ")", 1); hbImage hbImage = hbImageMaker(targ, Fold, sprite); hbImages.Add(hbImage); string text = Path.Combine(Fold.path, targ); if (!File.Exists(text + ".png")) { if (1 == 0) { } string[] array = targ switch { "itemIcon" => new string[9] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, targ.ToLower()), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "_" + targ.ToLower()), Path.Combine(Fold.path, "icon"), Path.Combine(Fold.path, "_icon"), Path.Combine(Fold.path, "Icon"), Path.Combine(Fold.path, "_Icon") }, "center" => new string[8] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "centre"), Path.Combine(Fold.path, "Centre"), Path.Combine(Fold.path, "Centre"), Path.Combine(Fold.path, "open"), Path.Combine(Fold.path, "Open"), Path.Combine(Fold.path, "opened"), Path.Combine(Fold.path, "Opened") }, "closed" => new string[3] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "beak"), Path.Combine(Fold.path, "Beak") }, "open" => new string[3] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, targ + "ed"), Path.Combine(Fold.path, targ.FCap() + "ed") }, "pissed" => new string[5] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "angry"), Path.Combine(Fold.path, "Angry"), Path.Combine(Fold.path, "mad"), Path.Combine(Fold.path, "Mad") }, "hurt" => new string[3] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "damaged"), Path.Combine(Fold.path, "Damaged") }, "body" => new string[5] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "chest"), Path.Combine(Fold.path, "Chest"), Path.Combine(Fold.path, "torso"), Path.Combine(Fold.path, "Torso") }, "leg" => new string[3] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "legs"), Path.Combine(Fold.path, "Legs") }, "ear" => new string[3] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "ears"), Path.Combine(Fold.path, "Ears") }, "armor" => new string[21] { Path.Combine(Fold.path, targ.FCap()), text + "Texture", text + "texture", Path.Combine(Fold.path, targ.FCap() + "Texture"), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "_" + targ + "Texture"), Path.Combine(Fold.path, "_" + targ.FCap() + "Texture"), Path.Combine(Fold.path, "_" + targ + "texture"), Path.Combine(Fold.path, "_" + targ.FCap() + "texture"), Path.Combine(Fold.path, "armour"), Path.Combine(Fold.path, "Armour"), "armourTexture", "armourtexture", Path.Combine(Fold.path, "ArmourTexture"), Path.Combine(Fold.path, "_armour"), Path.Combine(Fold.path, "_Armour"), Path.Combine(Fold.path, "_armourTexture"), Path.Combine(Fold.path, "_ArmourTexture"), Path.Combine(Fold.path, "_armourtexture"), Path.Combine(Fold.path, "_Armourtexture") }, "legPieceTexture_01" => new string[15] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "legPiece01"), Path.Combine(Fold.path, "LegPiece01"), Path.Combine(Fold.path, "legpiece01"), Path.Combine(Fold.path, "_legPiece01"), Path.Combine(Fold.path, "_LegPiece01"), Path.Combine(Fold.path, "_legpiece01"), Path.Combine(Fold.path, "legPiece1"), Path.Combine(Fold.path, "LegPiece1"), Path.Combine(Fold.path, "legpiece1"), Path.Combine(Fold.path, "_legPiece1"), Path.Combine(Fold.path, "_LegPiece1"), Path.Combine(Fold.path, "_legpiece1") }, "legPieceTexture_02" => new string[15] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "legPiece02"), Path.Combine(Fold.path, "LegPiece02"), Path.Combine(Fold.path, "legpiece02"), Path.Combine(Fold.path, "_legPiece02"), Path.Combine(Fold.path, "_LegPiece02"), Path.Combine(Fold.path, "_legpiece02"), Path.Combine(Fold.path, "legPiece2"), Path.Combine(Fold.path, "LegPiece2"), Path.Combine(Fold.path, "legpiece2"), Path.Combine(Fold.path, "_legPiece2"), Path.Combine(Fold.path, "_LegPiece2"), Path.Combine(Fold.path, "_legpiece2") }, "legPieceTexture_03" => new string[15] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "legPiece03"), Path.Combine(Fold.path, "LegPiece03"), Path.Combine(Fold.path, "legpiece03"), Path.Combine(Fold.path, "_legPiece03"), Path.Combine(Fold.path, "_LegPiece03"), Path.Combine(Fold.path, "_legpiece03"), Path.Combine(Fold.path, "legPiece3"), Path.Combine(Fold.path, "LegPiece3"), Path.Combine(Fold.path, "legpiece3"), Path.Combine(Fold.path, "_legPiece3"), Path.Combine(Fold.path, "_LegPiece3"), Path.Combine(Fold.path, "_legpiece3") }, "legPieceTexture_04" => new string[15] { Path.Combine(Fold.path, targ.FCap()), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "legPiece04"), Path.Combine(Fold.path, "LegPiece04"), Path.Combine(Fold.path, "legpiece04"), Path.Combine(Fold.path, "_legPiece04"), Path.Combine(Fold.path, "_LegPiece04"), Path.Combine(Fold.path, "_legpiece04"), Path.Combine(Fold.path, "legPiece4"), Path.Combine(Fold.path, "LegPiece4"), Path.Combine(Fold.path, "legpiece4"), Path.Combine(Fold.path, "_legPiece4"), Path.Combine(Fold.path, "_LegPiece4"), Path.Combine(Fold.path, "_legpiece4") }, _ => new string[10] { Path.Combine(Fold.path, targ.FCap()), text + "Texture", text + "texture", Path.Combine(Fold.path, targ.FCap() + "Texture"), Path.Combine(Fold.path, "_" + targ), Path.Combine(Fold.path, "_" + targ.FCap()), Path.Combine(Fold.path, "_" + targ + "Texture"), Path.Combine(Fold.path, "_" + targ.FCap() + "Texture"), Path.Combine(Fold.path, "_" + targ + "texture"), Path.Combine(Fold.path, "_" + targ.FCap() + "texture") }, }; if (1 == 0) { } string[] array2 = array; string[] array3 = array2; foreach (string text2 in array3) { if (File.Exists(text2 + ".png")) { hbImage.path = text2 + ".png"; Log("img.path is: " + hbImage.path, 1); break; } } } else { hbImage.path = text + ".png"; Log("img.path is: " + hbImage.path, 1); } if (hbImage.path == "") { Log("Didn't find '" + hbImage.name + "'. Not marking Image as done.", 2); ImageConversion.LoadImage(hbImage.tex, Array.Empty<byte>(), false); hbImage.path = text + ".png"; return hbImage; } byte[] array4; try { array4 = File.ReadAllBytes(hbImage.path); } catch (Exception t) { Log("Failed to read image! Not marking Image as done.", 4); Log(t, 4); ImageConversion.LoadImage(hbImage.tex, Array.Empty<byte>(), false); return hbImage; } if (array4.Length == 0) { Log("Image was totally devoid of contents! Not marking Image as done.", 4); ImageConversion.LoadImage(hbImage.tex, Array.Empty<byte>(), false); return hbImage; } var (num, num2) = GetImageSize(hbImage.path); if (num < 9 || num2 < 9) { Log("Image dimensions cannot be smaller than 9px in either axis! Not marking Image as done.", 4); ImageConversion.LoadImage(hbImage.tex, Array.Empty<byte>(), false); return hbImage; } if (cfgEnforceTexSize.Value) { } ImageConversion.LoadImage(hbImage.tex, array4, true); using (MD5 mD = MD5.Create()) { hbImage.hash = Convert.ToBase64String(mD.ComputeHash(array4)); } if (sprite) { hbImage.spr = Sprite.Create(hbImage.tex, new Rect(0f, 0f, (float)((Texture)hbImage.tex).width, (float)((Texture)hbImage.tex).height), new Vector2(0.5f, 0.5f)); ((Object)hbImage.spr).name = hbImage.name + "_Spr"; } hbImage.done = true; return hbImage; } private hbImage hbImageMaker(string targ, hbFolder Fold, bool sprite = false, string fname = "") { if (Fold != null) { fname = Fold.name; } hbImage hbImage = new hbImage { name = fname + "_" + targ, field = targ, folder = Fold, path = "", sprite = sprite }; ((Object)hbImage.tex).name = hbImage.name + "_Tex"; return hbImage; } private hbImage makeImage(string path, string targ, bool sprite = false) { //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) Log("makeImage(" + targ + ")", 1); hbImage hbImage = hbImageMaker(targ, null, sprite, "Internal"); hbImage.path = Path.Combine(path, targ + ".png"); if (!File.Exists(hbImage.path)) { Log("Didn't find '" + hbImage.name + "'. Not marking Image as done.\nThis is a problem, what has happened to the files in the Internal folder?", 4); ImageConversion.LoadImage(hbImage.tex, Array.Empty<byte>(), false); } byte[] array; try { array = File.ReadAllBytes(hbImage.path); } catch (Exception t) { Log("Failed to read image! Not marking Image as done.", 4); Log(t, 4); return hbImage; } if (array.Length == 0) { Log("Image was totally devoid of contents! Not marking Image as done.", 4); return hbImage; } var (num, num2) = GetImageSize(hbImage.path); if (num < 9 || num2 < 9) { Log("Image dimensions cannot be smaller than 9px in either axis! Not marking Image as done.", 4); return hbImage; } if (cfgEnforceTexSize.Value) { } ImageConversion.LoadImage(hbImage.tex, array, true); using (MD5 mD = MD5.Create()) { hbImage.hash = Convert.ToBase64String(mD.ComputeHash(array)); } if (sprite) { hbImage.spr = Sprite.Create(hbImage.tex, new Rect(0f, 0f, (float)((Texture)hbImage.tex).width, (float)((Texture)hbImage.tex).height), new Vector2(0.5f, 0.5f)); ((Object)hbImage.spr).name = hbImage.name + "_Spr"; } hbImage.done = true; hbImages.Add(hbImage); return hbImage; } private async void getSFX(string[] sfxTargs) { List<Task<bool>> tasks = new List<Task<bool>>(); foreach (string targ in sfxTargs) { tasks.Add(getSFXTask(targ)); } await Task.WhenAll(tasks); } private Task<bool> getSFXTask(string targ) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown string fileName = Path.GetFileName(targ); string text = "file:///" + targ.Replace("\\", "/"); UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(text, (AudioType)13); audioClip.SendWebRequest(); while (!audioClip.isDone) { } DownloadHandlerAudioClip val = (DownloadHandlerAudioClip)audioClip.downloadHandler; ((Object)val.audioClip).name = fileName; if (fileName == "hitsound.mp3" || fileName == "killsound.mp3") { hbSFX.Add(fileName, new List<AudioClip>(1) { val.audioClip }); } else { hbSFX["phone"].Add(val.audioClip); } return Task.FromResult(result: true); } private List<string> FindCustoms(string path, string part, out List<string> found) { Log("FindCustoms(" + path + "\\" + part + ")\n", 1); found = new List<string>(); if (Directory.Exists(Path.Combine(path, part))) { Log("Looking for " + part + " folders in " + path.Replace(modsPath, ""), 1); foreach (string item in Directory.EnumerateDirectories(Path.Combine(path, part))) { if (!hbFolds.Contains(item)) { found.Add(item); } } if (found.Count == 0) { Log("None found!\n", 1); return null; } found.Sort(); return found; } return null; } private GameObject Dial() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown Log("Dialed the hotline...", 2); GameObject val = new GameObject("Homebrewery Master Object"); GameObject val2 = new GameObject("Homebrewery Object"); val2.transform.SetParent(val.transform); AudioSource val3 = val2.AddComponent<AudioSource>(); ((Object)val3).name = "Homebrewery Audio Source"; val3.volume = 0.5f; val3.outputAudioMixerGroup = SettingsManager._current._masterMixer.FindMatchingGroups("Voice")[0]; DialogTrigger val4 = val2.AddComponent<DialogTrigger>(); ((Object)val4).name = "Homebrewery DialogTrigger"; val4._voxAsrc = val3; Log("Returning hbMGO", 2); return val; } private ScriptableDialogData ChattyBased() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_0198: 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_01d0: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Expected O, but got Unknown //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Expected O, but got Unknown Log("Clearing throat...", 2); DialogSelection val = new DialogSelection { _selectionCaption = "Wrong number...", _setDialogIndex = -1 }; DialogSelection val2 = new DialogSelection { _selectionCaption = "Catch you later!", _setDialogIndex = -1 }; DialogSelection val3 = new DialogSelection { _selectionCaption = "Business in the front...", _setDialogIndex = 3, _selectionIcon = hbSprites["chargen"] }; DialogSelection val4 = new DialogSelection { _selectionCaption = "Actually, no...", _setDialogIndex = 2 }; DialogSelection val5 = new DialogSelection { _selectionCaption = "I gotta travel...", _setDialogIndex = 4 }; DialogSelection val6 = new DialogSelection { _selectionCaption = "I left the stove on...", _setDialogIndex = 2 }; DialogSelection val7 = new DialogSelection { _selectionCaption = "Check my inventory...", _setDialogIndex = 5 }; DialogSelection val8 = new DialogSelection { _selectionCaption = "Got what I needed...", _setDialogIndex = 2 }; Sprite facepic = hbSprites["based"]; Dialog val9 = new Dialog(); val9._dialogInput = "You've reached The Based Department, how may we help you?"; val9._dialogKey = "hbDIntro"; val9._dialogUI = (DialogUIPrompt)0; val9.facepic = facepic; val9._dialogSelections = (DialogSelection[])(object)new DialogSelection[4] { val, val3, val5, val7 }; Dialog val10 = val9; Dialog val11 = new Dialog { _dialogInput = "Have a nice day and stay based!", _dialogKey = "hbDialogExit", _dialogUI = (DialogUIPrompt)0, facepic = facepic }; val9 = new Dialog(); val9._dialogInput = "Anything else?"; val9._dialogKey = "hbDMain"; val9._dialogUI = (DialogUIPrompt)0; val9.facepic = facepic; val9._dialogSelections = (DialogSelection[])(object)new DialogSelection[4] { val2, val3, val5, val7 }; Dialog val12 = val9; val9 = new Dialog(); val9._dialogInput = "Abso-lutely!"; val9._dialogKey = "hbDVanity"; val9._dialogUI = (DialogUIPrompt)4; val9.facepic = facepic; val9._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val4 }; Dialog val13 = val9; val9 = new Dialog(); val9._dialogInput = "Charging teleporter!"; val9._dialogKey = "hbDPortal"; val9._dialogUI = (DialogUIPrompt)5; val9.facepic = facepic; val9._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val6 }; Dialog val14 = val9; val9 = new Dialog(); val9._dialogInput = "Here's your things!"; val9._dialogKey = "hbDStorage"; val9._dialogUI = (DialogUIPrompt)3; val9.facepic = facepic; val9._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val8 }; Dialog val15 = val9; DialogBranch val16 = new DialogBranch(); val16.dialogs = (Dialog[])(object)new Dialog[1] { val10 }; DialogBranch val17 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #0 - Intro/Welcome"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val10 }; DialogBranch val18 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #1 - Exit"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val11 }; DialogBranch val19 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #2 - Main"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val12 }; DialogBranch val20 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #3 - Vanity Mirror"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val13 }; DialogBranch val21 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #4 - Dungeon Portal"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val14 }; DialogBranch val22 = val16; val16 = new DialogBranch(); val16._dialogIndexTag = "Branch #5 - Storage"; val16.dialogs = (Dialog[])(object)new Dialog[1] { val15 }; DialogBranch val23 = val16; Log("ScriptableDialogData"); ScriptableDialogData val24 = ScriptableObject.CreateInstance<ScriptableDialogData>(); val24._nameTag = "The Based Department"; val24._voxSounds = hbSFX["phone"].ToArray(); val24._voxSpeed = 0.1f; val24._shopkeepResponses = new string[1] { "Very nice!" }; val24._shopkeepRejections = new string[1] { "No, I don't think so..." }; val24._introductionBranches = (DialogBranch[])(object)new DialogBranch[1] { val17 }; val24._dialogBranches = (DialogBranch[])(object)new DialogBranch[6] { val18, val19, val20, val21, val22, val23 }; Log("Returning ScriptableDialogData", 2); return val24; } private ScriptableDialogData Chatty() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Expected O, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown Log("Clearing throat...", 2); DialogSelection val = new DialogSelection { _selectionCaption = "Exit", _setDialogIndex = -1 }; DialogSelection val2 = new DialogSelection { _selectionCaption = "Return", _setDialogIndex = 2 }; DialogSelection val3 = new DialogSelection { _selectionCaption = "Vanity Mirror", _setDialogIndex = 3, _selectionIcon = hbSprites["chargen"] }; DialogSelection val4 = new DialogSelection { _selectionCaption = "Teleporter", _setDialogIndex = 4 }; DialogSelection val5 = new DialogSelection { _selectionCaption = "Storage", _setDialogIndex = 5 }; Sprite facepic = hbSprites["nokia"]; Dialog val6 = new Dialog(); val6._dialogInput = "..."; val6._dialogKey = "hbDMain"; val6._dialogUI = (DialogUIPrompt)0; val6.facepic = facepic; val6._dialogSelections = (DialogSelection[])(object)new DialogSelection[4] { val, val3, val4, val5 }; Dialog val7 = val6; val6 = new Dialog(); val6._dialogInput = "..."; val6._dialogKey = "hbDVanity"; val6._dialogUI = (DialogUIPrompt)4; val6.facepic = facepic; val6._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val2 }; Dialog val8 = val6; val6 = new Dialog(); val6._dialogInput = "..."; val6._dialogKey = "hbDPortal"; val6._dialogUI = (DialogUIPrompt)5; val6.facepic = facepic; val6._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val2 }; Dialog val9 = val6; val6 = new Dialog(); val6._dialogInput = "..."; val6._dialogKey = "hbDStorage"; val6._dialogUI = (DialogUIPrompt)3; val6.facepic = facepic; val6._dialogSelections = (DialogSelection[])(object)new DialogSelection[1] { val2 }; Dialog val10 = val6; DialogBranch val11 = new DialogBranch(); val11._dialogIndexTag = "Branch #0 - Intro/Welcome"; val11.dialogs = (Dialog[])(object)new Dialog[1] { val7 }; DialogBranch val12 = val11; DialogBranch val13 = new DialogBranch { _dialogIndexTag = "Branch #1 - Exit", dialogs = Array.Empty<Dialog>() }; val11 = new DialogBranch(); val11._dialogIndexTag = "Branch #2 - Main"; val11.dialogs = (Dialog[])(object)new Dialog[1] { val7 }; DialogBranch val14 = val11; val11 = new DialogBranch(); val11._dialogIndexTag = "Branch #3 - Vanity Mirror"; val11.dialogs = (Dialog[])(object)new Dialog[1] { val8 }; DialogBranch val15 = val11; val11 = new DialogBranch(); val11._dialogIndexTag = "Branch #4 - Dungeon Portal"; val11.dialogs = (Dialog[])(object)new Dialog[1] { val9 }; DialogBranch val16 = val11; val11 = new DialogBranch(); val11._dialogIndexTag = "Branch #5 - Storage"; val11.dialogs = (Dialog[])(object)new Dialog[1] { val10 }; DialogBranch val17 = val11; Log("ScriptableDialogData"); ScriptableDialogData val18 = ScriptableObject.CreateInstance<ScriptableDialogData>(); val18._nameTag = "Homebrewery Phone"; val18._voxSounds = hbSFX["phone"].ToArray(); val18._voxSpeed = 0.1f; val18._shopkeepResponses = new string[1] { "Ok" }; val18._shopkeepRejections = new string[1] { "No" }; val18._introductionBranches = (DialogBranch[])(object)new DialogBranch[1] { val12 }; val18._dialogBranches = (DialogBranch[])(object)new DialogBranch[6] { val12, val13, val14, val15, val16, val17 }; Log("Returning ScriptableDialogData", 2); return val18; } public static ScriptableShopkeep Shop() { Log("Opening shop...", 1); Log("hbShopkeep", 1); ScriptableShopkeep val = ScriptableObject.CreateInstance<ScriptableShopkeep>(); ((Object)val).name = "Homebrewery Shopkeep"; val._shopName = "Homebrewery Shop"; Log("Adding table", 1); val._shopkeepItemTables = (ShopkeepItemTable[])(object)new ShopkeepItemTable[1] { ShopTable() }; val._canBuyFromPlayer = false; val._isGambler = false; Log("Returning hbShopkeep", 1); return val; } public static ShopkeepItemTable ShopTable() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00bc: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown Log("ScriptableItems", 1); List<ShopkeepItem> list = new List<ShopkeepItem>(); string[] array = new string[4] { "Blue Dye", "Red Dye", "Grey Dye", "Green Dye" }; string[] array2 = array; foreach (string text in array2) { ScriptableItem val = gm.LocateItem(text); val._vendorCost = 0; ShopkeepItem item = new ShopkeepItem { _itemNameTag = text, _scriptItem = val, _initialStock = 1, _stockRefreshTimer = 0f, _isInfiniteStock = true, _removeAtEmptyStock = false, _setStatModifier = null, _randomizeModifier = false, _gambleLootTable = null, _gambleValue = 0, _isGambleSlot = false }; list.Add(item); } foreach (string itemFolder in itemFolders) { foreach (hbFolder item2 in hbDir[itemFolder]) { if (item2.done) { list.Add(ShopkeepItemMaker((ScriptableItem)item2.thing)); } } } Log("hbShopTable", 1); ShopkeepItemTable result = new ShopkeepItemTable { _shopkeepTableTag = "Homebrewery Items", _levelRequirement = 1, _shopkeepItems = list.ToArray() }; Log("Returning hbShopTable", 1); return result; } private void Update() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4