Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of BoxInfo v2.0.0
plugins/BoxInfo.dll
Decompiled 4 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BoxInfo")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("3.9.0.0")] [assembly: AssemblyInformationalVersion("3.9.0")] [assembly: AssemblyProduct("BoxInfo")] [assembly: AssemblyTitle("BoxInfo")] [assembly: AssemblyVersion("3.9.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 BoxInfo { internal class AvatarHeadshot { private static readonly Vector3 BaseSpot = new Vector3(5000f, 5000f, -5000f); private static int nextSlot; private readonly Vector3 spot; internal readonly string SteamId; internal RawImage Target; internal int Size = 384; private bool lookReady; private readonly int[] savedColors; private readonly int[] savedCos; private readonly string[] savedCosIds; private GameObject holder; private GameObject pointer; private PlayerCosmetics cosmetics; private PlayerEyes eyes; private PlayerAvatarVisuals visuals; private Camera cam; private RenderTexture rt; private Transform avatarRoot; private Transform camRoot; private int[] wantColors; private int[] wantCos; private float spawnedAt; private float nextCheck; private float frameAt; private int applies; private bool framed; private bool everFramed; private Vector3 headCenter; private float headSize; private static MethodInfo setupCos; private static MethodInfo setupColors; private static MethodInfo setupColorsAll; private static MethodInfo eyesOverride; private int errors; private const float Lens = 24f; private Vector3 viewDir; internal bool Alive => (Object)(object)holder != (Object)null; internal bool Ready { get { if ((Object)(object)holder != (Object)null && everFramed) { return lookReady; } return false; } } internal bool GaveUp { get { if ((Object)(object)holder != (Object)null && !lookReady) { return Time.unscaledTime - spawnedAt > 15f; } return false; } } internal static bool IsBlank(int[] colors, int[] cos) { if (cos == null || cos.Length == 0) { return colors?.All((int c) => c <= 0) ?? true; } return false; } internal AvatarHeadshot(string steamId, int[] colors, int[] cos, string[] cosIds) { //IL_0038: 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_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_0063: Unknown result type (might be due to invalid IL or missing references) SteamId = steamId ?? ""; savedColors = colors; savedCos = cos; savedCosIds = cosIds; spot = BaseSpot + Vector3.right * (40f * (float)(nextSlot++ % 32)); } internal bool Spawn() { //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_030f: 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_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) try { PlayerAvatarMenu val = FindTemplate(); if ((Object)(object)val == (Object)null) { Plugin.Log.LogInfo((object)"Profile avatar: the game's menu avatar wasn't found."); return false; } setupCos = setupCos ?? AccessTools.Method(typeof(PlayerCosmetics), "SetupCosmeticsLogic", (Type[])null, (Type[])null); setupColors = setupColors ?? AccessTools.Method(typeof(PlayerCosmetics), "SetupColorsLogic", (Type[])null, (Type[])null); setupColorsAll = setupColorsAll ?? AccessTools.Method(typeof(PlayerCosmetics), "SetupColorsAllLogic", (Type[])null, (Type[])null); eyesOverride = eyesOverride ?? AccessTools.Method(typeof(PlayerEyes), "Override", new Type[3] { typeof(Vector3), typeof(float), typeof(GameObject) }, (Type[])null); holder = new GameObject("BoxInfo Profile Avatar"); holder.SetActive(false); holder.transform.position = spot; Object.DontDestroyOnLoad((Object)(object)holder); GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, holder.transform, false); ((Object)val2).name = "Avatar"; val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = ((Component)val).transform.localRotation; PlayerAvatarMenu component = val2.GetComponent<PlayerAvatarMenu>(); Traverse val3 = Traverse.Create((object)component); val3.Field("worldAvatar").SetValue((object)true); ((Behaviour)component).enabled = false; avatarRoot = val2.transform; object value = Traverse.Create((object)val).Field("cameraAndStuff").GetValue(); Transform val4 = (Transform)((value is Transform) ? value : null); object value2 = val3.Field("cameraAndStuff").GetValue(); Transform val5 = (Transform)((value2 is Transform) ? value2 : null); if (((Object)(object)val5 == (Object)null || !val5.IsChildOf(val2.transform)) && (Object)(object)val4 != (Object)null) { Vector3 val6 = val4.position - ((Component)val).transform.position; Quaternion rotation = val4.rotation; val5 = Object.Instantiate<GameObject>(((Component)val4).gameObject, holder.transform, false).transform; val5.position = val2.transform.position + val6; val5.rotation = rotation; val3.Field("cameraAndStuff").SetValue((object)val5); } camRoot = val5; cam = (((Object)(object)val5 != (Object)null) ? ((Component)val5).GetComponentInChildren<Camera>(true) : null); if ((Object)(object)cam == (Object)null) { GameObject val7 = new GameObject("Camera"); val7.transform.SetParent(holder.transform, false); val7.transform.position = val2.transform.position + val2.transform.forward * 2f + Vector3.up * 1f; val7.transform.LookAt(val2.transform.position + Vector3.up * 1f); cam = val7.AddComponent<Camera>(); cam.fieldOfView = 30f; } holder.SetActive(true); Rigidbody component2 = val2.GetComponent<Rigidbody>(); if ((Object)(object)component2 != (Object)null) { component2.isKinematic = true; component2.useGravity = false; } cosmetics = val2.GetComponentInChildren<PlayerCosmetics>(true); eyes = val2.GetComponentInChildren<PlayerEyes>(true); visuals = val2.GetComponentInChildren<PlayerAvatarVisuals>(true); CameraZoom[] componentsInChildren = ((Component)cam).GetComponentsInChildren<CameraZoom>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = false; } MonoBehaviour[] components = ((Component)cam).GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val8 in components) { if ((Object)(object)val8 != (Object)null && ((object)val8).GetType().FullName.IndexOf("PostProcess", StringComparison.OrdinalIgnoreCase) >= 0) { ((Behaviour)val8).enabled = false; } } PlayerAvatar val9 = LiveAvatar(); if ((Object)(object)val9 != (Object)null && (Object)(object)visuals != (Object)null) { try { Traverse.Create((object)visuals).Field("playerAvatar").SetValue((object)val9); } catch { } } int num = Mathf.Clamp(Size, 64, 1024); rt = new RenderTexture(num, num, 24, (RenderTextureFormat)0) { name = "BoxInfo Profile Avatar", antiAliasing = 2 }; rt.Create(); cam.targetTexture = rt; cam.clearFlags = (CameraClearFlags)2; cam.backgroundColor = new Color(0f, 0f, 0f, 0f); ((Behaviour)cam).enabled = true; if ((Object)(object)Target != (Object)null) { Target.texture = (Texture)(object)rt; } pointer = new GameObject("Look Target"); pointer.transform.SetParent(holder.transform, false); ManualLogSource log = Plugin.Log; string[] obj2 = new string[11] { "Profile avatar: copied '", ((Object)val).name, "' (", null, null, null, null, null, null, null, null }; Scene scene = ((Component)val).gameObject.scene; obj2[3] = (((Scene)(ref scene)).IsValid() ? "live" : "prefab"); obj2[4] = "), camera '"; obj2[5] = ((Object)cam).name; obj2[6] = "', cosmetics "; obj2[7] = (((Object)(object)cosmetics != (Object)null) ? "yes" : "no"); obj2[8] = ", eyes "; obj2[9] = (((Object)(object)eyes != (Object)null) ? "yes" : "no"); obj2[10] = "."; log.LogInfo((object)string.Concat(obj2)); spawnedAt = Time.unscaledTime; nextCheck = spawnedAt + 0.2f; frameAt = spawnedAt + 0.5f; return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Profile avatar failed: " + ex.Message)); Dispose(); return false; } } private static PlayerAvatarMenu FindTemplate() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) PlayerAvatarMenu val = null; PlayerAvatarMenu[] array = Resources.FindObjectsOfTypeAll<PlayerAvatarMenu>(); foreach (PlayerAvatarMenu val2 in array) { if ((Object)(object)val2 == (Object)null) { continue; } Traverse t = Traverse.Create((object)val2); if (!Flag(t, "iconMakerAvatar") && !Flag(t, "worldAvatar") && !Flag(t, "expressionAvatar")) { Scene scene = ((Component)val2).gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return val2; } if ((Object)(object)val == (Object)null) { val = val2; } } } return val; } private static bool Flag(Traverse t, string field) { try { object value = t.Field(field).GetValue(); bool flag = default(bool); int num; if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch { return false; } } internal static bool HasLook(string steamId, int[] savedColors, int[] savedCos = null) { if (savedColors == null || IsBlank(savedColors, savedCos)) { return (Object)(object)FindLive(steamId) != (Object)null; } return true; } private PlayerAvatar LiveAvatar() { return FindLive(SteamId); } private static PlayerAvatar FindLive(string SteamId) { if (string.IsNullOrEmpty(SteamId)) { return null; } try { List<PlayerAvatar> list = SemiFunc.PlayerGetList(); if (list == null) { return null; } foreach (PlayerAvatar item in list) { if ((Object)(object)item != (Object)null && Traverse.Create((object)item).Field("steamID").GetValue() as string == SteamId) { return item; } } } catch { } return null; } internal void Tick(Vector2 look) { //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)holder == (Object)null) { return; } try { if ((Object)(object)cam != (Object)null) { MonoBehaviour[] components = ((Component)cam).GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val in components) { if ((Object)(object)val != (Object)null && ((object)val).GetType().Name == "AvatarCameraGate") { ((Behaviour)val).enabled = false; Object.Destroy((Object)(object)val); } } if (!((Behaviour)cam).enabled) { ((Behaviour)cam).enabled = true; } } if ((Object)(object)cam != (Object)null && (Object)(object)cam.targetTexture == (Object)null) { cam.targetTexture = rt; } RenderTexture val2 = (((Object)(object)cam != (Object)null) ? cam.targetTexture : rt); if ((Object)(object)Target != (Object)null && (Object)(object)Target.texture != (Object)(object)val2) { Target.texture = (Texture)(object)val2; } float unscaledTime = Time.unscaledTime; if (unscaledTime >= nextCheck) { nextCheck = unscaledTime + 0.5f; NoScreenEffects(); KeepLook(); } if (unscaledTime >= frameAt) { if (framed) { frameAt = float.MaxValue; } else { frameAt = unscaledTime + 1f; FrameHead(); } } if (!everFramed && lookReady && unscaledTime - spawnedAt > 2.5f) { everFramed = true; Plugin.Log.LogInfo((object)"Profile avatar: couldn't measure the head, showing the menu camera's view."); } if (everFramed) { Aim(look); } if ((Object)(object)Target != (Object)null) { float num = ((everFramed && lookReady) ? Mathf.MoveTowards(((Graphic)Target).color.a, 1f, Time.unscaledDeltaTime * 4f) : 0f); if (!Mathf.Approximately(num, ((Graphic)Target).color.a)) { ((Graphic)Target).color = new Color(1f, 1f, 1f, num); } } } catch (Exception ex) { if (errors++ < 3) { Plugin.Log.LogWarning((object)("Profile avatar: " + ex)); } } } private void NoScreenEffects() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_00a9: 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) if ((Object)(object)cam == (Object)null) { return; } MonoBehaviour[] components = ((Component)cam).GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val in components) { if ((Object)(object)val != (Object)null && ((Behaviour)val).enabled && ((object)val).GetType().FullName.IndexOf("PostProcess", StringComparison.OrdinalIgnoreCase) >= 0) { ((Behaviour)val).enabled = false; } } if ((int)cam.clearFlags != 2 || cam.backgroundColor.a > 0f) { cam.clearFlags = (CameraClearFlags)2; cam.backgroundColor = new Color(0f, 0f, 0f, 0f); } } private void KeepLook() { if ((Object)(object)cosmetics == (Object)null) { return; } if (wantColors == null && wantCos == null) { ResolveLook(); } Traverse val = Traverse.Create((object)cosmetics); int[] source = (from object o in (val.Field("cosmeticEquippedRaw").GetValue() as IEnumerable)? select Convert.ToInt32(o)).ToArray() ?? new int[0]; int[] array = val.Field("colorsEquipped").GetValue() as int[]; bool flag = wantCos == null || source.OrderBy((int x) => x).SequenceEqual(wantCos.OrderBy((int x) => x)); bool flag2 = wantColors == null || (array?.Take(wantColors.Length).SequenceEqual(wantColors.Take(array.Length)) ?? false); if ((flag && flag2) || applies >= 12) { return; } applies++; val.Field("previewCosmetics").SetValue((object)false); val.Field("previewColors").SetValue((object)false); if (!flag) { setupCos?.Invoke(cosmetics, new object[2] { wantCos, false }); } if (!flag2) { int[] array2 = new int[(array != null) ? array.Length : wantColors.Length]; for (int num = 0; num < array2.Length; num++) { array2[num] = ((num < wantColors.Length) ? wantColors[num] : 0); } setupColors?.Invoke(cosmetics, new object[1] { array2 }); } framed = false; frameAt = Time.unscaledTime + 0.4f; } private void ResolveLook() { PlayerAvatar val = LiveAvatar(); if ((Object)(object)val != (Object)null) { object value = Traverse.Create((object)val).Field("playerCosmetics").GetValue(); PlayerCosmetics val2 = (PlayerCosmetics)((value is PlayerCosmetics) ? value : null); if ((Object)(object)val2 != (Object)null) { Traverse obj = Traverse.Create((object)val2); int[] array = (obj.Field("colorsEquipped").GetValue() as int[])?.ToArray(); int[] cos = (from object o in (obj.Field("cosmeticEquippedRaw").GetValue() as IEnumerable)? select Convert.ToInt32(o)).ToArray() ?? new int[0]; if (array != null && !IsBlank(array, cos)) { wantColors = array; wantCos = cos; lookReady = true; return; } } } if (savedColors != null && !IsBlank(savedColors, savedCos)) { wantColors = savedColors; wantCos = MapCosmetics(savedCos, savedCosIds); lookReady = true; } } private static int[] MapCosmetics(int[] idx, string[] ids) { if (idx == null) { return new int[0]; } IList list = null; try { object value = Traverse.Create(typeof(MetaManager)).Field("instance").GetValue(); list = ((value != null) ? (Traverse.Create(value).Field("cosmeticAssets").GetValue() as IList) : null); } catch { } List<string> list2 = (from object a in list? select (a == null) ? "" : AssetKey(a)).ToList(); List<int> list3 = new List<int>(); for (int num = 0; num < idx.Length; num++) { string text = ((ids != null && num < ids.Length) ? ids[num] : ""); if (list2 != null && !string.IsNullOrEmpty(text)) { int num2 = list2.IndexOf(text); if (num2 >= 0) { list3.Add(num2); } else if (idx[num] >= 0 && idx[num] < list2.Count && string.IsNullOrEmpty(list2[idx[num]])) { list3.Add(idx[num]); } } else if (list2 == null || (idx[num] >= 0 && idx[num] < list2.Count)) { list3.Add(idx[num]); } } return list3.Distinct().ToArray(); } private static string AssetKey(object asset) { string text = null; try { text = Traverse.Create(asset).Field("assetId").GetValue()?.ToString(); } catch { } if (string.IsNullOrEmpty(text)) { try { text = Traverse.Create(asset).Field("assetName").GetValue()?.ToString(); } catch { } } if (string.IsNullOrEmpty(text)) { Object val = (Object)((asset is Object) ? asset : null); if (val != null) { text = val.name; } } return (text ?? "").Replace("|", "/").Replace(";", " ").Replace(":", " ") .Replace("\n", " ") .Trim(); } private void FrameHead() { //IL_0038: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cam == (Object)null || (Object)(object)avatarRoot == (Object)null) { return; } if (!HeadBounds(out var b)) { Plugin.Log.LogDebug((object)"Profile avatar: no head to measure yet."); return; } if (viewDir == Vector3.zero) { viewDir = ((Component)cam).transform.forward; } cam.fieldOfView = 24f; float num = Mathf.Max(((Bounds)(ref b)).size.x, ((Bounds)(ref b)).size.z); float num2 = Mathf.Clamp(Mathf.Max(((Bounds)(ref b)).size.y, num) * 0.78f, 0.05f, 3f); if (everFramed && (num2 > headSize * 1.35f || num2 < headSize * 0.75f)) { Plugin.Log.LogDebug((object)$"Profile avatar: kept the framing (measured {num2:0.00} m vs {headSize:0.00} m)."); framed = true; return; } headSize = num2; float num3 = ((Bounds)(ref b)).max.y - headSize * 0.04f; headCenter = new Vector3(((Bounds)(ref b)).center.x, num3 - headSize * 0.5f, ((Bounds)(ref b)).center.z); float num4 = headSize * 0.5f / Mathf.Tan(MathF.PI / 15f) + num * 0.5f; ((Component)cam).transform.position = headCenter - viewDir * num4; ((Component)cam).transform.rotation = Quaternion.LookRotation(viewDir, Vector3.up); cam.nearClipPlane = Mathf.Max(0.05f, (num4 - num) * 0.5f); cam.farClipPlane = num4 * 3f + headSize * 4f; if (!everFramed) { Plugin.Log.LogInfo((object)$"Profile avatar: head {headSize:0.00} m, camera {num4:0.00} m away (lens {24f:0})."); } framed = (everFramed = true); } private bool HeadBounds(out Bounds b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) b = default(Bounds); Transform val = null; try { object value = Traverse.Create((object)visuals).Field("headLookAtTransform").GetValue(); val = (Transform)((value is Transform) ? value : null); } catch { } if ((Object)(object)val != (Object)null && Collect(val, out b) && ((Bounds)(ref b)).size.y > 0.08f && ((Bounds)(ref b)).size.y < 2.5f) { return true; } if (!Collect(avatarRoot, out var b2) || ((Bounds)(ref b2)).size.y < 0.05f) { return false; } float y = ((Bounds)(ref b2)).size.y; b = new Bounds(new Vector3(((Bounds)(ref b2)).center.x, ((Bounds)(ref b2)).max.y - y * 0.27f, ((Bounds)(ref b2)).center.z), new Vector3(((Bounds)(ref b2)).size.x, y * 0.55f, ((Bounds)(ref b2)).size.z)); return true; } private bool Collect(Transform t, out Bounds b) { //IL_0001: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) b = default(Bounds); bool flag = false; Renderer[] componentsInChildren = ((Component)t).GetComponentsInChildren<Renderer>(false); foreach (Renderer val in componentsInChildren) { if ((val is MeshRenderer || val is SkinnedMeshRenderer) && val.enabled && (!((Object)(object)camRoot != (Object)null) || !((Component)val).transform.IsChildOf(camRoot))) { if (!flag) { b = val.bounds; flag = true; } else { ((Bounds)(ref b)).Encapsulate(val.bounds); } } } return flag; } private void Aim(Vector2 look) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0082: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)eyes == (Object)null) && !(eyesOverride == null) && !((Object)(object)cam == (Object)null)) { ((Vector2)(ref look))..ctor(Mathf.Clamp(look.x, -4f, 4f), Mathf.Clamp(look.y, -4f, 4f)); float num = Vector3.Distance(((Component)cam).transform.position, headCenter); Vector3 val = cam.ViewportToWorldPoint(new Vector3(0.5f + look.x * 0.5f, 0.5f + look.y * 0.5f, num * 0.45f)); pointer.transform.position = val; eyesOverride.Invoke(eyes, new object[3] { val, 0.2f, pointer }); } } internal void Dispose() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)cam != (Object)null) { RenderTexture targetTexture = cam.targetTexture; cam.targetTexture = null; if ((Object)(object)targetTexture != (Object)null && (Object)(object)targetTexture != (Object)(object)rt && ((Object)targetTexture).name.StartsWith("BoxInfo")) { targetTexture.Release(); Object.Destroy((Object)(object)targetTexture); } } } catch { } if ((Object)(object)holder != (Object)null) { Object.Destroy((Object)(object)holder); } holder = null; if ((Object)(object)rt != (Object)null) { rt.Release(); Object.Destroy((Object)(object)rt); rt = null; } if ((Object)(object)Target != (Object)null) { Target.texture = null; ((Graphic)Target).color = new Color(1f, 1f, 1f, 0f); } } } internal class CommandPanel { private enum Snd { Action, Confirm, Deny, Dud, Tick } private class AvatarSlot { public string Id; public Rect Rect; public RawImage Image; public Image Placeholder; public RectTransform Loader; public bool Row; public bool LookKnown; public int[] Colors; public int[] Cos; public string[] CosIds; public bool Done; } private class Saved { public string Cmd; public string Kind; public string Query; public Hashtable Data; public object[] People; public int Person; public int Page; public List<string> Lines; } internal static bool IsOpen; private const float PW = 1240f; private const float PH = 720f; private static readonly Color Orange = new Color(1f, 0.6f, 0.08f); private static readonly Color Light = new Color(0.86f, 0.88f, 0.9f); private static readonly Color White = new Color(0.96f, 0.96f, 0.96f); private static readonly Color Dim = new Color(0.6f, 0.63f, 0.66f); private static readonly Color Grey = new Color(0.47f, 0.49f, 0.5f); private static readonly Color Gold = new Color(1f, 0.77f, 0.16f); private static readonly Color Purple = new Color(0.76f, 0.45f, 1f); private RectTransform frame; private RectTransform content; private RectTransform cursor; private UiCard tipCard; private string shownTip; private bool tipLogged; private readonly List<(Rect r, string tip, int rarity)> tips = new List<(Rect, string, int)>(); private readonly List<(Rect r, Action act, Snd snd)> clicks = new List<(Rect, Action, Snd)>(); private Image hoverBox; private bool hoverActive; private Rect hoverRect; private Vector2 boxPos; private Vector2 boxSize; private Vector2 boxPrev; private float boxGrow; private float pulseLerp; private float clickTimer; private bool pulseIn; private Color flashColor; private static readonly Color BoxIdle = new Color(0.08f, 0.2f, 0.4f, 0.75f); private static readonly Color BoxMoving = new Color(0.2f, 0.5f, 1f, 1f); private static readonly Color BoxOff = new Color(0.4f, 0.08f, 0.015f, 0f); private string cmd; private string kind; private Hashtable data; private readonly List<string> lines = new List<string>(); private int page; private int pages = 1; private object[] people; private int person; private string query; private float openedAt; private readonly List<AvatarSlot> slots = new List<AvatarSlot>(); private readonly Dictionary<string, AvatarHeadshot> shots = new Dictionary<string, AvatarHeadshot>(); private readonly Dictionary<string, Hashtable> looks = new Dictionary<string, Hashtable>(); private readonly Dictionary<string, float> lookAsked = new Dictionary<string, float>(); private readonly List<(RectTransform circle, RectTransform glass)> loaders = new List<(RectTransform, RectTransform)>(); private float hourglassLerp; private readonly Stack<Saved> back = new Stack<Saved>(); private string pendingProfile; internal static bool Typing; private string search = ""; private bool searchFocus; private Rect searchRect; private TextMeshProUGUI searchText; private Image[] searchEdges; private float pendingAt; private float profileAskAt; private static MethodInfo clickFx; private const int PlainTip = -2; private static readonly Color LockedTint = new Color(0.3f, 0.3f, 0.3f, 1f); private static MenuManager Menu { get { object value = Traverse.Create(typeof(MenuManager)).Field("instance").GetValue(); return (MenuManager)((value is MenuManager) ? value : null); } } internal void Show(string command, string[] newLines, Hashtable panel) { object value; string text = ((panel != null && ((Dictionary<object, object>)(object)panel).TryGetValue((object)"id", out value)) ? (value as string) : null); if (IsOpen && pendingProfile != null && text == pendingProfile && Time.unscaledTime - pendingAt < 15f) { back.Push(new Saved { Cmd = cmd, Kind = kind, Query = query, Data = data, People = people, Person = person, Page = page, Lines = new List<string>(lines) }); } else { back.Clear(); } pendingProfile = null; if (!IsOpen || panel != null || data != null || !(command == cmd) || !(Time.unscaledTime - openedAt < 10f)) { lines.Clear(); page = 0; } cmd = command ?? ""; data = panel; people = null; person = 0; if (panel != null && ((Dictionary<object, object>)(object)panel).TryGetValue((object)"people", out object value2) && value2 is object[] array && array.Length > 1) { object obj = array[0]; Hashtable val = (Hashtable)((obj is Hashtable) ? obj : null); if (val != null) { people = array; data = val; query = (((Dictionary<object, object>)(object)panel).TryGetValue((object)"query", out object value3) ? (value3 as string) : ""); } } kind = ((data != null && ((Dictionary<object, object>)(object)data).TryGetValue((object)"kind", out object value4)) ? (value4 as string) : null); if (newLines != null) { foreach (string text2 in newLines) { if (!string.IsNullOrWhiteSpace(text2)) { lines.Add(text2.Trim()); } } } if (kind != null || lines.Count != 0) { if (kind == "leaderboard") { looks.Clear(); lookAsked.Clear(); search = ""; searchFocus = false; int num = Int("me", -1); page = ((num >= 0) ? (num / 6) : 0); } openedAt = Time.unscaledTime; if (!IsOpen) { MenuSound("MenuEffectPopUpOpen"); } IsOpen = true; Build(); } } internal void Close() { if (IsOpen) { IsOpen = false; MenuSound("MenuEffectPopUpClose"); KeepEscFromPausing(0.3f); back.Clear(); pendingProfile = null; searchFocus = false; Typing = false; StopAvatars(null); if ((Object)(object)frame != (Object)null) { ((Component)frame).gameObject.SetActive(false); } if (tipCard != null) { tipCard.Visible = false; } } } private void StopAvatars(HashSet<string> keep) { foreach (string item in new List<string>(shots.Keys)) { if (keep == null || !keep.Contains(item)) { shots[item].Dispose(); shots.Remove(item); } } } private void GoBack() { Click(Snd.Deny); Saved saved = back.Pop(); cmd = saved.Cmd; kind = saved.Kind; query = saved.Query; data = saved.Data; people = saved.People; person = saved.Person; page = saved.Page; lines.Clear(); lines.AddRange(saved.Lines); Build(); } private void OpenProfile(string id) { if (!string.IsNullOrEmpty(id) && !(Time.unscaledTime < profileAskAt)) { profileAskAt = Time.unscaledTime + 1f; pendingProfile = id; pendingAt = Time.unscaledTime; Plugin.AskProfile(id); } } internal void OnLooks(object[] list) { if (list == null) { return; } foreach (object obj in list) { Hashtable val = (Hashtable)((obj is Hashtable) ? obj : null); if (val != null && ((Dictionary<object, object>)(object)val).TryGetValue((object)"id", out object value) && value is string key) { looks[key] = val; } } } internal void Tick() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } if ((Object)(object)frame == (Object)null || !((Component)frame).gameObject.activeSelf) { IsOpen = false; return; } ((Transform)frame).SetAsLastSibling(); bool flag = Plugin.ChatIsOpen(); KeepEscFromPausing(0.25f); if (!flag) { try { SemiFunc.CursorUnlock(0.1f); } catch { } try { object value = Traverse.Create(typeof(MenuCursor)).Field("instance").GetValue(); MenuCursor val = (MenuCursor)((value is MenuCursor) ? value : null); if ((Object)(object)val != (Object)null) { Traverse.Create((object)val).Field("hideTimer").SetValue((object)0.1f); } } catch { } try { SemiFunc.InputDisableAiming(); } catch { } try { object value2 = Traverse.Create(typeof(PlayerController)).Field("instance").GetValue(); PlayerController val2 = (PlayerController)((value2 is PlayerController) ? value2 : null); if ((Object)(object)val2 != (Object)null) { Traverse.Create((object)val2).Field("InputDisableTimer").SetValue((object)0.1f); } } catch { } } Vector2 val3 = MouseInFrame(); ((Component)cursor).gameObject.SetActive(!flag); cursor.anchoredPosition = new Vector2(val3.x, 0f - val3.y); if (!flag) { bool flag2 = false; try { flag2 = Input.GetKeyDown((KeyCode)27); } catch { } try { flag2 |= SemiFunc.InputDown((InputKey)6); } catch { } if (flag2 && searchFocus) { searchFocus = false; flag2 = false; UpdateSearchBox(); } if (flag2) { if (back.Count > 0) { GoBack(); } else { Close(); } return; } if (searchFocus) { TypeSearch(); } try { if (Input.GetMouseButtonDown(0)) { bool flag3 = kind == "leaderboard" && ((Rect)(ref searchRect)).Contains(val3); if (flag3 && !searchFocus) { Click(Snd.Action); } if (flag3 != searchFocus) { searchFocus = flag3; UpdateSearchBox(); } (Rect, Action, Snd)[] array = clicks.ToArray(); for (int i = 0; i < array.Length; i++) { var (val4, action, snd) = array[i]; if (((Rect)(ref val4)).Contains(val3)) { Click(snd); action(); return; } } } float y = Input.mouseScrollDelta.y; if (y < -0.01f) { Flip(1); } else if (y > 0.01f) { Flip(-1); } } catch { } } string text = null; int rarity = -1; foreach (var tip in tips) { var (val5, text2, num) = tip; if (((Rect)(ref val5)).Contains(val3)) { text = text2; rarity = num; break; } } ShowTip(flag ? null : text, rarity, val3); foreach (AvatarSlot slot in slots) { UpdateAvatar(slot, val3); } AnimateLoaders(); UpdateHover((Vector2)(flag ? new Vector2(-9999f, -9999f) : val3)); Typing = IsOpen && searchFocus && kind == "leaderboard"; if (!Typing) { return; } try { object value3 = Traverse.Create(typeof(MenuManager)).Field("instance").GetValue(); object obj8 = ((value3 is MenuManager) ? value3 : null); if (obj8 != null) { ((MenuManager)obj8).TextInputActive(); } } catch { } if ((Object)(object)searchText != (Object)null) { UpdateSearchBox(); } } private void Click(Snd snd) { //IL_0114: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) try { MenuManager menu = Menu; if ((Object)(object)menu != (Object)null) { if (clickFx == null) { clickFx = AccessTools.Method(typeof(MenuManager), "MenuEffectClick", (Type[])null, (Type[])null); } ParameterInfo[] array = clickFx?.GetParameters(); if (array != null && array.Length == 6) { clickFx.Invoke(menu, new object[6] { Enum.ToObject(array[0].ParameterType, (int)snd), null, -1f, -1f, true, false }); } } } catch { } if (snd != Snd.Action && snd != Snd.Confirm && snd != Snd.Tick) { return; } Color value = default(Color); ((Color)(ref value))..ctor(1f, 0.8f, 0.1f); try { object value2 = Traverse.Create(typeof(AssetManager)).Field("instance").GetValue(); AssetManager val = (AssetManager)((value2 is AssetManager) ? value2 : null); if (val != null) { value = Traverse.Create((object)val).Field("colorYellow").GetValue<Color>(); } } catch { } flashColor = ((snd == Snd.Confirm) ? Color.green : value); clickTimer = 1f; } private static void MenuSound(string method) { try { MenuManager menu = Menu; if ((Object)(object)menu != (Object)null) { AccessTools.Method(typeof(MenuManager), method, new Type[0], (Type[])null)?.Invoke(menu, null); } } catch { } } private void UpdateHover(Vector2 m) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hoverBox == (Object)null) { return; } float unscaledDeltaTime = Time.unscaledDeltaTime; Rect? val = null; foreach (var click in clicks) { Rect item = click.r; if (((Rect)(ref item)).Contains(m)) { val = item; break; } } if (!val.HasValue && kind == "leaderboard" && ((Rect)(ref searchRect)).Contains(m)) { val = searchRect; } if (val.HasValue && (!hoverActive || val.Value != hoverRect)) { try { MenuManager menu = Menu; if (menu != null) { menu.MenuEffectHover(-1f, -1f); } } catch { } if (!hoverActive) { Rect value = val.Value; boxPos = ((Rect)(ref value)).center; boxSize = Vector2.zero; boxGrow = 0f; } hoverRect = val.Value; } hoverActive = val.HasValue; RectTransform rectTransform = ((Graphic)hoverBox).rectTransform; if (hoverActive) { Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Rect)(ref hoverRect)).width + 26f, ((Rect)(ref hoverRect)).height + 26f); boxPrev = boxPos; boxPos = Vector2.Lerp(boxPos, ((Rect)(ref hoverRect)).center, 20f * unscaledDeltaTime); boxSize = Vector2.Lerp(boxSize, val2, 20f * unscaledDeltaTime); Color color = Color.Lerp(BoxIdle, BoxMoving, Vector2.Distance(boxPrev, boxPos) * 0.5f); if (clickTimer > 0f) { color = Color.Lerp(flashColor, BoxIdle, 1f - clickTimer); clickTimer -= unscaledDeltaTime * 10f; } ((Graphic)hoverBox).color = color; } else { ((Graphic)hoverBox).color = Color.Lerp(((Graphic)hoverBox).color, BoxOff, 10f * unscaledDeltaTime); } pulseLerp += 3f * unscaledDeltaTime; if (pulseLerp >= 1f) { pulseLerp = 0f; pulseIn = !pulseIn; } float num = Mathf.Sin(pulseLerp * MathF.PI) * (pulseIn ? 1f : (-1f)) * 0.01f; rectTransform.anchoredPosition = new Vector2(boxPos.x, 0f - boxPos.y); rectTransform.sizeDelta = boxSize * (1f + num); ((Component)hoverBox).gameObject.SetActive(((Graphic)hoverBox).color.a > 0.005f); } private static void KeepEscFromPausing(float seconds) { try { object value = Traverse.Create(typeof(GameDirector)).Field("instance").GetValue(); GameDirector val = (GameDirector)((value is GameDirector) ? value : null); if ((Object)(object)val != (Object)null) { Traverse.Create((object)val).Field("disableEscMenuTimer").SetValue((object)seconds); } } catch { } } private Vector2 MouseInFrame() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle(frame, Vector2.op_Implicit(Input.mousePosition), (Camera)null, ref val); return new Vector2(val.x + 620f, 360f - val.y); } private void Flip(int dir) { int num = page + dir; if (num >= 0 && num < pages) { page = num; Build(); } else { if (people == null || people.Length < 2) { return; } int num2 = person + dir; if (num2 >= 0 && num2 < people.Length) { object obj = people[num2]; Hashtable val = (Hashtable)((obj is Hashtable) ? obj : null); if (val != null) { person = num2; data = val; kind = (((Dictionary<object, object>)(object)data).TryGetValue((object)"kind", out object value) ? (value as string) : kind); page = ((dir <= 0) ? (PagesOf(val) - 1) : 0); Build(); } } } } private void ShowTip(string tip, int rarity, Vector2 m) { //IL_0018: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0126: Unknown result type (might be due to invalid IL or missing references) if (tipCard == null) { tipCard = new UiCard("BoxInfo Tooltip", new Vector2(0.5f, 0.5f), new Vector2(0f, 1f)); } bool flag = IsOpen && !string.IsNullOrEmpty(tip); tipCard.Visible = flag; if (!flag) { shownTip = null; return; } if (tip != shownTip) { shownTip = tip; string[] array = tip.Split('\n'); if (rarity == -2) { tipCard.Set(new List<Ui.Line> { new Ui.Line(tip, 22f, White) }, 440f, 0f, Gold); } else { List<Ui.Line> list = new List<Ui.Line> { new Ui.Line(array[0], 24f, (rarity >= 0) ? RarityColor(rarity) : White, upper: true) }; for (int i = 1; i < array.Length; i++) { if (!string.IsNullOrWhiteSpace(array[i])) { list.Add(new Ui.Line(array[i], (i == 1) ? 18f : 20f, (i == 1) ? Dim : Light)); } } tipCard.Set(list, 440f, 0f, (rarity >= 0) ? new Color?(RarityColor(rarity)) : ((Color?)null)); } if (!tipLogged) { tipLogged = true; Plugin.Log.LogInfo((object)$"Panel tooltip: showing '{array[0]}' ({tipCard.Width:0}x{tipCard.Height:0})."); } } ((Transform)tipCard.Panel).SetAsLastSibling(); float num = m.x - 620f; float num2 = 360f - m.y; float num3 = Ui.CanvasWidth / 2f; float num4 = num + 24f; float num5 = num2 - 26f; if (num4 + tipCard.Width > num3 - 8f) { num4 = num - tipCard.Width - 10f; } if (num5 - tipCard.Height < -532f) { num5 = num2 + tipCard.Height + 10f; } tipCard.Place(num4, num5); } private void EnsureFrame() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)frame != (Object)null)) { GameObject val = new GameObject("BoxInfo Command Panel", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(Ui.Canvas, false); frame = (RectTransform)val.transform; RectTransform obj = frame; RectTransform obj2 = frame; RectTransform obj3 = frame; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); obj3.pivot = val2; Vector2 anchorMin = (obj2.anchorMax = val2); obj.anchorMin = anchorMin; frame.sizeDelta = new Vector2(1240f, 720f); frame.anchoredPosition = Vector2.zero; Image obj4 = val.AddComponent<Image>(); obj4.sprite = GameArt.White; ((Graphic)obj4).color = new Color(0f, 0f, 0f, 0.62f); ((Graphic)obj4).raycastTarget = false; content = Box((Transform)(object)frame, "Content", 0f, 0f, 1240f, 720f); RectTransform val4 = Box((Transform)(object)frame, "Hover", 0f, 0f, 10f, 10f); val4.pivot = new Vector2(0.5f, 0.5f); hoverBox = ((Component)val4).gameObject.AddComponent<Image>(); ((Graphic)hoverBox).raycastTarget = false; ((Graphic)hoverBox).color = BoxOff; cursor = Box((Transform)(object)frame, "Pointer", 0f, 0f, 30f, 30f); Image obj5 = ((Component)cursor).gameObject.AddComponent<Image>(); obj5.sprite = GameArt.Cursor; ((Graphic)obj5).raycastTarget = false; } } private void Build() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) GameArt.Ensure(); EnsureFrame(); ((Component)frame).gameObject.SetActive(true); foreach (Transform item in (Transform)content) { Object.Destroy((Object)(object)((Component)item).gameObject); } tips.Clear(); clicks.Clear(); slots.Clear(); loaders.Clear(); pages = 1; try { switch (kind) { case "tokens": BuildTokens(); break; case "profile": BuildProfile(); break; case "badges": BuildBadges(); break; case "abilities": BuildAbilities(); break; case "commands": BuildCommands(); break; case "leaderboard": BuildLeaderboard(); break; case "odds": BuildOdds(); break; case "queue": BuildBoxLevels(queue: true); break; case "history": BuildBoxLevels(queue: false); break; case "valuables": BuildValuables(); break; case "haulers": BuildHaulers(); break; default: BuildText(); break; } } catch (Exception arg) { Plugin.Log.LogWarning((object)$"Panel '{kind ?? cmd}' failed: {arg}"); foreach (Transform item2 in (Transform)content) { Object.Destroy((Object)(object)((Component)item2).gameObject); } tips.Clear(); clicks.Clear(); slots.Clear(); loaders.Clear(); pages = 1; page = 0; BuildText(); } HashSet<string> hashSet = new HashSet<string>(); foreach (AvatarSlot slot in slots) { hashSet.Add(ShotKey(slot)); } StopAvatars(hashSet); Chrome(); if ((Object)(object)hoverBox != (Object)null) { hoverBox.sprite = (((Object)(object)GameArt.MenuGradient != (Object)null) ? GameArt.MenuGradient : GameArt.White); } ((Transform)cursor).SetAsLastSibling(); } private void Chrome() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_021d: Unknown result type (might be due to invalid IL or missing references) float num = 34f; float num2 = 1240f - num - 30f; float num3 = 28f; if ((Object)(object)GameArt.Close != (Object)null) { Pic((Transform)(object)content, GameArt.Close, num2, num3, num, num, White); } else { Label((Transform)(object)content, "X", 34f, White, num2, num3 - 4f, num, 40f, (TextAlignmentOptions)514); } clicks.Add((new Rect(num2 - 12f, num3 - 12f, num + 24f, num + 24f), (Action)Close, Snd.Action)); Fill((Transform)(object)content, 0f, 92f, 1240f, 2f, new Color(Orange.r, Orange.g, Orange.b, 0.47f)); PersonLabel(); page = Mathf.Clamp(page, 0, pages - 1); int num4 = page; int num5 = pages; if (people != null && people.Length > 1) { num4 = 0; num5 = 0; for (int i = 0; i < people.Length; i++) { int num6 = ((i == person) ? pages : PagesOf((Hashtable)/*isinst with value type is only supported in some contexts*/)); if (i < person) { num4 += num6; } num5 += num6; } num4 += page; } if (num5 > 1) { float num7 = 674f; float num8 = 620f; string text = $"{num4 + 1} / {num5}"; TextMeshProUGUI val = Label((Transform)(object)content, text, 24f, new Color(0.92f, 0.92f, 0.92f), num8 - 60f, num7 - 4f, 120f, 30f, (TextAlignmentOptions)258); float num9 = Mathf.Max(40f, ((TMP_Text)val).GetPreferredValues(text).x); Arrow(num8 - num9 / 2f - 33f, num7 + 11f, forward: false, num4 > 0, delegate { Flip(-1); }); Arrow(num8 + num9 / 2f + 33f, num7 + 11f, forward: true, num4 < num5 - 1, delegate { Flip(1); }); } } private static int PagesOf(Hashtable d) { if (d == null || !((Dictionary<object, object>)(object)d).TryGetValue((object)"kind", out object value)) { return 1; } switch (value as string) { case "profile": return Mathf.Max(1, (Count("colN") + 17) / 18); case "badges": return Mathf.Max(1, (Count("n") + 44) / 45); case "abilities": return Mathf.Max(1, (Count("n") + 5) / 6); case "leaderboard": return Mathf.Max(1, (Count("ids") + 5) / 6); case "history": case "queue": return Mathf.Max(1, (Count("lv") + 5) / 6); case "haulers": return Mathf.Max(1, (Count("v") + 5) / 6); default: return 1; } int Count(string key) { if (!((Dictionary<object, object>)(object)d).TryGetValue((object)key, out object value2) || !(value2 is Array array)) { return 0; } return array.Length; } } private void PersonLabel() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (people != null && people.Length >= 2) { Label((Transform)(object)content, $"Match {person + 1} of {people.Length}", 20f, White, 860f, 30f, 300f, 28f, (TextAlignmentOptions)260); string text = Str("id"); if (!string.IsNullOrEmpty(text)) { Label((Transform)(object)content, "Steam ID " + text, 15f, Dim, 860f, 60f, 300f, 22f, (TextAlignmentOptions)260); } tips.Add((new Rect(860f, 26f, 300f, 60f), $"{people.Length} players match '{query}'.\nThe arrows at the bottom go through all of them.", -1)); } } private void Arrow(float cx, float cy, bool forward, bool on, Action act) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) RectTransform val = Box((Transform)(object)content, forward ? "Next" : "Back", cx - 11f, cy - 11f, 22f, 22f); val.pivot = new Vector2(0.5f, 0.5f); val.anchoredPosition = new Vector2(cx, 0f - cy); Image val2 = ((Component)val).gameObject.AddComponent<Image>(); ((Graphic)val2).raycastTarget = false; val2.preserveAspect = true; if ((Object)(object)GameArt.Arrow != (Object)null) { val2.sprite = GameArt.Arrow; } else { val2.sprite = GameArt.White; val.sizeDelta = new Vector2(10f, 18f); } ((Graphic)val2).color = new Color(1f, 1f, 1f, on ? 1f : 0.3f); if (!forward) { ((Transform)val).localScale = new Vector3(-1f, 1f, 1f); } clicks.Add((new Rect(cx - 22f, cy - 22f, 44f, 44f), on ? act : ((Action)delegate { }), on ? Snd.Tick : Snd.Dud)); } private void Title(string title, string subtitle) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI val = Label((Transform)(object)content, (title ?? "").ToUpperInvariant(), 52f, Orange, 32f, 16f, 700f, 64f, (TextAlignmentOptions)257); if (!string.IsNullOrEmpty(subtitle)) { float num = Mathf.Clamp(((TMP_Text)val).GetPreferredValues(((TMP_Text)val).text).x, 40f, 700f); float num2 = ((people != null && people.Length > 1) ? 390f : ((kind == "leaderboard") ? 520f : 90f)); ((TMP_Text)Label((Transform)(object)content, subtitle, 24f, new Color(0.84f, 0.86f, 0.88f), 32f + num + 16f, 38f, 1240f - (32f + num + 16f) - num2, 48f, (TextAlignmentOptions)257)).overflowMode = (TextOverflowModes)1; } } private void BuildTokens() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) Title("Tokens", "this lobby"); int[] array = Ints("counts", 4); float num = 280f; string[] array2 = new string[4] { "COMMON", "UNCOMMON", "RARE", "ULTRA RARE" }; for (int i = 0; i < 4; i++) { float num2 = 60f + num * (float)i + num / 2f; Fill((Transform)(object)content, num2 - num / 2f + 12f, 140f, num - 24f, 420f, new Color(1f, 1f, 1f, 0.055f)); TokenStack(num2, 330f, 96f, i, array[i]); Label((Transform)(object)content, array[i].ToString(), 96f, White, num2 - num / 2f, 340f, num, 120f, (TextAlignmentOptions)258); Label((Transform)(object)content, array2[i], 28f, RarityColor(i), num2 - num / 2f, 480f, num, 40f, (TextAlignmentOptions)258); } int num3 = array[0] + array[1] + array[2] + array[3]; Label((Transform)(object)content, (num3 == 1) ? "1 token in total" : $"{num3} tokens in total", 30f, new Color(0.84f, 0.86f, 0.88f), 0f, 600f, 1240f, 40f, (TextAlignmentOptions)258); } private void TokenStack(float cx, float bottom, float height, int rarity, int count) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) Sprite token = GameArt.Token; float num; if (!((Object)(object)token != (Object)null)) { num = height; } else { Rect rect = token.rect; float num2 = height * ((Rect)(ref rect)).width; rect = token.rect; num = num2 / Mathf.Max(1f, ((Rect)(ref rect)).height); } float num3 = num; float num4 = GameArt.TokenStep * height; int num5 = Mathf.Clamp(count, 1, 3); Color c = GameArt.TokenColors[Mathf.Clamp(rarity, 0, 3)]; if (count <= 0) { c.a = 0.25f; } for (int i = 0; i < num5; i++) { if ((Object)(object)token != (Object)null) { Pic((Transform)(object)content, token, cx - num3 / 2f, bottom - height - (float)i * num4, num3, height, c, keepShape: false); } else { Fill((Transform)(object)content, cx - num3 / 2f, bottom - height * 0.6f - (float)i * num4, num3, height * 0.6f, c); } } } private void BuildProfile() { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) Title("Profile", null); string text = Str("name"); string text2 = Str("joined"); bool flag = ((Dictionary<object, object>)(object)data).ContainsKey((object)"counts"); AddAvatar(32f, 96f, 124f, Str("id"), row: false, lookKnown: true, ((Dictionary<object, object>)(object)data).TryGetValue((object)"colors", out object value) ? (value as int[]) : null, ((Dictionary<object, object>)(object)data).TryGetValue((object)"cos", out object value2) ? (value2 as int[]) : null, ((Dictionary<object, object>)(object)data).TryGetValue((object)"cosN", out object value3) ? (value3 as string[]) : null); TextMeshProUGUI nameLabel = Label((Transform)(object)content, text, 50f, White, 176f, 104f, 360f, 62f, (TextAlignmentOptions)257); if (Int("comp") == 1) { Crown(nameLabel, 176f, 104f, 360f, 62f, 52f); } Label((Transform)(object)content, (!flag) ? "No tokens collected yet" : (string.IsNullOrEmpty(text2) ? "" : ("Joined " + text2)), 24f, new Color(0.8f, 0.82f, 0.84f), 180f, 166f, 360f, 32f, (TextAlignmentOptions)257); int[] array = Ints("counts", 4); for (int i = 0; i < 4; i++) { float num = 560f + (float)i * 120f; TokenStack(num, 172f, 48f, i, array[i]); Label((Transform)(object)content, array[i].ToString(), 30f, White, num - 55f, 176f, 110f, 40f, (TextAlignmentOptions)258); } int num2 = array[0] + array[1] + array[2] + array[3]; Label((Transform)(object)content, num2.ToString(), 60f, White, 1040f, 104f, 160f, 72f, (TextAlignmentOptions)257); Label((Transform)(object)content, "TOKENS", 18f, Dim, 1042f, 180f, 160f, 26f, (TextAlignmentOptions)257); Label((Transform)(object)content, "EQUIPPED BADGES", 20f, Dim, 36f, 232f, 400f, 28f, (TextAlignmentOptions)257); string[] array2 = Strs("eqBn"); int[] a = Ints("eqBr", 0); for (int j = 0; j < 3; j++) { float x = 36f + (float)j * 134f; if (j < array2.Length) { Tile(x, 260f, 126f, 100f, array2[j], At(a, j), 2, array2[j] + "\n" + RarityName(At(a, j)) + " badge, equipped"); } else { EmptyTile(x, 260f, 126f, 100f); } } Label((Transform)(object)content, "EQUIPPED ABILITIES", 20f, Dim, 470f, 232f, 300f, 28f, (TextAlignmentOptions)257); string[] array3 = Strs("eqAn"); int[] a2 = Ints("eqAr", 0); int[] a3 = Ints("eqAm", 0); for (int k = 0; k < 2; k++) { float x2 = 470f + (float)k * 134f; if (k < array3.Length) { Tile(x2, 260f, 126f, 100f, array3[k], At(a2, k), 2, array3[k] + "\n" + RarityName(At(a2, k)) + " ability, equipped" + ((At(a3, k) == 1) ? ", mastered" : "")); } else { EmptyTile(x2, 260f, 126f, 100f); } } Label((Transform)(object)content, "BADGES", 20f, Dim, 780f, 232f, 300f, 28f, (TextAlignmentOptions)257); Label((Transform)(object)content, string.Format("{0} / {1}", Int("bGot"), Int("bAll")), 52f, White, 780f, 256f, 400f, 64f, (TextAlignmentOptions)257); Label((Transform)(object)content, string.Format("{0} / {1} abilities, {2} mastered", Int("aGot"), Int("aAll"), Int("aMas")), 20f, new Color(0.8f, 0.82f, 0.84f), 780f, 326f, 420f, 28f, (TextAlignmentOptions)257); Label((Transform)(object)content, "COLLECTED BADGES", 20f, Dim, 36f, 380f, 400f, 28f, (TextAlignmentOptions)257); string[] array4 = Strs("colN"); int[] a4 = Ints("colR", 0); int[] a5 = Ints("colE", 0); string[] a6 = Strs("colD"); string[] a7 = Strs("colW"); if (array4.Length == 0) { Label((Transform)(object)content, "No badges yet", 22f, Grey, 36f, 420f, 600f, 30f, (TextAlignmentOptions)257); return; } pages = Mathf.Max(1, (array4.Length + 18 - 1) / 18); page = Mathf.Clamp(page, 0, pages - 1); for (int l = 0; l < 18; l++) { int num3 = page * 18 + l; if (num3 < array4.Length) { float x3 = 36f + (float)(l % 9) * 134f; float y = 408f + (float)(l / 9) * 104f; string text3 = At(a6, num3); Tile(x3, y, 126f, 96f, array4[num3], At(a4, num3), (At(a5, num3) != 1) ? 1 : 2, array4[num3] + "\n" + RarityName(At(a4, num3)) + " badge" + (string.IsNullOrEmpty(text3) ? "" : (", earned " + text3)) + ((At(a5, num3) == 1) ? ", equipped" : "") + "\n" + At(a7, num3)); continue; } break; } } private void BuildBadges() { //IL_00d4: 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_0172: Unknown result type (might be due to invalid IL or missing references) string subtitle = Str("name"); Title("Badges", subtitle); string[] array = Strs("n"); int[] a = Ints("r", 0); int[] array2 = Ints("s", 0); string[] a2 = Strs("d"); string[] a3 = Strs("p"); string[] a4 = Strs("w"); int num = 0; int[] array3 = array2; for (int i = 0; i < array3.Length; i++) { if (array3[i] > 0) { num++; } } float num2 = 32f; float num3 = 112f; float num4 = 1176f; Label((Transform)(object)content, $"{num} / {array.Length} earned", 22f, new Color(0.92f, 0.92f, 0.92f), num2, num3 - 2f, 190f, 30f, (TextAlignmentOptions)257); Fill((Transform)(object)content, num2 + 190f, num3 + 8f, num4 - 190f, 12f, new Color(1f, 1f, 1f, 0.16f)); if (num > 0) { Fill((Transform)(object)content, num2 + 190f, num3 + 8f, (num4 - 190f) * (float)num / (float)Mathf.Max(1, array.Length), 12f, Orange); } float num5 = 126f; float num6 = 98f; float num7 = 8f; float num8 = (1240f - (9f * num5 + 8f * num7)) / 2f; pages = Mathf.Max(1, (array.Length + 45 - 1) / 45); page = Mathf.Clamp(page, 0, pages - 1); for (int j = 0; j < 45; j++) { int num9 = page * 45 + j; if (num9 < array.Length) { float x = num8 + (float)(j % 9) * (num5 + num7); float y = 152f + (float)(j / 9) * (num6 + num7); int num10 = At(array2, num9); string text = At(a4, num9); string text2 = At(a3, num9); string text3 = At(a2, num9); string tip = array[num9] + "\n" + RarityName(At(a, num9)) + " badge" + ((num10 > 0) ? ((string.IsNullOrEmpty(text3) ? ", earned" : (", earned " + text3)) + ((num10 == 2) ? ", equipped" : "")) : ((string.IsNullOrEmpty(text2) || text2 == "done") ? ", not earned yet" : (", progress " + text2))) + "\n" + text; Tile(x, y, num5, num6, array[num9], At(a, num9), num10, tip); continue; } break; } } private void BuildAbilities() { //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) string text = Str("name"); string[] array = Strs("n"); int[] a = Ints("r", 0); int[] array2 = Ints("s", 0); string[] a2 = Strs("g"); string[] a3 = Strs("pt"); string[] a4 = Strs("lk"); string[] a5 = Strs("w"); object value; float[] a6 = ((((Dictionary<object, object>)(object)data).TryGetValue((object)"pf", out value) && value is float[] array3) ? array3 : new float[0]); int num = 0; int num2 = 0; int num3 = 0; int[] array4 = array2; foreach (int num4 in array4) { if ((num4 & 1) != 0) { num++; } if ((num4 & 4) != 0) { num2++; } if ((num4 & 2) != 0) { num3++; } } string text2 = string.Format("{0} / {1} unlocked | {2} mastered | {3} / {4} equipped", num, array.Length, num2, num3, Int("eqMax", 2)); Title("Abilities", (Int("self", 1) == 1) ? text2 : (text + " | " + text2)); pages = Mathf.Max(1, (array.Length + 6 - 1) / 6); page = Mathf.Clamp(page, 0, pages - 1); for (int j = 0; j < 6; j++) { int num5 = page * 6 + j; if (num5 >= array.Length) { break; } float num6 = 116f + (float)j * 88f; int num7 = At(array2, num5); int num8 = At(a, num5); bool flag = (num7 & 1) != 0; bool flag2 = (num7 & 2) != 0; bool flag3 = (num7 & 4) != 0; bool flag4 = (num7 & 8) != 0; Fill((Transform)(object)content, 28f, num6, 1184f, 78f, new Color(1f, 1f, 1f, flag ? 0.063f : 0.027f)); Sprite val = GameArt.Box[Mathf.Clamp(num8, 0, 3)]; if ((Object)(object)val != (Object)null) { Pic((Transform)(object)content, val, 44f, num6 + 9f, 76f, 60f, flag ? Color.white : LockedTint); } Label((Transform)(object)content, array[num5].ToUpperInvariant(), 30f, flag ? RarityColor(num8) : Grey, 140f, num6 + 6f, 470f, 38f, (TextAlignmentOptions)257); Label((Transform)(object)content, At(a2, num5), 20f, (Color)(flag ? new Color(0.8f, 0.82f, 0.84f) : Grey), 140f, num6 + 46f, 470f, 28f, (TextAlignmentOptions)257); float num9 = 620f; if (!flag) { if ((Object)(object)GameArt.Lock != (Object)null) { Pic((Transform)(object)content, GameArt.Lock, num9, num6 + 24f, 26f, 26f, new Color(1f, 1f, 1f, 0.85f)); } Label((Transform)(object)content, At(a4, num5), 20f, Dim, num9 + 36f, num6 + 26f, 420f, 28f, (TextAlignmentOptions)257); } else if (flag4) { float num10 = Mathf.Clamp01(At(a6, num5)); Label((Transform)(object)content, flag3 ? "Mastered" : At(a3, num5), 20f, new Color(0.88f, 0.89f, 0.91f), num9, num6 + 12f, 380f, 28f, (TextAlignmentOptions)257); Fill((Transform)(object)content, num9, num6 + 44f, 380f, 14f, new Color(1f, 1f, 1f, 0.16f)); if (num10 > 0f) { Fill((Transform)(object)content, num9, num6 + 44f, 380f * num10, 14f, flag3 ? Purple : Orange); } } else { Label((Transform)(object)content, "Can't be mastered", 20f, Dim, num9, num6 + 26f, 380f, 28f, (TextAlignmentOptions)257); } if (flag && (flag2 || flag3)) { string text3 = (flag2 ? "EQUIPPED" : "MASTERED"); Color val2 = (flag2 ? Gold : Purple); float num11 = 120f; Fill((Transform)(object)content, 1200f - num11, num6 + 24f, num11, 30f, new Color(val2.r, val2.g, val2.b, 0.24f)); Label((Transform)(object)content, text3, 20f, val2, 1200f - num11, num6 + 27f, num11, 28f, (TextAlignmentOptions)258); } tips.Add((new Rect(28f, num6, 1184f, 78f), array[num5] + "\n" + RarityName(num8) + " ability" + (flag ? "" : ", locked") + "\n" + At(a5, num5), flag ? num8 : (-1))); } } private void TypeSearch() { string inputString; try { inputString = Input.inputString; } catch { return; } if (string.IsNullOrEmpty(inputString)) { return; } string text = search; string text2 = inputString; for (int i = 0; i < text2.Length; i++) { char c = text2[i]; switch (c) { case '\b': if (search.Length > 0) { search = search.Substring(0, search.Length - 1); } break; case '\n': case '\r': searchFocus = false; break; default: if (!char.IsControl(c) && search.Length < 32) { search += c; } break; } } if (search != text) { page = 0; Build(); } else { UpdateSearchBox(); } } private void UpdateSearchBox() { //IL_00a4: 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_00fc: 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) if ((Object)(object)searchText == (Object)null) { return; } bool flag = searchFocus && Time.unscaledTime * 2f % 2f < 1.2f; string text = ((search.Length == 0 && !searchFocus) ? "Search players" : (search + (flag ? "|" : ""))); if (((TMP_Text)searchText).text != text) { ((TMP_Text)searchText).text = text; } ((Graphic)searchText).color = ((search.Length == 0 && !searchFocus) ? Grey : White); if (searchEdges == null) { return; } Image[] array = searchEdges; foreach (Image val in array) { if ((Object)(object)val != (Object)null) { ((Graphic)val).color = (Color)(searchFocus ? Orange : new Color(1f, 1f, 1f, 0.3f)); } } } private void SearchBox() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_0147: Unknown result type (might be due to invalid IL or missing references) searchRect = new Rect(740f, 30f, 400f, 44f); float x = ((Rect)(ref searchRect)).x; float y = ((Rect)(ref searchRect)).y; float width = ((Rect)(ref searchRect)).width; float height = ((Rect)(ref searchRect)).height; Fill((Transform)(object)content, x, y, width, height, new Color(0f, 0f, 0f, 0.45f)); searchEdges = (Image[])(object)new Image[4] { Fill((Transform)(object)content, x, y, width, 2f, Color.white), Fill((Transform)(object)content, x, y + height - 2f, width, 2f, Color.white), Fill((Transform)(object)content, x, y, 2f, height, Color.white), Fill((Transform)(object)content, x + width - 2f, y, 2f, height, Color.white) }; searchText = Label((Transform)(object)content, "", 22f, White, x + 14f, y + 7f, width - 28f, 36f, (TextAlignmentOptions)257); tips.Add((searchRect, "Search\nA name or Steam ID. Click to type, Enter or Esc when done.", -1)); UpdateSearchBox(); } private void BuildLeaderboard() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) string[] array = Strs("ids"); string[] a = Strs("n"); int[] a2 = Ints("c", array.Length * 4); int[] a3 = Ints("comp", array.Length); int num = Int("me", -1); Title("Leaderboard", (num >= 0) ? $"you're #{num + 1} of {array.Length}" : $"{array.Length} players"); SearchBox(); if (array.Length == 0) { Label((Transform)(object)content, "Nobody has collected a token yet.", 24f, Dim, 40f, 130f, 800f, 34f, (TextAlignmentOptions)257); return; } List<int> list = new List<int>(); string text = search.Trim(); for (int i = 0; i < array.Length; i++) { if (text.Length == 0 || At(a, i).IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0 || array[i].Contains(text)) { list.Add(i); } } if (list.Count == 0) { Label((Transform)(object)content, "Nobody matches '" + text + "'.", 24f, Dim, 40f, 130f, 800f, 34f, (TextAlignmentOptions)257); return; } pages = Mathf.Max(1, (list.Count + 6 - 1) / 6); page = Mathf.Clamp(page, 0, pages - 1); List<string> list2 = new List<string>(); for (int j = 0; j < 6; j++) { if (page * 6 + j >= list.Count) { break; } int num2 = list[page * 6 + j]; float num3 = 116f + (float)j * 88f; bool flag = num2 == num; Fill((Transform)(object)content, 28f, num3, 1184f, 78f, flag ? new Color(Orange.r, Orange.g, Orange.b, 0.14f) : new Color(1f, 1f, 1f, 0.063f)); if (flag) { Fill((Transform)(object)content, 28f, num3, 4f, 78f, Orange); } Color c = (Color)(num2 switch { 2 => new Color(0.86f, 0.55f, 0.3f), 1 => new Color(0.82f, 0.85f, 0.9f), 0 => Gold, _ => Light, }); Label((Transform)(object)content, "#" + (num2 + 1), 30f, c, 38f, num3 + 20f, 76f, 40f, (TextAlignmentOptions)258); string text2 = array[num2]; string text3 = At(a, num2); AddAvatar(120f, num3 + 4f, 70f, text2, row: true, lookKnown: false, null, null, null); if (!looks.ContainsKey(text2) && (!lookAsked.TryGetValue(text2, out var value) || Time.unscaledTime - value > 5f)) { list2.Add(text2); lookAsked[text2] = Time.unscaledTime; } TextMeshProUGUI nameLabel = Label((Transform)(object)content, text3, 30f, flag ? Orange : White, 206f, num3 + 6f, 520f, 38f, (TextAlignmentOptions)257); if (At(a3, num2) == 1) { Crown(nameLabel, 206f, num3 + 6f, 520f, 38f, 34f); } int num4 = 0; for (int k = 0; k < 4; k++) { int num5 = At(a2, num2 * 4 + k); num4 += num5; float num6 = 222f + (float)k * 100f; TokenStack(num6, num3 + 72f, 22f, k, num5); Label((Transform)(object)content, num5.ToString(), 20f, new Color(0.86f, 0.88f, 0.9f), num6 + 18f, num3 + 48f, 70f, 26f, (TextAlignmentOptions)257); } Label((Transform)(object)content, num4.ToString(), 40f, White, 910f, num3 + 8f, 180f, 48f, (TextAlignmentOptions)260); Label((Transform)(object)content, "TOKENS", 16f, Dim, 910f, num3 + 54f, 180f, 20f, (TextAlignmentOptions)260); float num7 = 76f; float num8 = 54f; float num9 = 1196f - num7; float num10 = num3 + 12f; Fill((Transform)(object)content, num9, num10, num7, num8, Orange); if ((Object)(object)GameArt.SteamProfile != (Object)null) { Pic((Transform)(object)content, GameArt.SteamProfile, num9 + (num7 - 46f) / 2f, num10 + (num8 - 46f) / 2f, 46f, 46f, Color.white); } else { Label((Transform)(object)content, "PROFILE", 16f, Color.white, num9, num10 + 17f, num7, 22f, (TextAlignmentOptions)258); } string pid = text2; clicks.Add((new Rect(num9, num10, num7, num8), (Action)delegate { OpenProfile(pid); }, Snd.Confirm)); tips.Add((new Rect(num9, num10, num7, num8), "Open " + text3 + "'s profile", -1)); } if (list2.Count > 0) { Plugin.AskLooks(list2.ToArray()); } } private string ShotKey(AvatarSlot s) { return s.Id + "|" + (s.Row ? "row" : "big"); } private void Crown(TextMeshProUGUI nameLabel, float x, float y, float maxW, float h, float size) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)GameArt.Crown == (Object)null)) { float num = Mathf.Min(((TMP_Text)nameLabel).GetPreferredValues(((TMP_Text)nameLabel).text).x, maxW); float num2 = x + num + 8f; float num3 = y + h / 2f - size / 2f; Pic((Transform)(object)content, GameArt.Crown, num2, num3, size, size, Color.white); tips.Insert(0, (new Rect(num2 + size * 0.12f, num3 + size * 0.18f, size * 0.76f, size * 0.62f), "Earned all badges.", -2)); } } private static int MaxOf(int[] a) { int num = -1; if (a != null) { foreach (int num2 in a) { if (num2 > num) { num = num2; } } } return num; } private void AddAvatar(float x, float y, float size, string id, bool row, bool lookKnown, int[] colors, int[] cos, string[] cosIds) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_010d: 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) AvatarSlot avatarSlot = new AvatarSlot { Id = (id ?? ""), Rect = new Rect(x, y, size, size), Row = row, LookKnown = lookKnown, Colors = colors, Cos = cos, CosIds = cosIds }; RectTransform val = Box((Transform)(object)content, "Avatar", x, y, size, size); avatarSlot.Image = ((Component)val).gameObject.AddComponent<RawImage>(); ((Graphic)avatarSlot.Image).raycastTarget = false; AvatarHeadshot value; bool flag = shots.TryGetValue(ShotKey(avatarSlot), out value) && value.Ready; ((Graphic)avatarSlot.Image).color = new Color(1f, 1f, 1f, flag ? 1f : 0f); Sprite val2 = (row ? GameArt.Semibot : GameArt.SteamProfile); if ((Object)(object)val2 == (Object)null) { val2 = (row ? GameArt.SteamProfile : GameArt.Semibot); } avatarSlot.Placeholder = Pic((Transform)(object)content, val2, x, y, size, size, (Color)(row ? new Color(0.75f, 0.77f, 0.8f, 0.9f) : Color.white)); ((Component)avatarSlot.Placeholder).gameObject.SetActive(false); avatarSlot.Loader = Loader(x + size / 2f, y + size / 2f, Mathf.Min(size * 0.6f, 56f)); slots.Add(avatarSlot); UpdateAvatar(avatarSlot, new Vector2(-9999f, -9999f)); } private void UpdateAvatar(AvatarSlot slot, Vector2 m) { //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot.Image == (Object)null || slot.Done) { return; } string key = ShotKey(slot); if (!shots.TryGetValue(key, out var value) || !value.Alive) { bool flag = AvatarHeadshot.HasLook(slot.Id, null); if (!flag && !slot.LookKnown) { if (!looks.TryGetValue(slot.Id, out var value2)) { SetLoading(slot, on: true); return; } slot.LookKnown = true; if (!((Dictionary<object, object>)(object)value2).ContainsKey((object)"none")) { slot.Colors = (((Dictionary<object, object>)(object)value2).TryGetValue((object)"colors", out object value3) ? (value3 as int[]) : null); slot.Cos = (((Dictionary<object, object>)(object)value2).TryGetValue((object)"cos", out object value4) ? (value4 as int[]) : null); slot.CosIds = (((Dictionary<object, object>)(object)value2).TryGetValue((object)"cosN", out object value5) ? (value5 as string[]) : null); } } if (!flag && (slot.Colors == null || AvatarHeadshot.IsBlank(slot.Colors, slot.Cos))) { ShowPlaceholder(slot); return; } value = new AvatarHeadshot(slot.Id, slot.Colors, slot.Cos, slot.CosIds) { Size = (slot.Row ? 192 : 384), Target = slot.Image }; if (!value.Spawn()) { value.Dispose(); ShowPlaceholder(slot); return; } shots[key] = value; } if (value.GaveUp) { value.Dispose(); shots.Remove(key); ShowPlaceholder(slot); } else { value.Target = slot.Image; Vector2 center = ((Rect)(ref slot.Rect)).center; value.Tick(new Vector2((m.x - center.x) / (((Rect)(ref slot.Rect)).width * 0.5f), (0f - (m.y - center.y)) / (((Rect)(ref slot.Rect)).height * 0.5f))); SetLoading(slot, !value.Ready); } } private static void SetLoading(AvatarSlot slot, bool on) { if ((Object)(object)slot.Loader != (Object)null && ((Component)slot.Loader).gameObject.activeSelf != on) { ((Component)slot.Loader).gameObject.SetActive(on); } } private static void ShowPlaceholder(AvatarSlot slot) { slot.Done = true; SetLoading(slot, on: false); if ((Object)(object)slot.Placeholder != (Object)null && (Object)(object)slot.Placeholder.sprite != (Object)null) { ((Component)slot.Placeholder).gameObject.SetActive(true); } } private RectTransform Loader(float cx, float cy, float size) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) RectTransform root = Box((Transform)(object)content, "Loading", cx - size / 2f, cy - size / 2f, size, size); RectTransform item = Part(GameArt.LoadCircle, GameArt.LoadCircleColor, size); RectTransform item2 = Part(GameArt.LoadHourglass, GameArt.LoadHourglassColor, size * GameArt.LoadHourglassScale); if ((Object)(object)GameArt.LoadCircle == (Object)null && (Object)(object)GameArt.LoadHourglass == (Object)null) { Label((Transform)(object)root, "...", size * 0.5f, Dim, 0f, size * 0.2f, size, size * 0.6f, (TextAlignmentOptions)258); } loaders.Add((item, item2)); return root; RectTransform Part(Sprite sp, Color col, float s) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0060: 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) //IL_0067: 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: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(((Object)(object)sp != (Object)null) ? ((Object)sp).name : "Part", new Type[1] { typeof(RectTransform) }); val.transform.SetParent((Transform)(object)root, false); RectTransform val2 = (RectTransform)val.transform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); val2.pivot = val3; Vector2 anchorMin = (val2.anchorMax = val3); val2.anchorMin = anchorMin; val2.anchoredPosition = Vector2.zero; val2.sizeDelta = new Vector2(s, s); Image val5 = val.AddComponent<Image>(); val5.sprite = sp; ((Graphic)val5).color = col; val5.preserveAspect = true; ((Graphic)val5).raycastTarget = false; if ((Object)(object)sp == (Object)null) { ((Behaviour)val5).enabled = false; } return val2; } } private void AnimateLoaders() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) float unscaledDeltaTime = Time.unscaledDeltaTime; hourglassLerp += unscaledDeltaTime; if (hourglassLerp > 1f) { hourglassLerp = 0f; } float num = ((GameArt.HourglassCurve != null) ? GameArt.HourglassCurve.Evaluate(hourglassLerp) : Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0f, 0.4f, hourglassLerp))); foreach (var (val, val2) in loaders) { if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { ((Transform)val).Rotate(0f, 0f, (0f - unscaledDeltaTime) * 360f); ((Transform)val2).localEulerAngles = new Vector3(0f, 0f, Mathf.LerpUnclamped(90f, 0f, num)); } } } private void BuildOdds() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_023b: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missin