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 SkinTrade v1.0.0
plugins/SkinTrade.dll
Decompiled 39 minutes ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; 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("SkinTrade")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SkinTrade")] [assembly: AssemblyTitle("SkinTrade")] [assembly: AssemblyVersion("1.0.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 SkinTrade { internal static class CrtKit { private static readonly Dictionary<string, Sprite> _sprites = new Dictionary<string, Sprite>(); private static readonly Dictionary<string, Texture2D> _textures = new Dictionary<string, Texture2D>(); private static Texture2D _logo; private static bool _logoTried; private static float RoundedRectSdf(float x, float y, float w, float h, float inset, float radius) { //IL_0054: 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) float num = w / 2f - inset; float num2 = h / 2f - inset; float num3 = Mathf.Abs(x - w / 2f) - (num - radius); float num4 = Mathf.Abs(y - h / 2f) - (num2 - radius); Vector2 val = new Vector2(Mathf.Max(num3, 0f), Mathf.Max(num4, 0f)); float magnitude = ((Vector2)(ref val)).magnitude; float num5 = Mathf.Min(Mathf.Max(num3, num4), 0f); return magnitude + num5 - radius; } private static Texture2D NewTex(int w, int h, TextureWrapMode wrap = (TextureWrapMode)1, FilterMode filter = (FilterMode)1) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown return new Texture2D(w, h, (TextureFormat)4, false) { wrapMode = wrap, filterMode = filter }; } private static Sprite Sliced(Texture2D tex, float border) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(border, border, border, border)); } public static Sprite RoundedFill(int radius) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) string key = "fill" + radius; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 8; Texture2D val = NewTex(num, num, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num, 0f, radius); array[i * num + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Clamp01(0.5f - num2) * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 2); } public static Sprite RoundedBorder(int radius, int thickness) { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) string key = $"border{radius}_{thickness}"; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 8; Texture2D val = NewTex(num, num, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num, 0f, radius); float num3 = Mathf.Clamp01(0.5f - num2) * Mathf.Clamp01(num2 + (float)thickness + 0.5f); array[i * num + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 2); } public static Sprite BezelFrame(int outerRadius, int inset, int holeRadius) { //IL_0128: 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) string key = $"bezel{outerRadius}_{inset}_{holeRadius}"; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = inset + holeRadius + 4; int num2 = num * 2 + 16; Texture2D val = NewTex(num2, num2, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num2 * num2]; for (int i = 0; i < num2; i++) { for (int j = 0; j < num2; j++) { float x = (float)j + 0.5f; float num3 = (float)i + 0.5f; float num4 = RoundedRectSdf(x, num3, num2, num2, 0f, outerRadius); float num5 = RoundedRectSdf(x, num3, num2, num2, inset, holeRadius); float num6 = Mathf.Clamp01(0.5f - num4) * Mathf.Clamp01(num5 + 0.5f); float num7 = Mathf.Clamp01(1f - num5 / 10f); float num8 = Mathf.Clamp01(1f - (0f - num4) / 6f) * (num3 / (float)num2); byte b = (byte)(Mathf.Clamp01(0.82f - 0.45f * num7 * num7 + 0.25f * num8) * 255f); array[i * num2 + j] = new Color32(b, b, b, (byte)(num6 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, num); } public static Sprite Coin() { //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("coin", out var value)) { return value; } Texture2D val = NewTex(96, 96, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[9216]; float num = 48f; for (int i = 0; i < 96; i++) { for (int j = 0; j < 96; j++) { float num2 = (float)j + 0.5f - num; float num3 = (float)i + 0.5f - num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Clamp01(num - 1f - num4 + 0.5f); float num6 = ((!(num4 > num - 9f)) ? ((!(num4 > num - 13f)) ? ((!(Mathf.Abs(num4 - (num - 24f)) < 1.6f)) ? 0.85f : 0.6f) : 0.95f) : 0.62f); num6 += 0.15f * Mathf.Clamp01((num3 - num2) / 96f); byte b = (byte)(Mathf.Clamp01(num6) * 255f); array[i * 96 + j] = new Color32(b, b, b, (byte)(num5 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites["coin"] = Sprite.Create(val, new Rect(0f, 0f, 96f, 96f), new Vector2(0.5f, 0.5f), 100f); } private static float Noise01(int x, int y, int seed) { int num = x * 374761393 + y * 668265263 + seed * int.MaxValue; int num2 = (num ^ (num >> 13)) * 1274126177; return (float)((num2 ^ (num2 >> 16)) & 0xFFFF) / 65535f; } public static Sprite BevelCap(int radius) { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) string key = "cap" + radius; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 40; int num2 = radius * 2 + 24; Texture2D val = NewTex(num, num2, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num2]; for (int i = 0; i < num2; i++) { for (int j = 0; j < num; j++) { float num3 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num2, 0f, radius); float num4 = Mathf.Clamp01(0.5f - num3); float num5 = (float)i / (float)(num2 - 1); float num6 = Mathf.Lerp(0.62f, 0.96f, num5); float num7 = Mathf.Clamp01(1f + num3 / 5f); float num8 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((num5 - 0.2f) / 0.6f)); num6 += num7 * (0.25f * num8 - 0.35f * (1f - num8)); if (Noise01(j, i, 3) > 0.985f) { num6 *= 0.55f; } num6 *= 0.96f + 0.04f * Noise01(j / 2, i / 2, 7); byte b = (byte)(Mathf.Clamp01(num6) * 255f); array[i * num + j] = new Color32(b, b, b, (byte)(num4 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 3); } public static Sprite Recess(int radius) { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) string key = "recess" + radius; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 24; Texture2D val = NewTex(num, num, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num, 0f, radius); float num3 = Mathf.Clamp01(0.5f - num2); float num4 = Mathf.Clamp01(1f + num2 / 7f); float num5 = (float)i / (float)(num - 1); float num6 = Mathf.SmoothStep(0f, 1f, num5); byte b = (byte)(Mathf.Clamp01(0.15f + num4 * (0.2f * Mathf.Pow(1f - num6, 1.5f) - 0.1f * num6)) * 255f); array[i * num + j] = new Color32(b, b, b, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 3); } public static Sprite LampBezel(int radius, int thickness) { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) string key = $"lbez{radius}_{thickness}"; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 16; Texture2D val = NewTex(num, num, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num, 0f, radius); float num3 = Mathf.Clamp01(0.5f - num2) * Mathf.Clamp01(num2 + (float)thickness + 0.5f); float num4 = (float)(num - j + i) / (2f * (float)num); float num5 = 1f - Mathf.Abs((0f - num2) / (float)thickness - 0.5f) * 2f; byte b = (byte)(Mathf.Clamp01(0.35f + 0.5f * num4 + 0.2f * num5) * 255f); array[i * num + j] = new Color32(b, b, b, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 3); } public static Sprite Lens(int radius) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) string key = "lens" + radius; if (_sprites.TryGetValue(key, out var value)) { return value; } int num = radius * 2 + 16; Texture2D val = NewTex(num, num, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num]; float num2 = (float)num / 2f; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num3 = RoundedRectSdf((float)j + 0.5f, (float)i + 0.5f, num, num, 0f, radius); float num4 = Mathf.Clamp01(0.5f - num3); Vector2 val2 = new Vector2((float)j + 0.5f - num2, (float)i + 0.5f - num2 * 0.9f); float num5 = ((Vector2)(ref val2)).magnitude / num2; byte b = (byte)(Mathf.Clamp01(Mathf.Lerp(1f, 0.45f, Mathf.Clamp01(num5)) - 0.25f * Mathf.Clamp01(1f + num3 / 4f)) * 255f); array[i * num + j] = new Color32(b, b, b, (byte)(num4 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites[key] = Sliced(val, radius + 3); } public static Sprite SoftGlow() { //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("glow", out var value)) { return value; } Texture2D val = NewTex(128, 128, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[16384]; float num = 64f; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { Vector2 val2 = new Vector2((float)j + 0.5f - num, (float)i + 0.5f - num); float num2 = ((Vector2)(ref val2)).magnitude / num; float num3 = Mathf.Exp((0f - num2) * num2 * 4.5f) * Mathf.Clamp01((1f - num2) * 6f); array[i * 128 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num3 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites["glow"] = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 100f); } public static Sprite Rivet() { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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) if (_sprites.TryGetValue("rivet", out var value)) { return value; } Texture2D val = NewTex(32, 32, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[1024]; float num = 16f; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num2 = (float)j + 0.5f - num; float num3 = (float)i + 0.5f - num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Clamp01(num - 1f - num4 + 0.5f); byte b = (byte)(Mathf.Clamp01(0.55f + 0.35f * Mathf.Clamp01((num3 - num2) / 32f + 0.3f) - 0.25f * Mathf.Clamp01((num4 - num + 4f) / 3f)) * 255f); array[i * 32 + j] = new Color32(b, b, b, (byte)(num5 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites["rivet"] = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f); } public static Texture2D BrushedMetal() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("brushed", out var value)) { return value; } value = NewTex(256, 128, (TextureWrapMode)0, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[32768]; for (int i = 0; i < 128; i++) { float num = Noise01(0, i, 11); for (int j = 0; j < 256; j++) { byte b = (byte)(Mathf.Clamp01(0.5f + 0.35f * (num - 0.5f) + 0.15f * (Noise01(j / 8, i, 13) - 0.5f)) * 255f); array[i * 256 + j] = new Color32(b, b, b, (byte)40); } } value.SetPixels32(array); value.Apply(); return _textures["brushed"] = value; } public static Texture2D FadeLine() { //IL_0069: 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) if (_textures.TryGetValue("fadeline", out var value)) { return value; } value = NewTex(1, 128, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[128]; for (int i = 0; i < 128; i++) { float num = Mathf.Sin((float)i / 127f * MathF.PI); array[i] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Pow(num, 0.7f) * 255f)); } value.SetPixels32(array); value.Apply(); return _textures["fadeline"] = value; } public static Texture2D HousingTexture(float wf, float hf, float inset, float holeBottom, float outerRadius, float holeRadius) { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) string key = $"housing{wf}_{hf}_{inset}_{holeBottom}"; if (_textures.TryGetValue(key, out var value)) { return value; } int num = (int)wf; int num2 = (int)hf; Texture2D val = NewTex(num, num2, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[num * num2]; float num3 = (float)num - 2f * inset; float num4 = holeBottom - inset; float num5 = (float)num / 2f; float num6 = inset + num4 / 2f; for (int i = 0; i < num2; i++) { float num7 = (float)(num2 - 1 - i) + 0.5f; float num8 = Noise01(0, i, 11) - 0.5f; float num9 = Noise01(1, i / 3, 17) - 0.5f; for (int j = 0; j < num; j++) { float num10 = (float)j + 0.5f; float num11 = RoundedRectSdf(num10, num7, num, num2, 0f, outerRadius); float num12 = Mathf.Abs(num10 - num5) - (num3 / 2f - holeRadius); float num13 = Mathf.Abs(num7 - num6) - (num4 / 2f - holeRadius); Vector2 val2 = new Vector2(Mathf.Max(num12, 0f), Mathf.Max(num13, 0f)); float num14 = ((Vector2)(ref val2)).magnitude + Mathf.Min(Mathf.Max(num12, num13), 0f) - holeRadius; float num15 = Mathf.Clamp01(0.5f - num11) * Mathf.Clamp01(num14 + 0.5f); if (num15 <= 0f) { array[i * num + j] = new Color32((byte)0, (byte)0, (byte)0, (byte)0); continue; } float num16 = 0.82f + (0.07f * num8 + 0.05f * num9 + 0.04f * (Noise01(j / 9, i, 13) - 0.5f)); float num17 = Mathf.Clamp01(1f - num14 / 12f); byte b = (byte)(Mathf.Clamp01(num16 - 0.42f * num17 * num17 + 0.12f * Mathf.Clamp01(1f - (num14 - 12f) / 5f) * Mathf.Clamp01(num14 - 11f) + 0.18f * Mathf.Clamp01(1f + num11 / 6f) * Mathf.Clamp01(1f - num7 / (float)num2 * 2f) - 0.15f * Mathf.Clamp01(1f + num11 / 8f) * Mathf.Clamp01(num7 / (float)num2 * 2f - 1f) - 0.06f * (num7 / (float)num2)) * 255f); array[i * num + j] = new Color32(b, b, b, (byte)(num15 * 255f)); } } val.SetPixels32(array); val.Apply(); return _textures[key] = val; } public static Sprite Knob() { //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("knob", out var value)) { return value; } Texture2D val = NewTex(128, 128, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[16384]; float num = 64f; float num2 = num - 2f; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num3 = (float)j + 0.5f - num; float num4 = (float)i + 0.5f - num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Clamp01(num2 - num5 + 0.5f); float num7 = Mathf.Atan2(num4, num3); float num8 = Mathf.Clamp01((num4 - num3) / (2f * num2) + 0.5f); float num9 = ((!(num5 > num2 * 0.78f)) ? ((!(num5 > num2 * 0.72f)) ? (0.5f + 0.4f * num8 * (1f - num5 / num2) + 0.15f * (1f - num5 / (num2 * 0.72f))) : 0.25f) : (0.35f + 0.35f * num8 + 0.18f * Mathf.Sign(Mathf.Sin(num7 * 36f)))); byte b = (byte)(Mathf.Clamp01(num9) * 255f); array[i * 128 + j] = new Color32(b, b, b, (byte)(num6 * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites["knob"] = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 100f); } public static Sprite GaugeFace() { //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("gauge", out var value)) { return value; } Texture2D val = NewTex(400, 184, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[73600]; float num = 200f; float num2 = 24f; float num3 = 150f; float num4 = 136f; Color val2 = default(Color); ((Color)(ref val2))..ctor(0.9f, 0.86f, 0.74f); Random random = new Random(7); Color val4 = default(Color); Color val5 = default(Color); Color val6 = default(Color); for (int i = 0; i < 184; i++) { for (int j = 0; j < 400; j++) { float num5 = (float)j + 0.5f - num; float num6 = (float)i + 0.5f - num2; float num7 = Mathf.Sqrt(num5 * num5 + num6 * num6); float num8 = Mathf.Atan2(num5, num6) * 57.29578f; Color val3 = val2 * (0.97f + 0.03f * (float)random.NextDouble()); float num9 = (float)Mathf.Min(j, 399 - j) / 30f; float num10 = (float)Mathf.Min(i, 183 - i) / 24f; val3 *= Mathf.Lerp(0.72f, 1f, Mathf.Clamp01(Mathf.Min(num9, num10))); if (Mathf.Abs(num8) <= 55f && num7 >= num4 && num7 <= num3) { float num11 = (num8 + 55f) / 110f; ((Color)(ref val4))..ctor(0.72f, 0.2f, 0.13f); ((Color)(ref val5))..ctor(0.86f, 0.6f, 0.16f); ((Color)(ref val6))..ctor(0.3f, 0.62f, 0.26f); Color val7 = ((num11 < 0.5f) ? Color.Lerp(val4, val5, num11 * 2f) : Color.Lerp(val5, val6, (num11 - 0.5f) * 2f)); float num12 = Mathf.Clamp01(Mathf.Min(num7 - num4, num3 - num7)); val3 = Color.Lerp(val3, val7, num12); } for (int k = -5; k <= 5; k++) { float num13 = (float)k * 11f; bool flag = k == 0 || k == -5 || k == 5; float num14 = (flag ? 112f : 124f); if (!(num7 < num14) && !(num7 > num3 + 2f)) { float num15 = Mathf.Abs(num7 * Mathf.Sin((num8 - num13) * (MathF.PI / 180f))); if (!(Mathf.Abs(num8 - num13) > 20f)) { float num16 = Mathf.Clamp01((flag ? 2.2f : 1.5f) - num15); val3 = Color.Lerp(val3, new Color(0.14f, 0.12f, 0.09f), num16); } } } float num17 = Mathf.Max(0f, Mathf.Max(28f - ((float)j + 0.5f), (float)j + 0.5f - 372f)); float num18 = Mathf.Max(0f, Mathf.Max(28f - ((float)i + 0.5f), (float)i + 0.5f - 156f)); val3.a = Mathf.Clamp01(28f - Mathf.Sqrt(num17 * num17 + num18 * num18) + 0.5f); array[i * 400 + j] = Color32.op_Implicit(val3); } } val.SetPixels32(array); val.Apply(); return _sprites["gauge"] = Sprite.Create(val, new Rect(0f, 0f, 400f, 184f), new Vector2(0.5f, 0.5f), 100f); } public static Sprite Arrow() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("arrow", out var value)) { return value; } Texture2D val = NewTex(64, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[4096]; Vector2[] poly = (Vector2[])(object)new Vector2[4] { new Vector2(14f, 6f), new Vector2(56f, 32f), new Vector2(14f, 58f), new Vector2(22f, 32f) }; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { int num = 0; for (int k = 0; k < 4; k++) { for (int l = 0; l < 4; l++) { if (Inside(poly, new Vector2((float)j + ((float)l + 0.5f) / 4f, (float)i + ((float)k + 0.5f) / 4f))) { num++; } } } array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num * 255 / 16)); } } val.SetPixels32(array); val.Apply(); return _sprites["arrow"] = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); } public static Sprite Star() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_00e1: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("star", out var value)) { return value; } Texture2D val = NewTex(64, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[4096]; Vector2[] array2 = (Vector2[])(object)new Vector2[10]; for (int i = 0; i < 10; i++) { float num = ((i % 2 == 0) ? 30f : 12.5f); float num2 = MathF.PI / 2f + (float)i * MathF.PI / 5f; array2[i] = new Vector2(32f + num * Mathf.Cos(num2), 31f + num * Mathf.Sin(num2)); } for (int j = 0; j < 64; j++) { for (int k = 0; k < 64; k++) { int num3 = 0; for (int l = 0; l < 4; l++) { for (int m = 0; m < 4; m++) { if (Inside(array2, new Vector2((float)k + ((float)m + 0.5f) / 4f, (float)j + ((float)l + 0.5f) / 4f))) { num3++; } } } array[j * 64 + k] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num3 * 255 / 16)); } } val.SetPixels32(array); val.Apply(); return _sprites["star"] = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); } public static Texture2D Logo() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown if (_logoTried) { return _logo; } _logoTried = true; try { using Stream stream = typeof(CrtKit).Assembly.GetManifestResourceStream("SkinTrade.logo.png"); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; int num; for (int i = 0; i < array.Length; i += num) { num = stream.Read(array, i, array.Length - i); if (num <= 0) { break; } } MethodInfo methodInfo = GameBridge.FindType("UnityEngine.ImageConversion")?.GetMethod("LoadImage", new Type[2] { typeof(Texture2D), typeof(byte[]) }); if (methodInfo == null) { return null; } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, true) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)2, anisoLevel = 4 }; if (!(bool)methodInfo.Invoke(null, new object[2] { val, array })) { return null; } ((Object)val).hideFlags = (HideFlags)61; _logo = val; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Logo could not be loaded: " + ex.Message)); } return _logo; } public static Sprite MenuPointer() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("pointer", out var value)) { return value; } Texture2D val = NewTex(64, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[4096]; Vector2[] poly = (Vector2[])(object)new Vector2[4] { new Vector2(6f, 58f), new Vector2(58f, 38f), new Vector2(33f, 31f), new Vector2(22f, 6f) }; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { int num = 0; for (int k = 0; k < 4; k++) { for (int l = 0; l < 4; l++) { if (Inside(poly, new Vector2((float)j + ((float)l + 0.5f) / 4f, (float)i + ((float)k + 0.5f) / 4f))) { num++; } } } array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num * 255 / 16)); } } val.SetPixels32(array); val.Apply(); return _sprites["pointer"] = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.1f, 0.9f), 100f); } public static Sprite Shirt() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0162: 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_0251: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("shirt", out var value)) { return value; } Texture2D val = NewTex(64, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[4096]; Vector2[] poly = (Vector2[])(object)new Vector2[14] { new Vector2(22f, 54f), new Vector2(27f, 54f), new Vector2(29.5f, 50f), new Vector2(34.5f, 50f), new Vector2(37f, 54f), new Vector2(42f, 54f), new Vector2(58f, 44f), new Vector2(52f, 33f), new Vector2(46f, 37f), new Vector2(46f, 8f), new Vector2(18f, 8f), new Vector2(18f, 37f), new Vector2(12f, 33f), new Vector2(6f, 44f) }; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { int num = 0; for (int k = 0; k < 4; k++) { for (int l = 0; l < 4; l++) { if (Inside(poly, new Vector2((float)j + ((float)l + 0.5f) / 4f, (float)i + ((float)k + 0.5f) / 4f))) { num++; } } } array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num * 255 / 16)); } } val.SetPixels32(array); val.Apply(); return _sprites["shirt"] = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); } private static bool Inside(Vector2[] poly, Vector2 p) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) bool flag = false; int num = 0; int num2 = poly.Length - 1; while (num < poly.Length) { if (poly[num].y > p.y != poly[num2].y > p.y && p.x < (poly[num2].x - poly[num].x) * (p.y - poly[num].y) / (poly[num2].y - poly[num].y) + poly[num].x) { flag = !flag; } num2 = num++; } return flag; } public static Texture2D Paper() { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("paper", out var value)) { return value; } value = NewTex(256, 512, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[131072]; for (int i = 0; i < 512; i++) { for (int j = 0; j < 256; j++) { float num = Mathf.Abs((float)(j % 16) - 8f) / 8f * 7f; float num2 = (((float)i < num) ? 0f : 1f); byte b = (byte)(Mathf.Clamp01(0.95f + 0.012f * (Noise01(j / 3, i / 3, 21) - 0.5f) + 0.025f * (Mathf.PerlinNoise((float)j * 0.012f, (float)i * 0.012f) - 0.5f) + (Crease(j, i, 256, 151f, 0.06f, 0.55f) + Crease(j, i, 256, 356f, -0.035f, 0.4f))) * 255f); array[i * 256 + j] = new Color32(b, b, b, (byte)(num2 * 255f)); } } value.SetPixels32(array); value.Apply(); return _textures["paper"] = value; } private static float Crease(int x, int y, int w, float baseY, float tilt, float strength) { float num = baseY + ((float)x - (float)w / 2f) * tilt + 3f * Mathf.Sin((float)x * 0.03f); float num2 = (float)y - num; float num3 = 0.5f + 0.5f * Mathf.Sin((float)x * 0.021f + baseY); return ((num2 < 0f) ? ((0f - Mathf.Exp(num2 / 1.6f)) * 0.07f) : (Mathf.Exp((0f - num2) / 5f) * 0.035f)) * strength * (0.4f + 0.6f * num3); } public static Texture2D Scanlines() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("scan", out var value)) { return value; } value = NewTex(1, 4, (TextureWrapMode)0, (FilterMode)0); value.SetPixels32((Color32[])(object)new Color32[4] { new Color32((byte)0, (byte)0, (byte)0, (byte)0), new Color32((byte)0, (byte)0, (byte)0, (byte)20), new Color32((byte)0, (byte)0, (byte)0, (byte)110), new Color32((byte)0, (byte)0, (byte)0, (byte)55) }); value.Apply(); return _textures["scan"] = value; } public static Texture2D Noise() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("noise", out var value)) { return value; } value = NewTex(128, 128, (TextureWrapMode)0, (FilterMode)0); Random random = new Random(1234); Color32[] array = (Color32[])(object)new Color32[16384]; for (int i = 0; i < array.Length; i++) { byte b = (byte)random.Next(0, 256); array[i] = new Color32(b, b, b, (byte)random.Next(0, 40)); } value.SetPixels32(array); value.Apply(); return _textures["noise"] = value; } public static Sprite Ring() { //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (_sprites.TryGetValue("ring", out var value)) { return value; } Texture2D val = NewTex(64, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[4096]; float num = 32f; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { Vector2 val2 = new Vector2((float)j + 0.5f - num, (float)i + 0.5f - num); float num2 = ((Vector2)(ref val2)).magnitude / num; float num3 = Mathf.Clamp01(Mathf.Min(num2 - 0.62f, 0.86f - num2) * num); float num4 = Mathf.Clamp01((0.16f - num2) * num); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Max(num3, num4) * 255f)); } } val.SetPixels32(array); val.Apply(); return _sprites["ring"] = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); } public static Texture2D Static() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("static", out var value)) { return value; } value = NewTex(256, 256, (TextureWrapMode)0, (FilterMode)0); Random random = new Random(4321); Color32[] array = (Color32[])(object)new Color32[65536]; for (int i = 0; i < 256; i++) { float num = 0.75f + 0.25f * (float)random.NextDouble(); for (int j = 0; j < 256; j++) { byte b = (byte)Mathf.Clamp((float)random.NextDouble() * 255f * num, 0f, 255f); array[i * 256 + j] = new Color32(b, b, b, byte.MaxValue); } } value.SetPixels32(array); value.Apply(); return _textures["static"] = value; } public static Texture2D Vignette() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("vig", out var value)) { return value; } value = NewTex(128, 128, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = ((float)j + 0.5f) / 128f * 2f - 1f; float num2 = ((float)i + 0.5f) / 128f * 2f - 1f; float num3 = Mathf.Pow(Mathf.Pow(Mathf.Abs(num), 4f) + Mathf.Pow(Mathf.Abs(num2), 4f), 0.25f); float num4 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.72f, 1.05f, num3)) * 0.62f; array[i * 128 + j] = new Color32((byte)0, (byte)0, (byte)0, (byte)(num4 * 255f)); } } value.SetPixels32(array); value.Apply(); return _textures["vig"] = value; } public static Texture2D Glare() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("glare", out var value)) { return value; } value = NewTex(128, 128, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = (float)j / 128f; float num2 = (float)i / 128f; float num3 = Mathf.Clamp01(1f - Mathf.Abs(num + (1f - num2) - 0.55f) * 3.5f); float num4 = num3 * num3 * 0.07f * Mathf.Clamp01(1.4f - num); array[i * 128 + j] = new Color32(byte.MaxValue, (byte)240, (byte)210, (byte)(num4 * 255f)); } } value.SetPixels32(array); value.Apply(); return _textures["glare"] = value; } public static Texture2D RollBand() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (_textures.TryGetValue("roll", out var value)) { return value; } value = NewTex(1, 64, (TextureWrapMode)1, (FilterMode)1); Color32[] array = (Color32[])(object)new Color32[64]; for (int i = 0; i < 64; i++) { float num = Mathf.Sin((float)i / 63f * MathF.PI); array[i] = new Color32(byte.MaxValue, (byte)230, (byte)170, (byte)(num * num * 16f)); } value.SetPixels32(array); value.Apply(); return _textures["roll"] = value; } } internal sealed class CurvedRawImage : RawImage { private const int Segments = 32; private const int TearRows = 56; private float _curvature; private float _tear; private float _roll; private float _seed; public float Curvature { get { return _curvature; } set { value = Mathf.Clamp(value, 0f, 0.3f); if (!Mathf.Approximately(value, _curvature)) { _curvature = value; ((Graphic)this).SetVerticesDirty(); } } } public void SetGlitch(float tear, float roll, float seed) { if (!Mathf.Approximately(tear, _tear) || !Mathf.Approximately(roll, _roll) || !Mathf.Approximately(seed, _seed)) { _tear = tear; _roll = roll; _seed = seed; ((Graphic)this).SetVerticesDirty(); } } private static float Hash(float a, float b) { float num = Mathf.Sin(a * 127.1f + b * 311.7f) * 43758.547f; return num - Mathf.Floor(num); } public static Vector2 Warp(Vector2 q, float k) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (k <= 0f) { return q; } float num = (q.x * q.x + q.y * q.y) * 0.5f; return q * ((1f - k * num) / (1f - k)); } public static Vector2 Unwarp(Vector2 p, float k) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (k <= 0f) { return p; } Vector2 val = p; for (int i = 0; i < 8; i++) { float num = (val.x * val.x + val.y * val.y) * 0.5f; val = p * ((1f - k) / (1f - k * num)); } return val; } protected override void OnPopulateMesh(VertexHelper vh) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) if (_tear > 0.001f || Mathf.Abs(_roll) > 0.0001f) { PopulateGlitched(vh); return; } vh.Clear(); Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect(); Rect uvRect = ((RawImage)this).uvRect; Color32 val = Color32.op_Implicit(((Graphic)this).color); Vector2 val2 = default(Vector2); Vector3 val4 = default(Vector3); for (int i = 0; i <= 32; i++) { for (int j = 0; j <= 32; j++) { ((Vector2)(ref val2))..ctor((float)j / 32f, (float)i / 32f); Vector2 val3 = Warp(val2 * 2f - Vector2.one, _curvature); ((Vector3)(ref val4))..ctor(((Rect)(ref pixelAdjustedRect)).center.x + val3.x * ((Rect)(ref pixelAdjustedRect)).width * 0.5f, ((Rect)(ref pixelAdjustedRect)).center.y + val3.y * ((Rect)(ref pixelAdjustedRect)).height * 0.5f, 0f); vh.AddVert(val4, val, Vector4.op_Implicit(new Vector2(((Rect)(ref uvRect)).x + val2.x * ((Rect)(ref uvRect)).width, ((Rect)(ref uvRect)).y + val2.y * ((Rect)(ref uvRect)).height))); } } int num = 33; for (int k = 0; k < 32; k++) { for (int l = 0; l < 32; l++) { int num2 = k * num + l; vh.AddTriangle(num2, num2 + num, num2 + num + 1); vh.AddTriangle(num2, num2 + num + 1, num2 + 1); } } } private void PopulateGlitched(VertexHelper vh) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_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) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) //IL_013e: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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) vh.Clear(); Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect(); Rect uvRect = ((RawImage)this).uvRect; Color32 val = Color32.op_Implicit(((Graphic)this).color); int num = 0; Vector3 val3 = default(Vector3); for (int i = 0; i < 56; i++) { float num2 = Hash(i, _seed); float num3 = ((num2 > 0.78f) ? ((Hash((float)i + 17f, _seed) - 0.5f) * 0.32f) : ((num2 - 0.5f) * 0.025f)); float num4 = Mathf.Sin((float)i * 0.45f + _seed * 3.1f) * 0.012f; float num5 = (num3 + num4) * _tear; float num6 = (float)i / 56f; float num7 = (float)(i + 1) / 56f; for (int j = 0; j <= 32; j++) { float num8 = (float)j / 32f; float[] array = new float[2] { num6, num7 }; foreach (float num9 in array) { Vector2 val2 = Warp(new Vector2(num8, num9) * 2f - Vector2.one, _curvature); ((Vector3)(ref val3))..ctor(((Rect)(ref pixelAdjustedRect)).center.x + val2.x * ((Rect)(ref pixelAdjustedRect)).width * 0.5f, ((Rect)(ref pixelAdjustedRect)).center.y + val2.y * ((Rect)(ref pixelAdjustedRect)).height * 0.5f, 0f); vh.AddVert(val3, val, Vector4.op_Implicit(new Vector2(((Rect)(ref uvRect)).x + (num8 + num5) * ((Rect)(ref uvRect)).width, ((Rect)(ref uvRect)).y + (num9 + _roll) * ((Rect)(ref uvRect)).height))); } } for (int l = 0; l < 32; l++) { int num10 = num + l * 2; vh.AddTriangle(num10, num10 + 1, num10 + 3); vh.AddTriangle(num10, num10 + 3, num10 + 2); } num += 66; } } } internal sealed class DealAnnouncer : MonoBehaviour { private struct Step { public float At; public string Text; } private float _start = -1f; private Step[] _steps; private float _length; private Color _main; private Color _flash; private Action _onDone; private string _shown; private float _shownAt; private string _hint; private float _hintAt; private int _hintTyped; private const float TextY = 330f; private Image _glow; private Canvas _canvas; private TextMeshProUGUI _text; private TextMeshProUGUI _hintText; private string _invite; private float _inviteAlpha; private float _inviteAt; private int _inviteTyped; private TextMeshProUGUI _inviteText; private string _prompt; private float _promptAlpha; private TextMeshProUGUI _promptText; public void ShowAsk(string hint) { //IL_0070: 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) List<Step> list = new List<Step>(); float num = 0f; for (int i = 1; i <= "WANNA TRADE?".Length; i++) { if ("WANNA TRADE?"[i - 1] != ' ') { list.Add(new Step { At = num, Text = "WANNA TRADE?".Substring(0, i) }); num += 0.075f; } } Play(list.ToArray(), -1f, UiKit.Yellow, Color.white, null); _hint = hint; _hintAt = Time.unscaledTime + num + 0.15f; _hintTyped = 0; } public void PlayConfirm(Action onDone) { //IL_00b1: 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) List<Step> list = new List<Step>(); for (int i = 1; i <= 3; i++) { list.Add(new Step { At = 0.34f * (float)(i - 1), Text = new string('.', i) }); } float num = 1.35f; for (int j = 1; j <= "LET'S GO".Length; j++) { if ("LET'S GO"[j - 1] != ' ') { list.Add(new Step { At = num, Text = "LET'S GO".Substring(0, j) }); num += 0.075f; } } Play(list.ToArray(), 2.75f, UiKit.Yellow, Color.white, onDone); } public void PlayResult(bool success, string text) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Play(new Step[1] { new Step { At = 0f, Text = text } }, 1.8f, success ? UiKit.Green : UiKit.Red, Color.white, null); if (success) { Sfx.Type(1.5f); } else { Sfx.Deny(); } } public void Stop() { _start = -1f; _shown = null; _hint = null; if ((Object)(object)_text != (Object)null) { ((Component)_text).gameObject.SetActive(false); } if ((Object)(object)_glow != (Object)null) { ((Component)_glow).gameObject.SetActive(false); } if ((Object)(object)_hintText != (Object)null) { ((Component)_hintText).gameObject.SetActive(false); } } private void Play(Step[] steps, float length, Color main, Color flash, Action onDone) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) _steps = steps; _length = length; _main = main; _flash = flash; _onDone = onDone; _shown = null; _hint = null; _start = Time.unscaledTime; } private void Update() { if (_start < 0f) { return; } float num = Time.unscaledTime - _start; if (_length >= 0f && num >= _length) { Action onDone = _onDone; Stop(); onDone?.Invoke(); return; } string text = null; Step[] steps = _steps; for (int i = 0; i < steps.Length; i++) { Step step = steps[i]; if (num >= step.At) { text = step.Text; } } if (text != null) { if (text != _shown) { _shown = text; _shownAt = Time.unscaledTime; bool flag = text == "DEAL!" || text == "LET'S GO"; Sfx.Type(text.EndsWith(".") ? 0.8f : (flag ? 1.3f : (1f + 0.05f * (float)text.Length))); } Draw(ownText: true); } } public void SetInvite(string invite) { if (!string.IsNullOrEmpty(invite) && invite != _invite) { if (_inviteAlpha <= 0f || _invite == null) { _inviteAt = Time.unscaledTime; _inviteTyped = 0; } _invite = invite; } float num = ((string.IsNullOrEmpty(invite) || _start >= 0f) ? 0f : 1f); _inviteAlpha = Mathf.MoveTowards(_inviteAlpha, num, Time.unscaledDeltaTime * ((num > 0f) ? 10f : 4f)); if (_inviteAlpha <= 0f) { _invite = ((num > 0f) ? _invite : null); if ((Object)(object)_inviteText == (Object)null) { return; } } EnsureCanvas(); ((Component)_inviteText).gameObject.SetActive(_inviteAlpha > 0f && _invite != null); if (_inviteAlpha <= 0f || _invite == null) { return; } ((TMP_Text)_inviteText).text = _invite; int num2 = Mathf.Clamp(Mathf.FloorToInt((Time.unscaledTime - _inviteAt) * 55f), 0, _invite.Length); if (num2 > _inviteTyped) { if (!char.IsWhiteSpace(_invite[num2 - 1])) { Sfx.TypeTick(); } _inviteTyped = num2; } ((TMP_Text)_inviteText).maxVisibleCharacters = num2; ((TMP_Text)_inviteText).alpha = _inviteAlpha; } public void SetPrompt(string prompt) { if (!string.IsNullOrEmpty(prompt)) { _prompt = prompt; } float num = ((string.IsNullOrEmpty(prompt) || _start >= 0f) ? 0f : 1f); _promptAlpha = Mathf.MoveTowards(_promptAlpha, num, Time.unscaledDeltaTime * ((num > 0f) ? 8f : 5f)); if (!(_promptAlpha <= 0f) || !((Object)(object)_promptText == (Object)null)) { EnsureCanvas(); ((Component)_promptText).gameObject.SetActive(_promptAlpha > 0f); if (!(_promptAlpha <= 0f)) { ((TMP_Text)_promptText).text = _prompt; ((TMP_Text)_promptText).alpha = _promptAlpha * (0.85f + 0.15f * Mathf.Sin(Time.unscaledTime * 5f)); } } } private void EnsureCanvas() { //IL_0040: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0201: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: 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_0146: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_canvas != (Object)null)) { _canvas = UiKit.CreateCanvas("SkinTradeAnnouncer", 31000, matchHeight: true); _glow = UiKit.Image(UiKit.Rect(((Component)_canvas).transform, "Glow", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 330f), new Vector2(900f, 300f)), Color.clear, CrtKit.SoftGlow()); ((Graphic)_glow).raycastTarget = false; RectTransform rt = UiKit.Rect(((Component)_canvas).transform, "Text", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 330f), new Vector2(1400f, 220f)); _text = UiKit.Text(rt, "", 130f, _main, (TextAlignmentOptions)514); ((TMP_Text)_text).extraPadding = true; ((TMP_Text)_text).characterSpacing = 4f; try { ((TMP_Text)_text).outlineWidth = 0.2f; ((TMP_Text)_text).outlineColor = new Color32((byte)28, (byte)12, (byte)0, byte.MaxValue); } catch { } RectTransform rt2 = UiKit.Rect(((Component)_canvas).transform, "Hint", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 215f), new Vector2(1400f, 60f)); _hintText = UiKit.Text(rt2, "", 38f, UiKit.Yellow, (TextAlignmentOptions)514); ((TMP_Text)_hintText).characterSpacing = 4f; UiKit.SoftShadow((TMP_Text)(object)_hintText); RectTransform rt3 = UiKit.Rect(((Component)_canvas).transform, "Invite", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 310f), new Vector2(1600f, 200f)); _inviteText = UiKit.Text(rt3, "", 56f, UiKit.Yellow, (TextAlignmentOptions)514); ((TMP_Text)_inviteText).characterSpacing = 4f; ((TMP_Text)_inviteText).lineSpacing = -10f; UiKit.SoftShadow((TMP_Text)(object)_inviteText); ((Component)_inviteText).gameObject.SetActive(false); RectTransform rt4 = UiKit.Rect(((Component)_canvas).transform, "Prompt", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -90f), new Vector2(1200f, 50f)); _promptText = UiKit.Text(rt4, "", 32f, UiKit.Yellow, (TextAlignmentOptions)514); ((TMP_Text)_promptText).characterSpacing = 3f; UiKit.SoftShadow((TMP_Text)(object)_promptText); ((Component)_promptText).gameObject.SetActive(false); } } private void Draw(bool ownText) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_01cd: Unknown result type (might be due to invalid IL or missing references) if (ownText || !string.IsNullOrEmpty(_hint)) { EnsureCanvas(); } if ((Object)(object)_canvas == (Object)null) { return; } float num = Time.unscaledTime - _shownAt; ((Component)_text).gameObject.SetActive(ownText); if ((Object)(object)_glow != (Object)null) { ((Component)_glow).gameObject.SetActive(ownText); } if (ownText) { float num2 = Mathf.Max(260f, ((TMP_Text)_text).preferredWidth + 260f); ((Graphic)_glow).rectTransform.sizeDelta = new Vector2(num2, 300f); ((Graphic)_glow).color = new Color(_main.r, _main.g, _main.b, 0.38f * Mathf.Clamp01(num / 0.12f + 0.3f)); ((Component)_glow).transform.localScale = Vector3.one * UiKit.Spring(num); ((TMP_Text)_text).text = _shown; ((Graphic)_text).color = ((num < 0.08f) ? _flash : _main); ((TMP_Text)_text).transform.localScale = Vector3.one * UiKit.Spring(num); ((TMP_Text)_text).rectTransform.anchoredPosition = new Vector2(0f, 330f + 14f * Mathf.Exp(-10f * num) * Mathf.Sin(45f * num)); ((Graphic)_glow).rectTransform.anchoredPosition = ((TMP_Text)_text).rectTransform.anchoredPosition; } bool flag = !string.IsNullOrEmpty(_hint); ((Component)_hintText).gameObject.SetActive(flag); if (!flag) { return; } ((TMP_Text)_hintText).text = _hint; int num3 = Mathf.Clamp(Mathf.FloorToInt((Time.unscaledTime - _hintAt) * 45f), 0, _hint.Length); if (num3 > _hintTyped) { if (!char.IsWhiteSpace(_hint[num3 - 1])) { Sfx.TypeTick(); } _hintTyped = num3; } ((TMP_Text)_hintText).maxVisibleCharacters = num3; ((TMP_Text)_hintText).alpha = ((num3 < _hint.Length) ? 1f : (0.75f + 0.25f * Mathf.Sin(Time.unscaledTime * 4f))); } } internal static class GameBridge { public enum LookPart { None, RightHand, LeftHand, Body } private struct Arm { public Vector3 Shoulder; public Vector3 Hand; } private const BindingFlags All = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; private static readonly Dictionary<string, Type> _types = new Dictionary<string, Type>(); private static bool _resolved; private static bool _ok; private static Type _metaType; private static FieldInfo _saveReady; private static FieldInfo _unlocks; private static FieldInfo _equipped; private static FieldInfo _assets; private static FieldInfo _tokens; private static MethodInfo _save; private static MethodInfo _updateLocal; private static HashSet<int> _excluded; private static MethodInfo _toUnequip; private static bool _toUnequipResolved; private static readonly string[] DefaultRarityNames = new string[4] { "COMMON", "UNCOMMON", "RARE", "ULTRA RARE" }; private static readonly Color[] RarityColors = (Color[])(object)new Color[4] { new Color(0.35f, 0.95f, 0.35f), new Color(0.3f, 0.65f, 1f), new Color(1f, 0.4f, 0.85f), new Color(1f, 0.8f, 0.15f) }; private static Type _rarityEnum; private static Type _tokenElementType = typeof(int); private static MethodInfo _runIsShop; private static bool _shopResolved; private static MethodInfo _runIsLevel; private static bool _levelResolved; private static bool _truckWarned; private static Component _localAvatar; private static float _localAvatarAt = -9f; private static int _lookFrame = -1; private static int _lookActor; private static LookPart _lookPart; private static bool _handsWarned; private const float HandTolerance = 0.32f; private static Type _leftArmType; private const float ArmTolerance = 0.24f; private static MethodInfo _poseOverride; public static readonly string[] Categories = new string[4] { "HEAD", "BODY", "ARMS", "LEGS" }; private static readonly Dictionary<int, string> _category = new Dictionary<int, string>(); private static float _avatarScanAt = -9f; private static Type _avatarType; private static readonly Dictionary<int, Transform> _avatars = new Dictionary<int, Transform>(); private static MethodInfo _bigMessage; private static bool _bigResolved; private static TMP_FontAsset _font; private static bool _diagDone; private static bool _disabledByUs; private static AudioMixerGroup _sfxGroup; private static float _nextMixerLookup; private static Type _inputKeyType; private static Type _rumbleType; private static MethodInfo _keyDown; private static MethodInfo _keyHold; private static MethodInfo _keyString; private static MethodInfo _rumble; private static MethodInfo _deviceType; private static List<string> _monsterNames; private static float _monsterScanAt = -99f; private static FieldInfo _currentPage; public static string Problem { get; private set; } private static object Meta { get { if (!Resolve()) { return null; } return StaticInstance(_metaType); } } public static bool Ready { get { object meta = Meta; if (meta == null) { return false; } if (_saveReady != null && _saveReady.FieldType == typeof(bool) && !(bool)_saveReady.GetValue(meta)) { return false; } if (Unlocks != null) { return Assets != null; } return false; } } public static List<int> Unlocks { get { if (Meta != null) { return _unlocks.GetValue(Meta) as List<int>; } return null; } } private static List<int> Equipped { get { if (Meta != null && !(_equipped == null)) { return _equipped.GetValue(Meta) as List<int>; } return null; } } private static IList Assets { get { if (Meta != null) { return _assets.GetValue(Meta) as IList; } return null; } } private static IList Tokens { get { if (Meta != null && !(_tokens == null)) { return _tokens.GetValue(Meta) as IList; } return null; } } public static bool TokensAvailable => Tokens != null; public static int AssetCount => Assets?.Count ?? 0; public static List<int> RarityValues { get; private set; } = new List<int> { 0, 1, 2, 3 }; public static LookPart LookPartNow { get { LookTargetActor(); return _lookPart; } } internal static Type FindType(string name) { if (_types.TryGetValue(name, out var value)) { return value; } Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { type = assembly.GetType(name, throwOnError: false); } catch { } if (type != null) { break; } } _types[name] = type; return type; } private static object StaticInstance(Type t) { if (t == null) { return null; } object obj = null; FieldInfo fieldInfo = t.GetField("instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) ?? t.GetField("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (fieldInfo != null) { obj = fieldInfo.GetValue(null); } else { PropertyInfo propertyInfo = t.GetProperty("instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) ?? t.GetProperty("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (propertyInfo != null) { obj = propertyInfo.GetValue(null); } } if (!Alive(obj)) { return null; } return obj; } private static bool Alive(object o) { if (o != null) { Object val = (Object)((o is Object) ? o : null); if (val != null) { return !(val == (Object)null); } return true; } return false; } private static object Get(object inst, string member) { if (inst == null) { return null; } Type type = inst.GetType(); FieldInfo field = type.GetField(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return field.GetValue(inst); } return type.GetProperty(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(inst); } private static bool Resolve() { if (_resolved) { return _ok; } _resolved = true; _metaType = FindType("MetaManager"); if (_metaType == null) { return Fail("Type MetaManager not found (game version not supported)."); } _saveReady = _metaType.GetField("saveReady", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _unlocks = _metaType.GetField("cosmeticUnlocks", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _equipped = _metaType.GetField("cosmeticEquipped", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _assets = _metaType.GetField("cosmeticAssets", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _tokens = _metaType.GetField("cosmeticTokens", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _save = _metaType.GetMethod("Save", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); _updateLocal = _metaType.GetMethod("CosmeticPlayerUpdateLocal", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (_unlocks == null || _unlocks.FieldType != typeof(List<int>)) { return Fail("MetaManager.cosmeticUnlocks not found."); } if (_assets == null) { return Fail("MetaManager.cosmeticAssets not found."); } if (_save == null) { return Fail("MetaManager.Save() not found."); } if (_tokens == null || !typeof(IList).IsAssignableFrom(_tokens.FieldType)) { Plugin.Log.LogWarning((object)"MetaManager.cosmeticTokens not found - coins can't be traded."); } ResolveRarities(); _ok = true; Plugin.Log.LogInfo((object)"Cosmetic data found - trading available."); return true; } private static bool Fail(string msg) { Problem = msg; Plugin.Log.LogError((object)msg); _ok = false; return false; } public static bool Owns(int id) { if (Unlocks != null) { return Unlocks.Contains(id); } return false; } public static bool IsTradeable(int id) { if (id < 0 || id >= AssetCount) { return false; } if (_excluded == null) { _excluded = new HashSet<int>(); string[] array = (Plugin.ExcludedCosmeticIds.Value ?? "").Split(','); for (int i = 0; i < array.Length; i++) { if (int.TryParse(array[i].Trim(), out var result)) { _excluded.Add(result); } } } return !_excluded.Contains(id); } private static object Asset(int id) { IList assets = Assets; if (assets != null && id >= 0 && id < assets.Count) { return assets[id]; } return null; } public static object AssetObject(int id) { return Asset(id); } public static string AssetKey(int id) { object obj = Asset(id); Object val = (Object)((obj is Object) ? obj : null); if (val == null || !(val != (Object)null)) { return ""; } return val.name; } public static string DisplayName(int id) { object obj = Asset(id); if (obj == null) { return "#" + id; } string text = Get(obj, "assetName") as string; if (!string.IsNullOrEmpty(text)) { return text; } return AssetKey(id); } public static int AssetRarity(int id) { object obj = Get(Asset(id), "rarity"); try { return (obj != null) ? Convert.ToInt32(obj) : 0; } catch { return 0; } } public static List<int> EquippedList() { if (Equipped != null) { return new List<int>(Equipped); } return new List<int>(); } public static int[] EquippedColors() { try { return Meta?.GetType().GetField("colorsEquipped", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Meta) as int[]; } catch { return null; } } public static int[] TryOnColors(IEnumerable<int> loadout, IEnumerable<int> received) { int[] array = EquippedColors(); if (array == null) { return null; } int[] array2 = (int[])array.Clone(); try { IList list = Meta?.GetType().GetField("colors", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Meta) as IList; HashSet<int> hashSet = new HashSet<int>(loadout); foreach (int item in received) { if (hashSet.Contains(item)) { int num = AssetTypeIndex(item); if (num >= 0 && num < array2.Length) { object obj = Get(Asset(item), "defaultColor"); Object val = (Object)((obj is Object) ? obj : null); int num2 = ((val != (Object)null && list != null) ? list.IndexOf(val) : 0); array2[num] = ((num2 >= 0) ? num2 : 0); } } } } catch { } return array2; } public static int AssetTypeIndex(int id) { object obj = Get(Asset(id), "type"); try { return (obj == null) ? (-1) : Convert.ToInt32(obj); } catch { return -1; } } public static bool TypeAllowsMultiple(int typeIndex) { try { if (!(Meta?.GetType().GetField("cosmeticTypeAssets", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Meta) is IList list) || typeIndex < 0 || typeIndex >= list.Count || list[typeIndex] == null) { return false; } object obj = Get(list[typeIndex], "canEquipMultiple"); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch { return false; } } public static List<int> TryOnLoadout(IEnumerable<int> give, IEnumerable<int> get) { List<int> list = EquippedList(); HashSet<int> hashSet = new HashSet<int>(give); list.RemoveAll(hashSet.Contains); foreach (int item in get) { HashSet<int> hashSet2 = GameConflicts(list, item); if (hashSet2 != null) { list.RemoveAll(hashSet2.Contains); } else { int type = AssetTypeIndex(item); if (type >= 0 && !TypeAllowsMultiple(type)) { list.RemoveAll((int x) => AssetTypeIndex(x) == type); } } if (!list.Contains(item)) { list.Add(item); } } return list; } private static HashSet<int> GameConflicts(List<int> equipped, int id) { try { object meta = Meta; object obj = Asset(id); if (meta == null || obj == null) { return null; } if (!_toUnequipResolved) { _toUnequipResolved = true; _toUnequip = meta.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == "GetCosmeticsToUnequip" && m.GetParameters().Length == 2 && m.GetParameters()[0].ParameterType == typeof(List<int>)); if (_toUnequip == null) { Plugin.Log.LogWarning((object)"MetaManager.GetCosmeticsToUnequip not found - try-on uses a simple slot check."); } } if (_toUnequip == null) { return null; } if (!(_toUnequip.Invoke(meta, new object[2] { new List<int>(equipped), obj }) is IEnumerable enumerable)) { return null; } IList assets = Assets; HashSet<int> hashSet = new HashSet<int>(); foreach (object item2 in enumerable) { if (item2 is int item) { hashSet.Add(item); continue; } int num = assets?.IndexOf(item2) ?? (-1); if (num >= 0) { hashSet.Add(num); } } return hashSet; } catch { return null; } } private static void ResolveRarities() { if (_tokens != null && _tokens.FieldType.IsGenericType) { _tokenElementType = _tokens.FieldType.GetGenericArguments()[0]; } Type type = _assets?.FieldType; FieldInfo fieldInfo = ((type == null) ? null : (type.IsArray ? type.GetElementType() : (type.IsGenericType ? type.GetGenericArguments()[0] : null)))?.GetField("rarity", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (_tokenElementType.IsEnum) { _rarityEnum = _tokenElementType; } else if (fieldInfo != null && fieldInfo.FieldType.IsEnum) { _rarityEnum = fieldInfo.FieldType; } if (_rarityEnum != null) { RarityValues = (from v in (from object v in Enum.GetValues(_rarityEnum) where !string.Equals(Enum.GetName(_rarityEnum, v), "None", StringComparison.OrdinalIgnoreCase) select Convert.ToInt32(v)).Distinct() orderby v select v).ToList(); } } public static int RarityIndex(int value) { return RarityValues.IndexOf(value); } public static string RarityName(int value) { if (_rarityEnum != null) { string name = Enum.GetName(_rarityEnum, Enum.ToObject(_rarityEnum, value)); if (!string.IsNullOrEmpty(name)) { return Regex.Replace(name, "([a-z])([A-Z])", "$1 $2").ToUpperInvariant(); } } int num = RarityIndex(value); if (num < 0 || num >= DefaultRarityNames.Length) { return "RARITY " + value; } return DefaultRarityNames[num]; } public static Color RarityColor(int value) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(RarityIndex(value), 0, RarityColors.Length - 1); return RarityColors[num]; } public static int[] TokenCounts() { int[] array = new int[RarityValues.Count]; IList tokens = Tokens; if (tokens == null) { return array; } foreach (object item in tokens) { int num; try { num = RarityIndex(Convert.ToInt32(item)); } catch { continue; } if (num >= 0) { array[num]++; } } return array; } private static object MakeToken(int rarityValue) { if (!_tokenElementType.IsEnum) { return Convert.ChangeType(rarityValue, _tokenElementType); } return Enum.ToObject(_tokenElementType, rarityValue); } public static bool ApplyDeal(ICollection<int> giveSkins, ICollection<int> getSkins, int[] giveTokens, int[] getTokens, out string error) { return ApplyChanges(giveSkins, getSkins, giveTokens, getTokens, out error); } public static bool Escrow(ICollection<int> giveSkins, int[] giveTokens, out string error) { return ApplyChanges(giveSkins, Array.Empty<int>(), giveTokens, null, out error); } public static bool AddItems(ICollection<int> skins, int[] tokens, out string error) { return ApplyChanges(Array.Empty<int>(), skins, null, tokens, out error); } private static bool ApplyChanges(ICollection<int> removeSkins, ICollection<int> addSkins, int[] removeTokens, int[] addTokens, out string error) { if (!CanGive(removeSkins, removeTokens, out error)) { return false; } List<int> unlocks = Unlocks; IList tokens = Tokens; try { foreach (int id in removeSkins) { unlocks.RemoveAll((int x) => x == id); Equipped?.RemoveAll((int x) => x == id); } foreach (int addSkin in addSkins) { if (addSkin >= 0 && addSkin < AssetCount && !unlocks.Contains(addSkin)) { unlocks.Add(addSkin); } } try { if (addSkins.Count > 0 && Meta.GetType().GetField("cosmeticHistory", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Meta) is IList list) { foreach (int addSkin2 in addSkins) { while (list.Contains(addSkin2)) { list.Remove(addSkin2); } } } } catch { } if (tokens != null) { for (int num = 0; num < RarityValues.Count; num++) { int num2 = RarityValues[num]; for (int num3 = 0; num3 < At(removeTokens, num); num3++) { for (int num4 = tokens.Count - 1; num4 >= 0; num4--) { if (Convert.ToInt32(tokens[num4]) == num2) { tokens.RemoveAt(num4); break; } } } for (int num5 = 0; num5 < At(addTokens, num); num5++) { tokens.Add(MakeToken(num2)); } } } _save.Invoke(Meta, null); RefreshAvatar(); return true; } catch (Exception ex) { error = ex.GetBaseException().Message; Plugin.Log.LogError((object)("Changing cosmetics failed: " + ex)); return false; } } public static int IdOfKey(string key) { for (int i = 0; i < AssetCount; i++) { if (AssetKey(i) == key) { return i; } } return -1; } public static bool CanGive(ICollection<int> giveSkins, int[] giveTokens, out string error) { error = null; if (!Ready) { error = "save data not ready"; return false; } foreach (int giveSkin in giveSkins) { if (!Owns(giveSkin) || !IsTradeable(giveSkin)) { error = "you no longer own " + DisplayName(giveSkin); return false; } } int[] array = TokenCounts(); for (int i = 0; i < array.Length; i++) { if (At(giveTokens, i) > array[i]) { error = "not enough coins"; return false; } } if (giveTokens != null && giveTokens.Any((int c) => c > 0) && Tokens == null) { error = "coins not supported"; return false; } return true; } private static int At(int[] a, int i) { if (a == null || i >= a.Length) { return 0; } return Math.Max(0, a[i]); } private static void RefreshAvatar() { if (_updateLocal == null) { return; } try { ParameterInfo[] parameters = _updateLocal.GetParameters(); object[] array = new object[parameters.Length]; for (int i = 0; i < parameters.Length; i++) { array[i] = ((parameters[i].ParameterType == typeof(bool)) ? ((object)true) : (parameters[i].ParameterType.IsValueType ? Activator.CreateInstance(parameters[i].ParameterType) : null)); } _updateLocal.Invoke(Meta, array); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Avatar refresh failed (cosmetics update after the next level load): " + ex.GetBaseException().Message)); } } public static bool InShop() { if (!_shopResolved) { _shopResolved = true; _runIsShop = FindType("SemiFunc")?.GetMethod("RunIsShop", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (_runIsShop == null) { Plugin.Log.LogWarning((object)"SemiFunc.RunIsShop not found - using RunManager fallback."); } } try { if (_runIsShop != null) { return (bool)_runIsShop.Invoke(null, null); } object inst = StaticInstance(FindType("RunManager")); object obj = Get(inst, "levelCurrent"); object obj2 = Get(inst, "levelShop"); if (obj == null || obj2 == null) { return false; } if (obj2 is IList list) { return list.Contains(obj); } return obj2 == obj || obj2.Equals(obj); } catch { return false; } } public static bool RunIsLevel() { if (!_levelResolved) { _levelResolved = true; _runIsLevel = FindType("SemiFunc")?.GetMethod("RunIsLevel", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (_runIsLevel == null) { Plugin.Log.LogWarning((object)"SemiFunc.RunIsLevel not found - trading is allowed everywhere."); } } try { return _runIsLevel != null && (bool)_runIsLevel.Invoke(null, null); } catch { return false; } } public static bool LocalInTruck() { try { Component val = LocalAvatar(); if ((Object)(object)val == (Object)null) { return true; } object obj = Get(val, "RoomVolumeCheck") ?? Get(val, "roomVolumeCheck"); if (obj == null) { Type type = FindType("RoomVolumeCheck"); if (type != null) { obj = val.GetComponentInChildren(type); } } if (Get(obj, "inTruck") is bool result) { return result; } } catch { } if (!_truckWarned) { _truckWarned = true; Plugin.Log.LogWarning((object)"Truck detection not available - trading in levels is allowed everywhere."); } return true; } public static bool CanTradeHere() { if (RunIsLevel()) { return LocalInTruck(); } return true; } public static object LevelToken() { try { return Get(StaticInstance(FindType("RunManager")), "levelCurrent"); } catch { return null; } } public static string GameStateToken() { try { return Get(StaticInstance(FindType("GameDirector")), "currentState")?.ToString() ?? ""; } catch { return ""; } } private static Component LocalAvatar() { if ((Object)(object)_localAvatar != (Object)null && Time.unscaledTime - _localAvatarAt < 2f) { return _localAvatar; } _localAvatarAt = Time.unscaledTime; _localAvatar = null; Type type = FindType("PlayerAvatar"); if (type == null) { return null; } object obj = StaticInstance(type); Component val = (Component)((obj is Component) ? obj : null); if (val != null && (Object)(object)val != (Object)null) { return _localAvatar = val; } Object[] array = Object.FindObjectsByType(type, (FindObjectsSortMode)0); foreach (Object obj2 in array) { Component val2 = (Component)(object)((obj2 is Component) ? obj2 : null); if (val2 != null && (Object)(object)val2 != (Object)null) { PhotonView component = val2.GetComponent<PhotonView>(); if (component != null && component.IsMine) { return _localAvatar = val2; } } } return null; } public static int LocalGrabTargetActor() { try { if (!GameKeyHeld("Grab")) { return 0; } int num = LookTargetActor(); if (_lookPart != LookPart.RightHand || !HandshakePoseOk(num)) { return 0; } return num; } catch { return 0; } } public static bool LocalPhysGrabbing() { try { object obj = StaticInstance(FindType("PhysGrabber")); bool flag = default(bool); int num; if (obj != null) { object obj2 = Get(obj, "grabbed"); if (obj2 is bool) { flag = (bool)obj2; num = 1; } else { num = 0; } } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch { return false; } } public static bool IsTumbling(int actor) { try { Transform val = AvatarOf(actor); if ((Object)(object)val == (Object)null || _avatarType == null) { return false; } Component component = ((Component)val).GetComponent(_avatarType); bool flag = default(bool); int num; if ((Object)(object)component != (Object)null) { object obj = Get(component, "isTumbling"); if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch { return false; } } public static bool LocalPoseOk() { if (LocalPhysGrabbing()) { return false; } int num = ((PhotonNetwork.LocalPlayer != null) ? PhotonNetwork.LocalPlayer.ActorNumber : 0); if (num != 0) { return !IsTumbling(num); } return true; } public static bool HandshakePoseOk(int other) { if (!LocalPoseOk()) { return false; } if (other == 0) { return true; } try { Room currentRoom = PhotonNetwork.CurrentRoom; Player val = ((currentRoom != null) ? currentRoom.GetPlayer(other, false) : null); bool flag = default(bool); int num; if (val != null) { object obj = val.CustomProperties[(object)"skintrade.busy"]; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } } else { num = 0; } if (((uint)num & (flag ? 1u : 0u)) != 0) { return false; } } catch { } return true; } public static int LookTargetActor() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_0171: 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) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01da: Unknown result type (might be due to invalid IL or missing references) if (_lookFrame == Time.frameCount) { return _lookActor; } _lookFrame = Time.frameCount; _lookActor = 0; _lookPart = LookPart.None; try { Component val = LocalAvatar(); if ((Object)(object)val == (Object)null || IsOut(val)) { return 0; } object obj = Get(val, "localCamera"); Camera val2 = (Camera)((obj is Camera) ? obj : null); if ((Object)(object)val2 == (Object)null) { val2 = Camera.main; } if ((Object)(object)val2 == (Object)null) { return 0; } AvatarOf(0); int actorNumber = PhotonNetwork.LocalPlayer.ActorNumber; Vector3 position = ((Component)val2).transform.position; Vector3 forward = ((Component)val2).transform.forward; float num = Plugin.MaxDistance.Value * 1.3f + 0.6f; int lookActor = 0; LookPart lookPart = LookPart.None; float num2 = float.MaxValue; foreach (KeyValuePair<int, Transform> avatar in _avatars) { if (avatar.Key == actorNumber || (Object)(object)avatar.Value == (Object)null) { continue; } Component component = ((Component)avatar.Value).GetComponent(_avatarType); if ((Object)(object)component == (Object)null || IsOut(component)) { continue; } Vector3 a = avatar.Value.position + Vector3.up * 0.25f; Vector3 b = avatar.Value.position + Vector3.up * 1.7f; ClosestRaySegment(position, forward, a, b, out var along, out var gap); if (along <= 0.05f || along > num || gap > 0.6f) { continue; } LookPart lookPart2 = ((gap <= 0.5f) ? LookPart.Body : LookPart.None); float num3 = gap + along * 0.05f; if (Arms(component, out var right, out var left)) { float num4 = ArmScore(position, forward, right, num); float num5 = ArmScore(position, forward, left, num); float num6 = Mathf.Min(num4, num5); if (num6 <= 1f) { lookPart2 = ((num4 <= num5) ? LookPart.RightHand : LookPart.LeftHand); num3 = num6 * 0.15f + along * 0.05f; } } else { if (!_handsWarned) { _handsWarned = true; Plugin.Log.LogWarning((object)"Player hands not found - the whole body counts as the right hand."); } if (lookPart2 == LookPart.Body) { lookPart2 = LookPart.RightHand; } } if (lookPart2 != LookPart.None && num3 < num2) { num2 = num3; lookActor = avatar.Key; lookPart = lookPart2; } } _lookPart = lookPart; return _lookActor = lookActor; } catch { return 0; } } private static float RayPointGap(Vector3 o, Vector3 d, Vector3 p, float reach) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL