using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Net; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using Architect.Api; using Architect.Behaviour.Abilities; using Architect.Behaviour.Custom; using Architect.Behaviour.Fixers; using Architect.Behaviour.Utility; using Architect.Config; using Architect.Config.Types; using Architect.Content; using Architect.Content.Custom; using Architect.Content.Preloads; using Architect.Editor; using Architect.Events; using Architect.Events.Blocks; using Architect.Events.Blocks.Config; using Architect.Events.Blocks.Config.Types; using Architect.Events.Blocks.Events; using Architect.Events.Blocks.Functions; using Architect.Events.Blocks.Objects; using Architect.Events.Blocks.Operators; using Architect.Events.Blocks.Outputs; using Architect.Events.Vars; using Architect.Multiplayer; using Architect.Multiplayer.Ssmp; using Architect.Multiplayer.Ssmp.Data; using Architect.Objects; using Architect.Objects.Categories; using Architect.Objects.Groups; using Architect.Objects.Placeable; using Architect.Objects.Tools; using Architect.Placements; using Architect.Prefabs; using Architect.Sharer; using Architect.Sharer.Info; using Architect.Sharer.States; using Architect.Storage; using Architect.Utils; using Architect.Workshop; using Architect.Workshop.Config; using Architect.Workshop.Items; using Architect.Workshop.Types; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GlobalEnums; using GlobalSettings; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using InControl; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MonoMod.Utils; using Newtonsoft.Json; using Patchwork.Handlers; using PolyAndCode.UI; using PrepatcherPlugin; using QuickWarp; using SSMP.Api.Client; using SSMP.Api.Client.Networking; using SSMP.Api.Server; using SSMP.Api.Server.Networking; using SSMP.Math; using SSMP.Networking.Packet; using Silksong.AssetHelper.ManagedAssets; using Silksong.AssetHelper.Plugin; using Silksong.DataManager; using Silksong.ModMenu; using Silksong.ModMenu.Elements; using Silksong.ModMenu.Models; using Silksong.ModMenu.Screens; using TMProOld; using TeamCherry.Localization; using TeamCherry.SharedUtils; using TeamCherry.Splines; using UnityEngine; using UnityEngine.Animations; using UnityEngine.Audio; using UnityEngine.Bindings; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; using UnityStandardAssets.ImageEffects; using tk2dRuntime.TileMap; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Architect")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("3.28.0.0")] [assembly: AssemblyInformationalVersion("3.28.0+e580782e34ca3b99fa47182fbf9ff38785592697")] [assembly: AssemblyProduct("Architect")] [assembly: AssemblyTitle("Architect")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.28.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MonoDetour.HookGen { internal static class DefaultMonoDetourManager { internal static MonoDetourManager Instance { get; } = New(); internal static MonoDetourManager New() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name); } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] internal class MonoDetourTargetsAttribute : Attribute, IMonoDetourTargets { public Type? TargetType { get; } public bool IncludeNestedTypes { get; set; } public bool DistinguishOverloadsByName { get; set; } public string[]? Members { get; set; } public string[]? MemberNamePrefixes { get; set; } public string[]? MemberNameSuffixes { get; set; } public bool GenerateControlFlowVariants { get; set; } public MonoDetourTargetsAttribute(Type? targetType = null) { TargetType = targetType; IncludeNestedTypes = true; base..ctor(); } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Architect { public class ArchitectData { public Dictionary StringVariables = new Dictionary(); public Dictionary FloatVariables = new Dictionary(); public Dictionary BoolVariables = new Dictionary(); public string CustomNeedle = string.Empty; public static ArchitectData Instance => ArchitectPlugin.Instance.SaveData ?? (ArchitectPlugin.Instance.SaveData = new ArchitectData()); } public class GlobalArchitectData { public Dictionary Keybinds = new Dictionary(); public string CurrentMap = ""; public string CurrentMapId = ""; public Dictionary, int)> CherryScores = new Dictionary, int)>(); public Dictionary, int)> GoldCherryScores = new Dictionary, int)>(); public Dictionary CustomSaveArt = new Dictionary(); public List SavedMapNames = new List(); public Dictionary StringVariables = new Dictionary(); public Dictionary FloatVariables = new Dictionary(); public Dictionary BoolVariables = new Dictionary(); public static GlobalArchitectData Instance => ArchitectPlugin.Instance.GlobalData ?? (ArchitectPlugin.Instance.GlobalData = new GlobalArchitectData()); public string MapLabel => Utility.IsNullOrWhiteSpace(CurrentMap) ? "Map Keybinds" : CurrentMap; } [BepInPlugin("com.cometcake575.architect", "Architect", "3.28.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ArchitectPlugin : BaseUnityPlugin, ISaveDataMod, IRawSaveDataMod, IGlobalDataMod, IRawGlobalDataMod { internal static ArchitectPlugin Instance; internal static ManualLogSource Logger; public static readonly Sprite BlankSprite = ResourceUtils.LoadSpriteResource("blank", (FilterMode)1, default(Vector4), 300f); public ArchitectData SaveData { get; set; } public GlobalArchitectData GlobalData { get; set; } private void Awake() { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Architect has loaded!"); SceneUtils.Init(); PrefabManager.Init(); HookUtils.Init(); TitleUtils.Init(); StorageManager.Init(); Settings.Init(((BaseUnityPlugin)this).Config); MiscFixers.Init(); EnemyFixers.Init(); HazardFixers.Init(); InteractableFixers.Init(); Categories.Init(); ActionManager.Init(); CoopManager.Init(); WorkshopManager.Init(); ScriptManager.Init(); EditManager.Init(); CursorManager.Init(); VanillaObjects.Init(); SplineObjects.Init(); LegacyObjects.Init(); UtilityObjects.Init(); AbilityObjects.Init(); MiscObjects.Init(); CameraObjects.Init(); ParticleObjects.Init(); RespawnMarkerManager.Init(); PlacementManager.Init(); BroadcasterHooks.Init(); SharerManager.Init(); PreloadManager.Init(); EditorUI.Setup(); Architect.Objects.Groups.ConfigGroup.Init(); StorageManager.MakeBackup(DateTime.Now.ToString("yy-MM-dd-HH-mm-ss")); ProjectManager.Init(); typeof(GameManager).Hook("ResetSemiPersistentItems", (Action, GameManager>)delegate(Action orig, GameManager self) { BoolVarBlock.SemiVars.Clear(); NumVarBlock.SemiVars.Clear(); StringVarBlock.SemiVars.Clear(); orig(self); }); FindMaps(); } private static void FindMaps() { string[] directories = Directory.GetDirectories(Paths.PluginPath, "Architect", SearchOption.AllDirectories); foreach (string text in directories) { if (text == Path.Combine(Paths.PluginPath, "Architect")) { continue; } string path = Path.Combine(text, "Scenes"); if (Directory.Exists(path)) { string[] files = Directory.GetFiles(path); foreach (string text2 in files) { if (text2.EndsWith(".architect.json")) { string sceneName = Path.GetFileNameWithoutExtension(text2).Replace(".architect", ""); MapLoader.LoadStandaloneMap(sceneName, text2); } } } string path2 = Path.Combine(text, "Prefabs"); if (Directory.Exists(path2)) { string[] files2 = Directory.GetFiles(path2); foreach (string text3 in files2) { if (text3.EndsWith(".architect.json")) { string prefabName = Path.GetFileNameWithoutExtension(text3).Replace(".architect", ""); MapLoader.LoadStandalonePrefab(prefabName, text3); } } } string text4 = Path.Combine(text, "Assets"); if (Directory.Exists(text4)) { CustomAssetManager.AssetPaths.Add(text4); } StorageManager.LoadPrefabs(text); string path3 = Path.Combine(text, "workshop.json"); if (File.Exists(path3)) { string text5 = File.ReadAllText(path3); WorkshopManager.LoadExtWorkshop(JsonConvert.DeserializeObject(text5)); } StorageManager.Directories.Add(text); } } private void Start() { EditorUI.SetupCategories(); } private void Update() { if (Object.op_Implicit((Object)(object)HeroController.instance)) { EditManager.Update(); HazardFixers.UpdateLanterns(); } CursorManager.Update(); SharerManager.Update(); AbilityObjects.Update(); } } } namespace Architect.Workshop { public static class ConfigurationManager { public static readonly Dictionary ConfigTypes = new Dictionary(); public static Architect.Workshop.Types.ConfigType RegisterConfigType(Architect.Workshop.Types.ConfigType type) { ConfigTypes[type.Id] = type; return type; } public static Architect.Workshop.Types.ConfigValue DeserializeConfigValue(string configType, string serializedValue) { return ConfigTypes[configType].Deserialize(serializedValue); } } [JsonConverter(typeof(WorkshopDataConverter))] public class WorkshopData { public class WorkshopDataConverter : JsonConverter { public override void WriteJson(JsonWriter writer, WorkshopData value, JsonSerializer serializer) { writer.WriteStartObject(); writer.WritePropertyName("items"); writer.WriteStartArray(); foreach (WorkshopItem item in value.Items) { writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteValue(item.Type); writer.WritePropertyName("name"); writer.WriteValue(item.Id); writer.WritePropertyName("config"); serializer.Serialize(writer, (object)item.CurrentConfig.Values.ToDictionary((Architect.Workshop.Types.ConfigValue c) => c.GetTypeId(), (Architect.Workshop.Types.ConfigValue c) => c.SerializeValue())); writer.WriteEndObject(); } writer.WriteEndArray(); writer.WriteEndObject(); } public override WorkshopData ReadJson(JsonReader reader, Type objectType, WorkshopData existingValue, bool hasExistingValue, JsonSerializer serializer) { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Invalid comparison between Unknown and I4 WorkshopData workshopData = new WorkshopData(); reader.Read(); reader.Read(); reader.Read(); while ((int)reader.TokenType == 1) { string key = ""; string arg = ""; Dictionary currentConfig = new Dictionary(); reader.Read(); while ((int)reader.TokenType == 4) { switch (reader.Value as string) { case "type": key = reader.ReadAsString(); break; case "name": arg = reader.ReadAsString(); break; case "config": reader.Read(); currentConfig = DeserializeConfig(serializer.Deserialize>(reader)); break; } reader.Read(); } WorkshopItem workshopItem = WorkshopManager.WorkshopItems[key].Item2(arg); workshopItem.CurrentConfig = currentConfig; workshopData.Items.Add(workshopItem); reader.Read(); } reader.Read(); return workshopData; } private static Dictionary DeserializeConfig(Dictionary data) { Dictionary dictionary = new Dictionary(); foreach (KeyValuePair datum in data) { dictionary[datum.Key] = ConfigurationManager.DeserializeConfigValue(datum.Key, datum.Value); } return dictionary; } } public readonly List Items = new List(); } public static class WorkshopManager { public static WorkshopData WorkshopData; public static readonly Dictionary CustomItems = new Dictionary(); public static readonly Dictionary CustomEntries = new Dictionary(); public static readonly Dictionary CustomCrests = new Dictionary(); public static readonly Dictionary CustomQuests = new Dictionary(); public static readonly Dictionary CustomTools = new Dictionary(); public static readonly Dictionary)> WorkshopItems = new Dictionary)>(); private static readonly List ExtWorkshops = new List(); public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0226: 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_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) Register("Item", new Vector2(-300f, -150f), new List[4] { Architect.Workshop.Config.ConfigGroup.CustomItem, Architect.Workshop.Config.ConfigGroup.SpriteItem, Architect.Workshop.Config.ConfigGroup.UsableItem, Architect.Workshop.Config.ConfigGroup.CourierItem }); Register("Tool", new Vector2(-300f, -187.5f), new List[4] { Architect.Workshop.Config.ConfigGroup.CustomTool, Architect.Workshop.Config.ConfigGroup.SpriteItem, Architect.Workshop.Config.ConfigGroup.UseToolSprites, Architect.Workshop.Config.ConfigGroup.RedTools }); Register("Journal Entry", new Vector2(-100f, -187.5f), new List[3] { Architect.Workshop.Config.ConfigGroup.JournalEntry, Architect.Workshop.Config.ConfigGroup.SpriteItem, Architect.Workshop.Config.ConfigGroup.JournalEntrySprites }); Register("Quest", new Vector2(-100f, -150f), new List[4] { Architect.Workshop.Config.ConfigGroup.Quest, Architect.Workshop.Config.ConfigGroup.QuestSprites, new List(), Architect.Workshop.Config.ConfigGroup.QuestItem }); Register("Scene Group", new Vector2(-300f, -225f), new List[6] { Architect.Workshop.Config.ConfigGroup.SceneGroup, Architect.Workshop.Config.ConfigGroup.SceneGroupIcon, Architect.Workshop.Config.ConfigGroup.SceneGroupMap, Architect.Workshop.Config.ConfigGroup.SceneGroupMapPos, Architect.Workshop.Config.ConfigGroup.SceneGroupMapDirIn, Architect.Workshop.Config.ConfigGroup.SceneGroupMapDirOut }); Register("Scene", new Vector2(-100f, -225f), new List[3] { Architect.Workshop.Config.ConfigGroup.Scene, Architect.Workshop.Config.ConfigGroup.SceneMap, Architect.Workshop.Config.ConfigGroup.SceneMapColour }); Register("Material", new Vector2(-300f, -262.5f), new List[2] { Architect.Workshop.Config.ConfigGroup.MateriumEntry, Architect.Workshop.Config.ConfigGroup.SpriteItem }); Register("Map Icon", new Vector2(-100f, -262.5f), new List[3] { Architect.Workshop.Config.ConfigGroup.MapIcon, Architect.Workshop.Config.ConfigGroup.SpriteItem, Architect.Workshop.Config.ConfigGroup.MapIconLabel }); CustomKeybind.Init(); Register("Keybind", new Vector2(-300f, -300f), new List[1] { Architect.Workshop.Config.ConfigGroup.Keybind }); Register("Audio Cue", new Vector2(-100f, -300f), new List[1] { Architect.Workshop.Config.ConfigGroup.Cue }); CustomNeedle.Init(); Register("Needle", new Vector2(-300f, -337.5f), new List[2] { Architect.Workshop.Config.ConfigGroup.Needle, Architect.Workshop.Config.ConfigGroup.SpriteItem }); Register("Achievement", new Vector2(-100f, -337.5f), new List[1] { Architect.Workshop.Config.ConfigGroup.Achievement }); CustomCrest.Init(); Register("Crest", new Vector2(-300f, -375f), new List[3] { Architect.Workshop.Config.ConfigGroup.Crest, Architect.Workshop.Config.ConfigGroup.SpriteItem, Architect.Workshop.Config.ConfigGroup.CrestSprites }); Register("Crest Slot", new Vector2(-100f, -375f), new List[1] { Architect.Workshop.Config.ConfigGroup.CrestSlot }); SceneGroup.Init(); typeof(CollectableItemManager).Hook("InternalGetCollectedItems", (Func, List>, CollectableItemManager, Func, List>)delegate(Func, List> orig, CollectableItemManager self, Func predicate) { if (Application.isPlaying) { RefreshItems(); CollectableItemsData collectables = PlayerData.instance.Collectables; foreach (string item in from item in ((SerializableNamedList)(object)collectables).GetValidNames((Func)null) where !self.IsItemInMasterList(item) select item) { ((SerializableNamedList)(object)collectables).RuntimeData.Remove(item); CollectableItemManager.IncrementVersion(); } } return orig(self, predicate); }); typeof(HeroController).Hook("ThrowTool", (Action, HeroController, bool>)delegate(Action orig, HeroController self, bool isAutoThrow) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected I4, but got Unknown //IL_0072: 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_008b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self.willThrowTool)) { if (CustomTool.List.Contains(self.willThrowTool.name)) { ToolItemType type = self.willThrowTool.type; ToolItemType val = type; switch ((int)val) { case 3: HeroController.instance.TakeSilk(PlayerData.instance.SilkSkillCost); break; case 0: { Data savedData = self.willThrowTool.SavedData; savedData.AmountLeft--; self.willThrowTool.SavedData = savedData; ToolItemManager.ReportAllBoundAttackToolsUpdated(); break; } } } ToolBlock.DoBroadcast(self.willThrowTool.name); } orig(self, isAutoThrow); }); static void RefreshItems() { KeyValuePair[] array = CustomItems.ToArray(); string key; WorkshopItem value; foreach (KeyValuePair keyValuePair in array) { keyValuePair.Deconstruct(out key, out value); string key2 = key; WorkshopItem workshopItem = value; if (!((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).dictionary.ContainsKey(key2)) { workshopItem.Unregister(); workshopItem.Register(); } } KeyValuePair[] array2 = CustomEntries.ToArray(); foreach (KeyValuePair keyValuePair in array2) { keyValuePair.Deconstruct(out key, out value); string key3 = key; WorkshopItem workshopItem2 = value; if (!((NamedScriptableObjectList)(object)EnemyJournalManager.Instance.recordList).dictionary.ContainsKey(key3)) { workshopItem2.Unregister(); workshopItem2.Register(); } } KeyValuePair[] array3 = CustomCrests.ToArray(); foreach (KeyValuePair keyValuePair in array3) { keyValuePair.Deconstruct(out key, out value); string key4 = key; WorkshopItem workshopItem3 = value; if (!((NamedScriptableObjectList)(object)ManagerSingleton.Instance.crestList).dictionary.ContainsKey(key4)) { workshopItem3.Unregister(); workshopItem3.Register(); } } KeyValuePair[] array4 = CustomQuests.ToArray(); foreach (KeyValuePair keyValuePair in array4) { keyValuePair.Deconstruct(out key, out value); string key5 = key; WorkshopItem workshopItem4 = value; if (!((NamedScriptableObjectList)(object)QuestManager.Instance.masterList).dictionary.ContainsKey(key5)) { workshopItem4.Unregister(); workshopItem4.Register(); } } KeyValuePair[] array5 = CustomTools.ToArray(); foreach (KeyValuePair keyValuePair in array5) { keyValuePair.Deconstruct(out key, out value); string key6 = key; WorkshopItem workshopItem5 = value; if (!((NamedScriptableObjectList)(object)ManagerSingleton.Instance.toolItems).dictionary.ContainsKey(key6)) { workshopItem5.Unregister(); workshopItem5.Register(); } } } } public static void Setup() { CustomAchievement.Init(); SceneUtils.InitQWHook(); StorageManager.LoadWorkshopData(); foreach (WorkshopItem item in from i in ExtWorkshops.SelectMany((WorkshopData data) => data.Items) orderby i.GetPriority() select i) { if (WorkshopData.Items.Any((WorkshopItem i) => i.Id == item.Id)) { continue; } foreach (Architect.Workshop.Types.ConfigValue value in item.CurrentConfig.Values) { value.Setup(item); } item.Register(); } } public static void LoadExtWorkshop(WorkshopData data) { ExtWorkshops.Add(data); } public static void LoadWorkshop(WorkshopData data) { if (data == null) { data = new WorkshopData(); } if (WorkshopData != null) { foreach (WorkshopItem item in WorkshopData.Items) { item.Unregister(); } } WorkshopData = data; foreach (WorkshopItem item2 in WorkshopData.Items.OrderBy((WorkshopItem i) => i.GetPriority())) { foreach (Architect.Workshop.Types.ConfigValue value in item2.CurrentConfig.Values) { value.Setup(item2); } item2.Register(); } WorkshopUI.Refresh(); } private static void Register(string type, Vector2 pos, params List[] config) where T : WorkshopItem, new() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) pos.y += 5f; WorkshopItems[type] = (pos, (string s) => new T { Id = s, Type = type, Config = config, CurrentConfig = new Dictionary() }); } } } namespace Architect.Workshop.Types { public class BoolConfigType : ConfigType> where T : WorkshopItem { private bool? _defaultValue; public BoolConfigType(string name, string id, Action> action) : base(name, id, action) { } public BoolConfigType WithDefaultValue(bool value) { _defaultValue = value; return this; } public override ConfigValue GetDefaultValue() { return _defaultValue.HasValue ? new BoolConfigValue(this, _defaultValue.Value) : null; } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new BoolConfigElement(parent, apply, pos, currentVal); } public override ConfigValue Deserialize(string data) { return new BoolConfigValue(this, Convert.ToBoolean(data, CultureInfo.InvariantCulture)); } } public class BoolConfigValue : ConfigValue> where T : WorkshopItem { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private bool P; public BoolConfigValue(BoolConfigType type, bool value) { P = value; base..ctor(type); } public bool GetValue() { return P; } public override string SerializeValue() { return P.ToString(CultureInfo.InvariantCulture); } } public class BoolConfigElement : ConfigElement { private readonly Button _input; private bool _active = true; public BoolConfigElement(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown BoolConfigElement boolConfigElement = this; UIUtils.Label txt; (_input, txt) = UIUtils.MakeTextButton("Config Input", "Default", parent, Vector2.op_Implicit(pos), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), hasOutline: true, new Vector2(120f, 25f)); if (currentVal != null) { ((Text)txt.textComponent).text = currentVal; _active = Convert.ToBoolean(currentVal, CultureInfo.InvariantCulture); } ((UnityEvent)_input.onClick).AddListener((UnityAction)delegate { boolConfigElement._active = !boolConfigElement._active; ((Text)txt.textComponent).text = boolConfigElement._active.ToString(CultureInfo.InvariantCulture); ((Selectable)apply).interactable = true; }); } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return _active.ToString(CultureInfo.InvariantCulture); } } public class ChoiceConfigType : ConfigType> where T : WorkshopItem { private int? _defaultValue; private string[] _options = Array.Empty(); public ChoiceConfigType(string name, string id, Action> action) : base(name, id, action) { } public ChoiceConfigType WithOptions(params string[] options) { _options = options; return this; } public ChoiceConfigType WithDefaultValue(int value) { _defaultValue = value; return this; } public override ConfigValue GetDefaultValue() { return _defaultValue.HasValue ? new ChoiceConfigValue(this, _defaultValue.Value) : null; } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new ChoiceConfigElement(parent, apply, pos, currentVal, _options); } public override ConfigValue Deserialize(string data) { if (1 == 0) { } int num = ((!(data == "False")) ? ((data == "True") ? 1 : Convert.ToInt32(data, CultureInfo.InvariantCulture)) : 0); if (1 == 0) { } int value = num; return new ChoiceConfigValue(this, value); } public string GetOption(int index) { return _options[(index < _options.Length) ? index : 0]; } } public class ChoiceConfigValue : ConfigValue> where T : WorkshopItem { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int P; private readonly ChoiceConfigType _type; public ChoiceConfigValue(ChoiceConfigType type, int value) { P = value; _type = type; base..ctor(type); } public int GetValue() { return P; } public string GetStringValue() { return _type.GetOption(P); } public override string SerializeValue() { return P.ToString(CultureInfo.InvariantCulture); } } public class ChoiceConfigElement : ConfigElement { public class ChoiceButton : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public ChoiceConfigElement Cce; public void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected I4, but got Unknown InputButton button = eventData.button; InputButton val = button; switch ((int)val) { default: return; case 0: Cce._active++; break; case 1: if (Cce._active != -1) { Cce._active--; } break; case 2: return; } if (Cce._active < 0) { Cce._active += Cce._options.Length; } Cce._active %= Cce._options.Length; ((Text)Cce._txt.textComponent).text = Cce._options[Cce._active]; ((Selectable)Cce._apply).interactable = true; } } private readonly Button _input; private readonly string[] _options; private readonly Button _apply; private readonly UIUtils.Label _txt; private int _active = -1; public ChoiceConfigElement(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal, string[] options) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) (Button, UIUtils.Label) tuple = UIUtils.MakeTextButton("Config Input", "Default", parent, Vector2.op_Implicit(pos), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), hasOutline: true, new Vector2(120f, 25f)); _input = tuple.Item1; _txt = tuple.Item2; _options = options; _apply = apply; ChoiceButton choiceButton = ((Component)_input).gameObject.AddComponent(); choiceButton.Cce = this; if (currentVal != null) { _active = Convert.ToInt32(currentVal, CultureInfo.InvariantCulture); ((Text)_txt.textComponent).text = options[_active]; } } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return _active.ToString(CultureInfo.InvariantCulture); } } public abstract class ConfigType { public readonly string Name; public readonly string Id; public int Priority; protected ConfigType(string name, string id) { Name = name; Id = id; base..ctor(); } public abstract ConfigValue Deserialize(string data); [CanBeNull] public abstract ConfigValue GetDefaultValue(); public abstract ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal); internal abstract void RunAction(WorkshopItem item, ConfigValue value); } public abstract class ConfigType : ConfigType where TType : WorkshopItem where TValue : ConfigValue { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Action P; protected ConfigType(string name, string id, Action action) { P = action; base..ctor(name, id); } public ConfigType WithPriority(int priority) { Priority = priority; return this; } internal override void RunAction(WorkshopItem item, ConfigValue value) { P(item as TType, value as TValue); } } public abstract class ConfigValue { public abstract string SerializeValue(); public abstract string GetTypeId(); public abstract string GetName(); public abstract int GetPriority(); public abstract void Setup(WorkshopItem item); } public abstract class ConfigValue : ConfigValue where TType : ConfigType { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private TType P; protected ConfigValue(TType type) { P = type; base..ctor(); } public override string GetTypeId() { return P.Id; } public override string GetName() { return P.Name; } public override void Setup(WorkshopItem item) { P.RunAction(item, this); } public override int GetPriority() { return P.Priority; } } public abstract class ConfigElement { public abstract RectTransform GetElement(); public abstract string GetValue(); } public class FloatConfigType : ConfigType> where T : WorkshopItem { private float? _defaultValue; public FloatConfigType(string name, string id, Action> action) : base(name, id, action) { } public FloatConfigType WithDefaultValue(float value) { _defaultValue = value; return this; } public override ConfigValue GetDefaultValue() { return _defaultValue.HasValue ? new FloatConfigValue(this, _defaultValue.Value) : null; } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new FloatConfigElement(parent, apply, pos, currentVal); } public override ConfigValue Deserialize(string data) { float value; try { value = Convert.ToSingle(data, CultureInfo.InvariantCulture); } catch (FormatException) { value = 9999999f; } return new FloatConfigValue(this, value); } } public class FloatConfigValue : ConfigValue> where T : WorkshopItem { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private float P; public FloatConfigValue(FloatConfigType type, float value) { P = value; base..ctor(type); } public float GetValue() { return P; } public override string SerializeValue() { return P.ToString(CultureInfo.InvariantCulture); } } public class FloatConfigElement : ConfigElement { private readonly InputField _input; public FloatConfigElement(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) (_input, _) = UIUtils.MakeTextbox("Config Input", parent, Vector2.op_Implicit(pos), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), 120f, 25f); if (currentVal != null) { _input.text = currentVal; } string last = _input.text; _input.characterValidation = (CharacterValidation)2; ((UnityEvent)(object)_input.onValueChanged).AddListener((UnityAction)delegate(string s) { if (!(last == s)) { last = s; ((Selectable)apply).interactable = true; } }); } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return _input.text; } } public class IntConfigType : ConfigType> where T : WorkshopItem { private int? _defaultValue; public IntConfigType(string name, string id, Action> action) : base(name, id, action) { } public IntConfigType WithDefaultValue(int value) { _defaultValue = value; return this; } public override ConfigValue GetDefaultValue() { return _defaultValue.HasValue ? new IntConfigValue(this, _defaultValue.Value) : null; } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new IntConfigElement(parent, apply, pos, currentVal); } public override ConfigValue Deserialize(string data) { return new IntConfigValue(this, Convert.ToInt32(data, CultureInfo.InvariantCulture)); } } public class IntConfigValue : ConfigValue> where T : WorkshopItem { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int P; public IntConfigValue(IntConfigType type, int value) { P = value; base..ctor(type); } public int GetValue() { return P; } public override string SerializeValue() { return P.ToString(CultureInfo.InvariantCulture); } } public class IntConfigElement : ConfigElement { private readonly InputField _input; public IntConfigElement(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) (_input, _) = UIUtils.MakeTextbox("Config Input", parent, Vector2.op_Implicit(pos), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), 120f, 25f); if (currentVal != null) { _input.text = currentVal; } string last = _input.text; _input.characterValidation = (CharacterValidation)1; ((UnityEvent)(object)_input.onValueChanged).AddListener((UnityAction)delegate(string s) { if (!(last == s)) { last = s; ((Selectable)apply).interactable = true; } }); } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return _input.text; } } public class NoteConfigType : ConfigType { public NoteConfigType(string name) : base(name, string.Empty, (Action)delegate { }) { } public override ConfigValue GetDefaultValue() { return null; } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { return new NoteConfigElement(apply); } public override ConfigValue Deserialize(string data) { return new NoteConfigValue(this, data); } public static implicit operator NoteConfigType(string s) { return new NoteConfigType(s); } } public class NoteConfigValue : ConfigValue { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private string P; public NoteConfigValue(NoteConfigType type, string value) { P = value; base..ctor(type); } public override string SerializeValue() { return P; } } public class NoteConfigElement : ConfigElement { private readonly Button _input; public NoteConfigElement(Button apply) { _input = apply; ((Component)apply).gameObject.SetActive(false); ((Component)((Component)apply).GetComponent().label).gameObject.SetActive(false); } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return ""; } } public class StringConfigType : ConfigType> where T : WorkshopItem { [CanBeNull] private string _defaultValue; public StringConfigType(string name, string id, Action> action) : base(name, id, action) { } public StringConfigType WithDefaultValue(string value) { _defaultValue = value; return this; } public override ConfigValue GetDefaultValue() { return (_defaultValue == null) ? null : new StringConfigValue(this, _defaultValue); } public override ConfigElement CreateInput(GameObject parent, Button apply, Vector3 pos, string currentVal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new StringConfigElement(parent, apply, pos, currentVal); } public override ConfigValue Deserialize(string data) { return new StringConfigValue(this, data); } } public class StringConfigValue : ConfigValue> where T : WorkshopItem { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private string P; public StringConfigValue(StringConfigType type, string value) { P = value; base..ctor(type); } public string GetValue() { return P; } public override string SerializeValue() { return P; } } public class StringConfigElement : ConfigElement { private readonly InputField _input; public StringConfigElement(GameObject parent, Button apply, Vector3 pos, [CanBeNull] string currentVal) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) (_input, _) = UIUtils.MakeTextbox("Config Input", parent, Vector2.op_Implicit(pos), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), 220f, 25f); if (currentVal != null) { _input.text = currentVal; } string last = _input.text; ((UnityEvent)(object)_input.onValueChanged).AddListener((UnityAction)delegate(string s) { if (!(last == s)) { last = s; ((Selectable)apply).interactable = true; } }); } public override RectTransform GetElement() { Transform transform = ((Component)_input).transform; return (RectTransform)(object)((transform is RectTransform) ? transform : null); } public override string GetValue() { return _input.text; } } } namespace Architect.Workshop.Items { public class CustomAchievement : SpriteItem { private static readonly Dictionary Achievements = new Dictionary(); public string Name = string.Empty; public string Desc = string.Empty; public AchievementType AchievementType = (AchievementType)0; public string InsertBefore = string.Empty; private Achievement _achievement; public static void Init() { typeof(AchievementHandler).Hook("Start", (Action, AchievementHandler>)delegate(Action orig, AchievementHandler self) { orig(self); CustomAchievement[] array = Achievements.Values.ToArray(); foreach (CustomAchievement customAchievement in array) { customAchievement.Unregister(); customAchievement.Register(); } }); typeof(UIManager).Hook("UIGoToAchievementsMenu", (Action, UIManager>)delegate(Action orig, UIManager self) { orig(self); int num = 0; ICell[] componentsInChildren = ((Component)UIManager.instance.menuAchievementsList).GetComponentsInChildren(); foreach (ICell val in componentsInChildren) { UIManager.instance.menuAchievementsList.SetCell(val, num); num++; } }); typeof(Language).Hook("Get", (Func, string, string, string>)delegate(Func orig, string key, string sheetTitle) { if (sheetTitle == "Achievements") { foreach (CustomAchievement value in Achievements.Values) { if (key == value._achievement.TitleCell) { return value.Name; } if (key == value._achievement.DescriptionCell) { return value.Desc; } } } return orig(key, sheetTitle); }, typeof(string), typeof(string)); } public override void Register() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown Achievements[Id] = this; if (Object.op_Implicit((Object)(object)GameManager.instance)) { AchievementHandler achievementHandler = GameManager.instance.achievementHandler; _achievement = new Achievement { PlatformKey = Id, Type = AchievementType }; List achievements = achievementHandler.achievementsList.achievements; int num = achievements.FindIndex((Achievement o) => o.PlatformKey == InsertBefore); if (num != -1) { achievements.Insert(num, _achievement); } else { achievements.Add(_achievement); } base.Register(); } } protected override void OnReadySprite() { _achievement.Icon = Sprite; } public override void Unregister() { Achievements.Remove(Id); if (Object.op_Implicit((Object)(object)GameManager.instance)) { GameManager.instance.achievementHandler.achievementsList.achievements.Remove(_achievement); } } } public class CustomCrest : SpriteItem { public class CrestSlot : WorkshopItem { public string CrestId = string.Empty; public ToolItemType ToolType = (ToolItemType)0; public AttackToolBinding Binding = (AttackToolBinding)0; public Vector2 Pos; public bool Lock; public override void Register() { WorkshopUI.RefreshIcon(this); if (Crests.TryGetValue(CrestId, out var value)) { value._slots.Add(this); value.Unregister(); value.Register(); } } public override void Unregister() { if (Crests.TryGetValue(CrestId, out var value)) { value._slots.Remove(this); value.Unregister(); value.Register(); } } public override Sprite GetIcon() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) return Object.op_Implicit((Object)(object)List) ? ((InventoryItemToolBase)List.crests.First().templateSlots[ToolType]).Sprite : SharerManager.Placeholder; } } public class CustomConfigGroup : ConfigGroup { public ToolCrest InheritsDashFrom; } private static readonly Dictionary Crests = new Dictionary(); private ToolCrest _crest; public LocalStr Name = string.Empty; public LocalStr Desc = string.Empty; public LocalStr NamePrefix = string.Empty; public LocalStr EquipText = string.Empty; private readonly List _slots = new List(); public string HIconUrl = string.Empty; public bool HPoint; public float HPpu = 100f; public string GIconUrl = string.Empty; public bool GPoint; public float GPpu = 100f; public string Movement = "Hunter"; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private static InventoryToolCrestList k__BackingField; public override (string, string)[] FilesToDownload => new(string, string)[3] { (IconUrl, "png"), (HIconUrl, "png"), (GIconUrl, "png") }; private static InventoryToolCrestList List { get { if (Object.op_Implicit((Object)(object)k__BackingField)) { return k__BackingField; } return k__BackingField = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((InventoryToolCrestList c) => c.crests.Count > 0)); } } public static void Init() { typeof(HeroController).Hook("Start", (Action, HeroController>)delegate(Action orig, HeroController self) { CustomCrest[] array = Crests.Values.ToArray(); foreach (CustomCrest customCrest in array) { customCrest.Unregister(); customCrest.Register(); } orig(self); }); HookUtils.OnHeroAwake = (Action)Delegate.Combine(HookUtils.OnHeroAwake, (Action)delegate(HeroController controller) { PlayMakerFSM fsm = controller.sprintFSM; fsm.fsmTemplate = null; fsm.GetState("Start Attack").AddAction(delegate { if (controller.CurrentConfigGroup is CustomConfigGroup customConfigGroup) { PlayMakerFSM val = fsm; string name = customConfigGroup.InheritsDashFrom.name; if (1 == 0) { } string text = name switch { "Reaper" => "REAPER", "Wanderer" => "WANDERER", "Warrior" => "WARRIOR", "Spell" => "SHAMAN", "Toolmaster" => "TOOLMASTER", _ => string.Empty, }; if (1 == 0) { } val.SendEvent(text); } }, 6, everyFrame: false); }); } public override void Register() { //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) Crests[Id] = this; if (!Object.op_Implicit((Object)(object)HeroController.instance)) { return; } _crest = ScriptableObject.CreateInstance(); (HeroControllerConfig, ConfigGroup, ToolCrest) config = GetConfig(Movement); HeroControllerConfig item = config.Item1; ConfigGroup item2 = config.Item2; ToolCrest item3 = config.Item3; HeroControllerConfig val = Object.Instantiate(item); CustomConfigGroup customConfigGroup = new CustomConfigGroup { InheritsDashFrom = item3, Config = val, ActiveRoot = item2.ActiveRoot, NormalSlashObject = item2.NormalSlashObject, AlternateSlashObject = item2.AlternateSlashObject, WallSlashObject = item2.WallSlashObject, UpSlashObject = item2.UpSlashObject, AltUpSlashObject = item2.AltUpSlashObject, DownSlashObject = item2.DownSlashObject, AltDownSlashObject = item2.AltDownSlashObject, DashStab = item2.DashStab, DashStabAlt = item2.DashStabAlt, ChargeSlash = item2.ChargeSlash, TauntSlash = item2.TauntSlash }; bool activeSelf = item2.ActiveRoot.activeSelf; ((ConfigGroup)customConfigGroup).Setup(); if (activeSelf) { item2.ActiveRoot.SetActive(true); } List list = HeroController.instance.configs.ToList(); list.Add((ConfigGroup)(object)customConfigGroup); HeroController.instance.configs = list.ToArray(); _crest.heroConfig = val; _crest.name = Id; _crest.displayName = Name; _crest.description = Desc; _crest.getPromptDesc = Desc; _crest.itemNamePrefix = NamePrefix; _crest.equipText = EquipText; _crest.slots = ((IEnumerable)_slots).Select((Func)delegate(CrestSlot c) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) int num = _slots.FirstPosMin((CrestSlot s) => s.Pos.y - c.Pos.y, Dist); int num2 = _slots.FirstPosMin((CrestSlot s) => c.Pos.y - s.Pos.y, Dist); int num3 = _slots.FirstPosMin((CrestSlot s) => c.Pos.x - s.Pos.x, Dist); int num4 = _slots.FirstPosMin((CrestSlot s) => s.Pos.x - c.Pos.x, Dist); SlotInfo result = default(SlotInfo); result.Position = c.Pos; result.Type = c.ToolType; result.AttackBinding = c.Binding; result.NavUpIndex = num; result.NavDownIndex = num2; result.NavLeftIndex = num3; result.NavRightIndex = num4; result.NavUpFallbackIndex = num; result.NavDownFallbackIndex = num2; result.NavLeftFallbackIndex = num3; result.NavRightFallbackIndex = num4; result.IsLocked = c.Lock; return result; float Dist(CrestSlot s) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return Vector2.Distance(s.Pos, c.Pos); } }).ToArray(); ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.crestList).Add(_crest); WorkshopManager.CustomCrests.Add(Id, this); base.Register(); RefreshHSprite(); RefreshGSprite(); if (PlayerData.instance.CurrentCrestID == Id) { ToolItemManager.AutoEquip(_crest, false, false); } } private void RefreshHSprite() { if (Utility.IsNullOrWhiteSpace(HIconUrl)) { return; } CustomAssetManager.DoLoadSprite(HIconUrl, HPoint, HPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _crest.crestSilhouette = sprites[0]; } }); } private void RefreshGSprite() { if (Utility.IsNullOrWhiteSpace(GIconUrl)) { return; } CustomAssetManager.DoLoadSprite(GIconUrl, GPoint, GPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _crest.crestGlow = sprites[0]; } }); } public override void Unregister() { ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.crestList).Remove(_crest); WorkshopManager.CustomCrests.Remove(Id); if (!Object.op_Implicit((Object)(object)List)) { return; } InventoryToolCrest val = ((IEnumerable)List.crests).FirstOrDefault((Func)((InventoryToolCrest c) => (Object)(object)c.CrestData == (Object)(object)_crest)); if (!Object.op_Implicit((Object)(object)val)) { return; } List.crests.Remove(val); foreach (InventoryToolCrestSlot activeSlot in val.activeSlots) { ((Component)activeSlot).gameObject.SetActive(false); } ((Component)val.crestSprite).gameObject.SetActive(false); ((Component)val.crestGlowSprite).gameObject.SetActive(false); ((Component)val.crestSilhouette).gameObject.SetActive(false); Object.Destroy((Object)(object)val); } protected override void OnReadySprite() { _crest.crestSprite = Sprite; } private static (HeroControllerConfig, ConfigGroup, ToolCrest) GetConfig(string state) { ConfigGroup val = HeroController.instance.configs.First((ConfigGroup c) => ((Object)c.Config).name == "Default"); if (1 == 0) { } (HeroControllerConfig, ToolCrest) tuple = state switch { "Reaper" => (Gameplay.ReaperCrest.heroConfig, Gameplay.ReaperCrest), "Wanderer" => (Gameplay.WandererCrest.heroConfig, Gameplay.WandererCrest), "Beast" => (Gameplay.WarriorCrest.heroConfig, Gameplay.WarriorCrest), "Cloakless" => (Gameplay.CloaklessCrest.heroConfig, Gameplay.CloaklessCrest), "Architect" => (Gameplay.ToolmasterCrest.heroConfig, Gameplay.ToolmasterCrest), "Shaman" => (Gameplay.SpellCrest.heroConfig, Gameplay.SpellCrest), "Cursed" => (Gameplay.CursedCrest.heroConfig, Gameplay.CursedCrest), "Witch" => (Gameplay.WitchCrest.heroConfig, Gameplay.WitchCrest), _ => (val.Config, Gameplay.HunterCrest), }; if (1 == 0) { } var (s, item) = tuple; return (s, ((IEnumerable)HeroController.instance.configs).FirstOrDefault((Func)((ConfigGroup c) => (Object)(object)c.Config == (Object)(object)s)) ?? val, item); } } public class CustomCue : WorkshopItem { private static readonly Sprite Icon = ResourceUtils.LoadSpriteResource("audio_player", (FilterMode)1); private MusicCue _mcue; private AtmosCue _acue; private MusicChannelInfo _mci; private AtmosChannelInfo _aci; public string WavUrl = string.Empty; public bool IsAtmos; public override (string, string)[] FilesToDownload => new(string, string)[1] { (WavUrl, "wav") }; public override void Register() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown if (IsAtmos) { _acue = ScriptableObject.CreateInstance(); _aci = new AtmosChannelInfo(); _acue.alternatives = Array.Empty(); _acue.channelInfos = (AtmosChannelInfo[])(object)new AtmosChannelInfo[5] { _aci, new AtmosChannelInfo(), new AtmosChannelInfo(), new AtmosChannelInfo(), new AtmosChannelInfo() }; ((Object)_acue).name = Id; AudioPlayer.CustomAtmosCues.Add(Id, _acue); } else { _mcue = ScriptableObject.CreateInstance(); _mci = new MusicChannelInfo(); _mcue.alternatives = Array.Empty(); _mcue.channelInfos = (MusicChannelInfo[])(object)new MusicChannelInfo[6] { _mci, new MusicChannelInfo(), new MusicChannelInfo(), new MusicChannelInfo(), new MusicChannelInfo(), new MusicChannelInfo() }; ((Object)_mcue).name = Id; _mcue.originalMusicEventName = string.Empty; AudioPlayer.CustomMusicCues.Add(Id, _mcue); } RefreshSound(); } private void RefreshSound() { if (Utility.IsNullOrWhiteSpace(WavUrl)) { return; } CustomAssetManager.DoLoadSound(WavUrl, delegate(AudioClip wav) { wav.LoadAudioData(); if (IsAtmos) { _aci.clip = wav; } else { _mci.clip = wav; } }); } public override void Unregister() { if (Object.op_Implicit((Object)(object)_acue)) { Object.Destroy((Object)(object)_acue); } if (Object.op_Implicit((Object)(object)_mcue)) { Object.Destroy((Object)(object)_mcue); } AudioPlayer.CustomMusicCues.Remove(Id); AudioPlayer.CustomAtmosCues.Remove(Id); } public override Sprite GetIcon() { return Icon; } } public class CustomItem : SpriteItem { public interface ICustomItem { void Register(CustomItem item); void Unregister(); void SetSprite(Sprite sprite) { } void SetAudio1(AudioClip clip) { } void SetAudio2(AudioClip clip) { } } public enum CustomItemType { Normal, Usable, Memento, Courier } public class CustomCollectable : CollectableItemMemento, ICustomItem { public string consumeEvent; public bool consume; private CustomItem _item; public override bool TakeItemOnConsume => consume; public override void ConsumeItemResponse() { if (!Utility.IsNullOrWhiteSpace(consumeEvent)) { BroadcastBlock.DoBroadcast(consumeEvent); } } public void Register(CustomItem item) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) _item = item; ((Object)this).name = item.Id; ((CollectableItemBasic)this).displayName = item.ItemName; ((CollectableItemBasic)this).description = item.ItemDesc; ((CollectableItem)this).useResponseTextOverride = item.UseType; ((CollectableItem)this).useResponses = (UseResponse[])(object)new UseResponse[1] { new UseResponse { UseType = (UseTypes)(item.ItemType == CustomItemType.Usable), Description = item.UseDesc } }; ((CollectableItem)this).customMaxAmount = item.MaxAmount; ((CollectableItemBasic)this).setExtraPlayerDataBools = Array.Empty(); ((CollectableItemBasic)this).setExtraPlayerDataInts = Array.Empty(); ((CollectableItem)this).isHidden = item.Hidden; consumeEvent = item.UseEvent; consume = item.Consume; ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).Add((CollectableItem)(object)this); if (Object.op_Implicit((Object)(object)MementoList) && _item.ItemType == CustomItemType.Memento) { ((NamedScriptableObjectList)(object)MementoList).Add((CollectableItemMemento)(object)this); } } public void SetSprite(Sprite sprite) { ((CollectableItemBasic)this).icon = sprite; } public void SetAudio1(AudioClip clip) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) ((CollectableItem)this).useSounds = new AudioEventRandom { Volume = _item.Volume1, PitchMax = _item.MaxPitch1, PitchMin = _item.MinPitch1, Clips = (AudioClip[])(object)new AudioClip[1] { clip } }; } public void SetAudio2(AudioClip clip) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) ((CollectableItem)this).instantUseSounds = new AudioEventRandom { Volume = _item.Volume2, PitchMax = _item.MaxPitch2, PitchMin = _item.MinPitch2, Clips = (AudioClip[])(object)new AudioClip[1] { clip } }; } public override bool IsVisibleInCollection() { if (_item.ItemType == CustomItemType.Memento) { return ((CollectableItemMemento)this).IsVisibleInCollection(); } return ((CollectableItem)this).CollectedAmount > 0; } public override string GetDescription(ReadSource readSource) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return LocalisedString.op_Implicit(((CollectableItemBasic)this).description); } public void Unregister() { ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).Remove((CollectableItem)(object)this); if (Object.op_Implicit((Object)(object)MementoList)) { ((NamedScriptableObjectList)(object)MementoList).Remove((CollectableItemMemento)(object)this); } Object.Destroy((Object)(object)this); } } public class CustomCourierItem : DeliveryQuestItem, ICustomItem { public string consumeEvent; public bool consume; public int reward; public override bool TakeItemOnConsume => consume; public override void ConsumeItemResponse() { if (!Utility.IsNullOrWhiteSpace(consumeEvent)) { BroadcastBlock.DoBroadcast(consumeEvent); } } public void Register(CustomItem item) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) ((Object)this).name = item.Id; base.displayName = item.ItemName; base.description = item.ItemDesc; ((CollectableItem)this).useResponseTextOverride = item.UseType; ((CollectableItem)this).useResponses = (UseResponse[])(object)new UseResponse[1] { new UseResponse { UseType = (UseTypes)0, Description = item.UseDesc } }; ((CollectableItem)this).customMaxAmount = item.MaxAmount; ((CollectableItem)this).isHidden = item.Hidden; consumeEvent = item.UseEvent; consume = item.Consume; int courierEffects = item.CourierEffects; if (1 == 0) { } SavedItem val = (SavedItem)(courierEffects switch { 0 => null, 1 => MiscUtils.GetSavedItem("Courier Supplies"), 2 => MiscUtils.GetSavedItem("Courier Supplies Slave"), _ => MiscUtils.GetSavedItem("Courier Supplies Gourmand"), }); if (1 == 0) { } DeliveryQuestItem val2 = (DeliveryQuestItem)(object)((val is DeliveryQuestItem) ? val : null); if (Object.op_Implicit((Object)(object)val2)) { base.breakHeroEffect = val2.breakHeroEffect; base.breakUIEffect = val2.breakUIEffect; base.heroLoopEffect = val2.heroLoopEffect; base.hitHeroEffect = val2.hitHeroEffect; base.hitUIEffect = val2.hitUIEffect; base.uiLoopEffect = val2.uiLoopEffect; } base.barColour = item.BarColour; base.totalTimer = item.Time; reward = item.RewardCost; ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).Add((CollectableItem)(object)this); } public void SetSprite(Sprite sprite) { base.icon = sprite; } public override bool IsVisibleInCollection() { return ((CollectableItem)this).CollectedAmount > 0; } public override string GetDescription(ReadSource readSource) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return LocalisedString.op_Implicit(base.description); } public void Unregister() { ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).Remove((CollectableItem)(object)this); Object.Destroy((Object)(object)this); } } private ICustomItem _item; public CustomItemType ItemType = CustomItemType.Normal; public LocalStr ItemName = string.Empty; public LocalStr ItemDesc = string.Empty; public LocalStr UseDesc = string.Empty; public int MaxAmount = int.MaxValue; public bool Hidden; public LocalStr UseType = "Break"; public bool Consume; public string UseEvent; public int CourierEffects; public Color BarColour = Color.white; public int Time = 0; public int RewardCost = 0; public string WavURL1; public float Volume1 = 1f; public float MaxPitch1 = 1.2f; public float MinPitch1 = 0.8f; public string WavURL2; public float Volume2 = 1f; public float MaxPitch2 = 1.2f; public float MinPitch2 = 0.8f; private static CollectableItemMementoList _mementoList; public override (string, string)[] FilesToDownload => new(string, string)[3] { (IconUrl, "png"), (WavURL1, "wav"), (WavURL2, "wav") }; public static CollectableItemMementoList MementoList { get { if (!Object.op_Implicit((Object)(object)_mementoList)) { _mementoList = Resources.FindObjectsOfTypeAll().FirstOrDefault(); } return _mementoList; } } public override void Register() { if (ItemType == CustomItemType.Courier) { _item = ScriptableObject.CreateInstance(); } else { _item = ScriptableObject.CreateInstance(); } _item.Register(this); WorkshopManager.CustomItems.Add(Id, this); base.Register(); RefreshAudio1(); RefreshAudio2(); CollectableItemManager.IncrementVersion(); } public override void Unregister() { WorkshopManager.CustomItems.Remove(Id); _item.Unregister(); CollectableItemManager.IncrementVersion(); } protected override void OnReadySprite() { _item.SetSprite(Sprite); } public void RefreshAudio1() { if (!Utility.IsNullOrWhiteSpace(WavURL1)) { CustomAssetManager.DoLoadSound(WavURL1, delegate(AudioClip clip) { _item.SetAudio1(clip); }); } } public void RefreshAudio2() { if (!Utility.IsNullOrWhiteSpace(WavURL2)) { CustomAssetManager.DoLoadSound(WavURL2, delegate(AudioClip clip) { _item.SetAudio2(clip); }); } } } public class CustomJournalEntry : SpriteItem { private EnemyJournalRecord _record; public string LIconUrl = string.Empty; public bool LPoint; public float LPpu = 100f; public LocalStr ItemName = string.Empty; public LocalStr ItemDesc = string.Empty; public LocalStr ItemHDesc = string.Empty; public string InsertBefore = string.Empty; public RequiredTypes Required = (RequiredTypes)1; public int KillsRequired = 1; public int Priority; public override int GetPriority() { return Priority; } public override void Register() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0045: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) _record = ScriptableObject.CreateInstance(); ((Object)_record).name = Id; _record.altNotesTest = new PlayerDataTest(); _record.completeOthers = Array.Empty(); _record.recordType = (RecordTypes)0; _record.killsRequired = KillsRequired; _record.displayName = ItemName; _record.description = ItemDesc; _record.notes = ItemHDesc; _record.requiredType = Required; List list = ((NamedScriptableObjectList)(object)EnemyJournalManager.Instance.recordList).List; int num = list.FindIndex((EnemyJournalRecord o) => ((Object)o).name == InsertBefore); if (num != -1) { list.Insert(num, _record); } else { list.Add(_record); } base.Register(); RefreshLSprite(); EnemyJournalRecord byName = ((NamedScriptableObjectList)(object)EnemyJournalManager.Instance.recordList).GetByName(Id); if (Object.op_Implicit((Object)(object)byName)) { ((NamedScriptableObjectList)(object)EnemyJournalManager.Instance.recordList).Remove(byName); } WorkshopManager.CustomEntries.Add(Id, this); } public void RefreshLSprite() { if (Utility.IsNullOrWhiteSpace(LIconUrl)) { return; } CustomAssetManager.DoLoadSprite(LIconUrl, LPoint, LPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _record.enemySprite = sprites[0]; } }); } protected override void OnReadySprite() { _record.iconSprite = Sprite; } public override void Unregister() { ((NamedScriptableObjectList)(object)EnemyJournalManager.Instance.recordList).Remove(_record); WorkshopManager.CustomEntries.Remove(Id); Object.Destroy((Object)(object)_record); } } public class CustomKeybind : WorkshopItem { public class CustomKeyBindElement : KeyBindElement { public CustomKeybind Keybind; public CustomKeyBindElement(string label, [NotNull] IValueModel model) : base(LocalizedText.op_Implicit(label), model) { ((SelectableValueElement)this).OnValueChanged += DoChange; ((MenuDisposable)this).OnDispose += DoDispose; } public void DoChange(KeyCode code) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) GlobalArchitectData.Instance.Keybinds[Keybind.Id] = code; } public void DoDispose() { ((SelectableValueElement)this).OnValueChanged -= DoChange; ((MenuDisposable)this).OnDispose -= DoDispose; } } private static readonly Sprite Icon = ResourceUtils.LoadSpriteResource("key_listener", (FilterMode)0); public static readonly Dictionary Keybinds = new Dictionary(); public string Name = string.Empty; public KeyCode Default = (KeyCode)0; public override void Register() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!GlobalArchitectData.Instance.Keybinds.ContainsKey(Id) || Settings.TestMode.Value) { GlobalArchitectData.Instance.Keybinds[Id] = Default; } Keybinds.Add(Id, this); } public override void Unregister() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 Keybinds.Remove(Id); if (GlobalArchitectData.Instance.Keybinds.TryGetValue(Id, out var value) && (int)value == 0) { GlobalArchitectData.Instance.Keybinds.Remove(Id); } } public override Sprite GetIcon() { return Icon; } public static void Init() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown SimpleMenuScreen mapKeybinds = null; List keyButtons = new List(); Registry.AddModMenu("Architect Map", (MenuElementGenerator)delegate { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown TextButton val = new TextButton(LocalizedText.Key(new LocalisedString("ArchitectMap", "ArchitectMap"))); val.OnSubmit = (Action)Delegate.Combine(val.OnSubmit, (Action)delegate { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) SimpleMenuScreen obj = mapKeybinds; if (obj != null) { ((MenuDisposable)obj).Dispose(); } foreach (CustomKeyBindElement item in keyButtons) { ((MenuDisposable)item).Dispose(); } keyButtons.Clear(); mapKeybinds = new SimpleMenuScreen(GlobalArchitectData.Instance.MapLabel); MenuScreenNavigation.Show((AbstractMenuScreen)(object)mapKeybinds, (HistoryMode)0); foreach (KeyValuePair keybind in Keybinds) { keybind.Deconstruct(out var key, out var value); string key2 = key; CustomKeybind customKeybind = value; CustomKeyBindElement customKeyBindElement = new CustomKeyBindElement(customKeybind.Name, (IValueModel)(object)new ValueModel(GlobalArchitectData.Instance.Keybinds[key2])) { Keybind = customKeybind }; keyButtons.Add(customKeyBindElement); mapKeybinds.Add((MenuElement)(object)customKeyBindElement); } }); return (SelectableElement)(object)val; }); } } public class CustomMapIcon : SpriteItem { public class MapDisplayHandler : MonoBehaviour { public int mode; public string reqVar; public GameMapScene gms; private GameMap _gameMap; private Renderer _renderer; private void Reset() { _gameMap = ((Component)this).GetComponentInParent(true); } private void Awake() { _gameMap = ((Component)this).GetComponentInParent(); _gameMap.UpdateQuickMapDisplay += Refresh; _renderer = ((Component)this).GetComponent(); } private void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 if ((int)DisplayOnWorldMapOnly.updateState != 0) { Refresh((int)DisplayOnWorldMapOnly.updateState == 2, (MapZone)0); } } private void OnDestroy() { _gameMap.UpdateQuickMapDisplay -= Refresh; } private void Refresh(bool isQuickMap, MapZone _) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) DisplayOnWorldMapOnly.updateState = (UpdateState)((!isQuickMap) ? 1 : 2); if (Object.op_Implicit((Object)(object)_renderer)) { _renderer.enabled = (mode == 0 || mode == 1 == isQuickMap) && ShouldBeVisible(); } } private bool ShouldBeVisible() { if (!gms.IsMapped) { return false; } if (Utility.IsNullOrWhiteSpace(reqVar)) { return true; } bool value; return ArchitectData.Instance.BoolVariables.TryGetValue(reqVar, out value) && value; } } public static readonly List Icons = new List(); public string Scene = string.Empty; public Vector2 Pos = Vector2.zero; public int Mode; public string Text = string.Empty; public float FontSize = 6.2f; public Vector2 Offset = Vector2.zero; public Color Colour = Color.white; public string ReqVar; private GameObject _iconObj; private SpriteRenderer _renderer; public override void Register() { Icons.Add(this); Setup(); base.Register(); } public override void Unregister() { Icons.Remove(this); if (Object.op_Implicit((Object)(object)_iconObj)) { Object.Destroy((Object)(object)_iconObj); } } public void Setup() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) if (SceneUtils.CustomScenes.TryGetValue(Scene, out var value) && Object.op_Implicit((Object)(object)value.Map)) { _iconObj = Object.Instantiate(SceneGroup.MapIconPrefab, value.Map.transform); _iconObj.transform.localPosition = Vector2.op_Implicit(Pos); Extensions.SetLocalPositionZ(_iconObj.transform, -0.2f); _iconObj.transform.GetChild(0).localPosition = Vector2.op_Implicit(Offset); ((Renderer)_iconObj.GetComponentInChildren()).sortingOrder = 11; _renderer = _iconObj.GetComponentInChildren(); ((Renderer)_renderer).sortingOrder = 11; _iconObj.GetComponentInChildren().text = (LocalStr)Text; TextMeshPro componentInChildren = _iconObj.GetComponentInChildren(); ((TMP_Text)componentInChildren).fontSize = FontSize; ((Graphic)componentInChildren).color = Colour; MapDisplayHandler mapDisplayHandler = ((Component)_iconObj.transform.GetChild(0)).gameObject.AddComponent(); MapDisplayHandler mapDisplayHandler2 = ((Component)_iconObj.transform.GetChild(1)).gameObject.AddComponent(); mapDisplayHandler.mode = Mode; mapDisplayHandler.reqVar = (mapDisplayHandler2.reqVar = ReqVar); mapDisplayHandler.gms = (mapDisplayHandler2.gms = value.Gms); _renderer.sprite = Sprite; _iconObj.SetActive(true); } } protected override void OnReadySprite() { if (Object.op_Implicit((Object)(object)_renderer)) { _renderer.sprite = Sprite; } } } public class CustomMateriumEntry : SpriteItem { private MateriumItem _item; public LocalStr ItemName = string.Empty; public LocalStr Desc = string.Empty; public string InsertBefore = string.Empty; public override void Register() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) _item = ScriptableObject.CreateInstance(); ((Object)_item).name = Id; _item.itemQuests = new List(); _item.playerDataCondition = new PlayerDataTest(); _item.displayName = ItemName; _item.description = Desc; List list = ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).List; int num = list.FindIndex((MateriumItem o) => ((Object)o).name == InsertBefore); if (num != -1) { list.Insert(num, _item); } else { list.Add(_item); } ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).UpdateDictionary(); base.Register(); } public override void Unregister() { ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).Remove(_item); ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).UpdateDictionary(); Object.Destroy((Object)(object)_item); } protected override void OnReadySprite() { _item.icon = Sprite; } } public class CustomMenuStyle : WorkshopItem { public class FakePlayer : MonoBehaviour { private HeroController _hc; private void Start() { _hc = ((Component)this).GetComponent(); } private void Update() { _hc.ResetHardLandingTimer(); _hc.RelinquishControl(); Extensions.SetPosition2D(((Component)this).transform, 9999999f, 9999999f); } } public class LoadSceneContents : MonoBehaviour { public string id; private Scene _scene; public void OnEnable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) _scene = SceneManager.CreateScene(id + "_Title"); LevelData levelData = StorageManager.LoadScene(id + "_Title"); foreach (ObjectPlacement placement in levelData.Placements) { GameObject val = placement.SpawnObject(); if (Object.op_Implicit((Object)(object)val)) { SceneManager.MoveGameObjectToScene(val, _scene); PlacementManager.Objects[placement.GetId()] = val; PlacementManager.OnPlace?.Invoke(placement.GetPlacementType().GetId(), placement.GetId(), val); } } foreach (ScriptBlock scriptBlock in levelData.ScriptBlocks) { scriptBlock.Setup(visual: false); } foreach (ScriptBlock scriptBlock2 in levelData.ScriptBlocks) { scriptBlock2.LateSetup(); } } private void OnDisable() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SceneManager.UnloadSceneAsync(_scene); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject obj; private AsyncOperationHandle 5__1; private GameObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) 5__1 = default(AsyncOperationHandle); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameManager.instance.LoadHeroPrefab(); <>2__current = 5__1; <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = Object.Instantiate(5__1.Result, obj.transform); 5__2.AddComponent(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly List Styles = new List(); private static GameObject _ms; private GameObject _parent; public static void Init() { typeof(MenuStyles).Hook("Start", (Action, MenuStyles>)delegate(Action orig, MenuStyles self) { orig(self); _ms = ((Component)self).gameObject; ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadHero(((Component)self).gameObject)); CustomMenuStyle[] array = Styles.ToArray(); foreach (CustomMenuStyle customMenuStyle in array) { customMenuStyle.Unregister(); customMenuStyle.Register(); } }); typeof(GameManager).Hook("LoadHeroPrefab", (Func>, GameManager, AsyncOperationHandle>)delegate(Func> orig, GameManager self) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)HeroController._instance)) { ((Component)HeroController._instance).gameObject.RemoveComponent(); } return orig(self); }); } [IteratorStateMachine(typeof(d__4))] private static IEnumerator LoadHero(GameObject obj) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { obj = obj }; } public override void Register() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown Styles.Add(this); if (Object.op_Implicit((Object)(object)_ms)) { GameObject val = new GameObject(Id); val.transform.parent = _ms.transform; val.transform.localPosition = new Vector3(-5f, -7.8454f, 3.5469f); _parent = val; _parent.SetActive(false); LoadSceneContents loadSceneContents = _parent.AddComponent(); loadSceneContents.id = Id; } } public override void Unregister() { Styles.Remove(this); if (Object.op_Implicit((Object)(object)_parent)) { Object.Destroy((Object)(object)_parent); } } public override Sprite GetIcon() { return ArchitectPlugin.BlankSprite; } } public class CustomNeedle : SpriteItem { public static readonly Dictionary Needles = new Dictionary(); private static InventoryItemNail _nail; private static GameObject _nailPrefab; private DisplayState _displayState; public int Damage; public LocalStr Name = string.Empty; public LocalStr Desc = string.Empty; public float NeedleRangeMult = 1f; public int NeedleColourActive = 0; public Color NeedleColour = Color.white; public static void Init() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) typeof(InventoryItemNail).Hook("Awake", (Action, InventoryItemNail>)delegate(Action orig, InventoryItemNail self) { orig(self); _nail = self; _nailPrefab = _nail.displayStates[4].DisplayObject; foreach (CustomNeedle value5 in Needles.Values) { value5.Register(); } }); typeof(InventoryItemNail).Hook("UpdateState", (Action, InventoryItemNail>)delegate(Action orig, InventoryItemNail self) { orig(self); string customNeedle4 = ArchitectData.Instance.CustomNeedle; if (!Utility.IsNullOrWhiteSpace(customNeedle4) && Needles.TryGetValue(customNeedle4, out var value4)) { DisplayState[] displayStates = self.displayStates; foreach (DisplayState val5 in displayStates) { if (Object.op_Implicit((Object)(object)val5.DisplayObject)) { val5.DisplayObject.SetActive(false); } } self.currentState = value4._displayState; value4._displayState.DisplayObject.SetActive(true); } }); new Hook((MethodBase)typeof(PlayerData).GetProperty("nailDamage").GetGetMethod(), (Delegate)(Func, PlayerData, int>)delegate(Func orig, PlayerData self) { string customNeedle3 = ArchitectData.Instance.CustomNeedle; CustomNeedle value3; return (!Utility.IsNullOrWhiteSpace(customNeedle3) && Needles.TryGetValue(customNeedle3, out value3)) ? value3.Damage : orig(self); }); typeof(NailAttackBase).Hook("OnSlashStarting", (Action, NailAttackBase>)delegate(Action orig, NailAttackBase self) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) string customNeedle2 = ArchitectData.Instance.CustomNeedle; if (!Utility.IsNullOrWhiteSpace(customNeedle2) && Needles.TryGetValue(customNeedle2, out var value2)) { if (value2.NeedleColourActive == 1) { if (Object.op_Implicit((Object)(object)self.slashSprite)) { ((tk2dBaseSprite)self.slashSprite).color = value2.NeedleColour; } if (Object.op_Implicit((Object)(object)self.imbuedSlashAnim)) { ((tk2dBaseSprite)self.imbuedSlashSprite).color = value2.NeedleColour; } } orig(self); Transform transform = ((Component)self).transform; transform.localScale *= value2.NeedleRangeMult; if (value2.NeedleColourActive == 2) { if (Object.op_Implicit((Object)(object)self.slashSprite)) { ((tk2dBaseSprite)self.slashSprite).color = value2.NeedleColour; } if (Object.op_Implicit((Object)(object)self.imbuedSlashAnim)) { ((tk2dBaseSprite)self.imbuedSlashSprite).color = value2.NeedleColour; } } } else { orig(self); } }); typeof(HeroExtraNailSlash).Hook("OnEnable", (Action, HeroExtraNailSlash>)delegate(Action orig, HeroExtraNailSlash self) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) string customNeedle = ArchitectData.Instance.CustomNeedle; if (!Utility.IsNullOrWhiteSpace(customNeedle) && Needles.TryGetValue(customNeedle, out var value)) { if (value.NeedleColourActive == 1) { SpriteRenderer[] tintSprites = self.tintSprites; foreach (SpriteRenderer val in tintSprites) { if (Object.op_Implicit((Object)(object)val)) { val.color = value.NeedleColour; } } tk2dSprite[] tintTk2dSprites = self.tintTk2dSprites; foreach (tk2dSprite val2 in tintTk2dSprites) { if (Object.op_Implicit((Object)(object)val2)) { ((tk2dBaseSprite)val2).color = value.NeedleColour; } } } orig(self); if (value.NeedleColourActive == 2) { SpriteRenderer[] tintSprites2 = self.tintSprites; foreach (SpriteRenderer val3 in tintSprites2) { if (Object.op_Implicit((Object)(object)val3)) { val3.color = value.NeedleColour; } } tk2dSprite[] tintTk2dSprites2 = self.tintTk2dSprites; foreach (tk2dSprite val4 in tintTk2dSprites2) { if (Object.op_Implicit((Object)(object)val4)) { ((tk2dBaseSprite)val4).color = value.NeedleColour; } } } } else { orig(self); } }); } public override void Register() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown if (!Needles.ContainsKey(Id)) { Needles[Id] = this; } if (Object.op_Implicit((Object)(object)_nail)) { GameObject val = Object.Instantiate(_nailPrefab, ((Component)_nail).transform); ((Object)val).name = Id; _displayState = new DisplayState { DisplayObject = val, DisplayName = Name, Description = Desc }; List list = _nail.displayStates.ToList(); list.Add(_displayState); _nail.displayStates = list.ToArray(); base.Register(); } } public override void Unregister() { if (Object.op_Implicit((Object)(object)_nail)) { List list = _nail.displayStates.ToList(); list.Remove(_displayState); _nail.displayStates = list.ToArray(); Object.Destroy((Object)(object)_displayState.DisplayObject); } Needles.Remove(Id); } protected override void OnReadySprite() { _displayState.DisplayObject.GetComponent().sprite = Sprite; } } public class CustomQuest : SpriteItem { public bool MainQuest; public LocalStr ItemName = string.Empty; public LocalStr ItemDesc = string.Empty; public LocalStr WallDesc = string.Empty; public LocalStr TypeName = string.Empty; public Color Color = Color.white; private MainQuest _mq; private FullQuestBase _quest; private QuestType _type; public string LIconUrl = string.Empty; public bool LPoint; public float LPpu = 100f; public string GIconUrl = string.Empty; public bool GPoint; public float GPpu = 100f; public bool HasItem; public string ItemId = string.Empty; public int ItemCount = 1; public DescCounterTypes DescCounterType = (DescCounterTypes)0; public ListCounterTypes ListCounterType = (ListCounterTypes)0; public Color BarColour = Color.white; public LocalStr CollectedDesc = string.Empty; public override (string, string)[] FilesToDownload => new(string, string)[3] { (IconUrl, "png"), (LIconUrl, "png"), (GIconUrl, "png") }; public override int GetPriority() { return 1; } public override void Register() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) _type = QuestType.Create((LocalisedString)TypeName, (Sprite)null, Color, (Sprite)null, (Sprite)null, (Sprite)null); if (MainQuest) { _mq = ScriptableObject.CreateInstance(); _mq.questType = _type; _mq.subQuests = Array.Empty(); _mq.altTargets = Array.Empty(); _quest = (FullQuestBase)(object)_mq; } else { Quest val = ScriptableObject.CreateInstance(); val.questType = _type; _quest = (FullQuestBase)(object)val; } ((Object)_quest).name = Id; _quest.hideDescCounterForLangs = Array.Empty(); _quest.persistentBoolTests = Array.Empty(); _quest.requiredCompleteQuests = Array.Empty(); _quest.requiredUnlockedTools = Array.Empty(); _quest.requiredCompleteTotalGroups = Array.Empty(); _quest.markCompleted = Array.Empty(); _quest.cancelIfIncomplete = Array.Empty(); _quest.hideIfComplete = Array.Empty(); _quest.playerDataTest = new PlayerDataTest(); ((BasicQuestBase)_quest).displayName = ItemName; _quest.inventoryDescription = ItemDesc; _quest.inventoryCompletableDescription = ItemDesc; _quest.wallDescription = WallDesc; _quest.descCounterType = DescCounterType; _quest.listCounterType = ListCounterType; _quest.progressBarTint = BarColour; List list = new List(); if (HasItem) { _quest.inventoryCompletableDescription = CollectedDesc; string[] ic = ItemId.Split(","); Dictionary dictionary = ic.Distinct().ToDictionary((string i) => i, (string i) => ic.Count((string o) => o == i)); foreach (KeyValuePair item in dictionary) { item.Deconstruct(out var key, out var value); string name = key; int num = value; SavedItem savedItem = MiscUtils.GetSavedItem(name); CollectableItem val2 = (CollectableItem)(object)((savedItem is CollectableItem) ? savedItem : null); if (Object.op_Implicit((Object)(object)val2)) { list.Add(new QuestTarget { Counter = (QuestTargetCounter)(object)val2, Count = ItemCount / ic.Length * num, AltTest = new PlayerDataTest(), ItemName = (LocalStr)val2.GetDisplayName((ReadSource)0) }); } } } _quest.targets = list.ToArray(); _quest.overrideFontSize = new OverrideFloat(); _quest.overrideParagraphSpacing = new OverrideFloat(); _quest.overrideParagraphSpacingShort = new OverrideFloat(); ((NamedScriptableObjectList)(object)QuestManager.Instance.masterList).Add((BasicQuestBase)(object)_quest); base.Register(); RefreshLSprite(); RefreshGSprite(); QuestManager.IncrementVersion(); WorkshopManager.CustomQuests.Add(Id, this); } public override void Unregister() { ((NamedScriptableObjectList)(object)QuestManager.Instance.masterList).Remove((BasicQuestBase)(object)_quest); QuestManager.IncrementVersion(); Object.Destroy((Object)(object)_quest); WorkshopManager.CustomQuests.Remove(Id); } protected override void OnReadySprite() { _type.icon = Sprite; if (Object.op_Implicit((Object)(object)_mq)) { _mq.typeIcon = Sprite; } } public void RefreshLSprite() { if (Utility.IsNullOrWhiteSpace(LIconUrl)) { return; } CustomAssetManager.DoLoadSprite(LIconUrl, LPoint, LPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _type.largeIcon = sprites[0]; if (Object.op_Implicit((Object)(object)_mq)) { _mq.typeLargeIcon = sprites[0]; } } }); } public void RefreshGSprite() { if (Utility.IsNullOrWhiteSpace(GIconUrl)) { return; } CustomAssetManager.DoLoadSprite(GIconUrl, GPoint, GPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _type.largeIconGlow = sprites[0]; if (Object.op_Implicit((Object)(object)_mq)) { _mq.typeLargeIconGlow = sprites[0]; } } }); } } public class CustomScene : SpriteItem { public string Group = "None"; public int TilemapWidth = 500; public int TilemapHeight = 500; public Vector2 MapPos; public string EIconUrl = string.Empty; public bool EPoint; public float EPpu = 100f; public EnvironmentTypes Environment = (EnvironmentTypes)0; public bool OverrideColour; public Color MapColour = Color.white; public GameObject Map; public GameMapScene Gms; private Sprite _is; public override (string, string)[] FilesToDownload => new(string, string)[2] { (IconUrl, "png"), (EIconUrl, "png") }; public override void Register() { SceneUtils.CustomScenes[Id] = this; if (Object.op_Implicit((Object)(object)Map)) { Object.Destroy((Object)(object)Map); } TrySetupMap(); if (SceneUtils.QWHookEnabled) { QuickWarpHookLoader.RegisterScene(Group, Id); } } public void TrySetupMap() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if (!SceneUtils.SceneGroups.TryGetValue(Group, out var value) || !Object.op_Implicit((Object)(object)value.FocusMapObject)) { return; } Map = Object.Instantiate(SceneGroup.MapSegmentPrefab, value.FocusMapObject.transform); ((Object)Map).name = Id; Map.SetActive(true); Map.transform.localPosition = Vector2.op_Implicit(MapPos); Gms = Map.GetComponent(); Gms.initialColor = value.MapColour; Gms.fullSprite = null; Gms.initialSprite = null; Gms.initialState = (States)1; Gms.spriteRenderer = ((Component)Gms).GetComponent(); Gms.hasSpriteRenderer = true; Gms.spriteRenderer.color = (OverrideColour ? MapColour : value.MapColour); Gms.spriteRenderer.sprite = null; RefreshSprite(); RefreshESprite(); foreach (CustomMapIcon item in CustomMapIcon.Icons.Where((CustomMapIcon i) => i.Scene == Id)) { item.Setup(); } RefreshMap(); } private void RefreshMap() { if (Object.op_Implicit((Object)(object)Gms)) { PlayerData instance = PlayerData.instance; Gms.initialSprite = _is; Gms.fullSprite = Sprite; Gms.hasBeenSet = false; if ((Gms.isMapped || instance.scenesVisited.Contains(Id)) && SceneUtils.SceneGroups.TryGetValue(Group, out var value) && value.HasMapZone && !CollectableItemManager.IsInHiddenMode() && instance.hasQuill) { Gms.SetMapped(); } else { Gms.SetNotMapped(); } if (Object.op_Implicit((Object)(object)GameManager.instance.gameMap)) { GameManager.instance.gameMap.CalculateMapScrollBounds(); } } } public void RefreshESprite() { if (!Object.op_Implicit((Object)(object)Gms)) { return; } if (Utility.IsNullOrWhiteSpace(EIconUrl)) { RefreshMap(); return; } CustomAssetManager.DoLoadSprite(EIconUrl, EPoint, EPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _is = sprites[0]; RefreshMap(); } }); } protected override void OnReadySprite() { RefreshMap(); } public override void Unregister() { SceneUtils.CustomScenes.Remove(Id); if (Object.op_Implicit((Object)(object)Map)) { Object.Destroy((Object)(object)Map); } if (SceneUtils.QWHookEnabled) { QuickWarpHookLoader.UnregisterScene(Group, Id); } if (Object.op_Implicit((Object)(object)GameManager.instance.gameMap)) { GameManager.instance.gameMap.CalculateMapScrollBounds(); } } } public class CustomTool : SpriteItem { public class CustomToolItem : ToolItemBasic { public Sprite fullSprite; public int cost = 5; public override Sprite GetHudSprite(IconVariants iconVariant) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Sprite hudSprite = ((ToolItemBasic)this).GetHudSprite(iconVariant); if (!((ToolItem)this).IsEmpty) { return fullSprite ?? hudSprite; } return hudSprite; } public override bool TryReplenishSingle(bool doReplenish, float inCost, out float outCost, out int reserveCost) { ((ToolItem)this).TryReplenishSingle(doReplenish, inCost, ref outCost, ref reserveCost); outCost = cost; return true; } } public class CustomLiquidToolItem : ToolItemStatesLiquid { public Sprite fullSprite; public int cost = 5; public override Sprite GetHudSprite(IconVariants iconVariant) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Sprite hudSprite = ((ToolItemStates)this).GetHudSprite(iconVariant); if (!((ToolItem)this).IsEmpty) { return fullSprite ?? hudSprite; } return hudSprite; } public override bool TryReplenishSingle(bool doReplenish, float inCost, out float outCost, out int reserveCost) { ((ToolItemStatesLiquid)this).TryReplenishSingle(doReplenish, inCost, ref outCost, ref reserveCost); outCost = cost; return true; } } private ToolItemBasic _tool; public static readonly List List = new List(); public LocalStr ItemName = string.Empty; public LocalStr ItemDesc = string.Empty; public ToolItemType ItemType = (ToolItemType)0; public bool IsLiquid; public string HIconUrl = string.Empty; public bool HPoint; public float HPpu = 100f; public string GIconUrl = string.Empty; public bool GPoint; public float GPpu = 100f; public int RepairCost = 5; public bool PreventIncrease; public int MaxAmount = 10; public override (string, string)[] FilesToDownload => new(string, string)[3] { (IconUrl, "png"), (HIconUrl, "png"), (GIconUrl, "png") }; public override void Register() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008c: 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_00a1: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Invalid comparison between Unknown and I4 List.Add(Id); _tool = (ToolItemBasic)(object)(((int)ItemType == 3) ? ((CustomToolItem)(object)ScriptableObject.CreateInstance()) : ScriptableObject.CreateInstance()); _tool.usageOptions.FsmEventName = ""; ((ToolItem)_tool).name = Id; ((ToolItem)_tool).type = ItemType; _tool.displayName = ItemName; _tool.description = ItemDesc; ((ToolItem)_tool).alternateUnlockedTest = new PlayerDataTest(); ((ToolItem)_tool).preventStorageIncrease = PreventIncrease; if ((int)ItemType == 0) { ((ToolItem)_tool).baseStorageAmount = MaxAmount; } if (_tool is CustomToolItem customToolItem) { customToolItem.cost = RepairCost; } ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.toolItems).Add((ToolItem)(object)_tool); WorkshopManager.CustomTools.Add(Id, this); ToolItemManager.IncrementVersion(); base.Register(); RefreshHSprite(); RefreshGSprite(); } protected override void OnReadySprite() { _tool.inventorySprite = Sprite; } public override void Unregister() { List.Remove(Id); ((NamedScriptableObjectList)(object)ManagerSingleton.Instance.toolItems).Remove((ToolItem)(object)_tool); WorkshopManager.CustomTools.Remove(Id); ToolItemManager.IncrementVersion(); } public void RefreshHSprite() { if (Utility.IsNullOrWhiteSpace(HIconUrl)) { return; } CustomAssetManager.DoLoadSprite(HIconUrl, HPoint, HPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { _tool.hudSprite = sprites[0]; } }); } public void RefreshGSprite() { if (Utility.IsNullOrWhiteSpace(GIconUrl)) { return; } CustomAssetManager.DoLoadSprite(GIconUrl, GPoint, GPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { ToolItemBasic tool = _tool; ToolItemBasic val = tool; ToolItemSkill val2 = (ToolItemSkill)(object)((val is ToolItemSkill) ? val : null); if (val2 == null) { if (val is CustomToolItem customToolItem) { customToolItem.fullSprite = sprites[0]; } } else { val2.hudGlowSprite = sprites[0]; } } }); } } public class SceneGroup : SpriteItem { public delegate bool HasMapForScene(GameMap self, string sceneName, out bool hasSceneSprite); public class CustomMapZone : MonoBehaviour { public SceneGroup SceneGroup; public void OnEnable() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (SceneGroup != null) { SceneGroup.MapZone.initialColor = SceneGroup.MapColour; SceneGroup.MapZone.initialLabelColor = Color.white; } } } public string GroupName = string.Empty; public bool DisableAct3Bg; public Vector2 MapPos; public Vector2 LabelPos; public Vector2 ZoomPos; public Vector2 AreaNamePos; public string Variable = string.Empty; public float Radius = 0.2f; public bool HasMapZone; public Color MapColour = Color.white; public string MapUrl = string.Empty; public bool MPoint; public float MPpu = 100f; public readonly string[] OverwriteEnter = new string[4] { "", "", "", "" }; public readonly string[] OverwriteExit = new string[4] { "", "", "", "" }; public Sprite MapSprite; public AreaBackground Background; private static InventoryWideMap _wideMap; public static GameObject MapSegmentPrefab; public static GameObject MapIconPrefab; private static GameObject _areaTextPrefab; public InventoryItemWideMapZone MapZone; private GameObject _mapObject; public GameObject FocusMapObject; private static readonly int UILayer = LayerMask.NameToLayer("UI"); public override (string, string)[] FilesToDownload => new(string, string)[2] { (IconUrl, "png"), (MapUrl, "png") }; public static void Init() { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) PreloadManager.RegisterPreload(new BasicPreload("maps_assets_all", "Assets/Prefabs/UI/Map/Game_Map_Hornet.prefab", delegate(GameObject o) { GameObject gameObject = ((Component)o.transform.Find("Tut").Find("Tut_02")).gameObject; gameObject.SetActive(false); MapSegmentPrefab = Object.Instantiate(gameObject); gameObject.SetActive(true); Object.DontDestroyOnLoad((Object)(object)MapSegmentPrefab); GameObject gameObject2 = ((Component)o.transform.Find("Tut").Find("Area Name (2)")).gameObject; gameObject2.SetActive(false); _areaTextPrefab = Object.Instantiate(gameObject2); gameObject2.SetActive(true); Object.DontDestroyOnLoad((Object)(object)_areaTextPrefab); GameObject gameObject3 = ((Component)o.transform.Find("Tut").Find("Tut_01").Find("Next Area Up (2)")).gameObject; gameObject3.SetActive(false); MapIconPrefab = Object.Instantiate(gameObject3); gameObject3.SetActive(true); Object.DontDestroyOnLoad((Object)(object)MapIconPrefab); }, notSceneBundle: true)); typeof(GameMap).Hook("SetupMap", (Action, GameMap, bool>)delegate(Action orig, GameMap self, bool pinsOnly) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) orig(self, pinsOnly); PlayerData instance = PlayerData.instance; foreach (var (item, customScene2) in SceneUtils.CustomScenes) { if (Object.op_Implicit((Object)(object)customScene2.Gms)) { if ((customScene2.Gms.isMapped || instance.scenesVisited.Contains(item)) && SceneUtils.SceneGroups.TryGetValue(customScene2.Group, out var value7) && value7.HasMapZone && !CollectableItemManager.IsInHiddenMode()) { customScene2.Gms.spriteRenderer.color = value7.MapColour; if (instance.hasQuill && !pinsOnly) { customScene2.Gms.initialColor = value7.MapColour; customScene2.Gms.hasBeenSet = false; customScene2.Gms.SetMapped(); } } else { customScene2.Gms.SetNotMapped(); } } } }); typeof(GameMap).Hook("HasMapForScene", (<>F{00000400})delegate(HasMapForScene orig, GameMap self, string sceneName, out bool hasSceneSprite) { if (SceneUtils.CustomScenes.TryGetValue(sceneName, out var value5) && SceneUtils.SceneGroups.TryGetValue(value5.Group, out var value6)) { hasSceneSprite = value6.HasMapZone && Object.op_Implicit((Object)(object)value5.Gms) && Object.op_Implicit((Object)(object)value5.Gms.BoundsSprite); return value6.HasMapZone; } return orig(self, sceneName, out hasSceneSprite); }); typeof(InventoryItemWideMapZone).Hook("GetNextSelectable", (Func, InventoryItemWideMapZone, SelectionDirection, InventoryItemSelectable>)delegate(Func orig, InventoryItemWideMapZone self, SelectionDirection dir) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) string[] splitName = ((Object)self).name.Split("_"); int num4 = splitName.Length; int num5 = num4; if (num5 <= 4) { if (num5 > 2) { SceneGroup sceneGroup = SceneUtils.SceneGroups.Values.FirstOrDefault((SceneGroup cm) => cm.OverwriteEnter[dir].Contains(splitName[2])); if (sceneGroup != null) { return (InventoryItemSelectable)(object)sceneGroup.MapZone; } } } else { SceneGroup sceneGroup2 = SceneUtils.SceneGroups.Values.FirstOrDefault((SceneGroup cm) => cm.OverwriteEnter[dir].Contains(splitName[4])); if (sceneGroup2 != null) { return (InventoryItemSelectable)(object)sceneGroup2.MapZone; } } CustomMapZone component3 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { foreach (Transform item2 in ((Component)_wideMap).transform) { Transform val5 = item2; string[] array = ((Object)val5).name.Split("_"); int num6 = array.Length; int num7 = num6; if (num7 <= 4) { if (num7 > 2 && component3.SceneGroup.OverwriteExit[dir].Contains(array[2])) { return (InventoryItemSelectable)(object)((Component)val5).GetComponent(); } } else if (component3.SceneGroup.OverwriteExit[dir].Contains(array[4])) { return (InventoryItemSelectable)(object)((Component)val5).GetComponent(); } } InventoryItemSelectable selectableFromAutoNavGroup = ((InventoryItemSelectableDirectional)self).GetSelectableFromAutoNavGroup(dir, (Func)null); return (selectableFromAutoNavGroup is InventoryItemWideMapZone) ? selectableFromAutoNavGroup : null; } return orig(self, dir); }, typeof(SelectionDirection)); typeof(InventoryWideMap).Hook("UpdatePositions", (Action, InventoryWideMap>)delegate(Action orig, InventoryWideMap self) { if ((Object)(object)self != (Object)(object)_wideMap) { ArchitectPlugin.Logger.LogInfo((object)"Setting up WideMap"); _wideMap = self; foreach (SceneGroup value8 in SceneUtils.SceneGroups.Values) { value8.RegisterMap(); } SceneUtils.AdjustMapScale(_wideMap); } orig(self); }); Vector2 zoomPos = default(Vector2); bool customZoom = false; typeof(InventoryItemWideMapZone).Hook("Submit", (Func, InventoryItemWideMapZone, bool>)delegate(Func orig, InventoryItemWideMapZone self) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) CustomMapZone component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { zoomPos = component2.SceneGroup.ZoomPos; customZoom = true; } else { customZoom = false; } return orig(self); }); typeof(InventoryMapManager).Hook("ZoomIn", (Action, InventoryMapManager, MapZone, bool>)delegate(Action orig, InventoryMapManager self, MapZone zone, bool animate) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if ((int)zone == 0 && zoomPos == default(Vector2) && SceneUtils.CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value3) && SceneUtils.SceneGroups.TryGetValue(value3.Group, out var value4)) { zoomPos = value4.ZoomPos; customZoom = true; } orig(self, zone, animate); }); typeof(GameMap).Hook("GetZoomPosition", (Func, GameMap, MapZone, Vector2>)((Func orig, GameMap self, MapZone zone) => customZoom ? (zoomPos * -1.15f) : orig(self, zone))); typeof(GameMap).Hook("GetClosestWideMapZone", (Func, InventoryItemWideMapZone>, GameMap, IEnumerable, InventoryItemWideMapZone>)delegate(Func, InventoryItemWideMapZone> orig, GameMap self, IEnumerable wideMapPieces) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_0095: Unknown result type (might be due to invalid IL or missing references) InventoryItemWideMapZone val = orig(self, wideMapPieces); float num = float.MaxValue; Vector3 val2 = -((Component)self).transform.localPosition; if (Object.op_Implicit((Object)(object)val)) { ZoneInfo val3 = self.mapZoneInfo[val.zoomToZone]; ParentInfo[] parents = val3.Parents; foreach (ParentInfo val4 in parents) { if (Object.op_Implicit((Object)(object)val4.Parent)) { for (int j = 0; j < val4.Parent.transform.childCount; j++) { Transform child = val4.Parent.transform.GetChild(j); Vector2 localScenePos = GameMap.GetLocalScenePos(child); float num2 = Vector2.Distance(Vector2.op_Implicit(val2), localScenePos); if (num2 <= num) { num = num2; } } } } } foreach (SceneGroup value9 in SceneUtils.SceneGroups.Values) { if (value9.HasMap()) { float num3 = Vector2.Distance(Vector2.op_Implicit(val2), value9.ZoomPos) - value9.Radius; if (num3 < num) { num = num3; val = value9.MapZone; } } } return val; }); typeof(GameMap).Hook("EnableUnlockedAreas", (Action, GameMap, MapZone?>)delegate(Action orig, GameMap self, MapZone? setCurrent) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 if (setCurrent.HasValue) { if ((int)setCurrent.Value == 0 && SceneUtils.CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value) && SceneUtils.SceneGroups.TryGetValue(value.Group, out var value2) && value2.HasMap()) { value2.FocusMapObject.SetActive(true); } } else { foreach (SceneGroup item3 in SceneUtils.SceneGroups.Values.Where((SceneGroup group) => group.HasMap())) { item3.FocusMapObject.SetActive(true); } } orig(self, setCurrent); }); new Hook((MethodBase)typeof(InventoryItemWideMapZone).GetProperty("IsUnlocked").GetGetMethod(), (Delegate)(Func, InventoryItemWideMapZone, bool>)delegate(Func orig, InventoryItemWideMapZone self) { CustomMapZone component = ((Component)self).GetComponent(); return Object.op_Implicit((Object)(object)component) ? component.SceneGroup.HasMap() : orig(self); }); } public bool HasMap() { if (!HasMapZone) { return false; } return Utility.IsNullOrWhiteSpace(Variable) || ArchitectData.Instance.BoolVariables.GetValueOrDefault(Variable, defaultValue: false); } public void RegisterMap() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) if (!HasMapZone) { return; } _mapObject = Object.Instantiate(((Component)((Component)_wideMap).transform.Find("Wide_map__0007_Bonetown")).gameObject, ((Component)_wideMap).transform, true); ((Object)_mapObject).name = "Wide_map_" + Id; MapZone = _mapObject.GetComponent(); ((InventoryItemSelectableDirectional)MapZone).Selectables = (InventoryItemSelectable[])(object)new InventoryItemSelectable[4]; MapZone.zoomToZone = (MapZone)0; CustomMapZone customMapZone = _mapObject.AddComponent(); customMapZone.SceneGroup = this; customMapZone.OnEnable(); Transform val = _mapObject.transform.Find("Area Name"); ((Component)val).GetComponent().text = (LocalStr)GroupName; Extensions.SetPositionX(val, Extensions.GetPositionX(val) + LabelPos.x); Extensions.SetPositionY(val, Extensions.GetPositionY(val) + LabelPos.y); _mapObject.transform.localPosition = Vector2.op_Implicit(MapPos); _mapObject.GetComponent().sprite = MapSprite; GameMap gameMap = GameManager.instance.gameMap; GameObject val2 = new GameObject(Id) { layer = UILayer }; val2.transform.parent = ((Component)gameMap).transform; val2.transform.localPosition = Vector2.op_Implicit(ZoomPos); val2.transform.localScale = Vector3.one; FocusMapObject = val2; GameObject val3 = Object.Instantiate(_areaTextPrefab, FocusMapObject.transform); val3.SetActive(true); ((Object)val3).name = "Area Name"; val3.transform.localPosition = Vector2.op_Implicit(AreaNamePos); val3.GetComponent().text = (LocalStr)GroupName; ((Graphic)val3.GetComponent()).color = MapColour; foreach (CustomScene item in SceneUtils.CustomScenes.Values.Where((CustomScene s) => s.Group == Id)) { item.TrySetupMap(); } FocusMapObject.SetActive(false); _mapObject.SetActive(true); GameManager.instance.gameMap.CalculateMapScrollBounds(); SceneUtils.AdjustMapScale(_wideMap); } public override void Register() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown Background = new AreaBackground { BackgroundImage = ArchitectPlugin.BlankSprite, NameOverride = (LocalStr)GroupName, Act3OverlayOptOut = DisableAct3Bg }; SceneUtils.SceneGroups.Add(Id, this); base.Register(); RefreshMapSprite(); if (Object.op_Implicit((Object)(object)_wideMap)) { RegisterMap(); } } public void RefreshMapSprite() { if (Utility.IsNullOrWhiteSpace(MapUrl)) { return; } CustomAssetManager.DoLoadSprite(MapUrl, MPoint, MPpu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { MapSprite = sprites[0]; SceneUtils.AdjustMapScale(_wideMap); if (Object.op_Implicit((Object)(object)_mapObject)) { _mapObject.GetComponent().sprite = MapSprite; } } }); } protected override void OnReadySprite() { Background.BackgroundImage = Sprite; } public override void Unregister() { SceneUtils.SceneGroups.Remove(Id); if (Object.op_Implicit((Object)(object)_mapObject)) { if (((MonoBehaviour)MapZone).didAwake) { ((InventoryPaneBase)MapZone.pane).OnPaneStart -= MapZone.EvaluateUnlocked; } _wideMap.selectables = null; Object.Destroy((Object)(object)_mapObject); } if (Object.op_Implicit((Object)(object)FocusMapObject)) { Object.Destroy((Object)(object)FocusMapObject); } SceneUtils.AdjustMapScale(_wideMap); } } public abstract class SpriteItem : WorkshopItem { public string IconUrl = string.Empty; public bool Point; public float Ppu = 100f; protected Sprite Sprite; public override (string, string)[] FilesToDownload => new(string, string)[1] { (IconUrl, "png") }; public override void Register() { RefreshSprite(); } public void RefreshSprite() { if (Utility.IsNullOrWhiteSpace(IconUrl)) { return; } CustomAssetManager.DoLoadSprite(IconUrl, Point, Ppu, 1, 1, delegate(Sprite[] sprites) { if (!Extensions.IsNullOrEmpty((ICollection)sprites)) { Sprite = sprites[0]; OnReadySprite(); WorkshopUI.RefreshIcon(this); } }); } public override Sprite GetIcon() { return Sprite; } protected virtual void OnReadySprite() { } } public class StatusEffect : WorkshopItem { private static readonly Sprite Sprite = ResourceUtils.LoadSpriteResource("effect", (FilterMode)0); public override void Register() { } public override void Unregister() { } public override Sprite GetIcon() { return Sprite; } } public abstract class WorkshopItem { public string Id; public string Type; public List[] Config; public Dictionary CurrentConfig; public virtual (string, string)[] FilesToDownload => null; public abstract void Register(); public abstract void Unregister(); public abstract Sprite GetIcon(); public virtual int GetPriority() { return 0; } } } namespace Architect.Workshop.Config { public static class ConfigGroup { public static readonly List SpriteItem = new List(3) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Icon URL", "png_url", delegate(SpriteItem item, Architect.Workshop.Types.StringConfigValue value) { item.IconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_antialias", delegate(SpriteItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Point = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_ppu", delegate(SpriteItem item, Architect.Workshop.Types.FloatConfigValue value) { item.Ppu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List JournalEntry = new List(9) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enemy Name", "journal_display_name", delegate(CustomJournalEntry item, Architect.Workshop.Types.StringConfigValue value) { item.ItemName = value.GetValue(); }).WithDefaultValue("Sample Name")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "journal_desc", delegate(CustomJournalEntry item, Architect.Workshop.Types.StringConfigValue value) { item.ItemDesc = value.GetValue(); }).WithDefaultValue("Sample Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Hunter's Notes", "journal_hdesc", delegate(CustomJournalEntry item, Architect.Workshop.Types.StringConfigValue value) { item.ItemHDesc = value.GetValue(); }).WithDefaultValue("Sample Hunter's Notes")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Required Kills", "journal_kills", delegate(CustomJournalEntry item, Architect.Workshop.Types.IntConfigValue value) { item.KillsRequired = value.GetValue(); }).WithDefaultValue(1)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Requirement", "journal_requirements", delegate(CustomJournalEntry item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) item.Required = (RequiredTypes)value.GetValue(); }).WithOptions("None", "Required", "Steel Soul").WithDefaultValue(1)), (NoteConfigType)"A vanilla entry (list can be found in the guide)", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Add Before", "journal_before", delegate(CustomJournalEntry item, Architect.Workshop.Types.StringConfigValue value) { item.InsertBefore = value.GetValue(); })), (NoteConfigType)"Entries with higher priorities are loaded earlier", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Load Priority", "journal_priority", delegate(CustomJournalEntry item, Architect.Workshop.Types.IntConfigValue value) { item.Priority = -value.GetValue(); }).WithDefaultValue(0)) }; public static readonly List MateriumEntry = new List(4) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Item Name", "materium_display_name", delegate(CustomMateriumEntry item, Architect.Workshop.Types.StringConfigValue value) { item.ItemName = value.GetValue(); }).WithDefaultValue("Sample Name")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "materium_desc", delegate(CustomMateriumEntry item, Architect.Workshop.Types.StringConfigValue value) { item.Desc = value.GetValue(); }).WithDefaultValue("Sample Description")), (NoteConfigType)"A vanilla entry (list can be found in the guide)", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Add Before", "materium_before", delegate(CustomMateriumEntry item, Architect.Workshop.Types.StringConfigValue value) { item.InsertBefore = value.GetValue(); })) }; public static readonly List Cue = new List(2) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("WAV URL", "music_cue_wav_url", delegate(CustomCue item, Architect.Workshop.Types.StringConfigValue value) { item.WavUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Mode", "music_cue_mode", delegate(CustomCue item, Architect.Workshop.Types.ChoiceConfigValue value) { item.IsAtmos = value.GetValue() == 1; }).WithOptions("Music", "Atmos").WithDefaultValue(0)) }; public static readonly List JournalEntrySprites = new List(3) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enemy Image URL", "png_journal_url", delegate(CustomJournalEntry item, Architect.Workshop.Types.StringConfigValue value) { item.LIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_journal_antialias", delegate(CustomJournalEntry item, Architect.Workshop.Types.BoolConfigValue value) { item.LPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_journal_ppu", delegate(CustomJournalEntry item, Architect.Workshop.Types.FloatConfigValue value) { item.LPpu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List MapIcon = new List(6) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Custom Scene ID", "map_icon_scene", delegate(CustomMapIcon item, Architect.Workshop.Types.StringConfigValue value) { item.Scene = value.GetValue(); })), (NoteConfigType)"The icon is unlocked when this global variable is true (if set)", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Required Variable", "map_icon_reqvar", delegate(CustomMapIcon item, Architect.Workshop.Types.StringConfigValue value) { item.ReqVar = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Visibility Mode", "map_icon_visual_mode", delegate(CustomMapIcon item, Architect.Workshop.Types.ChoiceConfigValue value) { item.Mode = value.GetValue(); }).WithOptions("Both", "Quick Map", "Inventory").WithDefaultValue(0)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Offset X", "map_icon_x", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Pos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Offset Y", "map_icon_y", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Pos.y = value.GetValue(); }).WithDefaultValue(0f)) }; public static readonly List MapIconLabel = new List(7) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Text", "map_icon_text", delegate(CustomMapIcon item, Architect.Workshop.Types.StringConfigValue value) { item.Text = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Font Size", "map_icon_font_size", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.FontSize = value.GetValue(); }).WithDefaultValue(6.2f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Text Offset X", "map_icon_text_x", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Offset.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Text Offset Y", "map_icon_text_y", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Offset.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Text Colour R", "map_icon_text_r", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Colour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Text Colour G", "map_icon_text_g", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Colour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Text Colour B", "map_icon_text_b", delegate(CustomMapIcon item, Architect.Workshop.Types.FloatConfigValue value) { item.Colour.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List UsableItem = new List(12) { (NoteConfigType)"Only apply to Usable items", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Use Action", "item_consume_desc", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.UseType = value.GetValue(); }).WithDefaultValue("Break")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Consume on Use", "item_consume_use", delegate(CustomItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Consume = value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Use Event", "item_onconsume", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.UseEvent = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Using Audio URL", "wav_url1", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.WavURL1 = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Volume", "wav_volume1", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.Volume1 = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Min Pitch", "wav_min_pitch1", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.MinPitch1 = value.GetValue(); }).WithDefaultValue(0.8f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Max Pitch", "wav_max_pitch1", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.MaxPitch1 = value.GetValue(); }).WithDefaultValue(1.2f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Used Audio URL", "wav_url2", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.WavURL2 = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Volume", "wav_volume2", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.Volume2 = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Min Pitch", "wav_min_pitch2", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.MinPitch2 = value.GetValue(); }).WithDefaultValue(0.8f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Max Pitch", "wav_max_pitch2", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.MaxPitch2 = value.GetValue(); }).WithDefaultValue(1.2f)) }; public static readonly List CourierItem = new List(11) { (NoteConfigType)"Only apply to Courier items", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Effects", "courier_item_effect", delegate(CustomItem item, Architect.Workshop.Types.ChoiceConfigValue value) { item.CourierEffects = value.GetValue(); }).WithOptions("None", "Swag", "Liquid", "Meat").WithDefaultValue(1)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Ring R", "courier_item_r", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Ring G", "courier_item_g", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Ring B", "courier_item_b", delegate(CustomItem item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.b = value.GetValue(); }).WithDefaultValue(1f)), (NoteConfigType)"The time in seconds for the item to break", (NoteConfigType)"If set to 0 the item will not break over time", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Time to Break", "courier_item_time", delegate(CustomItem item, Architect.Workshop.Types.IntConfigValue value) { item.Time = value.GetValue(); }).WithDefaultValue(0)), (NoteConfigType)"The number of rosaries to show up as a reward when used alone in a quest", (NoteConfigType)"Setting this to 0 will make the quest appear as a normal quest", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Reward Count", "courier_reward_num", delegate(CustomItem item, Architect.Workshop.Types.IntConfigValue value) { item.RewardCost = value.GetValue(); }).WithDefaultValue(0)) }; public static readonly List CustomItem = new List(6) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Item Name", "item_display_name", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.ItemName = value.GetValue(); }).WithDefaultValue("Sample Name")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "item_desc", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.ItemDesc = value.GetValue().Replace("
", "\n"); }).WithDefaultValue("Sample Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Use Description", "item_udesc", delegate(CustomItem item, Architect.Workshop.Types.StringConfigValue value) { item.UseDesc = value.GetValue().Replace("
", "\n"); }).WithDefaultValue("Sample Use Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Hide in Inventory", "item_hide_inventory", delegate(CustomItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Hidden = value.GetValue(); }).WithDefaultValue(value: false)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Item Type", "item_consume", delegate(CustomItem item, Architect.Workshop.Types.ChoiceConfigValue value) { item.ItemType = Enum.Parse(value.GetStringValue()); }).WithOptions("Normal", "Usable", "Memento", "Courier").WithDefaultValue(0)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Max Amount", "item_max", delegate(CustomItem item, Architect.Workshop.Types.IntConfigValue value) { item.MaxAmount = value.GetValue(); })) }; public static readonly List CustomTool = new List(3) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Tool Name", "tool_name", delegate(CustomTool item, Architect.Workshop.Types.StringConfigValue value) { item.ItemName = value.GetValue(); }).WithDefaultValue("Sample Name")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "tool_desc", delegate(CustomTool item, Architect.Workshop.Types.StringConfigValue value) { item.ItemDesc = value.GetValue().Replace("
", "\n"); }).WithDefaultValue("Sample Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Type", "tool_type", delegate(CustomTool item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) item.IsLiquid = value.GetValue() == 4; if (item.IsLiquid) { item.ItemType = (ToolItemType)0; } else { item.ItemType = (ToolItemType)value.GetValue(); } }).WithDefaultValue(0).WithOptions("Red", "Blue", "Yellow", "Skill")) }; public static readonly List Keybind = new List(2) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Name", "keybind_name", delegate(CustomKeybind item, Architect.Workshop.Types.StringConfigValue value) { item.Name = value.GetValue(); }).WithDefaultValue("Sample Text")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Default Key", "keybind_default", delegate(CustomKeybind item, Architect.Workshop.Types.StringConfigValue value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (Enum.TryParse(value.GetValue(), out KeyCode result3)) { item.Default = result3; } }).WithDefaultValue("None")) }; public static readonly List Scene = new List(4) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Group ID", "scene_group", delegate(CustomScene item, Architect.Workshop.Types.StringConfigValue value) { item.Group = value.GetValue(); }).WithDefaultValue("None")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Scene Width", "scene_tilemap_width", delegate(CustomScene item, Architect.Workshop.Types.IntConfigValue value) { item.TilemapWidth = value.GetValue(); }).WithDefaultValue(500)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Scene Height", "scene_tilemap_height", delegate(CustomScene item, Architect.Workshop.Types.IntConfigValue value) { item.TilemapHeight = value.GetValue(); }).WithDefaultValue(500)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Environment Type", "scene_enviro_type", delegate(CustomScene item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_004c: 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) string text = value.GetStringValue(); string text2 = text; string text3 = text2; if (!(text3 == "WaterS")) { if (text3 == "WaterRun") { text = "RunningWater"; } } else { text = "ShallowWater"; } if (Enum.TryParse(text, out EnvironmentTypes result2)) { item.Environment = result2; } }).WithOptions("Dust", "Grass", "Bone", "WaterS", "Metal", "NoEffect", "Moss", "Sand", "Bell", "WetMetal", "ThinMetal", "Wood", "Silk", "WetWood", "WaterRun", "PeakPuff", "FlowerField").WithDefaultValue(0)) }; public static readonly List SceneMap = new List(9) { (NoteConfigType)"Only applies if the scene's group has a map", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map X Offset", "scene_map_x", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.MapPos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map Y Offset", "scene_map_y", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.MapPos.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Full Map URL", "scene_full_map_url", delegate(SpriteItem item, Architect.Workshop.Types.StringConfigValue value) { item.IconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "scene_full_map_antialias", delegate(SpriteItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Point = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "scene_full_map_ppu", delegate(SpriteItem item, Architect.Workshop.Types.FloatConfigValue value) { item.Ppu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Empty Room URL", "scene_empty_map_url", delegate(CustomScene item, Architect.Workshop.Types.StringConfigValue value) { item.EIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "scene_empty_map_antialias", delegate(CustomScene item, Architect.Workshop.Types.BoolConfigValue value) { item.EPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "scene_empty_map_ppu", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.EPpu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List SceneMapColour = new List(4) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Override Colour", "scene_override_col", delegate(CustomScene item, Architect.Workshop.Types.BoolConfigValue value) { item.OverrideColour = value.GetValue(); }).WithDefaultValue(value: false)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour R", "scene_override_col_r", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour G", "scene_override_col_g", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour B", "scene_override_col_b", delegate(CustomScene item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List SceneGroup = new List(1) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Area Name", "scene_group_name", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.GroupName = value.GetValue(); })) }; public static readonly List SceneGroupIcon = new List(3) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Save Icon URL", "scene_group_url", delegate(SpriteItem item, Architect.Workshop.Types.StringConfigValue value) { item.IconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "scene_group_antialias", delegate(SpriteItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Point = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Hide Void Overlay", "scene_group_no_void", delegate(SceneGroup item, Architect.Workshop.Types.BoolConfigValue value) { item.DisableAct3Bg = value.GetValue(); }).WithDefaultValue(value: false)) }; public static readonly List SceneGroupMap = new List(9) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Has Map", "scene_group_map", delegate(SceneGroup item, Architect.Workshop.Types.BoolConfigValue value) { item.HasMapZone = value.GetValue(); }).WithDefaultValue(value: false)), (NoteConfigType)"The map is unlocked when this global variable is true (if set)", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Required Variable", "scene_group_map_var", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.Variable = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Map Icon URL", "scene_group_map_url", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.MapUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "scene_group_map_antialias", delegate(SceneGroup item, Architect.Workshop.Types.BoolConfigValue value) { item.MPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "scene_group_map_ppu", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MPpu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map Colour R", "scene_group_map_cr", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map Colour G", "scene_group_map_cg", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map Colour B", "scene_group_map_cb", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MapColour.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List SceneGroupMapPos = new List(10) { (NoteConfigType)"The position of the map, label and zoomed in map", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map X", "scene_group_map_px", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MapPos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Map Y", "scene_group_map_py", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.MapPos.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Title Offset X", "scene_group_map_lx", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.LabelPos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Title Offset Y", "scene_group_map_ly", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.LabelPos.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Zoom X", "scene_group_map_zx", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.ZoomPos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Zoom Y", "scene_group_map_zy", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.ZoomPos.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Area Label X", "scene_group_map_alx", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.AreaNamePos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Area Label Y", "scene_group_map_aly", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.AreaNamePos.y = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Area Radius", "scene_group_map_radius", delegate(SceneGroup item, Architect.Workshop.Types.FloatConfigValue value) { item.Radius = value.GetValue(); }).WithDefaultValue(0.2f)) }; public static readonly List SceneGroupMapDirIn = new List(5) { (NoteConfigType)"Make other maps lead to this one", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enter Below", "scene_group_map_b", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteEnter[1] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enter Above", "scene_group_map_a", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteEnter[0] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enter Left", "scene_group_map_l", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteEnter[2] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Enter Right", "scene_group_map_r", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteEnter[3] = value.GetValue(); })) }; public static readonly List SceneGroupMapDirOut = new List(5) { (NoteConfigType)"Make this map lead to others", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Exit Below", "scene_group_map_b2", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteExit[1] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Exit Above", "scene_group_map_a2", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteExit[0] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Exit Left", "scene_group_map_l2", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteExit[2] = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Exit Right", "scene_group_map_r2", delegate(SceneGroup item, Architect.Workshop.Types.StringConfigValue value) { item.OverwriteExit[3] = value.GetValue(); })) }; public static readonly List Quest = new List(8) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Quest Name", "quest_display_name", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.ItemName = value.GetValue(); }).WithDefaultValue("Sample Name")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "quest_desc", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.ItemDesc = value.GetValue(); }).WithDefaultValue("Sample Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Board Description", "quest_board_desc", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.WallDesc = value.GetValue(); }).WithDefaultValue("Sample Board Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Quest Category", "quest_display_type", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.TypeName = value.GetValue(); }).WithDefaultValue("Seek")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Quest Type", "quest_type", delegate(CustomQuest item, Architect.Workshop.Types.ChoiceConfigValue value) { item.MainQuest = value.GetValue() == 1; }).WithDefaultValue(0).WithOptions("Regular", "Major")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour R", "quest_r", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.Color.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour G", "quest_g", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.Color.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour B", "quest_b", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.Color.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List QuestItem = new List(12) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Include Items", "quest_req_items", delegate(CustomQuest item, Architect.Workshop.Types.BoolConfigValue value) { item.HasItem = value.GetValue(); }).WithDefaultValue(value: false)), (NoteConfigType)"Separating IDs with a comma will share the required count across each item type", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Item ID", "quest_item_id", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.ItemId = value.GetValue(); })), (NoteConfigType)"For normal items, this is the required number to complete the quest", (NoteConfigType)"For Courier items, this is the number of hit points the item will have", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Item Count", "quest_item_num", delegate(CustomQuest item, Architect.Workshop.Types.IntConfigValue value) { item.ItemCount = value.GetValue(); }).WithDefaultValue(1)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Collected Desc", "quest_item_desc_done", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.CollectedDesc = value.GetValue(); }).WithDefaultValue("Sample Collected Description")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("List Counter Type", "quest_item_list_icon", delegate(CustomQuest item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) string stringValue2 = value.GetStringValue(); if (1 == 0) { } ListCounterTypes listCounterType = ((stringValue2 == "Notches") ? ((ListCounterTypes)0) : ((!(stringValue2 == "Bar")) ? ((ListCounterTypes)2) : ((ListCounterTypes)1))); if (1 == 0) { } item.ListCounterType = listCounterType; }).WithOptions("Notches", "Bar", "None").WithDefaultValue(0)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Desc Counter Type", "quest_item_desc_icon", delegate(CustomQuest item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) string stringValue = value.GetStringValue(); if (1 == 0) { } DescCounterTypes descCounterType = (DescCounterTypes)(stringValue switch { "Icon" => 0, "Number" => 1, "Bar" => 2, _ => 3, }); if (1 == 0) { } item.DescCounterType = descCounterType; }).WithOptions("Icon", "Number", "Bar", "None").WithDefaultValue(0)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Counter R", "quest_item_r", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Counter G", "quest_item_g", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Counter B", "quest_item_b", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.BarColour.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List UseToolSprites = new List(7) { (NoteConfigType)"Only apply to Red and Skill tools", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("HUD Icon URL", "png_tool_ui_url", delegate(CustomTool item, Architect.Workshop.Types.StringConfigValue value) { item.HIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_tool_ui_antialias", delegate(CustomTool item, Architect.Workshop.Types.BoolConfigValue value) { item.HPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_tool_ui_ppu", delegate(CustomTool item, Architect.Workshop.Types.FloatConfigValue value) { item.HPpu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("HUD Usable URL", "png_tool_glow_url", delegate(CustomTool item, Architect.Workshop.Types.StringConfigValue value) { item.GIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_tool_glow_antialias", delegate(CustomTool item, Architect.Workshop.Types.BoolConfigValue value) { item.GPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_tool_glow_ppu", delegate(CustomTool item, Architect.Workshop.Types.FloatConfigValue value) { item.GPpu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List RedTools = new List(4) { (NoteConfigType)"Only apply to Red tools", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Max Amount", "tool_red_max", delegate(CustomTool item, Architect.Workshop.Types.IntConfigValue value) { item.MaxAmount = value.GetValue(); }).WithDefaultValue(10)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Affected by Pouches", "tool_red_pouch", delegate(CustomTool item, Architect.Workshop.Types.BoolConfigValue value) { item.PreventIncrease = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Repair Cost", "tool_red_repair_cost", delegate(CustomTool item, Architect.Workshop.Types.IntConfigValue value) { item.RepairCost = value.GetValue(); }).WithDefaultValue(5)) }; public static readonly List QuestSprites = new List(9) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Icon URL", "png_quest_url", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.IconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_quest_antialias", delegate(CustomQuest item, Architect.Workshop.Types.BoolConfigValue value) { item.Point = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_quest_ppu", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.Ppu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Prompt Icon URL", "png_lquest_url", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.LIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_lquest_antialias", delegate(CustomQuest item, Architect.Workshop.Types.BoolConfigValue value) { item.LPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_lquest_ppu", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.LPpu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Glow Icon URL", "png_gquest_url", delegate(CustomQuest item, Architect.Workshop.Types.StringConfigValue value) { item.GIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_gquest_antialias", delegate(CustomQuest item, Architect.Workshop.Types.BoolConfigValue value) { item.GPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_gquest_ppu", delegate(CustomQuest item, Architect.Workshop.Types.FloatConfigValue value) { item.GPpu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List Needle = new List(8) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Name", "needle_title", delegate(CustomNeedle item, Architect.Workshop.Types.StringConfigValue value) { item.Name = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "needle_desc", delegate(CustomNeedle item, Architect.Workshop.Types.StringConfigValue value) { item.Desc = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.IntConfigType("Damage", "needle_damage_level", delegate(CustomNeedle item, Architect.Workshop.Types.IntConfigValue value) { item.Damage = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Range Multiplier", "needle_damage_range", delegate(CustomNeedle item, Architect.Workshop.Types.FloatConfigValue value) { item.NeedleRangeMult = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Colour Mode", "needle_colour_mode", delegate(CustomNeedle item, Architect.Workshop.Types.ChoiceConfigValue value) { item.NeedleColourActive = value.GetValue(); }).WithOptions("Off", "PreImbue", "PostImbue").WithDefaultValue(0)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour R", "needle_colour_r", delegate(CustomNeedle item, Architect.Workshop.Types.FloatConfigValue value) { item.NeedleColour.r = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour G", "needle_colour_g", delegate(CustomNeedle item, Architect.Workshop.Types.FloatConfigValue value) { item.NeedleColour.g = value.GetValue(); }).WithDefaultValue(1f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Colour B", "needle_colour_b", delegate(CustomNeedle item, Architect.Workshop.Types.FloatConfigValue value) { item.NeedleColour.b = value.GetValue(); }).WithDefaultValue(1f)) }; public static readonly List Crest = new List(6) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Unlock Prefix", "crest_name_prefix", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.NamePrefix = value.GetValue(); }).WithDefaultValue("Bound the Crest of")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Name", "crest_name", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.Name = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "crest_desc", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.Desc = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Equip Desc", "crest_equip_desc", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.EquipText = value.GetValue(); }).WithDefaultValue("To change Crest, open the Crest screen of the Menu while resting at a bench.")), (NoteConfigType)"Determines the moveset for the crest, does not affect the bind", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Base Movement", "crest_base_movement", delegate(CustomCrest item, Architect.Workshop.Types.ChoiceConfigValue value) { item.Movement = value.GetStringValue(); }).WithOptions("Hunter", "Reaper", "Wanderer", "Beast", "Witch", "Architect", "Shaman", "Cursed", "Cloakless").WithDefaultValue(0)) }; public static readonly List CrestSprites = new List(6) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Silhouette URL", "png_crest_sil_url", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.HIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_crest_sil_antialias", delegate(CustomCrest item, Architect.Workshop.Types.BoolConfigValue value) { item.HPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_crest_sil_ppu", delegate(CustomCrest item, Architect.Workshop.Types.FloatConfigValue value) { item.HPpu = value.GetValue(); }).WithDefaultValue(100f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Glow URL", "png_crest_glow_url", delegate(CustomCrest item, Architect.Workshop.Types.StringConfigValue value) { item.GIconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "png_crest_glow_antialias", delegate(CustomCrest item, Architect.Workshop.Types.BoolConfigValue value) { item.GPoint = !value.GetValue(); }).WithDefaultValue(value: true)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Pixels Per Unit", "png_crest_glow_ppu", delegate(CustomCrest item, Architect.Workshop.Types.FloatConfigValue value) { item.GPpu = value.GetValue(); }).WithDefaultValue(100f)) }; public static readonly List CrestSlot = new List(7) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Crest ID", "crest_target_id", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.StringConfigValue value) { item.CrestId = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Type", "crest_slot_type", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) item.ToolType = (ToolItemType)value.GetValue(); }).WithDefaultValue(0).WithOptions("Red", "Blue", "Yellow", "Skill")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Direction", "crest_slot_dir", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) item.Binding = (AttackToolBinding)value.GetValue(); }).WithDefaultValue(0).WithOptions("Neutral", "Up", "Down")), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("X Pos", "crest_slot_x", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.FloatConfigValue value) { item.Pos.x = value.GetValue(); }).WithDefaultValue(0f)), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.FloatConfigType("Y Pos", "crest_slot_y", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.FloatConfigValue value) { item.Pos.y = value.GetValue(); }).WithDefaultValue(0f)), (NoteConfigType)"At least one slot must be unlocked by default", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Start Locked", "crest_slot_locked", delegate(CustomCrest.CrestSlot item, Architect.Workshop.Types.BoolConfigValue value) { item.Lock = value.GetValue(); }).WithDefaultValue(value: false)) }; public static readonly List Achievement = new List(7) { ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Name", "achievement_name", delegate(CustomAchievement item, Architect.Workshop.Types.StringConfigValue value) { item.Name = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Description", "achievement_desc", delegate(CustomAchievement item, Architect.Workshop.Types.StringConfigValue value) { item.Desc = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.ChoiceConfigType("Type", "achievement_type", delegate(CustomAchievement item, Architect.Workshop.Types.ChoiceConfigValue value) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (Enum.TryParse(value.GetStringValue(), out AchievementType result)) { item.AchievementType = result; } }).WithOptions("Normal", "Hidden").WithDefaultValue(0)), (NoteConfigType)"A vanilla achievement (list can be found in the guide)", ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Add Before", "achievement_before", delegate(CustomAchievement item, Architect.Workshop.Types.StringConfigValue value) { item.InsertBefore = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.StringConfigType("Icon URL", "achievement_url", delegate(SpriteItem item, Architect.Workshop.Types.StringConfigValue value) { item.IconUrl = value.GetValue(); })), ConfigurationManager.RegisterConfigType(new Architect.Workshop.Types.BoolConfigType("Anti Aliasing", "achievement_antialias", delegate(SpriteItem item, Architect.Workshop.Types.BoolConfigValue value) { item.Point = !value.GetValue(); }).WithDefaultValue(value: true)) }; } } namespace Architect.Utils { public static class FsmUtils { public class CustomFsmAction : FsmStateAction { public bool EveryFrame; private Action _method; public CustomFsmAction(Action method) { _method = method; ((FsmStateAction)this)..ctor(); } public override void Reset() { _method = null; ((FsmStateAction)this).Reset(); } public override void OnEnter() { _method(); if (!EveryFrame) { ((FsmStateAction)this).Finish(); } } public override void OnUpdate() { if (EveryFrame) { _method(); } } } public static void AddState(this PlayMakerFSM fsm, string state) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown FsmState[] states = fsm.fsm.States; FsmState[] array = (FsmState[])(object)new FsmState[states.Length + 1]; for (int i = 0; i < states.Length; i++) { array[i] = states[i]; } FsmState val = new FsmState(fsm.fsm) { Name = state }; array[states.Length] = val; fsm.fsm.States = array; } public static FsmState GetState(this PlayMakerFSM fsm, string state) { return fsm.Fsm.GetState(state); } public static void DisableAction(this FsmState state, int index) { state.Actions[index].Enabled = false; } public static void AddAction(this FsmState state, Action action, int index = -1, bool everyFrame = false) { CustomFsmAction customAction = new CustomFsmAction(action) { EveryFrame = everyFrame }; state.AddAction((FsmStateAction)(object)customAction, index); } public static void AddAction(this FsmState state, FsmStateAction customAction, int index = -1) { FsmStateAction[] actions = state.Actions; if (index == -1) { index = actions.Length; } FsmStateAction[] array = (FsmStateAction[])(object)new FsmStateAction[actions.Length + 1]; int num = 0; int num2 = 0; while (num < array.Length) { if (num == index) { array[num] = customAction; num++; } if (num2 < actions.Length) { array[num] = actions[num2]; } num++; num2++; } state.Actions = array; customAction.Init(state); } } public static class HookUtils { public static Action OnHeroUpdate; public static Action OnHeroAwake; public static Action OnFsmAwake; public static void Init() { typeof(PlayMakerFSM).Hook("Awake", (Action, PlayMakerFSM>)delegate(Action orig, PlayMakerFSM self) { orig(self); OnFsmAwake?.Invoke(self); }); typeof(HeroController).Hook("Update", (Action, HeroController>)delegate(Action orig, HeroController self) { orig(self); OnHeroUpdate?.Invoke(self); }); typeof(HeroController).Hook("Awake", (Action, HeroController>)delegate(Action orig, HeroController self) { orig(self); OnHeroAwake?.Invoke(self); }); } public static void Hook(this Type type, string name, Delegate target, params Type[] types) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Extensions.IsNullOrEmpty((ICollection)types)) { new Hook((MethodBase)type.GetMethod(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic), target); } else { new Hook((MethodBase)type.GetMethod(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, types, null), target); } } } public static class MiscUtils { [CompilerGenerated] private sealed class <>c__DisplayClass0_0 { public HeroController hero; public Predicate condition; internal bool b__0() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return !hero.controlReqlinquished && (int)HeroController.instance.transitionState == 0 && (condition == null || condition(hero)); } } [CompilerGenerated] private sealed class d__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController hero; public Predicate condition; private <>c__DisplayClass0_0 <>8__1; private PlayMakerFSM 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass0_0(); <>8__1.hero = hero; <>8__1.condition = condition; 5__2 = <>8__1.hero.sprintFSM; if (5__2.ActiveStateName.Contains("Sprint")) { 5__2.SendEvent("SKID END"); } <>8__1.hero.umbrellaFSM.SendEvent("END"); <>2__current = (object)new WaitUntil((Func)(() => !<>8__1.hero.controlReqlinquished && (int)HeroController.instance.transitionState == 0 && (<>8__1.condition == null || <>8__1.condition(<>8__1.hero)))); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] public static IEnumerator FreeControl(this HeroController hero, Predicate condition = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { hero = hero, condition = condition }; } [CanBeNull] public static SavedItem GetSavedItem(string name) { if (((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).dictionary.TryGetValue(name, out var value)) { return (SavedItem)(object)value; } if (((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).dictionary.TryGetValue(name, out var value2)) { return (SavedItem)(object)value2; } if (((NamedScriptableObjectList)(object)ManagerSingleton.Instance.masterList).dictionary.TryGetValue(name, out var value3)) { return (SavedItem)(object)value3; } return (SavedItem)(object)((NamedScriptableObjectList)(object)ManagerSingleton.Instance.toolItems).dictionary.GetValueOrDefault(name); } public static int FirstPosMin(this IEnumerable enumerable, Func rule, Func backupRule) { float num = float.MaxValue; float num2 = float.MaxValue; int result = -1; int num3 = -1; foreach (T item in enumerable) { num3++; float num4 = rule(item); float num5 = backupRule(item); if (!(num4 <= 0f) && (num4 < num || (Mathf.Approximately(num4, num) && num5 < num2))) { num = num4; num2 = num5; result = num3; } } return result; } } public class LocalStr { public readonly string Content; public LocalStr(string s) { Content = s; base..ctor(); } public static implicit operator LocalisedString(LocalStr s) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new LocalisedString("ArchitectMod", s.Content); } public static implicit operator string(LocalStr s) { return s.Content; } public static implicit operator LocalStr(string s) { return new LocalStr(s); } } public static class ObjectUtils { public static T GetOrAddComponent(this GameObject obj) where T : Component { T component = obj.GetComponent(); return Object.op_Implicit((Object)(object)component) ? component : obj.AddComponent(); } public static void RemoveComponent(this GameObject obj) where T : Component { T component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } public static T ReplaceComponent(this GameObject obj) where T : Component { obj.RemoveComponent(); return obj.AddComponent(); } public static void BroadcastEvent(this GameObject obj, string triggerName) { EventManager.BroadcastEvent(obj, triggerName); } public static void RemoveComponentsInChildren(this GameObject obj) where T : Component { T[] componentsInChildren = obj.GetComponentsInChildren(true); T[] array = componentsInChildren; foreach (T val in array) { Object.Destroy((Object)(object)val); } } public static string GetPath(this Transform current) { if (!Object.op_Implicit((Object)(object)current.parent)) { return ((Object)current).name; } return current.parent.GetPath() + "/" + ((Object)current).name; } public static GameObject FindGameObject(string path, int index = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < SceneManager.loadedSceneCount; i++) { Scene sceneAt = SceneManager.GetSceneAt(i); GameObject gameObjectFromArray = GetGameObjectFromArray(((Scene)(ref sceneAt)).GetRootGameObjects(), path, index); if (Object.op_Implicit((Object)(object)gameObjectFromArray)) { return gameObjectFromArray; } } return null; } internal static GameObject GetGameObjectFromArray(GameObject[] objects, string objName, int index = 0) { string text = null; int num = objName.IndexOf('/'); string rootName; if (num == -1) { rootName = objName; } else { if (num == 0 || num == objName.Length - 1) { throw new ArgumentException("Invalid GameObject path"); } rootName = objName.Substring(0, num); int num2 = num + 1; text = objName.Substring(num2, objName.Length - num2); } GameObject val = objects.Where((GameObject o) => ((Object)o).name == rootName).ElementAtOrDefault(index); if (!Object.op_Implicit((Object)(object)val)) { return null; } if (text != null) { Transform val2 = val.transform.Find(text); return (!Object.op_Implicit((Object)(object)val2)) ? null : ((Component)val2).gameObject; } return val; } public static Vector3 RotatePointAroundPivot(this Vector3 point, Vector3 pivot, float angle) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_002d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = point - pivot; val = Quaternion.Euler(0f, 0f, angle) * val; point = val + pivot; return point; } public static void DisableChild(this Transform transform, params int[] children) { ((Component)children.Aggregate(transform, (Transform current, int c) => current.GetChild(c))).gameObject.SetActive(false); } public static void ApplyToAllComponents(this GameObject obj, Action action) where T : Component { T[] componentsInChildren = obj.GetComponentsInChildren(true); foreach (T obj2 in componentsInChildren) { action(obj2); } } } public static class PreviewUtils { public static Vector3 FixPreview(SpriteRenderer renderer, PlaceableObject type, bool flipped, float rotation, float scale) { //IL_0072: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (type.Tk2dRotation / 90 % 2 != 0) { renderer.flipY = flipped != type.FlipX; renderer.flipX = type.LossyScale.x < 0f; } else { renderer.flipX = flipped != type.FlipX; renderer.flipY = type.LossyScale.y < 0f; } Vector3 childOffset = type.ChildOffset; childOffset.x /= type.LossyScale.x; childOffset.y /= type.LossyScale.y; Vector3 val = type.Offset + childOffset; val.x *= type.ParentScale.x; val.y *= type.ParentScale.y; if (flipped) { val.x = 0f - val.x; } return Quaternion.Euler(0f, 0f, rotation) * (val * scale); } public static Sprite ConvertFrom2DToolkit(tk2dSpriteDefinition def, float ppu) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) Texture mainTexture = def.material.mainTexture; Texture2D val = (Texture2D)(object)((mainTexture is Texture2D) ? mainTexture : null); if (val == null) { return null; } float num = def.uvs[0].x; float num2 = def.uvs[0].y; float num3 = def.uvs[0].x; float num4 = def.uvs[0].y; for (int i = 1; i < def.uvs.Length; i++) { num = Mathf.Min(num, def.uvs[i].x); num2 = Mathf.Min(num2, def.uvs[i].y); num3 = Mathf.Max(num3, def.uvs[i].x); num4 = Mathf.Max(num4, def.uvs[i].y); } float num5 = num * (float)((Texture)val).width; float num6 = num2 * (float)((Texture)val).height; float num7 = (num3 - num) * (float)((Texture)val).width; float num8 = (num4 - num2) * (float)((Texture)val).height; return Sprite.Create(val, new Rect(num5, num6, num7, num8), new Vector2(0.5f, 0.5f), ppu); } } public static class QuickWarpHook { private static QuickWarpGUI _gui; private static FieldInfo _areaNames; private static FieldInfo _scenesByArea; private static FieldInfo _transitionsByScene; private static FieldInfo _respawnsByScene; public static void Init() { _gui = Resources.FindObjectsOfTypeAll().FirstOrDefault(); if (Object.op_Implicit((Object)(object)_gui)) { _areaNames = typeof(QuickWarpGUI).GetField("_areaNames", BindingFlags.Instance | BindingFlags.NonPublic); _scenesByArea = typeof(Warp).GetField("_scenes_by_area", BindingFlags.Static | BindingFlags.NonPublic); _transitionsByScene = typeof(Warp).GetField("_transitions_by_scene", BindingFlags.Static | BindingFlags.NonPublic); _respawnsByScene = typeof(Warp).GetField("_respawns_by_scene", BindingFlags.Static | BindingFlags.NonPublic); SceneUtils.QWHookEnabled = true; } } private static void RegisterGroup(string groupName) { List list = ((string[])_areaNames.GetValue(_gui)).ToList(); Dictionary> dictionary = (Dictionary>)_scenesByArea.GetValue(null); dictionary[groupName] = new List(); list.Add(groupName); _areaNames.SetValue(_gui, list.ToArray()); } private static void UnregisterGroup(string groupName) { List list = ((string[])_areaNames.GetValue(_gui)).ToList(); list.Remove(groupName); Dictionary> dictionary = (Dictionary>)_scenesByArea.GetValue(null); dictionary.Remove(groupName); _areaNames.SetValue(_gui, list.ToArray()); } public static void RegisterScene(string groupName, string sceneName) { Dictionary> dictionary = (Dictionary>)_scenesByArea.GetValue(null); if (!dictionary.ContainsKey(groupName)) { RegisterGroup(groupName); } dictionary[groupName].Add(sceneName); ((Dictionary>)_transitionsByScene.GetValue(null))[sceneName] = new List(1) { "_SceneManager" }; ((Dictionary>)_respawnsByScene.GetValue(null))[sceneName] = new List(); } public static void UnregisterScene(string groupName, string sceneName) { Dictionary> dictionary = (Dictionary>)_scenesByArea.GetValue(null); if (dictionary.ContainsKey(groupName)) { dictionary[groupName].Remove(sceneName); if (Extensions.IsNullOrEmpty((ICollection)dictionary[groupName])) { UnregisterGroup(groupName); } } } } public class QuickWarpHookLoader { public static void Init() { QuickWarpHook.Init(); } public static void RegisterScene(string groupName, string sceneName) { QuickWarpHook.RegisterScene(groupName, sceneName); } public static void UnregisterScene(string groupName, string sceneName) { QuickWarpHook.UnregisterScene(groupName, sceneName); } } public static class ResourceUtils { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string clipPath; public Action callback; private UnityWebRequest 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = UnityWebRequestMultimedia.GetAudioClip(new Uri(clipPath), GetAudioType(clipPath)); <>2__current = 5__1.SendWebRequest(); <>1__state = 1; return true; case 1: <>1__state = -1; if ((int)5__1.result == 1) { callback(DownloadHandlerAudioClip.GetContent(5__1)); } else { ArchitectPlugin.Logger.LogInfo((object)5__1.error); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static Sprite LoadSpriteResource(string spritePath, FilterMode filterMode = 1, Vector4 border = default(Vector4), float ppu = 100f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return LoadSpriteResource(spritePath, new Vector2(0.5f, 0.5f), filterMode, border, ppu); } internal static Sprite LoadSpriteResource(string spritePath, Vector2 pivot, FilterMode filterMode = 1, Vector4 border = default(Vector4), float ppu = 100f) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) string name = "Architect.Resources." + spritePath + ".png"; Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(name); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array, true); ((Texture)val).wrapMode = (TextureWrapMode)1; Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), pivot, ppu, 0u, (SpriteMeshType)1, border); ((Texture)val2.texture).filterMode = filterMode; return val2; } public static string LoadTextResource(string resourceName) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream("Architect.Resources." + resourceName); if (stream == null) { throw new Exception("Resource not found."); } using StreamReader streamReader = new StreamReader(stream); return streamReader.ReadToEnd(); } [CanBeNull] internal static Sprite[] LoadSprites(string spritePath, bool point, float ppu, int hcount, int vcount) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (!File.Exists(spritePath)) { return null; } Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(spritePath), true); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)((!point) ? 1 : 0); Sprite[] array = (Sprite[])(object)new Sprite[hcount * vcount]; float num = (float)((Texture)val).height / (float)vcount; float num2 = (float)((Texture)val).width / (float)hcount; int num3 = 0; for (int num4 = vcount - 1; num4 >= 0; num4--) { for (int i = 0; i < hcount; i++) { array[num3] = Sprite.Create(val, new Rect(num2 * (float)i, num * (float)num4, num2, num), new Vector2(0.5f, 0.5f), ppu); num3++; } } return array; } [IteratorStateMachine(typeof(d__4))] internal static IEnumerator LoadClip(string clipPath, Action callback) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { clipPath = clipPath, callback = callback }; } internal static void LoadClipResource(string clipPath, Action callback) { string text = StorageManager.DataPath + "ModAssets/" + clipPath + ".wav"; if (!File.Exists(text)) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream("Architect.Resources." + clipPath + ".wav"); if (stream == null) { return; } using FileStream destination = new FileStream(text, FileMode.Create, FileAccess.Write); stream.CopyTo(destination); } ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadClip(text, callback)); } private static AudioType GetAudioType(string fileName) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) string text = Path.GetExtension(fileName).ToLower(); if (1 == 0) { } AudioType result; switch (text) { case ".wav": result = (AudioType)20; break; case ".mp3": result = (AudioType)13; break; case ".ogg": result = (AudioType)14; break; case ".aif": case ".aiff": result = (AudioType)2; break; default: result = (AudioType)0; break; } if (1 == 0) { } return result; } } public static class SceneUtils { public delegate bool TryOpenQuickMap(GameMap self, out string displayName); public delegate void GetSceneInfo(GameMap self, string sceneName, MapZone mapZone, out GameMapScene foundScene, out GameObject foundSceneObj, out Vector2 foundScenePos); [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__9_0; public static Action <>9__9_1; public static Action <>9__9_2; public static Func <>9__9_11; public static Func <>9__9_12; public static Func <>9__9_13; public static Func <>9__9_14; public static Func <>9__9_15; public static Func <>9__9_16; public static Func <>9__9_17; public static Manipulator <>9__9_3; public static Action, GameManager, string> <>9__9_4; public static Func, InventoryMapManager, InventoryItemSelectable> <>9__9_6; public static <>F{00000080} <>9__9_7; public static <>A{00092000} <>9__9_8; public static Func <>9__9_18; public static Func, PlayerData, bool> <>9__9_9; public static Func <>9__9_19; public static Action, GameMap> <>9__9_10; public static Func <>9__11_0; public static Func <>9__18_0; internal void b__9_0(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Managers Preload"; _manager = o; } internal void b__9_1(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Scene Manager Preload"; _sceneManager = o; } internal void b__9_2(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); tk2dTileMap component = o.GetComponent(); ((Behaviour)component).enabled = true; for (int i = 0; i < component.width; i++) { for (int j = 0; j < component.height; j++) { component.ClearTile(i, j, 0); } } Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Tilemap Preload"; _tilemap = o; tk2dTileMap component2 = _tilemap.GetComponent(); Object.Destroy((Object)(object)component2.renderData); } internal void b__9_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[4] { (Instruction instr) => ILPatternMatchingExt.MatchLdloc(instr, 2), (Instruction instr) => instr.OpCode == OpCodes.Ldflda, (Instruction instr) => instr.OpCode == OpCodes.Call, (Instruction instr) => instr.OpCode == OpCodes.Brfalse_S }); ILLabel val2 = val.MarkLabel(); val.GotoNext((MoveType)2, new Func[3] { (Instruction instr) => ILPatternMatchingExt.MatchLdloc(instr, 2), (Instruction instr) => instr.OpCode == OpCodes.Ldc_I4_4, (Instruction instr) => instr.OpCode == OpCodes.Call }); ILLabel val3 = val.MarkLabel(); val.GotoLabel(val2, (MoveType)1, false); val.Emit(OpCodes.Br, (object)val3); } internal bool b__9_11(Instruction instr) { return ILPatternMatchingExt.MatchLdloc(instr, 2); } internal bool b__9_12(Instruction instr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return instr.OpCode == OpCodes.Ldflda; } internal bool b__9_13(Instruction instr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return instr.OpCode == OpCodes.Call; } internal bool b__9_14(Instruction instr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return instr.OpCode == OpCodes.Brfalse_S; } internal bool b__9_15(Instruction instr) { return ILPatternMatchingExt.MatchLdloc(instr, 2); } internal bool b__9_16(Instruction instr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return instr.OpCode == OpCodes.Ldc_I4_4; } internal bool b__9_17(Instruction instr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return instr.OpCode == OpCodes.Call; } internal void b__9_4(Action orig, GameManager self, string destScene) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown if (CustomScenes.ContainsKey(destScene)) { StorageManager.SaveScene(self.sceneName, PlacementManager.GetLevelData()); StorageManager.SaveScene("Global", PlacementManager.GetGlobalData()); PersistentAudioManager.OnLeaveScene(); PersistentAudioManager.QueueSceneEntry(); self.startedOnThisScene = false; self.nextSceneName = destScene; self.LastSceneLoad = new SceneLoad((MonoBehaviour)(object)self, new SceneLoadInfo { SceneName = destScene }); ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadScene(destScene)); } else { orig(self, destScene); } } internal InventoryItemSelectable b__9_6(Func orig, InventoryMapManager self) { if (CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value) && SceneGroups.TryGetValue(value.Group, out var value2) && value2.HasMap()) { return (InventoryItemSelectable)(object)value2.MapZone; } return orig(self); } internal bool b__9_7(TryOpenQuickMap orig, GameMap self, out string displayName) { //IL_0085: 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_00a1: Unknown result type (might be due to invalid IL or missing references) displayName = string.Empty; if (CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value)) { if (!SceneGroups.TryGetValue(value.Group, out var value2) || !value2.HasMap()) { return false; } self.DisableAllAreas(); self.EnableUnlockedAreas((MapZone?)(MapZone)0); displayName = value2.GroupName; ((Component)self).transform.localScale = new Vector3(1.4725f, 1.4725f, 1f); Extensions.SetPosition2D(((Component)self).transform, value2.ZoomPos * -1.4725f); if (value.Map.activeInHierarchy) { string heroCorpseScene = PlayerData.instance.HeroCorpseScene; if (heroCorpseScene != null && CustomScenes.TryGetValue(heroCorpseScene, out var value3) && SceneGroups.TryGetValue(value3.Group, out var value4) && value4 == value2) { self.shadeMarker.SetActive(true); } self.PositionCompassAndCorpse(); } self.SetDisplayNextArea(true, (MapZone)0); self.SetupMapMarkers(); return true; } return orig(self, out displayName); } internal void b__9_8(GetSceneInfo orig, GameMap self, string sceneName, MapZone mapZone, out GameMapScene foundScene, out GameObject foundSceneObj, out Vector2 foundScenePos) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (sceneName != null && CustomScenes.TryGetValue(sceneName, out var value) && Object.op_Implicit((Object)(object)value.Map)) { foundScene = value.Gms; foundSceneObj = value.Map; Vector3 localPosition = foundSceneObj.transform.localPosition; Vector3 localPosition2 = foundSceneObj.transform.parent.localPosition; Vector3 val = localPosition + localPosition2; float? num = 0f; foundScenePos = Vector2.op_Implicit(Extensions.Where(val, (float?)null, (float?)null, num)); if (!foundSceneObj.activeInHierarchy) { foundSceneObj = null; } } else { orig(self, sceneName, mapZone, out foundScene, out foundSceneObj, out foundScenePos); } } internal bool b__9_9(Func orig, PlayerData self) { return orig(self) || SceneGroups.Values.Any((SceneGroup sg) => sg.HasMap()); } internal bool b__9_18(SceneGroup sg) { return sg.HasMap(); } internal void b__9_10(Action _, GameMap self) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Invalid comparison between Unknown and I4 //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Expected O, but got Unknown //IL_0669: Expected O, but got Unknown //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0510: 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_0521: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass9_1 CS$<>8__locals0 = new <>c__DisplayClass9_1 { self = self }; CS$<>8__locals0.self.CompleteVisibleLocalBoundsNow(); if (CS$<>8__locals0.self.updatePinAreaBounds) { CS$<>8__locals0.self.CalculatePinAreaBounds(); } CS$<>8__locals0.self.panMinX = float.MaxValue; CS$<>8__locals0.self.panMaxX = float.MinValue; CS$<>8__locals0.self.panMinY = float.MaxValue; CS$<>8__locals0.self.panMaxY = float.MinValue; PlayerData instance = PlayerData.instance; MapZone val = (MapZone)(CS$<>8__locals0.self.displayingCompass ? ((int)CS$<>8__locals0.self.GetCurrentMapZone()) : 0); bool flag = CollectableItemManager.IsInHiddenMode(); bool flag2 = CS$<>8__locals0.self.IsLostInAbyssPostMap(); bool flag3 = flag || flag2; Bounds val2 = default(Bounds); int num = 0; Bounds val7 = default(Bounds); for (int i = 0; i < CS$<>8__locals0.self.mapZoneInfo.Length; i++) { ZoneInfo val3 = CS$<>8__locals0.self.mapZoneInfo[i]; MapZone val4 = (MapZone)i; bool flag4 = false; ParentInfo[] parents = val3.Parents; foreach (ParentInfo val5 in parents) { if (!Object.op_Implicit((Object)(object)val5.Parent)) { continue; } if (val4 != val && !val5.Parent.gameObject.activeSelf) { if ((int)val5.BoundsAddedByPinGroup == -1 || flag || flag2) { continue; } string text = CaravanTroupeHunter.PdBools[val5.BoundsAddedByPinGroup]; if (!VariableExtensions.GetVariable((IIncludeVariableExtensions)(object)instance, text) || !CS$<>8__locals0.self.HasRemainingPinFor(val5.BoundsAddedByPinGroup)) { continue; } } foreach (Transform item in val5.Parent.transform) { Transform val6 = item; if (((Component)val6).gameObject.activeSelf) { SpriteRenderer component = ((Component)val6).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sprite)) { flag4 = true; break; } } } if (flag4) { break; } } if (flag4) { Vector2 wideMapZoomPositionNew = val3.GetWideMapZoomPositionNew(); if (wideMapZoomPositionNew.x < CS$<>8__locals0.self.panMinX) { CS$<>8__locals0.self.panMinX = wideMapZoomPositionNew.x; } if (wideMapZoomPositionNew.x > CS$<>8__locals0.self.panMaxX) { CS$<>8__locals0.self.panMaxX = wideMapZoomPositionNew.x; } if (wideMapZoomPositionNew.y < CS$<>8__locals0.self.panMinY) { CS$<>8__locals0.self.panMinY = wideMapZoomPositionNew.y; } if (wideMapZoomPositionNew.y > CS$<>8__locals0.self.panMaxY) { CS$<>8__locals0.self.panMaxY = wideMapZoomPositionNew.y; } Vector3 size = ((Bounds)(ref val3.VisibleLocalBounds)).size; ((Bounds)(ref val7))..ctor(((Bounds)(ref val3.VisibleLocalBounds)).center, size); if (num == 0) { val2 = val7; } else { ((Bounds)(ref val2)).Encapsulate(val7); } num++; } } using (IEnumerator enumerator2 = SceneGroups.Values.Where((SceneGroup group) => group.HasMap()).Distinct().GetEnumerator()) { Bounds val9 = default(Bounds); while (enumerator2.MoveNext()) { <>c__DisplayClass9_2 CS$<>8__locals1 = new <>c__DisplayClass9_2 { group = enumerator2.Current }; foreach (CustomScene item2 in CustomScenes.Values.Where((CustomScene o) => o.Group == CS$<>8__locals1.group.Id)) { Vector2 val8 = CS$<>8__locals1.group.ZoomPos + item2.MapPos; if (val8.x < CS$<>8__locals0.self.panMinX) { CS$<>8__locals0.self.panMinX = val8.x; } if (val8.x > CS$<>8__locals0.self.panMaxX) { CS$<>8__locals0.self.panMaxX = val8.x; } if (val8.y < CS$<>8__locals0.self.panMinY) { CS$<>8__locals0.self.panMinY = val8.y; } if (val8.y > CS$<>8__locals0.self.panMaxY) { CS$<>8__locals0.self.panMaxY = val8.y; } if (Object.op_Implicit((Object)(object)item2.Gms) && Object.op_Implicit((Object)(object)item2.Gms.fullSprite)) { Bounds croppedBounds = GameMapScene.GetCroppedBounds(item2.Gms.fullSprite); ((Bounds)(ref val9))..ctor(Vector2.op_Implicit(val8), ((Bounds)(ref croppedBounds)).extents * 1.15f); if (num == 0) { val2 = val9; } else { ((Bounds)(ref val2)).Encapsulate(val9); } num++; } } } } CS$<>8__locals0.self.mapBounds = val2; Vector3 center = ((Bounds)(ref CS$<>8__locals0.self.mapMarkerScrollArea)).center; ArrayForEnumAttribute.EnsureArraySize(ref instance.placedMarkers, typeof(MarkerTypes)); if (!flag3) { Bounds val10 = default(Bounds); bool flag5 = false; if (Object.op_Implicit((Object)(object)CS$<>8__locals0.self.markerParent) && (Object)(object)CS$<>8__locals0.self.markerParent != (Object)(object)((Component)CS$<>8__locals0.self).transform) { CS$<>8__locals0.self.markerToGameMapLocal = ((Component)CS$<>8__locals0.self).transform.worldToLocalMatrix * CS$<>8__locals0.self.markerParent.localToWorldMatrix; } for (int k = 0; k < CS$<>8__locals0.self.spawnedMapMarkers.GetLength(0); k++) { WrappedVector2List val11 = instance.placedMarkers[k]; if (val11 == null) { WrappedVector2List[] placedMarkers = instance.placedMarkers; int num2 = k; WrappedVector2List val12 = new WrappedVector2List(); val11 = val12; placedMarkers[num2] = val12; } foreach (Vector3 item3 in ((WrappedList)(object)val11).List.Select((Vector2 t) => ((Matrix4x4)(ref CS$<>8__locals0.self.markerToGameMapLocal)).MultiplyPoint3x4(Vector2.op_Implicit(t)))) { if (flag5) { ((Bounds)(ref val10)).Encapsulate(item3); continue; } val10 = new Bounds(item3, Vector3.zero); flag5 = true; } } if (flag5) { ((Bounds)(ref val2)).Encapsulate(val10); } } CS$<>8__locals0.self.MapMarkerBounds = val2; CS$<>8__locals0.self.NoPanBounds = val2; Bounds zoomedBounds = CS$<>8__locals0.self.ApplyScrollAreaOffset(val2); ((Bounds)(ref zoomedBounds)).center = -((Bounds)(ref zoomedBounds)).center + center; ((Bounds)(ref CS$<>8__locals0.self.MapMarkerBounds)).center = -((Bounds)(ref CS$<>8__locals0.self.MapMarkerBounds)).center + center; ((Bounds)(ref CS$<>8__locals0.self.NoPanBounds)).center = -((Bounds)(ref CS$<>8__locals0.self.NoPanBounds)).center + center; if (num > 1) { CS$<>8__locals0.self.panMinX = ((Bounds)(ref zoomedBounds)).min.x; CS$<>8__locals0.self.panMinY = ((Bounds)(ref zoomedBounds)).min.y; CS$<>8__locals0.self.panMaxX = ((Bounds)(ref zoomedBounds)).max.x; CS$<>8__locals0.self.panMaxY = ((Bounds)(ref zoomedBounds)).max.y; } else { GameMap self2 = CS$<>8__locals0.self; self2.panMinX += center.x; GameMap self3 = CS$<>8__locals0.self; self3.panMaxX += center.x; GameMap self4 = CS$<>8__locals0.self; self4.panMinY += center.y; GameMap self5 = CS$<>8__locals0.self; self5.panMaxY += center.y; } CS$<>8__locals0.self.ZoomedBounds = zoomedBounds; } internal bool b__9_19(SceneGroup group) { return group.HasMap(); } internal bool b__11_0(SceneGroup g) { return g.HasMapZone && Object.op_Implicit((Object)(object)g.MapSprite); } internal bool b__18_0(AtmosCue o) { return ((Object)o).name == "None"; } } [CompilerGenerated] private sealed class <>c__DisplayClass14_0 { public SceneLoad self; } [CompilerGenerated] private sealed class <>c__DisplayClass9_1 { public GameMap self; public Func <>9__21; internal Vector3 b__21(Vector2 t) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return ((Matrix4x4)(ref self.markerToGameMapLocal)).MultiplyPoint3x4(Vector2.op_Implicit(t)); } } [CompilerGenerated] private sealed class <>c__DisplayClass9_2 { public SceneGroup group; public Func <>9__20; internal bool b__20(CustomScene o) { return o.Group == group.Id; } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string sceneName; private string 5__1; private CustomScene 5__2; private Scene 5__3; private GameObject 5__4; private TransitionPoint 5__5; private BoxCollider2D 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__4 = null; 5__5 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameManager.instance.sceneName; if (5__1 == sceneName) { SceneManager.MergeScenes(SceneManager.GetActiveScene(), SceneManager.CreateScene("Temp")); 5__1 = "Temp"; } 5__2 = CustomScenes[sceneName]; 5__3 = SceneManager.CreateScene(sceneName); 5__4 = CreateSceneManager(); 5__4.GetComponent().environmentType = 5__2.Environment; SceneManager.MoveGameObjectToScene(5__4, 5__3); SceneManager.MoveGameObjectToScene(CreateManager(), 5__3); SceneManager.SetActiveScene(5__3); CreateTileMap(5__2); 5__4.AddComponent(); 5__5 = 5__4.AddComponent(); 5__5.nonHazardGate = true; 5__5.targetScene = "Belltown"; 5__5.entryPoint = "door1"; 5__6 = 5__4.AddComponent(); 5__6.size = new Vector2(0f, 0f); ((Collider2D)5__6).offset = new Vector2(-9999f, -9999f); ((Collider2D)5__6).isTrigger = true; <>2__current = SceneManager.UnloadSceneAsync(5__1); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Func orig; public SceneLoad self; private <>c__DisplayClass14_0 <>8__1; private IEnumerator 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass14_0(); <>8__1.self = self; 5__2 = orig(<>8__1.self); if (CustomScenes.ContainsKey(<>8__1.self.TargetSceneName)) { <>8__1.self.ActivationComplete += new ActivationCompleteDelegate(Load); } break; case 1: <>1__state = -1; break; } if (5__2.MoveNext()) { <>2__current = 5__2.Current; <>1__state = 1; return true; } <>8__1.self.ActivationComplete -= new ActivationCompleteDelegate(Load); return false; void Load() { ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadScene(((<>c__DisplayClass14_0)this).self.TargetSceneName)); } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static GameObject _manager; private static GameObject _sceneManager; private static GameObject _tilemap; private static GameObject _borderPrefab; public static tk2dTileMap Tilemap; public static readonly Dictionary CustomScenes = new Dictionary(); public static readonly Dictionary SceneGroups = new Dictionary(); public static bool QWHookEnabled; private static readonly FieldInfo SceneMapStartScale = typeof(InventoryMapManager).GetField("SceneMapStartScale", BindingFlags.Static | BindingFlags.Public); [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private static AtmosCue k__BackingField; private static AtmosCue NoAtmosCue => k__BackingField ?? (k__BackingField = ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((AtmosCue o) => ((Object)o).name == "None"))); public static void InitQWHook() { if (Chainloader.PluginInfos.ContainsKey("io.github.hk-speedrunning.quickwarp")) { ArchitectPlugin.Logger.LogInfo((object)"Enabling QuickWarp Hook"); QuickWarpHookLoader.Init(); } } public static void Init() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_02bc: Unknown result type (might be due to invalid IL or missing references) _borderPrefab = new GameObject("[Architect] Border Replacement"); _borderPrefab.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_borderPrefab); PreloadManager.RegisterPreload(new BasicPreload("Arborium_09", "_Managers", delegate(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Managers Preload"; _manager = o; })); PreloadManager.RegisterPreload(new BasicPreload("Arborium_09", "_SceneManager", delegate(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Scene Manager Preload"; _sceneManager = o; })); PreloadManager.RegisterPreload(new BasicPreload("Arborium_09", "TileMap", delegate(GameObject o) { o = Object.Instantiate(o); o.SetActive(false); tk2dTileMap component2 = o.GetComponent(); ((Behaviour)component2).enabled = true; for (int l = 0; l < component2.width; l++) { for (int m = 0; m < component2.height; m++) { component2.ClearTile(l, m, 0); } } Object.DontDestroyOnLoad((Object)(object)o); ((Object)o).name = "[Architect] Tilemap Preload"; _tilemap = o; tk2dTileMap component3 = _tilemap.GetComponent(); Object.Destroy((Object)(object)component3.renderData); })); typeof(SceneLoad).Hook("BeginRoutine", new Func, SceneLoad, IEnumerator>(RedirectLoad)); MethodInfo stateMachineTarget = Extensions.GetStateMachineTarget(typeof(SceneLoad).GetMethod("BeginRoutine", BindingFlags.Instance | BindingFlags.NonPublic)); object obj = <>c.<>9__9_3; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) ILCursor val15 = new ILCursor(il); val15.GotoNext((MoveType)2, new Func[4] { (Instruction instr) => ILPatternMatchingExt.MatchLdloc(instr, 2), (Instruction instr) => instr.OpCode == OpCodes.Ldflda, (Instruction instr) => instr.OpCode == OpCodes.Call, (Instruction instr) => instr.OpCode == OpCodes.Brfalse_S }); ILLabel val16 = val15.MarkLabel(); val15.GotoNext((MoveType)2, new Func[3] { (Instruction instr) => ILPatternMatchingExt.MatchLdloc(instr, 2), (Instruction instr) => instr.OpCode == OpCodes.Ldc_I4_4, (Instruction instr) => instr.OpCode == OpCodes.Call }); ILLabel val17 = val15.MarkLabel(); val15.GotoLabel(val16, (MoveType)1, false); val15.Emit(OpCodes.Br, (object)val17); }; <>c.<>9__9_3 = val; obj = (object)val; } new ILHook((MethodBase)stateMachineTarget, (Manipulator)obj); typeof(GameManager).Hook("LoadScene", (Action, GameManager, string>)delegate(Action orig, GameManager self, string destScene) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown if (CustomScenes.ContainsKey(destScene)) { StorageManager.SaveScene(self.sceneName, PlacementManager.GetLevelData()); StorageManager.SaveScene("Global", PlacementManager.GetGlobalData()); PersistentAudioManager.OnLeaveScene(); PersistentAudioManager.QueueSceneEntry(); self.startedOnThisScene = false; self.nextSceneName = destScene; self.LastSceneLoad = new SceneLoad((MonoBehaviour)(object)self, new SceneLoadInfo { SceneName = destScene }); ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadScene(destScene)); } else { orig(self, destScene); } }); AreaBackground blankBackground = new AreaBackground { BackgroundImage = ArchitectPlugin.BlankSprite, NameOverride = new LocalisedString("ArchitectMod", "???") }; typeof(SaveSlotBackgrounds).Hook("GetBackground", (Func, SaveSlotBackgrounds, SaveStats, AreaBackground>)delegate(Func orig, SaveSlotBackgrounds self, SaveStats currentSaveStats) { string key = currentSaveStats?.saveGameData?.playerData?.respawnScene ?? ""; CustomScene value8; SceneGroup value9; return CustomScenes.TryGetValue(key, out value8) ? (SceneGroups.TryGetValue(value8.Group, out value9) ? (value9.Background ?? blankBackground) : blankBackground) : orig(self, currentSaveStats); }, typeof(SaveStats)); typeof(InventoryMapManager).Hook("GetStartSelectable", (Func, InventoryMapManager, InventoryItemSelectable>)((Func orig, InventoryMapManager self) => (InventoryItemSelectable)((CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value6) && SceneGroups.TryGetValue(value6.Group, out var value7) && value7.HasMap()) ? ((object)value7.MapZone) : ((object)orig(self))))); typeof(GameMap).Hook("TryOpenQuickMap", (<>F{00000080})delegate(TryOpenQuickMap orig, GameMap self, out string displayName) { //IL_0085: 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_00a1: Unknown result type (might be due to invalid IL or missing references) displayName = string.Empty; if (CustomScenes.TryGetValue(GameManager.instance.sceneName, out var value2)) { if (!SceneGroups.TryGetValue(value2.Group, out var value3) || !value3.HasMap()) { return false; } self.DisableAllAreas(); self.EnableUnlockedAreas((MapZone?)(MapZone)0); displayName = value3.GroupName; ((Component)self).transform.localScale = new Vector3(1.4725f, 1.4725f, 1f); Extensions.SetPosition2D(((Component)self).transform, value3.ZoomPos * -1.4725f); if (value2.Map.activeInHierarchy) { string heroCorpseScene = PlayerData.instance.HeroCorpseScene; if (heroCorpseScene != null && CustomScenes.TryGetValue(heroCorpseScene, out var value4) && SceneGroups.TryGetValue(value4.Group, out var value5) && value5 == value3) { self.shadeMarker.SetActive(true); } self.PositionCompassAndCorpse(); } self.SetDisplayNextArea(true, (MapZone)0); self.SetupMapMarkers(); return true; } return orig(self, out displayName); }); typeof(GameMap).Hook("GetSceneInfo", (<>A{00092000})delegate(GetSceneInfo orig, GameMap self, string sceneName, MapZone mapZone, out GameMapScene foundScene, out GameObject foundSceneObj, out Vector2 foundScenePos) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (sceneName != null && CustomScenes.TryGetValue(sceneName, out var value) && Object.op_Implicit((Object)(object)value.Map)) { foundScene = value.Gms; foundSceneObj = value.Map; Vector3 localPosition = foundSceneObj.transform.localPosition; Vector3 localPosition2 = foundSceneObj.transform.parent.localPosition; Vector3 val14 = localPosition + localPosition2; float? num3 = 0f; foundScenePos = Vector2.op_Implicit(Extensions.Where(val14, (float?)null, (float?)null, num3)); if (!foundSceneObj.activeInHierarchy) { foundSceneObj = null; } } else { orig(self, sceneName, mapZone, out foundScene, out foundSceneObj, out foundScenePos); } }); new Hook((MethodBase)typeof(PlayerData).GetProperty("HasAnyMap").GetGetMethod(), (Delegate)(Func, PlayerData, bool>)((Func orig, PlayerData self) => orig(self) || SceneGroups.Values.Any((SceneGroup sg) => sg.HasMap()))); typeof(GameMap).Hook("CalculateMapScrollBounds", (Action, GameMap>)delegate(Action _, GameMap self) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Invalid comparison between Unknown and I4 //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Expected O, but got Unknown //IL_0669: Expected O, but got Unknown //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0510: 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_0521: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) self.CompleteVisibleLocalBoundsNow(); if (self.updatePinAreaBounds) { self.CalculatePinAreaBounds(); } self.panMinX = float.MaxValue; self.panMaxX = float.MinValue; self.panMinY = float.MaxValue; self.panMaxY = float.MinValue; PlayerData instance = PlayerData.instance; MapZone val2 = (MapZone)(self.displayingCompass ? ((int)self.GetCurrentMapZone()) : 0); bool flag = CollectableItemManager.IsInHiddenMode(); bool flag2 = self.IsLostInAbyssPostMap(); bool flag3 = flag || flag2; Bounds val3 = default(Bounds); int num = 0; Bounds val8 = default(Bounds); for (int i = 0; i < self.mapZoneInfo.Length; i++) { ZoneInfo val4 = self.mapZoneInfo[i]; MapZone val5 = (MapZone)i; bool flag4 = false; ParentInfo[] parents = val4.Parents; foreach (ParentInfo val6 in parents) { if (Object.op_Implicit((Object)(object)val6.Parent)) { if (val5 != val2 && !val6.Parent.gameObject.activeSelf) { if ((int)val6.BoundsAddedByPinGroup == -1 || flag || flag2) { continue; } string text = CaravanTroupeHunter.PdBools[val6.BoundsAddedByPinGroup]; if (!VariableExtensions.GetVariable((IIncludeVariableExtensions)(object)instance, text) || !self.HasRemainingPinFor(val6.BoundsAddedByPinGroup)) { continue; } } foreach (Transform item in val6.Parent.transform) { Transform val7 = item; if (((Component)val7).gameObject.activeSelf) { SpriteRenderer component = ((Component)val7).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sprite)) { flag4 = true; break; } } } if (flag4) { break; } } } if (flag4) { Vector2 wideMapZoomPositionNew = val4.GetWideMapZoomPositionNew(); if (wideMapZoomPositionNew.x < self.panMinX) { self.panMinX = wideMapZoomPositionNew.x; } if (wideMapZoomPositionNew.x > self.panMaxX) { self.panMaxX = wideMapZoomPositionNew.x; } if (wideMapZoomPositionNew.y < self.panMinY) { self.panMinY = wideMapZoomPositionNew.y; } if (wideMapZoomPositionNew.y > self.panMaxY) { self.panMaxY = wideMapZoomPositionNew.y; } Vector3 size = ((Bounds)(ref val4.VisibleLocalBounds)).size; ((Bounds)(ref val8))..ctor(((Bounds)(ref val4.VisibleLocalBounds)).center, size); if (num == 0) { val3 = val8; } else { ((Bounds)(ref val3)).Encapsulate(val8); } num++; } } Bounds val10 = default(Bounds); foreach (SceneGroup group2 in SceneGroups.Values.Where((SceneGroup group) => group.HasMap()).Distinct()) { foreach (CustomScene item2 in CustomScenes.Values.Where((CustomScene o) => o.Group == group2.Id)) { Vector2 val9 = group2.ZoomPos + item2.MapPos; if (val9.x < self.panMinX) { self.panMinX = val9.x; } if (val9.x > self.panMaxX) { self.panMaxX = val9.x; } if (val9.y < self.panMinY) { self.panMinY = val9.y; } if (val9.y > self.panMaxY) { self.panMaxY = val9.y; } if (Object.op_Implicit((Object)(object)item2.Gms) && Object.op_Implicit((Object)(object)item2.Gms.fullSprite)) { Bounds croppedBounds = GameMapScene.GetCroppedBounds(item2.Gms.fullSprite); ((Bounds)(ref val10))..ctor(Vector2.op_Implicit(val9), ((Bounds)(ref croppedBounds)).extents * 1.15f); if (num == 0) { val3 = val10; } else { ((Bounds)(ref val3)).Encapsulate(val10); } num++; } } } self.mapBounds = val3; Vector3 center = ((Bounds)(ref self.mapMarkerScrollArea)).center; ArrayForEnumAttribute.EnsureArraySize(ref instance.placedMarkers, typeof(MarkerTypes)); if (!flag3) { Bounds val11 = default(Bounds); bool flag5 = false; if (Object.op_Implicit((Object)(object)self.markerParent) && (Object)(object)self.markerParent != (Object)(object)((Component)self).transform) { self.markerToGameMapLocal = ((Component)self).transform.worldToLocalMatrix * self.markerParent.localToWorldMatrix; } for (int k = 0; k < self.spawnedMapMarkers.GetLength(0); k++) { WrappedVector2List val12 = instance.placedMarkers[k]; if (val12 == null) { WrappedVector2List[] placedMarkers = instance.placedMarkers; int num2 = k; WrappedVector2List val13 = new WrappedVector2List(); val12 = val13; placedMarkers[num2] = val13; } foreach (Vector3 item3 in ((WrappedList)(object)val12).List.Select((Vector2 t) => ((Matrix4x4)(ref self.markerToGameMapLocal)).MultiplyPoint3x4(Vector2.op_Implicit(t)))) { if (flag5) { ((Bounds)(ref val11)).Encapsulate(item3); } else { val11 = new Bounds(item3, Vector3.zero); flag5 = true; } } } if (flag5) { ((Bounds)(ref val3)).Encapsulate(val11); } } self.MapMarkerBounds = val3; self.NoPanBounds = val3; Bounds zoomedBounds = self.ApplyScrollAreaOffset(val3); ((Bounds)(ref zoomedBounds)).center = -((Bounds)(ref zoomedBounds)).center + center; ((Bounds)(ref self.MapMarkerBounds)).center = -((Bounds)(ref self.MapMarkerBounds)).center + center; ((Bounds)(ref self.NoPanBounds)).center = -((Bounds)(ref self.NoPanBounds)).center + center; if (num > 1) { self.panMinX = ((Bounds)(ref zoomedBounds)).min.x; self.panMinY = ((Bounds)(ref zoomedBounds)).min.y; self.panMaxX = ((Bounds)(ref zoomedBounds)).max.x; self.panMaxY = ((Bounds)(ref zoomedBounds)).max.y; } else { GameMap obj2 = self; obj2.panMinX += center.x; GameMap obj3 = self; obj3.panMaxX += center.x; GameMap obj4 = self; obj4.panMinY += center.y; GameMap obj5 = self; obj5.panMaxY += center.y; } self.ZoomedBounds = zoomedBounds; }); } public static void AdjustMapScale(InventoryWideMap wideMap) { //IL_004a: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) float num = 1f; foreach (SceneGroup item in SceneGroups.Values.Where((SceneGroup g) => g.HasMapZone && Object.op_Implicit((Object)(object)g.MapSprite))) { Vector2 val = item.MapPos * 1.34f; Bounds bounds = item.MapSprite.bounds; Vector2 val2 = val + Vector2.op_Implicit(((Bounds)(ref bounds)).max); Vector2 val3 = item.MapPos * 1.34f; bounds = item.MapSprite.bounds; Vector2 val4 = val3 + Vector2.op_Implicit(((Bounds)(ref bounds)).min); num = Mathf.Min(new float[5] { num, 6f / Mathf.Abs(val2.y), 6f / Mathf.Abs(val4.y), 10f / Mathf.Abs(val2.x), 10f / Mathf.Abs(val4.x) }); } if (Object.op_Implicit((Object)(object)wideMap)) { ((Component)wideMap).transform.localScale = new Vector3(1.34f * num, 1.34f * num, 1f); } if (Object.op_Implicit((Object)(object)GameManager.instance.gameMap) && Object.op_Implicit((Object)(object)GameManager.instance.gameMap.mapManager)) { GameManager.instance.gameMap.mapManager.zoneMapInitialScale = new Vector3(1.34f * num, 1.34f * num, 1f); } SceneMapStartScale.SetValue(null, (object)new Vector3(0.39f * num, 0.39f * num, 1f)); } [IteratorStateMachine(typeof(d__14))] private static IEnumerator RedirectLoad(Func orig, SceneLoad self) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { orig = orig, self = self }; } [IteratorStateMachine(typeof(d__15))] public static IEnumerator LoadScene(string sceneName) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { sceneName = sceneName }; } public static GameObject CreateSceneManager() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(_sceneManager); ((Object)val).name = "_SceneManager"; CustomSceneManager component = val.GetComponent(); component.borderPrefab = _borderPrefab; component.overrideParticlesWith = (MapZone)0; component.noParticles = true; component.mapZone = (MapZone)0; component.environmentType = (EnvironmentTypes)5; component.actorSnapshot = GameManager.instance.actorSnapshotUnpaused; component.atmosSnapshot = AudioPlayer.AtmosSnapshot; component.atmosCue = NoAtmosCue; component.musicCue = GameManager.instance.noMusicCue; component.darknessLevel = 0; val.AddComponent(); val.SetActive(true); return val; } public static GameObject CreateManager() { GameObject val = Object.Instantiate(_manager); ((Object)val).name = "_Managers"; val.SetActive(true); return val; } public static void CreateTileMap(CustomScene scene) { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown GameObject val = Object.Instantiate(_tilemap); ((Object)val).name = "TileMap"; val.SetActive(true); Tilemap = val.GetComponent(); Tilemap.width = scene.TilemapWidth; Tilemap.height = scene.TilemapHeight; Tilemap.layers[0].width = scene.TilemapWidth; Tilemap.layers[0].height = scene.TilemapHeight; GameManager.instance.tilemap = Tilemap; GameManager.instance.sceneWidth = scene.TilemapWidth; GameManager.instance.sceneHeight = scene.TilemapHeight; Tilemap.layers[0].numColumns = Mathf.CeilToInt((float)scene.TilemapWidth / 32f); Tilemap.layers[0].numRows = Mathf.CeilToInt((float)scene.TilemapHeight / 32f); List list = new List(); for (int i = 0; i < Tilemap.layers[0].numRows; i++) { for (int j = 0; j < Tilemap.layers[0].numColumns; j++) { list.Add(new SpriteChunk()); } } Tilemap.layers[0].spriteChannel.chunks = list.ToArray(); LevelData modData = MapLoader.GetModData(scene.Id); if (modData != null && !Extensions.IsNullOrEmpty<(int, int)>((ICollection<(int, int)>)modData.TilemapChanges)) { foreach (var (num, num2) in modData.TilemapChanges) { try { if (Tilemap.GetTile(num, num2, 0) == -1) { Tilemap.SetTile(num, num2, 0, 0); } else { Tilemap.ClearTile(num, num2, 0); } } catch (Exception) { } } } LevelData levelData = PlacementManager.GetLevelData(); if (!Extensions.IsNullOrEmpty<(int, int)>((ICollection<(int, int)>)levelData.TilemapChanges)) { foreach (var (num3, num4) in levelData.TilemapChanges) { try { if (Tilemap.GetTile(num3, num4, 0) == -1) { Tilemap.SetTile(num3, num4, 0, 0); } else { Tilemap.ClearTile(num3, num4, 0); } } catch (Exception) { } } } Tilemap.Build(); } } public static class TitleUtils { [CompilerGenerated] private sealed class <g__TitleDown|13_7>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__TitleDown|13_7>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; _bigBoss.SetActive(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool _overrideAreaText; private static bool _waitForCancel; private static int _areaType; private static string _areaHeader; private static string _areaBody; private static string _areaFooter; private static PlayMakerFSM _fsm; private static GameObject _bigBoss; private static PlayMakerFSM _bigBossFsm; private static FsmState _bigBossFsmUp; private static SetTextMeshProGameText _bigBossHeader; private static SetTextMeshProGameText _bigBossBody; private static SetTextMeshProGameText _bigBossFooter; public static void Init() { HookUtils.OnFsmAwake = (Action)Delegate.Combine(HookUtils.OnFsmAwake, (Action)delegate(PlayMakerFSM fsm) { if (fsm.FsmName == "Area Title Control") { _fsm = fsm; FsmString header = fsm.FsmVariables.FindFsmString("Title Sup"); FsmString footer = fsm.FsmVariables.FindFsmString("Title Sub"); FsmString body = fsm.FsmVariables.FindFsmString("Title Main"); FsmBool right = fsm.FsmVariables.FindFsmBool("Display Right"); FsmBool npc = fsm.FsmVariables.FindFsmBool("NPC Title"); FsmFloat wait = fsm.FsmVariables.FindFsmFloat("Unvisited Wait"); fsm.GetState("Init all").AddAction(delegate { if (_overrideAreaText) { header.value = _areaHeader; footer.value = _areaFooter; body.value = _areaBody; npc.value = _waitForCancel; wait.value = (_waitForCancel ? 9999999f : 4.75f); } }, -1, everyFrame: false); fsm.GetState("Visited Check").AddAction(delegate { if (_overrideAreaText) { _overrideAreaText = false; right.value = _areaType == 2; fsm.SendEvent((_areaType == 0) ? "UNVISITED" : "VISITED"); } }, 0, everyFrame: false); fsm.GetState("Titles Down 2").AddAction(delegate { wait.value = 4.75f; }, 0, everyFrame: false); } }); PreloadManager.RegisterPreload(new BasicPreload("Abyss_Cocoon", "Boss Control/Boss Title", delegate(GameObject o) { o.SetActive(false); _bigBoss = Object.Instantiate(o); Object.DontDestroyOnLoad((Object)(object)_bigBoss); _bigBossFsm = _bigBoss.GetComponent(); _bigBossFsmUp = _bigBossFsm.GetState("Title Up"); Transform child = _bigBoss.transform.GetChild(1).GetChild(1); _bigBossHeader = ((Component)child.GetChild(1)).GetComponent(); _bigBossBody = ((Component)child.GetChild(0)).GetComponent(); _bigBossFooter = ((Component)child.GetChild(2)).GetComponent(); FsmState state = _bigBossFsm.GetState("Flash Effect"); state.DisableAction(2); state.DisableAction(3); _bigBossFsm.GetState("Idle").AddAction(delegate { _bigBossFsm.SendEvent("TITLE UP"); }, -1, everyFrame: false); _bigBossFsm.GetState("Title Down").AddAction(delegate { ((MonoBehaviour)_bigBossFsm).StartCoroutine(TitleDown()); }, -1, everyFrame: false); })); [IteratorStateMachine(typeof(<g__TitleDown|13_7>d))] static IEnumerator TitleDown() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <g__TitleDown|13_7>d(0); } } public static void DisplayTitle(string header, string body, string footer, int type, bool waitForCancel = false) { if (type == 3) { DisplayBigBoss(header, body, footer, waitForCancel); return; } _overrideAreaText = true; _areaType = type; _areaHeader = header; _areaBody = body; _areaFooter = footer; _waitForCancel = waitForCancel; ((Component)ManagerSingleton.Instance).gameObject.SetActive(true); } private static void DisplayBigBoss(string header, string body, string footer, bool waitForCancel) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) _bigBossFsmUp.actions[1].enabled = !waitForCancel; _bigBossHeader.Text = (LocalStr)header; _bigBossHeader.setTextOn.text = header; _bigBossBody.Text = (LocalStr)body; _bigBossBody.setTextOn.text = body; _bigBossFooter.Text = (LocalStr)footer; _bigBossFooter.setTextOn.text = footer; _bigBoss.SetActive(true); } public static void CancelTitle() { _fsm.SendEvent("FINISHED"); _fsm.SendEvent("NPC TITLE DOWN"); _bigBossFsm.SendEvent("FINISHED"); } } public static class UIUtils { public class LabelledButton : MonoBehaviour { public Label label; private void Start() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) RectTransform component = ((Component)this).GetComponent(); component.sizeDelta = new Vector2(((Text)label.textComponent).preferredWidth * 3f + 10f, ((Text)label.textComponent).preferredHeight * 3f); } } public class Label : MonoBehaviour { public string font = "Perpetua"; public TruncatableText textComponent; private void Start() { ((Text)textComponent).font = GetFont(font); } private void Update() { if (!Object.op_Implicit((Object)(object)((Text)textComponent).font)) { ((Text)textComponent).font = GetFont(font); } } } public class TruncatableText : Text { public bool truncate; protected override void Start() { ((UIBehaviour)this).Start(); if (truncate) { Truncate(); } } private void Update() { if (truncate) { Truncate(); } } public void Truncate() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) while (((Graphic)this).rectTransform.sizeDelta.x < ((Text)this).preferredWidth) { string text = ((Text)this).text; ((Text)this).text = text.Substring(0, text.Length - 4) + "..."; } } } public static readonly Sprite Square = ResourceUtils.LoadSpriteResource("square", (FilterMode)1); public static readonly Color LightGrey = new Color(0.7f, 0.7f, 0.7f); private static readonly Sprite ButtonSprite = ResourceUtils.LoadSpriteResource("button_outline", new Vector2(0.5f, 0.5f), (FilterMode)1, new Vector4(6f, 5f, 6f, 5f)); private static readonly Sprite ButtonSpriteBlank = ResourceUtils.LoadSpriteResource("button_no_outline", new Vector2(0.5f, 0.5f), (FilterMode)1, new Vector4(6f, 5f, 6f, 5f)); private static readonly Vector2 Centre = new Vector2(0.5f, 0.5f); private static readonly Dictionary Fonts = new Dictionary(); public static (Button, Image, Label) MakeButtonWithImage(string name, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, int size, int imageSize, bool doOutline = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); RectTransform val2 = val.AddComponent(); Button val3 = val.AddComponent