Decompiled source of Architect v2.11.2
Architect/Architect.dll
Decompiled 14 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.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.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.Storage; using Architect.Storage.Sharer; using Architect.Utils; 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 Newtonsoft.Json; 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 TMProOld; using TeamCherry.Localization; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Animations; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [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("2.11.2.0")] [assembly: AssemblyInformationalVersion("2.11.2+a2eb9e00fda3e30c034644a7ca18140b86fcdd9b")] [assembly: AssemblyProduct("Architect")] [assembly: AssemblyTitle("Architect")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.11.2.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 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 { [BepInPlugin("com.cometcake575.architect", "Architect", "2.11.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ArchitectPlugin : BaseUnityPlugin { internal static ArchitectPlugin Instance; internal static ManualLogSource Logger; public static readonly Sprite BlankSprite = ResourceUtils.LoadSpriteResource("blank", (FilterMode)1, default(Vector4), 300f); private void Awake() { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Architect has loaded!"); HookUtils.Init(); StorageManager.Init(); Settings.Init(((BaseUnityPlugin)this).Config); MiscFixers.Init(); EnemyFixers.Init(); HazardFixers.Init(); Categories.Init(); PreloadManager.Init(); ActionManager.Init(); CoopManager.Init(); EditManager.Init(); CursorManager.Init(); EditorUI.Init(); VanillaObjects.Init(); UtilityObjects.Init(); AbilityObjects.Init(); MiscObjects.Init(); RespawnMarkerManager.Init(); PlacementManager.Init(); BroadcasterHooks.Init(); LevelSharerUI.Init(); } private void Update() { if (Object.op_Implicit((Object)(object)HeroController.instance)) { EditManager.Update(); HazardFixers.Update(); } CursorManager.Update(); LevelSharerUI.Update(); AbilityObjects.Update(); } } } 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 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 customFsmAction = new CustomFsmAction(action) { EveryFrame = everyFrame }; 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] = (FsmStateAction)(object)customFsmAction; num++; } if (num2 < actions.Length) { array[num] = actions[num2]; } num++; num2++; } state.Actions = array; ((FsmStateAction)customFsmAction).Init(state); } } public static class HeroUtils { [CompilerGenerated] private sealed class <>c__DisplayClass0_0 { public HeroController hero; public Predicate<HeroController> condition; internal bool <FreeControl>b__0() { return !hero.controlReqlinquished && (condition == null || condition(hero)); } } [CompilerGenerated] private sealed class <FreeControl>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HeroController hero; public Predicate<HeroController> condition; private <>c__DisplayClass0_0 <>8__1; private PlayMakerFSM <fsm>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FreeControl>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <fsm>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; <fsm>5__2 = <>8__1.hero.sprintFSM; if (<fsm>5__2.ActiveStateName.Contains("Sprint")) { <fsm>5__2.SendEvent("SKID END"); } <>8__1.hero.umbrellaFSM.SendEvent("END"); <>2__current = (object)new WaitUntil((Func<bool>)(() => !<>8__1.hero.controlReqlinquished && (<>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(<FreeControl>d__0))] public static IEnumerator FreeControl(this HeroController hero, Predicate<HeroController> condition = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FreeControl>d__0(0) { hero = hero, condition = condition }; } } public static class HookUtils { public static Action<HeroController> OnHeroUpdate; public static Action<HeroController> OnHeroAwake; public static Action<PlayMakerFSM> OnFsmAwake; public static void Init() { typeof(PlayMakerFSM).Hook("Awake", (Action<Action<PlayMakerFSM>, PlayMakerFSM>)delegate(Action<PlayMakerFSM> orig, PlayMakerFSM self) { orig(self); OnFsmAwake?.Invoke(self); }); typeof(HeroController).Hook("Update", (Action<Action<HeroController>, HeroController>)delegate(Action<HeroController> orig, HeroController self) { orig(self); OnHeroUpdate?.Invoke(self); }); typeof(HeroController).Hook("Awake", (Action<Action<HeroController>, HeroController>)delegate(Action<HeroController> 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<Type>((ICollection<Type>)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 ObjectUtils { public static T GetOrAddComponent<T>(this GameObject obj) where T : Component { T component = obj.GetComponent<T>(); return Object.op_Implicit((Object)(object)component) ? component : obj.AddComponent<T>(); } public static void RemoveComponent<T>(this GameObject obj) where T : Component { T component = obj.GetComponent<T>(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } public static T ReplaceComponent<T>(this GameObject obj) where T : Component { obj.RemoveComponent<T>(); return obj.AddComponent<T>(); } public static void BroadcastEvent(this GameObject obj, string triggerName) { EventManager.BroadcastEvent(obj, triggerName); } public static void RemoveComponentsInChildren<T>(this GameObject obj) where T : Component { T[] componentsInChildren = obj.GetComponentsInChildren<T>(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; } internal static GameObject GetGameObjectFromArray(GameObject[] objects, string objName) { 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 = ((IEnumerable<GameObject>)objects).FirstOrDefault((Func<GameObject, bool>)((GameObject o) => ((Object)o).name == rootName)); 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 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 ResourceUtils { [CompilerGenerated] private sealed class <LoadClip>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string clipPath; public Action<AudioClip> callback; private UnityWebRequest <www>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadClip>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <www>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; <www>5__1 = UnityWebRequestMultimedia.GetAudioClip(new Uri(clipPath), GetAudioType(clipPath)); <>2__current = <www>5__1.SendWebRequest(); <>1__state = 1; return true; case 1: <>1__state = -1; if ((int)<www>5__1.result == 1) { callback(DownloadHandlerAudioClip.GetContent(<www>5__1)); } else { ArchitectPlugin.Logger.LogInfo((object)<www>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; } [CanBeNull] internal static Sprite LoadSprite(string spritePath, bool point, float ppu) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) 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); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), ppu); } [IteratorStateMachine(typeof(<LoadClip>d__3))] internal static IEnumerator LoadClip(string clipPath, Action<AudioClip> callback) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadClip>d__3(0) { clipPath = clipPath, callback = callback }; } internal static void LoadClipResource(string clipPath, Action<AudioClip> 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 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<RectTransform>(); component.sizeDelta = new Vector2(label.textComponent.preferredWidth * 3f + 10f, label.textComponent.preferredHeight * 3f); } } public class Label : MonoBehaviour { public string font = "Perpetua"; public Text textComponent; private void Start() { textComponent.font = GetFont(font); } } private 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 Vector2 Centre = new Vector2(0.5f, 0.5f); private static readonly Dictionary<string, Font> Fonts = new Dictionary<string, Font>(); public static (Button, Image, Label) MakeButtonWithImage(string name, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, int size, int imageSize) { //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_0040: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00a6: 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_00c5: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); RectTransform val2 = val.AddComponent<RectTransform>(); Button val3 = val.AddComponent<Button>(); Image val4 = val.AddComponent<Image>(); ColorBlock colors = ((Selectable)val3).colors; ((ColorBlock)(ref colors)).pressedColor = LightGrey; ((ColorBlock)(ref colors)).fadeDuration = 0.1f; ((Selectable)val3).colors = colors; ((Selectable)val3).targetGraphic = (Graphic)(object)val4; val4.sprite = ButtonSprite; val4.type = (Type)1; ((Transform)val2).SetParent(parent.transform, false); val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; val2.sizeDelta = new Vector2((float)size, (float)size); Transform transform = val.transform; transform.localScale /= 3f; val2.anchoredPosition = pos; GameObject val5 = new GameObject("Image"); val5.transform.SetParent((Transform)(object)val2, false); val5.AddComponent<RectTransform>().sizeDelta = new Vector2((float)imageSize, (float)imageSize); Image val6 = val5.AddComponent<Image>(); val6.preserveAspect = true; Label label = MakeLabel(name + " Label", val, Vector2.zero, Centre, Centre, 80f, 80f, (HorizontalWrapMode)1); label.textComponent.alignment = (TextAnchor)4; return (val3, val6, label); } public static (Button, Label) MakeTextButton(string name, string text, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, bool hasOutline = true, Vector2 size = default(Vector2)) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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) GameObject val = new GameObject(name); RectTransform val2 = val.AddComponent<RectTransform>(); Button val3 = val.AddComponent<Button>(); Label label; if (hasOutline) { label = MakeLabel(name + " Label", parent, pos, anchorMin, anchorMax, 80f, 80f, (HorizontalWrapMode)1); Image val5 = (Image)(object)(((Selectable)val3).targetGraphic = (Graphic)(object)val.AddComponent<Image>()); val5.sprite = ButtonSprite; val5.type = (Type)1; ColorBlock colors = ((Selectable)val3).colors; ((ColorBlock)(ref colors)).pressedColor = LightGrey; ((ColorBlock)(ref colors)).fadeDuration = 0.1f; ((Selectable)val3).colors = colors; label.textComponent.fontSize = 8; } else { label = MakeLabel(name + " Label", val, Vector2.zero, Centre, Centre, 80f, 80f, (HorizontalWrapMode)1); ((Selectable)val3).targetGraphic = (Graphic)(object)label.textComponent; ((Component)label).transform.SetParent((Transform)(object)val2); label.textComponent.fontSize = 44; Transform transform = ((Component)label).transform; transform.localScale /= 3f; } label.textComponent.alignment = (TextAnchor)4; label.textComponent.text = text; ((Transform)val2).SetParent(parent.transform, false); val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; Transform transform2 = val.transform; transform2.localScale /= 3f; val2.anchoredPosition = pos; if (size == Vector2.zero) { val.AddComponent<LabelledButton>().label = label; } else { val2.sizeDelta = size; } return (val3, label); } public static (InputField, Label) MakeTextbox(string name, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, float width, float height, int fontSize = 20) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001b: 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_0033: 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_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0109: 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) //IL_0120: 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_0136: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); RectTransform val2 = val.AddComponent<RectTransform>(); InputField val3 = val.AddComponent<InputField>(); val2.sizeDelta = new Vector2(width, height); Label label = MakeLabel(name + " Label", parent, pos, anchorMin, anchorMax, width - 15f, 80f, (HorizontalWrapMode)1); Image val5 = (Image)(object)(((Selectable)val3).targetGraphic = (Graphic)(object)val.AddComponent<Image>()); val5.sprite = ButtonSprite; val5.type = (Type)1; ColorBlock colors = ((Selectable)val3).colors; ((ColorBlock)(ref colors)).selectedColor = LightGrey; ((ColorBlock)(ref colors)).pressedColor = LightGrey; ((ColorBlock)(ref colors)).fadeDuration = 0.1f; ((Selectable)val3).colors = colors; val3.textComponent = label.textComponent; val3.textComponent.supportRichText = false; label.textComponent.fontSize = fontSize; Transform transform = ((Component)label).transform; transform.localScale /= 3f; label.textComponent.alignment = (TextAnchor)3; ((Transform)val2).SetParent(parent.transform, false); val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; Transform transform2 = val.transform; transform2.localScale /= 3f; val2.anchoredPosition = pos; return (val3, label); } public static Label MakeLabel(string name, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, float maxWidth = 80f, float maxHeight = 80f, HorizontalWrapMode wrapMode = 1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0035: 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_005b: 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_0074: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); RectTransform val2 = val.AddComponent<RectTransform>(); Label label = val.AddComponent<Label>(); label.textComponent = val.AddComponent<Text>(); label.textComponent.supportRichText = false; label.textComponent.horizontalOverflow = wrapMode; ((Transform)val2).SetParent(parent.transform, false); ((Transform)val2).SetAsFirstSibling(); val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; val2.sizeDelta = new Vector2(maxWidth, maxHeight); val2.anchoredPosition = pos; return label; } public static Font GetFont(string fontName) { if (Fonts.TryGetValue(fontName, out var value)) { return value; } Font[] array = Resources.FindObjectsOfTypeAll<Font>(); foreach (Font val in array) { if (((Object)val).name == fontName) { Fonts[fontName] = val; return val; } } return Fonts.GetValueOrDefault(fontName); } public static Image MakeImage(string name, GameObject parent, Vector2 pos, Vector2 anchorMin, Vector2 anchorMax, Vector2 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0023: 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_0033: 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_005a: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent.transform, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchoredPosition = pos; val2.anchorMin = anchorMin; val2.anchorMax = anchorMax; val2.sizeDelta = size; Image val3 = val.AddComponent<Image>(); val3.preserveAspect = false; Transform transform = val.transform; transform.localScale *= 0.5f; return val3; } } public static class ZipUtils { private static void CopyTo(Stream src, Stream dest) { byte[] array = new byte[4096]; int count; while ((count = src.Read(array, 0, array.Length)) != 0) { dest.Write(array, 0, count); } } public static byte[] Zip(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); using MemoryStream src = new MemoryStream(bytes); using MemoryStream memoryStream = new MemoryStream(); using (GZipStream dest = new GZipStream(memoryStream, CompressionMode.Compress)) { CopyTo(src, dest); } return memoryStream.ToArray(); } public static string Unzip(byte[] bytes) { using MemoryStream stream = new MemoryStream(bytes); using MemoryStream memoryStream = new MemoryStream(); using (GZipStream src = new GZipStream(stream, CompressionMode.Decompress)) { CopyTo(src, memoryStream); } return Encoding.UTF8.GetString(memoryStream.ToArray()); } } } namespace Architect.Storage { public static class CustomAssetManager { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public string url; internal void <LoadSound>b__0(AudioClip clip) { if (Object.op_Implicit((Object)(object)clip)) { Sounds[url] = clip; } LoadingSounds.Remove(url); } } [CompilerGenerated] private sealed class <>c__DisplayClass10_1 { public string path; public <>c__DisplayClass10_0 CS$<>8__locals1; internal Task<bool> <LoadSound>b__1() { return SaveFile(CS$<>8__locals1.url, path); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_0 { public string url; public string path; internal Task<bool> <LoadVideo>b__0() { return SaveFile(url, path); } } [CompilerGenerated] private sealed class <>c__DisplayClass8_0 { public string url; } [CompilerGenerated] private sealed class <>c__DisplayClass8_1 { public string path; public <>c__DisplayClass8_0 CS$<>8__locals1; internal Task<bool> <LoadSprite>b__0() { return SaveFile(CS$<>8__locals1.url, path); } } [CompilerGenerated] private sealed class <LoadSound>d__10 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string url; public GameObject obj; private <>c__DisplayClass10_0 <>8__1; private <>c__DisplayClass10_1 <>8__2; private Task<bool> <task>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadSound>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>8__2 = null; <task>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.url = url; if (LoadingSounds.Contains(<>8__1.url)) { return false; } if (Sounds.ContainsKey(<>8__1.url)) { break; } <>8__2 = new <>c__DisplayClass10_1(); <>8__2.CS$<>8__locals1 = <>8__1; LoadingSounds.Add(<>8__2.CS$<>8__locals1.url); <>8__2.path = GetPath(<>8__2.CS$<>8__locals1.url) + ".wav"; if (!File.Exists(<>8__2.path)) { <task>5__3 = Task.Run(() => SaveFile(<>8__2.CS$<>8__locals1.url, <>8__2.path)); goto IL_0136; } goto IL_0152; case 1: <>1__state = -1; goto IL_0136; case 2: { <>1__state = -1; <>8__2 = null; break; } IL_0136: if (!<task>5__3.IsCompleted) { <>2__current = null; <>1__state = 1; return true; } <task>5__3 = null; goto IL_0152; IL_0152: <>2__current = ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(ResourceUtils.LoadClip(<>8__2.path, delegate(AudioClip clip) { if (Object.op_Implicit((Object)(object)clip)) { Sounds[<>8__2.CS$<>8__locals1.url] = clip; } LoadingSounds.Remove(<>8__2.CS$<>8__locals1.url); })); <>1__state = 2; return true; } if (Object.op_Implicit((Object)(object)obj)) { obj.GetComponent<WavObject>().sound = Sounds[<>8__1.url]; } 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 <LoadSprite>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string url; public bool point; public float ppu; public GameObject obj; private <>c__DisplayClass8_0 <>8__1; private string <id>5__2; private <>c__DisplayClass8_1 <>8__3; private Sprite <tmp>5__4; private Task<bool> <task>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadSprite>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <id>5__2 = null; <>8__3 = null; <tmp>5__4 = null; <task>5__5 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass8_0(); <>8__1.url = url; <id>5__2 = <>8__1.url + (point ? "_point_" : "_bilinear_") + ppu; if (!Sprites.ContainsKey(<id>5__2)) { <>8__3 = new <>c__DisplayClass8_1(); <>8__3.CS$<>8__locals1 = <>8__1; <>8__3.path = GetPath(<>8__3.CS$<>8__locals1.url) + ".png"; <tmp>5__4 = ResourceUtils.LoadSprite(<>8__3.path, point, ppu); if (!Object.op_Implicit((Object)(object)<tmp>5__4)) { <task>5__5 = Task.Run(() => SaveFile(<>8__3.CS$<>8__locals1.url, <>8__3.path)); goto IL_014d; } goto IL_0189; } goto IL_01af; case 1: <>1__state = -1; goto IL_014d; case 2: { <>1__state = -1; return false; } IL_014d: if (!<task>5__5.IsCompleted) { <>2__current = null; <>1__state = 1; return true; } <tmp>5__4 = ResourceUtils.LoadSprite(<>8__3.path, point, ppu); <task>5__5 = null; goto IL_0189; IL_01af: if (Object.op_Implicit((Object)(object)obj)) { obj.GetComponent<SpriteRenderer>().sprite = Sprites[<id>5__2]; } <>2__current = null; <>1__state = 2; return true; IL_0189: Sprites[<id>5__2] = <tmp>5__4; <>8__3 = null; <tmp>5__4 = null; goto IL_01af; } } 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 <LoadVideo>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string url; public float? scale; public VideoPlayer player; private <>c__DisplayClass6_0 <>8__1; private Task<bool> <task>5__2; private float <sc>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadVideo>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <task>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass6_0(); <>8__1.url = url; <>8__1.path = GetPath(<>8__1.url) + ".mov"; if (!File.Exists(<>8__1.path)) { <task>5__2 = Task.Run(() => SaveFile(<>8__1.url, <>8__1.path)); goto IL_00bf; } goto IL_00d9; case 1: <>1__state = -1; goto IL_00bf; case 2: { <>1__state = -1; goto IL_011c; } IL_00d9: if (!Object.op_Implicit((Object)(object)player)) { break; } player.url = <>8__1.path; goto IL_011c; IL_00bf: if (!<task>5__2.IsCompleted) { <>2__current = null; <>1__state = 1; return true; } <task>5__2 = null; goto IL_00d9; IL_011c: if (player.width == 0) { <>2__current = null; <>1__state = 2; return true; } <sc>5__3 = scale.GetValueOrDefault(EditManager.CurrentScale); Extensions.SetScaleX(((Component)player).transform, <sc>5__3 * (float)player.width / 100f); Extensions.SetScaleY(((Component)player).transform, <sc>5__3 * (float)player.height / 100f); break; } 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(); } } public static readonly Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>(); public static readonly Dictionary<string, AudioClip> Sounds = new Dictionary<string, AudioClip>(); public static readonly HashSet<string> LoadingSounds = new HashSet<string>(); public static async Task<bool> SaveFile(string url, string path) { try { WebClient webClient = new WebClient(); await webClient.DownloadFileTaskAsync(url, path); return true; } catch { return false; } } public static void WipeAssets() { foreach (Sprite value in Sprites.Values) { Object.Destroy((Object)(object)value); } foreach (AudioClip value2 in Sounds.Values) { Object.Destroy((Object)(object)value2); } Sprites.Clear(); Sounds.Clear(); } public static void DoLoadVideo(VideoPlayer player, float? scale, string url) { ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadVideo(url, scale, player)); } [IteratorStateMachine(typeof(<LoadVideo>d__6))] private static IEnumerator LoadVideo(string url, float? scale, [CanBeNull] VideoPlayer player = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadVideo>d__6(0) { url = url, scale = scale, player = player }; } public static void DoLoadSprite([CanBeNull] GameObject obj, string url, bool point, float ppu) { ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadSprite(url, point, ppu, obj)); } [IteratorStateMachine(typeof(<LoadSprite>d__8))] private static IEnumerator LoadSprite(string url, bool point, float ppu, [CanBeNull] GameObject obj = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadSprite>d__8(0) { url = url, point = point, ppu = ppu, obj = obj }; } public static void DoLoadSound(GameObject obj, string url) { ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(LoadSound(url, obj)); } [IteratorStateMachine(typeof(<LoadSound>d__10))] private static IEnumerator LoadSound(string url, [CanBeNull] GameObject obj = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadSound>d__10(0) { url = url, obj = obj }; } public static string GetPath(string url) { string text = Path.GetInvalidFileNameChars().Aggregate(url, (string current, char c) => current.Replace(c, '_')); return StorageManager.DataPath + "Assets/" + text; } public static async Task<bool> TryDownloadAssets(StringConfigValue config) { string fileType = null; if (config.GetTypeId().Equals("png_url")) { fileType = ".png"; } else if (config.GetTypeId().Equals("wav_url")) { fileType = ".wav"; } else if (config.GetTypeId().Equals("mp4_url")) { fileType = ".mov"; } if (fileType == null) { return true; } string url = config.GetValue(); return await SaveFile(url, GetPath(url) + fileType); } } public static class Settings { public class Keybind { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private KeyCode <code>P; public bool IsPressed => Input.GetKey(<code>P); public bool WasPressed => Input.GetKeyDown(<code>P); public Keybind(KeyCode code) { //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) <code>P = code; base..ctor(); } } public static Keybind ToggleEditor; public static Keybind Rotate; public static Keybind UnsafeRotation; public static Keybind Flip; public static Keybind ScaleUp; public static Keybind ScaleDown; public static Keybind SavePrefab; public static Keybind LockAxis; public static Keybind Undo; public static Keybind Redo; public static Keybind MultiSelect; public static Keybind Copy; public static Keybind Paste; public static Keybind Preview; public static Keybind Overwrite; public static Keybind GrabId; public static Keybind Blank; public static Keybind Cursor; public static Keybind Drag; public static Keybind Eraser; public static Keybind Pick; public static Keybind Reset; public static Keybind Lock; public static Keybind TileChanger; public static bool TestMode; public static bool ShowRespawnPoint; public static void Init(ConfigFile config) { //IL_0018: 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_0067: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) ToggleEditor = new Keybind(config.Bind<KeyCode>("Keybinds", "EditToggle", (KeyCode)101, "Toggles Edit Mode").Value); Rotate = new Keybind(config.Bind<KeyCode>("Keybinds", "Rotate", (KeyCode)114, "Rotates the object on the cursor").Value); UnsafeRotation = new Keybind(config.Bind<KeyCode>("Keybinds", "UnsafeRotation", (KeyCode)308, "Allows rotating objects at any angle").Value); Flip = new Keybind(config.Bind<KeyCode>("Keybinds", "Flip", (KeyCode)102, "Flips the object on the cursor").Value); ScaleUp = new Keybind(config.Bind<KeyCode>("Keybinds", "ScaleUp", (KeyCode)61, "Increases the scale of the object on the cursor").Value); ScaleDown = new Keybind(config.Bind<KeyCode>("Keybinds", "ScaleDown", (KeyCode)45, "Decreases the scale of the object on the cursor").Value); SavePrefab = new Keybind(config.Bind<KeyCode>("Keybinds", "SavePrefab", (KeyCode)13, "Saves the object on the cursor as a prefab").Value); LockAxis = new Keybind(config.Bind<KeyCode>("Keybinds", "LockAxis", (KeyCode)303, "Locks the current X or Y axis to the axis of the last placed object").Value); Undo = new Keybind(config.Bind<KeyCode>("Keybinds", "Undo", (KeyCode)122, "Undoes the last action").Value); Redo = new Keybind(config.Bind<KeyCode>("Keybinds", "Redo", (KeyCode)121, "Redoes the last action").Value); MultiSelect = new Keybind(config.Bind<KeyCode>("Keybinds", "MultiSelect", (KeyCode)306, "Allows selecting multiple objects with the Drag tool").Value); Copy = new Keybind(config.Bind<KeyCode>("Keybinds", "Copy", (KeyCode)99, "Copies the current selection of objects").Value); Paste = new Keybind(config.Bind<KeyCode>("Keybinds", "Paste", (KeyCode)118, "Pastes the objects on the clipboard").Value); Preview = new Keybind(config.Bind<KeyCode>("Keybinds", "Preview", (KeyCode)112, "Preview objects affected by the Object Anchor").Value); Overwrite = new Keybind(config.Bind<KeyCode>("Keybinds", "Overwrite", (KeyCode)111, "Overwrites a clicked object with the one on your cursor").Value); GrabId = new Keybind(config.Bind<KeyCode>("Keybinds", "GrabId", (KeyCode)105, "Sets the ID option of the object on the cursor to the selected object's ID").Value); Blank = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Blank", (KeyCode)0, "Clears your current selected item").Value); Cursor = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Cursor", (KeyCode)0, "Sets your current selected item to the Cursor tool").Value); Drag = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Drag", (KeyCode)0, "Sets your current selected item to the Drag tool").Value); Eraser = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Eraser", (KeyCode)0, "Sets your current selected item to the Eraser tool").Value); Pick = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Pick", (KeyCode)0, "Sets your current selected item to the Pick tool").Value); Reset = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Reset", (KeyCode)0, "Sets your current selected item to the Reset tool").Value); TileChanger = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "TilemapChanger", (KeyCode)0, "Sets your current selected item to the Tilemap Changer tool").Value); Lock = new Keybind(config.Bind<KeyCode>("ToolHotkeys", "Lock", (KeyCode)0, "Locks an object in place so it cannot be edited until unlocked").Value); TestMode = config.Bind<bool>("Options", "TestMode", false, "Stops the game from storing persistent data in such as enemies being killed").Value; ShowRespawnPoint = config.Bind<bool>("Options", "ShowRespawnPoint", false, "Adds an indicator showing your current hazard respawn point").Value; } } public static class StorageManager { [CompilerGenerated] private sealed class <>c__DisplayClass17_0 { public Task<bool> download; internal bool <LoadLevelData>b__1() { return download.IsCompleted; } } [CompilerGenerated] private sealed class <LoadLevelData>d__17 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Dictionary<string, LevelData> levels; public string levelId; public Text status; private float <startTime>5__1; private bool <passed>5__2; private float <elapsed>5__3; private Dictionary<string, LevelData>.Enumerator <>s__4; private string <scene>5__5; private LevelData <data>5__6; private IEnumerator<StringConfigValue> <>s__7; private StringConfigValue <config>5__8; private <>c__DisplayClass17_0 <>8__9; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadLevelData>d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || num == 1) { try { if (num == -4 || num == 1) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } <>s__4 = default(Dictionary<string, LevelData>.Enumerator); <scene>5__5 = null; <data>5__6 = null; <>s__7 = null; <config>5__8 = null; <>8__9 = null; <>1__state = -2; } private bool MoveNext() { //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; WipeLevelData(); <startTime>5__1 = Time.realtimeSinceStartup; <passed>5__2 = true; <>s__4 = levels.GetEnumerator(); <>1__state = -3; goto IL_01b5; case 1: <>1__state = -4; if (!<>8__9.download.Result) { <passed>5__2 = false; } <>8__9 = null; <config>5__8 = null; goto IL_0176; case 2: { <>1__state = -1; break; } IL_0176: if (<>s__7.MoveNext()) { <config>5__8 = <>s__7.Current; <>8__9 = new <>c__DisplayClass17_0(); <>8__9.download = CustomAssetManager.TryDownloadAssets(<config>5__8); <>2__current = (object)new WaitUntil((Func<bool>)(() => <>8__9.download.IsCompleted)); <>1__state = 1; return true; } <>m__Finally2(); <>s__7 = null; SaveScene(<scene>5__5, <data>5__6); <scene>5__5 = null; <data>5__6 = null; goto IL_01b5; IL_01b5: if (<>s__4.MoveNext()) { <>s__4.Current.Deconstruct(out var key, out var value); <scene>5__5 = key; <data>5__6 = value; <>s__7 = <data>5__6.Placements.SelectMany((ObjectPlacement obj) => obj.Config).OfType<StringConfigValue>().GetEnumerator(); <>1__state = -4; goto IL_0176; } <>m__Finally1(); <>s__4 = default(Dictionary<string, LevelData>.Enumerator); <elapsed>5__3 = Time.realtimeSinceStartup - <startTime>5__1; if (<elapsed>5__3 < 1f) { <>2__current = (object)new WaitForSeconds(1f - <elapsed>5__3); <>1__state = 2; return true; } break; } LevelSharerUI.CurrentlyDownloading = false; LevelSharerUI.RefreshActiveOptions(); status.text = "Download Complete" + (<passed>5__2 ? "" : "\nSome assets could not be downloaded"); return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__4).Dispose(); } private void <>m__Finally2() { <>1__state = -3; if (<>s__7 != null) { <>s__7.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static readonly LevelData.LevelDataConverter Ldc = new LevelData.LevelDataConverter(); internal static readonly ObjectPlacement.ObjectPlacementConverter Opc = new ObjectPlacement.ObjectPlacementConverter(); public static string DataPath; private static readonly Dictionary<string, List<IScheduledEdit>> ScheduledEdits = new Dictionary<string, List<IScheduledEdit>>(); public static void Init() { DataPath = Path.GetFullPath(Application.persistentDataPath + "/Architect/"); Directory.CreateDirectory(DataPath + "Scenes/"); Directory.CreateDirectory(DataPath + "Assets/"); Directory.CreateDirectory(DataPath + "ModAssets/"); typeof(GameManager).Hook("SaveGame", (Action<Action<GameManager, Action<bool>>, GameManager, Action<bool>>)delegate(Action<GameManager, Action<bool>> orig, GameManager self, Action<bool> callback) { SaveFavourites(FavouritesCategory.Favourites); SavePrefabs(PrefabsCategory.Prefabs); if (EditManager.IsEditing) { SaveScene(GameManager.instance.sceneName, PlacementManager.GetLevelData()); } foreach (var (scene, edits) in ScheduledEdits) { ApplyScheduledEdits(scene, edits); } ScheduledEdits.Clear(); orig(self, callback); }, typeof(Action<bool>)); } public static void SaveScene(string scene, LevelData level) { string path = DataPath + "Scenes/" + scene + ".architect.json"; if (File.Exists(path)) { File.Delete(path); } if (Extensions.IsNullOrEmpty<ObjectPlacement>((ICollection<ObjectPlacement>)level.Placements) && Extensions.IsNullOrEmpty<(int, int)>((ICollection<(int, int)>)level.TilemapChanges)) { return; } string value = SerializeLevel(level, (Formatting)1); using FileStream stream = File.Create(path); using StreamWriter streamWriter = new StreamWriter(stream); streamWriter.Write(value); } public static LevelData LoadScene(string scene) { if (ScheduledEdits.Remove(scene, out var value)) { return ApplyScheduledEdits(scene, value); } string path = DataPath + "Scenes/" + scene + ".architect.json"; return File.Exists(path) ? DeserializeLevel(File.ReadAllText(path)) : new LevelData(new List<ObjectPlacement>(), new List<(int, int)>()); } public static LevelData DeserializeLevel(string data) { return JsonConvert.DeserializeObject<LevelData>(data); } public static List<ObjectPlacement> DeserializePlacements(string data) { return JsonConvert.DeserializeObject<List<ObjectPlacement>>(data); } public static string SerializeLevel(LevelData level, Formatting formatting) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return JsonConvert.SerializeObject((object)level, formatting, (JsonConverter[])(object)new JsonConverter[2] { (JsonConverter)Ldc, (JsonConverter)Opc }); } public static string SerializePlacements(List<ObjectPlacement> placements) { return JsonConvert.SerializeObject((object)placements, (Formatting)1, (JsonConverter[])(object)new JsonConverter[1] { (JsonConverter)Opc }); } public static void SaveFavourites(List<string> favourites) { string path = DataPath + "favourites.json"; if (File.Exists(path)) { File.Delete(path); } string value = JsonConvert.SerializeObject((object)favourites); using FileStream stream = File.Create(path); using StreamWriter streamWriter = new StreamWriter(stream); streamWriter.Write(value); } public static List<string> LoadFavourites() { string path = DataPath + "favourites.json"; return File.Exists(path) ? JsonConvert.DeserializeObject<List<string>>(File.ReadAllText(path)) : new List<string>(); } public static void SavePrefabs(List<PrefabObject> prefabs) { string path = DataPath + "prefabs.json"; if (File.Exists(path)) { File.Delete(path); } string value = SerializePlacements(prefabs.Select((PrefabObject obj) => obj.Placement).ToList()); using FileStream stream = File.Create(path); using StreamWriter streamWriter = new StreamWriter(stream); streamWriter.Write(value); } public static List<PrefabObject> LoadPrefabs() { string path = DataPath + "prefabs.json"; return File.Exists(path) ? (from obj in DeserializePlacements(File.ReadAllText(path)) select new PrefabObject(obj)).ToList() : new List<PrefabObject>(); } public static string SerializeAllScenes() { Dictionary<string, LevelData> dictionary = new Dictionary<string, LevelData>(); string[] files = Directory.GetFiles(DataPath + "Scenes/"); foreach (string path in files) { string fileName = Path.GetFileName(path); if (fileName.EndsWith(".architect.json")) { string text = fileName.Replace(".architect.json", ""); dictionary[text] = LoadScene(text); } } return JsonConvert.SerializeObject((object)dictionary, (Formatting)0, (JsonConverter[])(object)new JsonConverter[2] { (JsonConverter)Ldc, (JsonConverter)Opc }); } private static void WipeLevelData() { string[] files = Directory.GetFiles(DataPath + "Scenes/"); foreach (string path in files) { File.Delete(path); } string[] files2 = Directory.GetFiles(DataPath + "Assets/"); foreach (string path2 in files2) { File.Delete(path2); } CustomAssetManager.WipeAssets(); } [IteratorStateMachine(typeof(<LoadLevelData>d__17))] public static IEnumerator LoadLevelData(Dictionary<string, LevelData> levels, string levelId, Text status) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadLevelData>d__17(0) { levels = levels, levelId = levelId, status = status }; } public static void SaveApiKey([CanBeNull] string key) { string path = DataPath + "key.txt"; if (File.Exists(path)) { File.Delete(path); } if (key == null) { return; } using FileStream stream = File.Create(path); using StreamWriter streamWriter = new StreamWriter(stream); streamWriter.Write(key); } [CanBeNull] public static string LoadApiKey() { string path = DataPath + "key.txt"; return File.Exists(path) ? File.ReadAllText(path) : null; } public static void ScheduleEdit(string scene, IScheduledEdit edit) { if (!ScheduledEdits.TryGetValue(scene, out var value)) { List<IScheduledEdit> list2 = (ScheduledEdits[scene] = new List<IScheduledEdit>()); value = list2; } value.Add(edit); } public static LevelData ApplyScheduledEdits(string scene, List<IScheduledEdit> edits) { LevelData levelData = LoadScene(scene); foreach (IScheduledEdit edit in edits) { edit.ExecuteScheduled(levelData); } SaveScene(scene, levelData); return levelData; } public static void WipeScheduledEdits(string scene) { ScheduledEdits.Remove(scene); } } } namespace Architect.Storage.Sharer { public static class LevelSharerUI { private enum SortBy { MostDownloads, Newest } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__30_1; public static UnityAction <>9__34_2; public static UnityAction <>9__37_0; public static UnityAction <>9__37_1; public static Func<Dictionary<string, string>, int> <>9__38_0; internal void <SetupSearchArea>b__30_1() { Task.Run((Func<Task?>)PerformSearch); } internal void <SetupLoginArea>b__34_2() { APIKey = null; RefreshActiveOptions(); } internal void <SetupLevelsArea>b__37_0() { _index--; if (_index < 0) { _index = _currentLevels.Count / 6; } RefreshCurrentLevels(); } internal void <SetupLevelsArea>b__37_1() { _index = (_index + 1) % ((_currentLevels.Count - 1) / 6 + 1); RefreshCurrentLevels(); } internal int <RefreshCurrentLevels>b__38_0(Dictionary<string, string> c) { return Convert.ToInt32(c["downloads"]); } } [CompilerGenerated] private sealed class <FadeGameTitle>d__26 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private SpriteRenderer <sprite>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FadeGameTitle>d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <sprite>5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <sprite>5__1 = _uiManager.gameTitle; goto IL_00cd; case 1: <>1__state = -1; goto IL_00cd; case 2: { <>1__state = -1; return false; } IL_00cd: if ((double)<sprite>5__1.color.a > 0.0 && _viewing) { <sprite>5__1.color = new Color(<sprite>5__1.color.r, <sprite>5__1.color.g, <sprite>5__1.color.b, <sprite>5__1.color.a - Time.unscaledDeltaTime * 3.2f); <>2__current = null; <>1__state = 1; return true; } <sprite>5__1.color = new Color(<sprite>5__1.color.r, <sprite>5__1.color.g, <sprite>5__1.color.b, (float)((!_viewing) ? 1 : 0)); if (_viewing) { _levelSharerObj.SetActive(true); _backgroundObj.SetActive(true); } <>2__current = null; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GetSprite>d__39 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Image image; public int pageIndex; public string url; private UnityWebRequest <www>5__1; private Texture2D <tex>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GetSprite>d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <www>5__1 = null; <tex>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 //IL_00ba: 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_00c7: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <www>5__1 = UnityWebRequestTexture.GetTexture(url); <>2__current = <www>5__1.SendWebRequest(); <>1__state = 1; return true; case 1: <>1__state = -1; if (_index != pageIndex) { return false; } if ((int)<www>5__1.result == 1) { <tex>5__2 = DownloadHandlerTexture.GetContent(<www>5__1); image.sprite = Sprite.Create(<tex>5__2, new Rect(0f, 0f, (float)((Texture)<tex>5__2).width, (float)((Texture)<tex>5__2).height), default(Vector2)); <tex>5__2 = null; } 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 const float MENU_FADE_SPEED = 3.2f; private const int LEVELS_PER_PAGE = 6; public static bool CurrentlyDownloading; private static int _index; private static List<Dictionary<string, string>> _orderedCurrentLevels; private static List<Dictionary<string, string>> _currentLevels; private static readonly List<(Text, Text, Text, GameObject, GameObject, GameObject, GameObject, Image)> DownloadChoices = new List<(Text, Text, Text, GameObject, GameObject, GameObject, GameObject, Image)>(); [CanBeNull] private static string _apiKey = StorageManager.LoadApiKey(); private static GameObject _canvasObj; private static GameObject _levelSharerObj; private static GameObject _backgroundObj; private static UIManager _uiManager; private static bool _viewing; private static InputField _descriptionInput; private static InputField _creatorInput; private static readonly List<Selectable> InteractableWhenLoggedIn = new List<Selectable>(); private static readonly List<Selectable> InteractableWhenLoggedOut = new List<Selectable>(); private static readonly List<Selectable> UninteractableWhenDownloading = new List<Selectable>(); private static SortBy _currentSortBy = SortBy.MostDownloads; [CanBeNull] public static string APIKey { get { return _apiKey; } set { StorageManager.SaveApiKey(value); _apiKey = value; } } public static void Init() { SetupCanvas(); SetupBackground(); SetupSwitchArea(); SetupSearchArea(); SetupLevelsArea(); SetupUploadArea(); SetupLoginArea(); RefreshActiveOptions(); } public static void Update() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)_uiManager)) { _uiManager = Object.FindAnyObjectByType<UIManager>(); if (!Object.op_Implicit((Object)(object)_uiManager)) { return; } } _canvasObj.SetActive((int)_uiManager.menuState == 1 && PreloadManager.HasPreloaded); } private static void SetupCanvas() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0085: 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) //IL_009d: 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) _canvasObj = new GameObject("[Architect] Level Sharer Canvas"); _canvasObj.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_canvasObj); _canvasObj.AddComponent<Canvas>().renderMode = (RenderMode)0; CanvasScaler val = _canvasObj.AddComponent<CanvasScaler>(); val.uiScaleMode = (ScaleMode)1; val.screenMatchMode = (ScreenMatchMode)1; _canvasObj.AddComponent<GraphicRaycaster>(); _levelSharerObj = new GameObject("Level Sharer"); _levelSharerObj.SetActive(false); RectTransform val2 = _levelSharerObj.AddComponent<RectTransform>(); val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; ((Transform)val2).SetParent(_canvasObj.transform, false); } private static void SetupBackground() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0057: Unknown result type (might be due to invalid IL or missing references) Image val = UIUtils.MakeImage("Background", _canvasObj, Vector2.op_Implicit(Vector3.zero), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(3000f, 3000f)); val.sprite = ResourceUtils.LoadSpriteResource("level_sharer_bg", (FilterMode)1); _backgroundObj = ((Component)val).gameObject; _backgroundObj.SetActive(false); _backgroundObj.transform.SetAsFirstSibling(); } private static void SetupSwitchArea() { //IL_0010: 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) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown Sprite openEditor = ResourceUtils.LoadSpriteResource("level_sharer_open", (FilterMode)1); Sprite closeEditor = ResourceUtils.LoadSpriteResource("level_sharer_close", (FilterMode)1); var (val, img, _) = UIUtils.MakeButtonWithImage("Toggle Sharer UI", _canvasObj, Vector2.op_Implicit(new Vector3(-50f, -50f)), new Vector2(1f, 1f), new Vector2(1f, 1f), 220, 220); img.sprite = openEditor; UninteractableWhenDownloading.Add((Selectable)(object)val); ((UnityEvent)val.onClick).AddListener((UnityAction)delegate { _viewing = !_viewing; if (_viewing) { img.sprite = closeEditor; ((MonoBehaviour)_uiManager).StartCoroutine(FadeGameTitle()); ((MonoBehaviour)_uiManager).StartCoroutine(_uiManager.FadeOutCanvasGroup(_uiManager.mainMenuScreen, true, false)); PerformSearch(); } else { img.sprite = openEditor; _levelSharerObj.SetActive(false); _backgroundObj.SetActive(false); _uiManager.UIGoToMainMenu(); } }); } [IteratorStateMachine(typeof(<FadeGameTitle>d__26))] private static IEnumerator FadeGameTitle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FadeGameTitle>d__26(0); } private static void MakeTitleText(string text, int xPos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Text textComponent = UIUtils.MakeLabel(text, _levelSharerObj, new Vector2((float)xPos, -25f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), 80f, 80f, (HorizontalWrapMode)1).textComponent; textComponent.text = text; textComponent.fontSize = 18; textComponent.alignment = (TextAnchor)4; } private static InputField MakeTitleOption(string name, int xPos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) return UIUtils.MakeTextbox(name, _levelSharerObj, new Vector2((float)xPos, -50f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), 600f, 60f, 30).Item1; } private static void SetupSearchArea() { //IL_0070: 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_008e: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown MakeTitleText("Name/Description", -220); MakeTitleText("Creator", 0); MakeTitleText("Sort By", 190); _descriptionInput = MakeTitleOption("Description Input", -220); _creatorInput = MakeTitleOption("Creator Input", 0); var (val, label) = UIUtils.MakeTextButton("Sort By Button", "Sort By", _levelSharerObj, new Vector2(189f, -50f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), hasOutline: true, new Vector2(300f, 60f)); label.textComponent.fontSize = 10; label.textComponent.text = GetSortByText(_currentSortBy); ((UnityEvent)val.onClick).AddListener((UnityAction)delegate { _currentSortBy = ((_currentSortBy != SortBy.Newest) ? SortBy.Newest : SortBy.MostDownloads); label.textComponent.text = GetSortByText(_currentSortBy); _index = 0; RefreshCurrentLevels(); }); var (val2, label2) = UIUtils.MakeTextButton("Search Button", "Search", _levelSharerObj, new Vector2(0f, -80f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), hasOutline: true, new Vector2(140f, 60f)); label2.textComponent.fontSize = 14; ButtonClickedEvent onClick = val2.onClick; object obj = <>c.<>9__30_1; if (obj == null) { UnityAction val3 = delegate { Task.Run((Func<Task?>)PerformSearch); }; <>c.<>9__30_1 = val3; obj = (object)val3; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } private static Button MakeLoginButton(string text, Vector2 pos) { //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_000e: 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) return UIUtils.MakeTextButton(text, text, _levelSharerObj, pos, Vector2.zero, Vector2.zero, hasOutline: true, new Vector2(85f, 40f)).Item1; } private static InputField MakeLoginBox(string name, Vector2 pos) { //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_000d: Unknown result type (might be due to invalid IL or missing references) return UIUtils.MakeTextbox(name, _levelSharerObj, pos, Vector2.zero, Vector2.zero, 300f, 40f, 24).Item1; } private static void MakeLoginLabel(string name, Vector2 pos) { //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_000d: Unknown result type (might be due to invalid IL or missing references) Text textComponent = UIUtils.MakeLabel(name, _levelSharerObj, pos, Vector2.zero, Vector2.zero, 80f, 80f, (HorizontalWrapMode)1).textComponent; textComponent.alignment = (TextAnchor)4; textComponent.text = name; textComponent.fontSize = 10; } private static void SetupLoginArea() { //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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00a3: 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_010f: 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_0131: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown Text error = UIUtils.MakeLabel("Login Error Message", _levelSharerObj, new Vector2(140f, 15f), Vector2.zero, Vector2.zero, 80f, 80f, (HorizontalWrapMode)1).textComponent; error.alignment = (TextAnchor)4; error.fontSize = 8; MakeLoginLabel("Username", new Vector2(80f, 65f)); MakeLoginLabel("Password", new Vector2(200f, 65f)); InputField username = MakeLoginBox("Username Input", new Vector2(80f, 50f)); InputField password = MakeLoginBox("Password Input", new Vector2(200f, 50f)); InteractableWhenLoggedOut.Add((Selectable)(object)username); InteractableWhenLoggedOut.Add((Selectable)(object)password); password.contentType = (ContentType)7; Button val = MakeLoginButton("Sign Up", new Vector2(100f, 30f)); ((UnityEvent)val.onClick).AddListener((UnityAction)delegate { SharerRequests.SendAuthRequest(username.text, password.text, "/create", error); }); InteractableWhenLoggedOut.Add((Selectable)(object)val); Button val2 = MakeLoginButton("Log In", new Vector2(140f, 30f)); ((UnityEvent)val2.onClick).AddListener((UnityAction)delegate { SharerRequests.SendAuthRequest(username.text, password.text, "/login", error); }); InteractableWhenLoggedOut.Add((Selectable)(object)val2); Button val3 = MakeLoginButton("Log Out", new Vector2(180f, 30f)); ButtonClickedEvent onClick = val3.onClick; object obj = <>c.<>9__34_2; if (obj == null) { UnityAction val4 = delegate { APIKey = null; RefreshActiveOptions(); }; <>c.<>9__34_2 = val4; obj = (object)val4; } ((UnityEvent)onClick).AddListener((UnityAction)obj); InteractableWhenLoggedIn.Add((Selectable)(object)val3); } internal static void RefreshActiveOptions() { bool flag = APIKey == null; foreach (Selectable item in InteractableWhenLoggedOut) { item.interactable = flag && !CurrentlyDownloading; } foreach (Selectable item2 in InteractableWhenLoggedIn) { item2.interactable = !flag && !CurrentlyDownloading; } foreach (Selectable item3 in UninteractableWhenDownloading) { item3.interactable = !CurrentlyDownloading; } } internal static async Task PerformSearch() { _currentLevels = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(await SharerRequests.SendSearchRequest(_descriptionInput.text, _creatorInput.text)); _currentLevels.Reverse(); _index = 0; RefreshCurrentLevels(); } private static void SetupLevelsArea() { //IL_001c: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: 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) //IL_02f4: 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_0313: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Expected O, but got Unknown //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Expected O, but got Unknown //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_040d: 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_042c: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Expected O, but got Unknown //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Expected O, but got Unknown Text status = UIUtils.MakeLabel("Download Status", _levelSharerObj, new Vector2(0f, 40f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), 80f, 80f, (HorizontalWrapMode)1).textComponent; status.alignment = (TextAnchor)1; status.text = "Warning!\n\nDownloading a level will overwrite any changes you have made yourself\nDownloading a save will overwrite save slot 4"; int num = 135; for (int j = 0; j < 6; j++) { Image val = UIUtils.MakeImage($"Download Image {j}", _levelSharerObj, new Vector2(-300f, (float)(num + 25)), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(200f, 100f)); val.sprite = ArchitectPlugin.BlankSprite; val.preserveAspect = true; Text textComponent = UIUtils.MakeLabel($"Download Count {j}", _levelSharerObj, new Vector2(-210f, (float)num), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), 80f, 80f, (HorizontalWrapMode)1).textComponent; textComponent.alignment = (TextAnchor)1; textComponent.fontSize = 10; Text textComponent2 = UIUtils.MakeLabel($"Level Name {j}", _levelSharerObj, new Vector2(-130f, (float)(num + 20)), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), 80f, 80f, (HorizontalWrapMode)1).textComponent; Text textComponent3 = UIUtils.MakeLabel($"Level Desc {j}", _levelSharerObj, new Vector2(60f, (float)(num + 20)), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), 440f, 40f, (HorizontalWrapMode)0).textComponent; textComponent3.fontSize = 8; var (val2, label) = UIUtils.MakeTextButton($"Level Download {j}", "Download Level", _levelSharerObj, new Vector2(320f, (float)(num + 55)), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), hasOutline: true, new Vector2(160f, 40f)); ((Component)val2).gameObject.SetActive(false); ((Component)label).gameObject.SetActive(false); UninteractableWhenDownloading.Add((Selectable)(object)val2); var (val3, label2) = UIUtils.MakeTextButton($"Save Download {j}", "Download Save", _levelSharerObj, new Vector2(320f, (float)(num + 35)), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), hasOutline: true, new Vector2(160f, 40f)); ((Component)val3).gameObject.SetActive(false); ((Component)label2).gameObject.SetActive(false); UninteractableWhenDownloading.Add((Selectable)(object)val3); DownloadChoices.Add((textComponent, textComponent2, textComponent3, ((Component)val2).gameObject, ((Component)label).gameObject, ((Component)val3).gameObject, ((Component)label2).gameObject, val)); int i = j; ((UnityEvent)val2.onClick).AddListener((UnityAction)delegate { SharerRequests.DownloadLevel(_orderedCurrentLevels[_index * 6 + i]["level_id"], status); }); ((UnityEvent)val3.onClick).AddListener((UnityAction)delegate { SharerRequests.DownloadSave(_orderedCurrentLevels[_index * 6 + i]["level_id"], status); }); num -= 70; } var (val4, label3) = UIUtils.MakeTextButton("Arrow Left", "<=", _levelSharerObj, new Vector2(-370f, 0f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), hasOutline: true, new Vector2(55f, 55f)); label3.textComponent.fontSize = 10; var (val5, label4) = UIUtils.MakeTextButton("Arrow Right", "=>", _levelSharerObj, new Vector2(370f, 0f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), hasOutline: true, new Vector2(55f, 55f)); label4.textComponent.fontSize = 10; ButtonClickedEvent onClick = val4.onClick; object obj = <>c.<>9__37_0; if (obj == null) { UnityAction val6 = delegate { _index--; if (_index < 0) { _index = _currentLevels.Count / 6; } RefreshCurrentLevels(); }; <>c.<>9__37_0 = val6; obj = (object)val6; } ((UnityEvent)onClick).AddListener((UnityAction)obj); ButtonClickedEvent onClick2 = val5.onClick; object obj2 = <>c.<>9__37_1; if (obj2 == null) { UnityAction val7 = delegate { _index = (_index + 1) % ((_currentLevels.Count - 1) / 6 + 1); RefreshCurrentLevels(); }; <>c.<>9__37_1 = val7; obj2 = (object)val7; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); UninteractableWhenDownloading.Add((Selectable)(object)val4); UninteractableWhenDownloading.Add((Selectable)(object)val5); } private static void RefreshCurrentLevels() { _orderedCurrentLevels = ((_currentSortBy == SortBy.MostDownloads) ? _currentLevels.OrderByDescending((Dictionary<string, string> c) => Convert.ToInt32(c["downloads"])).ToList() : _currentLevels); for (int i = 0; i < 6; i++) { DownloadChoices[i].Rest.Item1.sprite = ArchitectPlugin.BlankSprite; int num = _index * 6 + i; if (_orderedCurrentLevels.Count > num) { string text = _orderedCurrentLevels[num]["level_name"] + " – " + _orderedCurrentLevels[num]["username"]; DownloadChoices[i].Item1.text = "Downloads:\n" + _orderedCurrentLevels[num]["downloads"]; DownloadChoices[i].Item2.text = text + new string(' ', Mathf.Max(0, 50 - text.Length)); DownloadChoices[i].Item3.text = _orderedCurrentLevels[num]["level_desc"]; DownloadChoices[i].Item4.SetActive(true); DownloadChoices[i].Item5.SetActive(true); bool active = _orderedCurrentLevels[num]["has_save"] == "true"; DownloadChoices[i].Item6.SetActive(active); DownloadChoices[i].Item7.SetActive(active); ((MonoBehaviour)ArchitectPlugin.Instance).StartCoroutine(GetSprite(DownloadChoices[i].Rest.Item1, _index, _orderedCurrentLevels[num]["url"])); } else { DownloadChoices[i].Item1.text = ""; DownloadChoices[i].Item2.text = ""; DownloadChoices[i].Item3.text = ""; DownloadChoices[i].Item4.SetActive(false); DownloadChoices[i].Item5.SetActive(false); DownloadChoices[i].Item6.SetActive(false); DownloadChoices[i].Item7.SetActive(false); } } } [IteratorStateMachine(typeof(<GetSprite>d__39))] private static IEnumerator GetSprite(Image image, int pageIndex, string url) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GetSprite>d__39(0) { image = image, pageIndex = pageIndex, url = url }; } private static Button MakeUploadButton(string text, Vector2 pos) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0032: Unknown result type (might be due to invalid IL or missing references) return UIUtils.MakeTextButton(text, text, _levelSharerObj, pos, new Vector2(1f, 0f), new Vector2(1f, 0f), hasOutline: true, new Vector2(85f, 40f)).Item1; } private static InputField MakeUploadBox(string name, Vector2 pos) { //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_0021: Unknown result type (might be due to invalid IL or missing references) return UIUtils.MakeTextbox(name, _levelSharerObj, pos, new Vector2(1f, 0f), new Vector2(1f, 0f), 300f, 40f, 24).Item1; } private static void MakeUploadLabel(string name, Vector2 pos) { //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_0021: Unknown result type (might be due to invalid IL or missing references) Text textComponent = UIUtils.MakeLabel(name, _levelSharerObj, pos, new Vector2(1f, 0f), new Vector2(1f, 0f), 80f, 80f, (HorizontalWrapMode)1).textComponent; textComponent.alignment = (TextAnchor)4; textComponent.text = name; textComponent.fontSize = 10; } private static void SetupUploadArea() { //IL_001c: 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_003a: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to inva