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 oracle cheat menu v0.0.1
oracle cheat menu.dll
Decompiled an hour 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; [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("RepoMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RepoMenu")] [assembly: AssemblyTitle("RepoMenu")] [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 RepoMenu { internal static class Commands { private struct Pending { public float time; public string command; } private static readonly List<Pending> pending = new List<Pending>(); private static readonly Dictionary<string, List<string>> cache = new Dictionary<string, List<string>>(); private static string lastScene = ""; internal static string Last = ""; internal static int PendingCount => pending.Count; internal static void ClearCache() { cache.Clear(); } internal static bool Run(string command) { DebugCommandHandler commands = Game.Commands; if (!Game.Alive((Object)(object)commands)) { Last = "/" + command + ": command handler not available (load into a level first)"; return false; } int num; string last; if (Game.CallResult(commands, "Execute", out var result, command, true) && result is bool) { num = (((bool)result) ? 1 : 0); if (num != 0) { last = "/" + command + ": sent"; goto IL_007d; } } else { num = 0; } last = "/" + command + ": refused (host only / wrong place / not in a run)"; goto IL_007d; IL_007d: Last = last; return (byte)num != 0; } internal static void RunLater(string command, float seconds) { pending.Add(new Pending { time = Time.unscaledTime + seconds, command = command }); } internal static void Tick() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != lastScene) { lastScene = name; cache.Clear(); } for (int num = pending.Count - 1; num >= 0; num--) { if (!(Time.unscaledTime < pending[num].time)) { string command = pending[num].command; pending.RemoveAt(num); Run(command); } } } internal static List<string> Suggest(string partial) { if (cache.TryGetValue(partial, out var value)) { return value; } value = new List<string>(); DebugCommandHandler commands = Game.Commands; if (Game.Alive((Object)(object)commands) && Game.CallResult(commands, "GetSuggestions", out var result, partial, true) && result is IEnumerable<string> collection) { value.AddRange(collection); } cache[partial] = value; return value; } internal static bool SetMoney(int value) { try { SemiFunc.StatSetRunCurrency(value); Last = "Money set to " + value; return true; } catch (Exception ex) { Last = "Money failed: " + ex.Message; return false; } } internal static bool SetLevelNumber(int value) { try { SemiFunc.StatSetRunLevel(value); Last = "Level number set to " + value; return true; } catch (Exception ex) { Last = "Level failed: " + ex.Message; return false; } } internal static bool SetTotalHaul(int value) { try { SemiFunc.StatSetRunTotalHaul(value); Last = "Total haul set to " + value; return true; } catch (Exception ex) { Last = "Haul failed: " + ex.Message; return false; } } } internal static class Esp { private enum Kind { Player, Enemy, Valuable, Item, Extraction, Trap } private sealed class Part { public Transform t; public Vector3[] pts; } private sealed class Shape { public GameObject owner; public Part[] parts; public float built; } private sealed class Marker { public Kind kind; public GameObject go; public Transform anchor; public Vector3 offset; public string text = ""; public Color color; public float health01 = -1f; public bool dead; public Shape shape; } internal static bool Enabled; internal static bool Players = true; internal static bool Enemies = true; internal static bool Valuables = true; internal static bool Items; internal static bool Extraction = true; internal static bool Traps; internal static bool ShowNames = true; internal static bool ShowDistance = true; internal static bool ShowHealth = true; internal static bool ShowValue = true; internal static bool ShowBoxes = true; internal static bool ShowOffscreen = true; internal static bool ValueTiers; internal static bool Radar; internal static bool OutlineGlow = true; internal static bool AllGreen; internal static float OutlineThickness = 2f; internal static float MaxDistance = 120f; internal static int CameraOverride; private static readonly Color OutlineGreen = new Color(0.25f, 1f, 0.35f, 1f); private static readonly Color PlayerColor = new Color(0.3f, 0.8f, 1f, 1f); private static readonly Color EnemyColor = new Color(1f, 0.25f, 0.2f, 1f); private static readonly Color DeadColor = new Color(0.55f, 0.55f, 0.55f, 1f); private static readonly Color TrapColor = new Color(0.9f, 0.4f, 1f, 1f); private static readonly List<Marker> markers = new List<Marker>(); private static readonly Dictionary<int, Shape> shapes = new Dictionary<int, Shape>(); private static readonly List<Vector2> screenPts = new List<Vector2>(512); private static readonly List<Vector2> hull = new List<Vector2>(64); private static readonly Comparison<Vector2> ptCompare = (Vector2 a, Vector2 b) => (a.x == b.x) ? a.y.CompareTo(b.y) : a.x.CompareTo(b.x); private static float nextCollect; private static float nextPrune; private static GUIStyle labelStyle; private static GUIStyle smallStyle; private static Matrix4x4 viewProj; private static Rect area; private static bool Usable(Camera c) { if ((Object)(object)c != (Object)null) { return ((Behaviour)c).isActiveAndEnabled; } return false; } internal static Camera ActiveCamera() { if (CameraOverride > 0) { Camera[] allCameras = Camera.allCameras; int num = CameraOverride - 1; if (num >= 0 && num < allCameras.Length && Usable(allCameras[num])) { return allCameras[num]; } } GameDirector director = Game.Director; Camera val = (((Object)(object)director != (Object)null) ? director.MainCamera : null); if (Usable(val)) { return val; } val = Camera.main; if (Usable(val)) { return val; } Camera val2 = null; Camera[] allCameras2 = Camera.allCameras; foreach (Camera val3 in allCameras2) { if (Usable(val3) && ((Object)(object)val2 == (Object)null || val3.depth > val2.depth)) { val2 = val3; } } return val2; } internal static string CameraInfo() { Camera val = ActiveCamera(); if ((Object)(object)val == (Object)null) { return "none found"; } string text = (((Object)(object)val.targetTexture != (Object)null) ? (" RT " + ((Texture)val.targetTexture).width + "x" + ((Texture)val.targetTexture).height) : ""); return ((Object)val).name + " (depth " + val.depth + ")" + text + " screen " + Screen.width + "x" + Screen.height + ((CameraOverride > 0) ? (" [manual " + CameraOverride + "]") : " [auto]"); } internal static void CycleCamera() { CameraOverride = (CameraOverride + 1) % (Camera.allCameras.Length + 1); } internal static void LogCameras() { Camera[] allCameras = Camera.allCameras; Plugin.LogInfo("--- CAMERAS (" + allCameras.Length + ") ---"); for (int i = 0; i < allCameras.Length; i++) { Camera val = allCameras[i]; Plugin.LogInfo(i + 1 + ": " + ((Object)val).name + " tag=" + ((Component)val).tag + " depth=" + val.depth + " enabled=" + ((Behaviour)val).enabled + " rt=" + (((Object)(object)val.targetTexture != (Object)null) ? (((Texture)val.targetTexture).width + "x" + ((Texture)val.targetTexture).height) : "none") + " fov=" + val.fieldOfView); } } private static void SetupProjection(Camera cam) { //IL_0001: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) viewProj = cam.projectionMatrix * cam.worldToCameraMatrix; area = (Rect)(((Object)(object)cam.targetTexture == (Object)null) ? cam.pixelRect : new Rect(0f, 0f, (float)Screen.width, (float)Screen.height)); if (((Rect)(ref area)).width <= 1f || ((Rect)(ref area)).height <= 1f) { area = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height); } } private static bool Project(Vector3 w, out Vector2 s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 val = viewProj; float num = val.m30 * w.x + val.m31 * w.y + val.m32 * w.z + val.m33; if (num < 0.05f) { s = Vector2.zero; return false; } float num2 = (val.m00 * w.x + val.m01 * w.y + val.m02 * w.z + val.m03) / num; float num3 = (val.m10 * w.x + val.m11 * w.y + val.m12 * w.z + val.m13) / num; float num4 = num2 * 0.5f + 0.5f; float num5 = num3 * 0.5f + 0.5f; s.x = Mathf.Clamp(((Rect)(ref area)).x + num4 * ((Rect)(ref area)).width, -20000f, 20000f); s.y = Mathf.Clamp((float)Screen.height - (((Rect)(ref area)).y + num5 * ((Rect)(ref area)).height), -20000f, 20000f); return true; } private static Vector3[] BoxCorners(Bounds b) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3[] array = (Vector3[])(object)new Vector3[8]; for (int i = 0; i < 8; i++) { array[i] = new Vector3(((i & 1) == 0) ? ((Bounds)(ref b)).min.x : ((Bounds)(ref b)).max.x, ((i & 2) == 0) ? ((Bounds)(ref b)).min.y : ((Bounds)(ref b)).max.y, ((i & 4) == 0) ? ((Bounds)(ref b)).min.z : ((Bounds)(ref b)).max.z); } return array; } private static Vector3[] SampleMesh(Mesh mesh, int budget) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0147: 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) Vector3[] vertices = mesh.vertices; int num = vertices.Length; if (num == 0) { return null; } List<Vector3> list = new List<Vector3>(budget + 6); int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; for (int i = 1; i < num; i++) { if (vertices[i].x < vertices[num2].x) { num2 = i; } if (vertices[i].x > vertices[num3].x) { num3 = i; } if (vertices[i].y < vertices[num4].y) { num4 = i; } if (vertices[i].y > vertices[num5].y) { num5 = i; } if (vertices[i].z < vertices[num6].z) { num6 = i; } if (vertices[i].z > vertices[num7].z) { num7 = i; } } list.Add(vertices[num2]); list.Add(vertices[num3]); list.Add(vertices[num4]); list.Add(vertices[num5]); list.Add(vertices[num6]); list.Add(vertices[num7]); int num8 = Mathf.Max(1, num / Mathf.Max(8, budget)); for (int j = 0; j < num; j += num8) { list.Add(vertices[j]); } return list.ToArray(); } private static Shape BuildShape(GameObject go) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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) List<Renderer> list = new List<Renderer>(); Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(false); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && val.enabled && (val is MeshRenderer || val is SkinnedMeshRenderer)) { list.Add(val); if (list.Count >= 40) { break; } } } List<Part> list2 = new List<Part>(); int budget = Mathf.Clamp(160 / Mathf.Max(1, list.Count), 8, 96); foreach (Renderer item in list) { Vector3[] array = null; MeshRenderer val2 = (MeshRenderer)(object)((item is MeshRenderer) ? item : null); if ((Object)(object)val2 != (Object)null) { MeshFilter component = ((Component)val2).GetComponent<MeshFilter>(); Mesh val3 = (((Object)(object)component != (Object)null) ? component.sharedMesh : null); try { if ((Object)(object)val3 != (Object)null && val3.isReadable) { array = SampleMesh(val3, budget); } } catch (Exception) { array = null; } } if (array == null) { array = BoxCorners(item.localBounds); } list2.Add(new Part { t = ((Component)item).transform, pts = array }); } if (list2.Count == 0) { list2.Add(new Part { t = go.transform, pts = BoxCorners(new Bounds(Vector3.zero, Vector3.one * 0.6f)) }); } return new Shape { owner = go, parts = list2.ToArray(), built = Time.unscaledTime }; } private static Shape GetShape(GameObject go) { int instanceID = ((Object)go).GetInstanceID(); if (shapes.TryGetValue(instanceID, out var value) && (Object)(object)value.owner != (Object)null && Time.unscaledTime - value.built < 3f) { return value; } value = BuildShape(go); shapes[instanceID] = value; return value; } private static void Prune() { if (Time.unscaledTime < nextPrune) { return; } nextPrune = Time.unscaledTime + 10f; List<int> list = null; foreach (KeyValuePair<int, Shape> shape in shapes) { if ((Object)(object)shape.Value.owner == (Object)null) { if (list == null) { list = new List<int>(); } list.Add(shape.Key); } } if (list == null) { return; } foreach (int item in list) { shapes.Remove(item); } } private static Color TierColor(float value) { //IL_001c: 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_003e: Unknown result type (might be due to invalid IL or missing references) if (value >= 15000f) { return new Color(1f, 0.2f, 0.15f, 1f); } if (value >= 5000f) { return new Color(1f, 0.8f, 0.15f, 1f); } return new Color(0.4f, 1f, 0.4f, 1f); } private static void Add(Kind kind, GameObject go, Transform anchor, Vector3 offset, string text, Color color, float hp01, bool dead) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)go == (Object)null)) { markers.Add(new Marker { kind = kind, go = go, anchor = (((Object)(object)anchor != (Object)null) ? anchor : go.transform), offset = offset, text = text, color = color, health01 = hp01, dead = dead, shape = GetShape(go) }); } } private static void Collect() { nextCollect = Time.unscaledTime + 0.25f; markers.Clear(); if (Players) { Try(CollectPlayers); } if (Enemies) { Try(CollectEnemies); } if (Valuables) { Try(CollectValuables); } if (Items) { Try(CollectItems); } if (Extraction) { Try(CollectExtraction); } if (Traps) { Try(CollectTraps); } Prune(); } private static void Try(Action a) { try { a(); } catch (Exception) { } } private static void CollectPlayers() { //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar localAvatar = Game.LocalAvatar; string steamId = Game.SteamId; PlayerAvatar[] players = Game.Players; foreach (PlayerAvatar val in players) { if ((Object)(object)val == (Object)null || ((Object)(object)localAvatar != (Object)null && (Object)(object)val == (Object)(object)localAvatar)) { continue; } if (!string.IsNullOrEmpty(steamId)) { try { if (SemiFunc.PlayerGetSteamID(val) == steamId) { continue; } } catch { } } string text = (Game.Get(val, "playerName") as string) ?? "player"; bool flag = Game.Get(val, "deadSet") is bool && (bool)Game.Get(val, "deadSet"); float num = -1f; if ((Object)(object)val.playerHealth != (Object)null) { object obj2 = Game.Get(val.playerHealth, "health"); object obj3 = Game.Get(val.playerHealth, "maxHealth"); if (obj2 is int && obj3 is int && (int)obj3 > 0) { num = (float)(int)obj2 / (float)(int)obj3; } } string text2 = ""; if (ShowNames) { text2 = text2 + (flag ? "[DEAD] " : "") + text; } if (ShowHealth && num >= 0f) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "HP " + Mathf.RoundToInt(num * 100f) + "%"; } Add(Kind.Player, ((Component)val).gameObject, ((Component)val).transform, Vector3.up * 0.8f, text2, flag ? DeadColor : PlayerColor, num, flag); } } private static void CollectEnemies() { //IL_0168: 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) EnemyDirector enemyDir = Game.EnemyDir; if ((Object)(object)enemyDir == (Object)null || enemyDir.enemiesSpawned == null) { return; } foreach (EnemyParent item in enemyDir.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object target = Game.Get(item, "Enemy"); object obj = Game.Get(target, "CenterTransform"); Transform val = (Transform)((obj is Transform) ? obj : null); string text = ((Object)((Component)item).gameObject).name.Replace("(Clone)", ""); float num = -1f; object obj2 = Game.Get(target, "Health"); if (obj2 != null) { object obj3 = Game.Get(obj2, "healthCurrent"); object obj4 = Game.Get(obj2, "health"); if (obj3 is float && obj4 is float && (float)obj4 > 0f) { num = (float)obj3 / (float)obj4; } } string text2 = (ShowNames ? text : ""); if (ShowHealth && num >= 0f) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "HP " + Mathf.RoundToInt(num * 100f) + "%"; } Add(Kind.Enemy, ((Component)item).gameObject, ((Object)(object)val != (Object)null) ? val : ((Component)item).transform, Vector3.zero, text2, EnemyColor, num, dead: false); } } private static void CollectValuables() { //IL_00dc: 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_00ea: Unknown result type (might be due to invalid IL or missing references) ValuableDirector instance = ValuableDirector.instance; if ((Object)(object)instance == (Object)null || instance.valuableList == null) { return; } foreach (ValuableObject valuable in instance.valuableList) { if (!((Object)(object)valuable == (Object)null)) { string text = ((Object)((Component)valuable).gameObject).name.Replace("(Clone)", ""); float num = ((Game.Get(valuable, "dollarValueCurrent") is float) ? ((float)Game.Get(valuable, "dollarValueCurrent")) : 0f); string text2 = (ShowNames ? text : ""); if (ShowValue) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "$" + Mathf.RoundToInt(num); } Add(Kind.Valuable, ((Component)valuable).gameObject, ((Component)valuable).transform, Vector3.zero, text2, ValueTiers ? TierColor(num) : OutlineGreen, -1f, dead: false); } } } private static void CollectItems() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) ItemManager instance = ItemManager.instance; if ((Object)(object)instance == (Object)null || instance.spawnedItems == null) { return; } foreach (ItemAttributes spawnedItem in instance.spawnedItems) { if (!((Object)(object)spawnedItem == (Object)null)) { string text = (((Object)(object)spawnedItem.item != (Object)null) ? spawnedItem.item.itemName : ((Object)((Component)spawnedItem).gameObject).name); Add(Kind.Item, ((Component)spawnedItem).gameObject, ((Component)spawnedItem).transform, Vector3.zero, ShowNames ? text : "", OutlineGreen, -1f, dead: false); } } } private static void CollectExtraction() { //IL_004b: 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_006d: Unknown result type (might be due to invalid IL or missing references) RoundDirector round = Game.Round; if ((Object)(object)round == (Object)null || !(Game.Get(round, "extractionPointList") is IEnumerable enumerable)) { return; } foreach (object item in enumerable) { GameObject val = (GameObject)((item is GameObject) ? item : null); if (!((Object)(object)val == (Object)null)) { Add(Kind.Extraction, val, val.transform, Vector3.up * 1f, ShowNames ? "EXTRACTION" : "", OutlineGreen, -1f, dead: false); } } } private static void CollectTraps() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) TrapDirector instance = TrapDirector.instance; if ((Object)(object)instance == (Object)null || instance.TrapList == null) { return; } foreach (GameObject trap in instance.TrapList) { if (!((Object)(object)trap == (Object)null)) { Add(Kind.Trap, trap, trap.transform, Vector3.zero, ShowNames ? "TRAP" : "", TrapColor, -1f, dead: false); } } } private static void EnsureStyles() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown if (labelStyle == null) { labelStyle = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)4, wordWrap = false, clipping = (TextClipping)0 }; smallStyle = new GUIStyle(labelStyle) { fontSize = 10, fontStyle = (FontStyle)0 }; } } internal static void Draw() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { return; } Event current = Event.current; if (current == null || (int)current.type != 7) { return; } Camera val = ActiveCamera(); if ((Object)(object)val == (Object)null) { return; } EnsureStyles(); if (Time.unscaledTime >= nextCollect) { Collect(); } SetupProjection(val); Color color = GUI.color; if (Radar) { DrawRadar(val); } PlayerController instance = PlayerController.instance; Vector3 val2 = (((Object)(object)instance != (Object)null) ? ((Component)instance).transform.position : ((Component)val).transform.position); float num = Screen.width; float num2 = Screen.height; for (int i = 0; i < markers.Count; i++) { Marker marker = markers[i]; if ((Object)(object)marker.go == (Object)null) { continue; } Vector3 val3 = (((Object)(object)marker.anchor != (Object)null) ? marker.anchor.position : marker.go.transform.position) + marker.offset; float num3 = Vector3.Distance(val2, val3); if (num3 > MaxDistance) { continue; } Color val4 = (AllGreen ? OutlineGreen : marker.color); bool flag = marker.kind == Kind.Player || marker.kind == Kind.Enemy || marker.kind == Kind.Extraction; if (!Project(val3, out var s)) { if (ShowOffscreen && flag) { DrawOffscreen(val, val3, val4, num3); } continue; } screenPts.Clear(); Part[] parts = marker.shape.parts; foreach (Part part in parts) { if ((Object)(object)part.t == (Object)null) { continue; } Matrix4x4 localToWorldMatrix = part.t.localToWorldMatrix; Vector3[] pts = part.pts; for (int k = 0; k < pts.Length; k++) { if (Project(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(pts[k]), out var s2)) { screenPts.Add(s2); } } } ConvexHull(screenPts); float num4 = s.x - 8f; float num5 = s.x + 8f; float num6 = s.y - 8f; float num7 = s.y + 8f; if (hull.Count >= 3) { num4 = (num5 = hull[0].x); num6 = (num7 = hull[0].y); for (int l = 1; l < hull.Count; l++) { if (hull[l].x < num4) { num4 = hull[l].x; } if (hull[l].x > num5) { num5 = hull[l].x; } if (hull[l].y < num6) { num6 = hull[l].y; } if (hull[l].y > num7) { num7 = hull[l].y; } } } if (num5 < 0f || num4 > num || num7 < 0f || num6 > num2) { if (ShowOffscreen && flag) { DrawOffscreen(val, val3, val4, num3); } continue; } Rect box = new Rect(num4, num6, Mathf.Max(num5 - num4, 12f), Mathf.Max(num7 - num6, 12f)); if (ShowBoxes) { if (hull.Count >= 3) { DrawPolygon(hull, val4); } else { DrawDiamond(s, 9f, val4); } } DrawInfo(box, marker, val4, num3); } GUI.color = color; } private static void DrawInfo(Rect box, Marker m, Color col, float dist) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00cc: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) float num = ((Rect)(ref box)).y - 4f; if (ShowHealth && m.health01 >= 0f) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref box)).x, num - 5f, Mathf.Max(((Rect)(ref box)).width, 30f), 5f); GUI.color = new Color(0f, 0f, 0f, 0.85f); GUI.DrawTexture(new Rect(((Rect)(ref val)).x - 1f, ((Rect)(ref val)).y - 1f, ((Rect)(ref val)).width + 2f, ((Rect)(ref val)).height + 2f), (Texture)(object)Texture2D.whiteTexture); GUI.color = (m.dead ? DeadColor : Color.Lerp(Color.red, Color.green, m.health01)); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width * Mathf.Clamp01(m.health01), ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); num -= 8f; } string text = m.text; if (ShowDistance) { text = text + ((text.Length > 0) ? "\n" : "") + Mathf.RoundToInt(dist) + "m"; } if (text.Length == 0) { GUI.color = Color.white; return; } int num2 = 1; for (int i = 0; i < text.Length; i++) { if (text[i] == '\n') { num2++; } } float num3 = 15f * (float)num2; float num4 = num - num3; if (num4 < 2f) { num4 = ((Rect)(ref box)).yMax + 2f; } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(Mathf.Clamp(((Rect)(ref box)).center.x - 130f, 0f, (float)Screen.width - 260f), num4, 260f, num3); GUI.color = new Color(0f, 0f, 0f, 0.9f); GUI.Label(new Rect(((Rect)(ref val2)).x + 1f, ((Rect)(ref val2)).y + 1f, ((Rect)(ref val2)).width, ((Rect)(ref val2)).height), text, labelStyle); GUI.color = col; GUI.Label(val2, text, labelStyle); GUI.color = Color.white; } private static void DrawLine(Vector2 a, Vector2 b, float w) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; if (!(magnitude < 0.5f)) { Vector2 val2 = val / magnitude; a -= val2 * (w * 0.5f); magnitude += w; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(num, a); GUI.DrawTexture(new Rect(a.x, a.y - w * 0.5f, magnitude, w), (Texture)(object)Texture2D.whiteTexture); GUI.matrix = matrix; } } private static void DrawPolygon(List<Vector2> poly, Color c) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) int count = poly.Count; float num = Mathf.Max(1f, OutlineThickness); if (OutlineGlow) { GUI.color = new Color(c.r, c.g, c.b, 0.2f); for (int i = 0; i < count; i++) { DrawLine(poly[i], poly[(i + 1) % count], num * 3.5f); } } GUI.color = new Color(0f, 0f, 0f, 0.55f); for (int j = 0; j < count; j++) { DrawLine(poly[j], poly[(j + 1) % count], num + 2f); } GUI.color = c; for (int k = 0; k < count; k++) { DrawLine(poly[k], poly[(k + 1) % count], num); } } private static void DrawDiamond(Vector2 c, float r, Color col) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) DrawPolygon(new List<Vector2>(4) { new Vector2(c.x, c.y - r), new Vector2(c.x + r, c.y), new Vector2(c.x, c.y + r), new Vector2(c.x - r, c.y) }, col); } private static float Cross(Vector2 o, Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x); } private static void ConvexHull(List<Vector2> pts) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0127: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) hull.Clear(); int count = pts.Count; if (count < 3) { hull.AddRange(pts); return; } pts.Sort(ptCompare); for (int i = 0; i < count; i++) { while (hull.Count >= 2 && Cross(hull[hull.Count - 2], hull[hull.Count - 1], pts[i]) <= 0f) { hull.RemoveAt(hull.Count - 1); } hull.Add(pts[i]); } int num = hull.Count + 1; for (int num2 = count - 2; num2 >= 0; num2--) { while (hull.Count >= num && Cross(hull[hull.Count - 2], hull[hull.Count - 1], pts[num2]) <= 0f) { hull.RemoveAt(hull.Count - 1); } hull.Add(pts[num2]); } hull.RemoveAt(hull.Count - 1); } private static void DrawOffscreen(Camera cam, Vector3 world, Color c, float dist) { //IL_0006: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c3: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00eb: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)cam).transform.InverseTransformPoint(world); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(val.x, 0f - val.y); if (((Vector2)(ref val2)).sqrMagnitude < 0.0001f) { ((Vector2)(ref val2))..ctor(0f, 1f); } ((Vector2)(ref val2)).Normalize(); Vector2 val3 = new Vector2((float)Screen.width * 0.5f, (float)Screen.height * 0.5f); float num = (float)Screen.width * 0.5f - 44f; float num2 = (float)Screen.height * 0.5f - 44f; Vector2 val4 = val3 + new Vector2(val2.x * num, val2.y * num2); Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(0f - val2.y, val2.x); DrawPolygon(new List<Vector2>(3) { val4 + val2 * 11f, val4 - val2 * 8f + val5 * 8f, val4 - val2 * 8f - val5 * 8f }, c); if (ShowDistance) { GUI.color = c; GUI.Label(new Rect(val4.x - 30f, val4.y + ((val2.y > 0f) ? (-26f) : 12f), 60f, 16f), Mathf.RoundToInt(dist) + "m", smallStyle); } GUI.color = Color.white; } private static void DrawRadar(Camera cam) { //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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_014f: 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_031e: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: 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) Rect val = default(Rect); ((Rect)(ref val))..ctor(14f, 14f, 200f, 200f); GUI.color = new Color(0f, 0f, 0f, 0.55f); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(0.3f, 0.9f, 0.5f, 1f); float num = 2f; GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, num), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).yMax - num, ((Rect)(ref val)).width, num), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, num, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).xMax - num, ((Rect)(ref val)).y, num, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); PlayerController instance = PlayerController.instance; Vector3 val2 = (((Object)(object)instance != (Object)null) ? ((Component)instance).transform.position : ((Component)cam).transform.position); Vector3 forward = ((Component)cam).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f) { forward = Vector3.forward; } ((Vector3)(ref forward)).Normalize(); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(forward.z, 0f, 0f - forward.x); Vector2 val5 = default(Vector2); for (int i = 0; i < markers.Count; i++) { Marker marker = markers[i]; if (!((Object)(object)marker.go == (Object)null) && (marker.kind == Kind.Player || marker.kind == Kind.Enemy || marker.kind == Kind.Valuable)) { Vector3 val4 = (((Object)(object)marker.anchor != (Object)null) ? marker.anchor.position : marker.go.transform.position) - val2; float num2 = Vector3.Dot(val4, val3) / 40f * 100f; float num3 = Vector3.Dot(val4, forward) / 40f * 100f; ((Vector2)(ref val5))..ctor(((Rect)(ref val)).center.x + num2, ((Rect)(ref val)).center.y - num3); if (!(val5.x < ((Rect)(ref val)).x + 3f) && !(val5.x > ((Rect)(ref val)).xMax - 3f) && !(val5.y < ((Rect)(ref val)).y + 3f) && !(val5.y > ((Rect)(ref val)).yMax - 3f)) { float num4 = ((marker.kind == Kind.Valuable) ? 4f : 6f); GUI.color = (AllGreen ? OutlineGreen : marker.color); GUI.DrawTexture(new Rect(val5.x - num4 * 0.5f, val5.y - num4 * 0.5f, num4, num4), (Texture)(object)Texture2D.whiteTexture); } } } GUI.color = Color.white; GUI.DrawTexture(new Rect(((Rect)(ref val)).center.x - 4f, ((Rect)(ref val)).center.y - 4f, 8f, 8f), (Texture)(object)Texture2D.whiteTexture); GUI.Label(new Rect(((Rect)(ref val)).x + 4f, ((Rect)(ref val)).yMax - 20f, 192f, 18f), "RADAR 40m", smallStyle); GUI.color = Color.white; } } internal static class Features { internal static bool GodMode; internal static bool InfiniteStamina; internal static bool NoTumble; internal static bool SpeedOn; internal static bool MultiJump; internal static bool Noclip; internal static bool AntiKnockback; internal static bool ZeroGravity; internal static bool NoFriction; internal static bool InfiniteReach; internal static float SpeedMultiplier = 2f; internal static float NoclipSpeed = 10f; private static float origMove; private static float origSprint; private static float origJump; private static float origGravity; private static float origFriction; private static float origSlideDecay; private static float origSlideTime; private static int origJumpExtra; private static bool multiJumpWas; private static bool origNoTumble; private static bool savedAny; private static PlayerController lastController; private static float nextGod; private static Vector3 anchorPosition; internal static void Tick() { //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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_027f: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) PlayerController controller = Game.Controller; if ((Object)(object)controller == (Object)null) { lastController = null; return; } if (controller != lastController) { if (savedAny) { RestoreValues(lastController); } lastController = controller; SaveValues(controller); savedAny = true; } if (InfiniteStamina) { controller.DebugEnergy = true; controller.EnergyCurrent = controller.EnergyStart; } else if (savedAny) { controller.DebugEnergy = false; } controller.DebugNoTumble = NoTumble; if (SpeedOn) { controller.OverrideSpeed(SpeedMultiplier, 0.25f, -1f); } if (MultiJump) { Game.Set(controller, "JumpExtra", 100); multiJumpWas = true; } else if (multiJumpWas) { Game.Set(controller, "JumpExtra", origJumpExtra); multiJumpWas = false; } if (GodMode && Time.unscaledTime >= nextGod) { nextGod = Time.unscaledTime + 0.5f; PlayerAvatar localAvatar = Game.LocalAvatar; if ((Object)(object)localAvatar != (Object)null && (Object)(object)localAvatar.playerHealth != (Object)null) { localAvatar.playerHealth.InvincibleSet(1f); } } if (AntiKnockback) { anchorPosition = ((Component)controller).transform.position; if ((Object)(object)controller.rb != (Object)null && !controller.rb.isKinematic) { controller.rb.linearVelocity = Vector3.zero; controller.rb.angularVelocity = Vector3.zero; } ((Component)controller).transform.position = anchorPosition; } if (ZeroGravity) { controller.CustomGravity = 0f; controller.AntiGravity(0.1f); } if (InfiniteReach) { PhysGrabber instance = PhysGrabber.instance; if ((Object)(object)instance != (Object)null) { instance.grabRange = 50f; } } else { PhysGrabber instance2 = PhysGrabber.instance; if ((Object)(object)instance2 != (Object)null && instance2.grabRange > 10f) { instance2.grabRange = 4f; } } if (NoFriction) { controller.SlideDecay = 0.008f; controller.SlideTime = 6f; } else if (savedAny) { controller.SlideDecay = origSlideDecay; controller.SlideTime = origSlideTime; } if (!Noclip) { return; } controller.Kinematic(0.1f); controller.AntiGravity(0.1f); Camera val = (((Object)(object)Game.Director != (Object)null) ? Game.Director.MainCamera : null); if ((Object)(object)val != (Object)null && !MenuWindow.IsOpen) { Vector3 val2 = Vector3.zero; if (Input.GetKey((KeyCode)119)) { val2 += ((Component)val).transform.forward; } if (Input.GetKey((KeyCode)115)) { val2 -= ((Component)val).transform.forward; } if (Input.GetKey((KeyCode)97)) { val2 -= ((Component)val).transform.right; } if (Input.GetKey((KeyCode)100)) { val2 += ((Component)val).transform.right; } if (Input.GetKey((KeyCode)32)) { val2 += Vector3.up; } if (Input.GetKey((KeyCode)306)) { val2 -= Vector3.up; } float num = (Input.GetKey((KeyCode)304) ? 3f : 1f); Transform transform = ((Component)controller).transform; transform.position += val2 * NoclipSpeed * num * Time.deltaTime; } } private static void SaveValues(PlayerController pc) { origMove = pc.MoveSpeed; origSprint = pc.SprintSpeed; origJump = pc.JumpForce; object obj = Game.Get(pc, "JumpExtra"); origJumpExtra = ((obj is int) ? ((int)obj) : 0); origGravity = pc.CustomGravity; origFriction = pc.MoveFriction; origSlideDecay = pc.SlideDecay; origSlideTime = pc.SlideTime; origNoTumble = pc.DebugNoTumble; } private static void RestoreValues(PlayerController pc) { if (!((Object)(object)pc == (Object)null)) { pc.MoveSpeed = origMove; pc.SprintSpeed = origSprint; pc.JumpForce = origJump; pc.CustomGravity = origGravity; pc.MoveFriction = origFriction; pc.SlideDecay = origSlideDecay; pc.SlideTime = origSlideTime; pc.DebugNoTumble = origNoTumble; pc.DebugEnergy = false; Game.Set(pc, "JumpExtra", origJumpExtra); } } internal static void RestoreAll() { if (savedAny) { RestoreValues(lastController); } savedAny = false; GodMode = (InfiniteStamina = (NoTumble = (SpeedOn = (MultiJump = (Noclip = false))))); AntiKnockback = (ZeroGravity = (NoFriction = (InfiniteReach = false))); PhysGrabber instance = PhysGrabber.instance; if ((Object)(object)instance != (Object)null && instance.grabRange > 10f) { instance.grabRange = 4f; } } } internal static class Fun { private struct ComponentState { internal MonoBehaviour Component; internal bool Enabled; } private class FrozenEnemy { internal Enemy Enemy; internal float FreezeTimer; internal readonly List<ComponentState> Components = new List<ComponentState>(); internal Behaviour Agent; internal bool AgentEnabled; internal Rigidbody Body; } internal static bool FreezeEnemies; private static readonly Dictionary<Enemy, FrozenEnemy> frozen = new Dictionary<Enemy, FrozenEnemy>(); private static bool KeepEnabled(MonoBehaviour mb) { Type type = ((object)mb).GetType(); if (!(type == typeof(Enemy)) && !(type == typeof(EnemyHealth)) && !(type == typeof(EnemyRigidbody)) && !(type.Name == "AudioSource") && !(type.Name == "PhotonView")) { return type.Name == "PhotonTransformView"; } return true; } internal static void Tick() { if (!FreezeEnemies) { if (frozen.Count > 0) { Restore(); } return; } EnemyDirector enemyDir = Game.EnemyDir; if ((Object)(object)enemyDir == (Object)null || enemyDir.enemiesSpawned == null) { return; } foreach (EnemyParent item in enemyDir.enemiesSpawned) { if (!((Object)(object)item == (Object)null)) { object obj = Game.Get(item, "Enemy"); Enemy val = (Enemy)((obj is Enemy) ? obj : null); if (!((Object)(object)val == (Object)null)) { Freeze(val); } } } if (frozen.Count <= 0) { return; } List<Enemy> list = null; foreach (KeyValuePair<Enemy, FrozenEnemy> item2 in frozen) { if ((Object)(object)item2.Value.Enemy == (Object)null) { if (list == null) { list = new List<Enemy>(); } list.Add(item2.Key); } } if (list == null) { return; } foreach (Enemy item3 in list) { frozen.Remove(item3); } } private static void Freeze(Enemy enemy) { //IL_011d: 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) if (!frozen.TryGetValue(enemy, out var value)) { value = new FrozenEnemy { Enemy = enemy, FreezeTimer = enemy.FreezeTimer }; MonoBehaviour[] components = ((Component)enemy).GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val in components) { if (!((Object)(object)val == (Object)null) && ((Behaviour)val).enabled && !KeepEnabled(val)) { value.Components.Add(new ComponentState { Component = val, Enabled = ((Behaviour)val).enabled }); ((Behaviour)val).enabled = false; } } Component component = ((Component)enemy).GetComponent("NavMeshAgent"); Behaviour val2 = (Behaviour)(object)((component is Behaviour) ? component : null); if ((Object)(object)val2 != (Object)null) { value.Agent = val2; value.AgentEnabled = val2.enabled; val2.enabled = false; } Rigidbody component2 = ((Component)enemy).GetComponent<Rigidbody>(); if ((Object)(object)component2 != (Object)null) { value.Body = component2; } frozen.Add(enemy, value); } enemy.FreezeTimer = 999999f; if ((Object)(object)value.Body != (Object)null && !value.Body.isKinematic) { value.Body.linearVelocity = Vector3.zero; value.Body.angularVelocity = Vector3.zero; } } internal static void Restore() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Enemy, FrozenEnemy> item in frozen) { FrozenEnemy value = item.Value; foreach (ComponentState component in value.Components) { if ((Object)(object)component.Component != (Object)null) { ((Behaviour)component.Component).enabled = component.Enabled; } } if ((Object)(object)value.Agent != (Object)null) { value.Agent.enabled = value.AgentEnabled; } if ((Object)(object)value.Body != (Object)null && !value.Body.isKinematic) { value.Body.linearVelocity = Vector3.zero; value.Body.angularVelocity = Vector3.zero; } if ((Object)(object)value.Enemy != (Object)null) { value.Enemy.FreezeTimer = value.FreezeTimer; } } frozen.Clear(); } } internal static class Game { private const BindingFlags Flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy; private static readonly HashSet<string> warned = new HashSet<string>(); internal static GameDirector Director => GameDirector.instance; internal static GameManager Manager => GameManager.instance; internal static PlayerController Controller => PlayerController.instance; internal static PlayerAvatar LocalAvatar => PlayerAvatar.instance; internal static StatsManager Stats => StatsManager.instance; internal static EnemyDirector EnemyDir => EnemyDirector.instance; internal static RoundDirector Round => RoundDirector.instance; internal static MetaManager Meta => MetaManager.instance; internal static ShopManager Shop => ShopManager.instance; internal static NetworkManager Net => NetworkManager.instance; internal static DebugCommandHandler Commands => DebugCommandHandler.instance; internal static InputManager Input => InputManager.instance; internal static bool IsHost { get { try { return SemiFunc.IsMasterClientOrSingleplayer(); } catch { return false; } } } internal static bool InGame { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 GameDirector director = Director; if ((Object)(object)director == (Object)null) { return false; } if ((int)director.currentState != 2) { return (int)director.currentState == 7; } return true; } } internal static string StateName { get { GameDirector director = Director; if (!((Object)(object)director == (Object)null)) { return ((object)Unsafe.As<gameState, gameState>(ref director.currentState)/*cast due to .constrained prefix*/).ToString(); } return "no director"; } } internal static int PlayerCount { get { GameDirector director = Director; if (!((Object)(object)director == (Object)null) && director.PlayerList != null) { return director.PlayerList.Count; } return 0; } } internal static PlayerAvatar[] Players { get { GameDirector director = Director; if ((Object)(object)director == (Object)null || director.PlayerList == null) { return (PlayerAvatar[])(object)new PlayerAvatar[0]; } return director.PlayerList.ToArray(); } } internal static bool InRoom { get { try { return PhotonNetwork.InRoom; } catch { return false; } } } internal static bool IsMaster { get { try { return PhotonNetwork.IsMasterClient; } catch { return false; } } } internal static int RoomPlayerCount { get { try { return (PhotonNetwork.CurrentRoom != null) ? PhotonNetwork.CurrentRoom.PlayerCount : 0; } catch { return 0; } } } internal static int Health { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "health"); if (!(obj is int)) { return -1; } return (int)obj; } } internal static int MaxHealth { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "maxHealth"); if (!(obj is int)) { return -1; } return (int)obj; } } internal static bool GodMode { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "godMode"); if (obj is bool) { return (bool)obj; } return false; } set { PlayerAvatar localAvatar = LocalAvatar; Set(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "godMode", value); } } internal static string SteamId { get { PlayerController controller = Controller; if ((Object)(object)controller == (Object)null) { return ""; } return ReflString(controller, "playerSteamID") ?? ""; } } internal static bool Alive(Object o) { return o != (Object)null; } internal static object Get(object target, string member) { if (target == null) { return null; } Type type = target.GetType(); try { FieldInfo field = type.GetField(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (field != null) { return field.GetValue(field.IsStatic ? null : target); } PropertyInfo property = type.GetProperty(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (property != null && property.CanRead) { return property.GetValue(property.GetGetMethod(nonPublic: true).IsStatic ? null : target, null); } } catch (Exception ex) { Warn("get " + type.Name + "." + member + ": " + ex.GetType().Name); } return null; } internal static bool Set(object target, string member, object value) { if (target == null) { return false; } Type type = target.GetType(); try { FieldInfo field = type.GetField(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (field != null) { field.SetValue(field.IsStatic ? null : target, Coerce(value, field.FieldType)); return true; } PropertyInfo property = type.GetProperty(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (property != null && property.CanWrite) { property.SetValue(property.GetSetMethod(nonPublic: true).IsStatic ? null : target, Coerce(value, property.PropertyType), null); return true; } } catch (Exception ex) { Warn("set " + type.Name + "." + member + ": " + ex.GetType().Name); } return false; } internal static bool Call(object target, string method, params object[] args) { object result; return CallResult(target, method, out result, args); } internal static bool CallResult(object target, string method, out object result, params object[] args) { result = null; if (target == null) { return false; } Type type = target.GetType(); try { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name != method) { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length < args.Length) { continue; } bool flag = true; for (int j = args.Length; j < parameters.Length; j++) { if (!parameters[j].IsOptional) { flag = false; break; } } if (flag) { object[] array = new object[parameters.Length]; for (int k = 0; k < parameters.Length; k++) { array[k] = ((k < args.Length) ? Coerce(args[k], parameters[k].ParameterType) : parameters[k].DefaultValue); } result = methodInfo.Invoke(methodInfo.IsStatic ? null : target, array); return true; } } } catch (Exception ex) { Warn("call " + type.Name + "." + method + ": " + ex.GetType().Name); } return false; } private static object Coerce(object value, Type target) { if (value == null) { if (!target.IsValueType) { return null; } return Activator.CreateInstance(target); } if (target.IsInstanceOfType(value)) { return value; } if (target.IsEnum) { if (value is string) { return Enum.Parse(target, (string)value); } return Enum.ToObject(target, value); } return Convert.ChangeType(value, target); } private static void Warn(string msg) { if (warned.Add(msg)) { Plugin.LogWarn("Game: " + msg); } } private static string ReflString(object o, string name) { object obj = Get(o, name); if (obj != null) { return obj as string; } return null; } } internal static class HostPatch { private static bool applied; internal static bool ForceHostChecks; internal static void Apply() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown if (applied) { return; } try { Harmony val = new Harmony("repomenu.hostpatch"); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "IsMasterClientOrSingleplayer", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "IsMasterClient", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "MasterOnlyRPC", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "MasterAndOwnerOnlyRPC", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); MethodInfo methodInfo = AccessTools.PropertyGetter(typeof(PhotonNetwork), "IsMasterClient"); if (methodInfo != null) { val.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo2 = AccessTools.PropertyGetter(typeof(Player), "IsMasterClient"); if (methodInfo2 != null) { val.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } applied = true; Plugin.LogInfo("HostPatch applied (SemiFunc host checks)."); } catch (Exception ex) { Plugin.LogWarn("HostPatch failed: " + ex.Message); } } private static bool IsMasterPrefix(ref bool __result) { if (!ForceHostChecks) { return true; } __result = true; return false; } } internal static class Theme { internal static GUISkin Skin; internal static GUIStyle Window; internal static GUIStyle Box; internal static GUIStyle Card; internal static GUIStyle Button; internal static GUIStyle ButtonActive; internal static GUIStyle Label; internal static GUIStyle Small; internal static GUIStyle Section; internal static GUIStyle Header; internal static GUIStyle TitleBar; internal static GUIStyle TabItem; internal static GUIStyle TabItemActive; internal static GUIStyle Right; internal static GUIStyle RightAccent; internal static GUIStyle SwitchLabel; internal static GUIStyle SwitchLabelOn; internal static GUIStyle ButtonLeft; internal static GUIStyle ButtonLeftActive; internal static GUIStyle Tag; internal static GUIStyle SmallMid; internal static GUIStyle RightMid; internal static GUIStyle GroupLabel; internal static GUIStyle Pill; private static bool ready; private static Texture2D texWindow; private static Texture2D texPanel; private static Texture2D texHeader; private static Texture2D texLogo; private static Texture2D texDivider; private static Texture2D texBtn; private static Texture2D texBtnHover; private static Texture2D texBtnPressed; private static Texture2D texTab; private static Texture2D texTabHover; private static Texture2D texTabActive; private static Texture2D texField; private static Texture2D texSliderTrack; private static Texture2D texSliderThumb; private static Texture2D texScrollBg; private static Texture2D texScrollThumb; private static Texture2D texToggleOff; private static Texture2D texToggleOn; private static Texture2D texSwitchOff; private static Texture2D texSwitchOn; private static Texture2D texCursorMenu; private static Texture2D texCursorOff; private static Texture2D texPill; private static Texture2D texDot; internal static readonly Vector2 CursorMenuHotspot = new Vector2(0f, 0f); internal static readonly Vector2 CursorOffHotspot = new Vector2(32f, 32f); private static readonly string[] IconNames = new string[21] { "status", "player", "players", "upgrades", "spawn", "level", "mobs", "teleport", "settings", "fun", "esp", "inspect", "profiles", "cosmetics", "visuals", "audio", "extras", "dev", "settings", "players", "mobs" }; private static readonly Texture2D[] iconSm = (Texture2D[])(object)new Texture2D[21]; private static readonly Texture2D[] iconLg = (Texture2D[])(object)new Texture2D[21]; private static readonly Color Txt = new Color(0.9f, 0.92f, 0.95f); private static readonly Color Dim = new Color(0.66f, 0.7f, 0.76f); private static readonly Color Accent = new Color(1f, 0.45f, 0.36f); internal static Texture2D Logo => texLogo; internal static Texture2D Divider => texDivider; internal static Texture2D CursorMenu => texCursorMenu; internal static Texture2D CursorOff => texCursorOff; internal static bool Ready => ready; internal static Texture2D TabIconSm(int i) { if (i < 0 || i >= iconSm.Length) { return null; } return iconSm[i]; } internal static Texture2D TabIconLg(int i) { if (i < 0 || i >= iconLg.Length) { return null; } return iconLg[i]; } private static Texture2D LoadAsset(string name) { try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); using (Stream stream = executingAssembly.GetManifestResourceStream(name)) { if (stream != 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; } } Texture2D val = NewTexture(array); if ((Object)(object)val != (Object)null) { return val; } } } string directoryName = Path.GetDirectoryName(executingAssembly.Location); string[] array2 = new string[2] { Path.Combine(directoryName, "Assets", name), Path.Combine(directoryName, "RepoMenu", "Assets", name) }; foreach (string path in array2) { if (File.Exists(path)) { Texture2D val2 = NewTexture(File.ReadAllBytes(path)); if ((Object)(object)val2 != (Object)null) { return val2; } } } } catch { } return null; } private static Texture2D NewTexture(byte[] bytes) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (!ImageConversion.LoadImage(val, bytes)) { return null; } ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Object)val).hideFlags = (HideFlags)61; return val; } internal static void Init() { //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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) if (ready) { return; } try { texWindow = LoadAsset("window_bg.png"); texPanel = LoadAsset("panel_bg.png"); texHeader = LoadAsset("header_bg.png"); texLogo = LoadAsset("logo.png"); texDivider = LoadAsset("divider.png"); texBtn = LoadAsset("button_normal.png"); texBtnHover = LoadAsset("button_hover.png"); texBtnPressed = LoadAsset("button_pressed.png"); texTab = LoadAsset("tab_normal.png"); texTabHover = LoadAsset("tab_hover.png"); texTabActive = LoadAsset("tab_active.png"); texField = LoadAsset("textfield_bg.png"); texSliderTrack = LoadAsset("slider_track.png"); texSliderThumb = LoadAsset("slider_thumb.png"); texScrollBg = LoadAsset("scrollbar_bg.png"); texScrollThumb = LoadAsset("scrollbar_thumb.png"); texToggleOff = LoadAsset("toggle_off.png"); texToggleOn = LoadAsset("toggle_on.png"); texSwitchOff = LoadAsset("switch_off.png") ?? MakeSwitch(on: false); texSwitchOn = LoadAsset("switch_on.png") ?? MakeSwitch(on: true); texCursorMenu = LoadAsset("cursor_menu.png"); texCursorOff = LoadAsset("cursor_off.png"); texPill = MakeRoundRect(48, 32, 15.5f, new Color(0.09f, 0.1f, 0.13f, 0.92f), new Color(1f, 0.45f, 0.36f, 0.95f), 1.6f); texDot = MakeRoundRect(16, 16, 8f, Color.white, Color.white, 8f); for (int i = 0; i < IconNames.Length; i++) { iconSm[i] = LoadAsset("icon_" + IconNames[i] + "_sm.png"); iconLg[i] = LoadAsset("icon_" + IconNames[i] + "_lg.png"); } BuildSkin(); ready = true; } catch (Exception) { Fallback(); } } private static void SetBg(GUIStyle s, Texture2D normal, Texture2D hover, Texture2D active, Color text) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)normal == (Object)null)) { hover = hover ?? normal; active = active ?? normal; s.normal.background = normal; s.onNormal.background = normal; s.hover.background = hover; s.onHover.background = hover; s.active.background = active; s.onActive.background = active; s.focused.background = normal; s.onFocused.background = normal; s.normal.textColor = text; s.onNormal.textColor = text; s.hover.textColor = Color.white; s.onHover.textColor = Color.white; s.active.textColor = Color.white; s.onActive.textColor = Color.white; s.focused.textColor = text; s.onFocused.textColor = text; } } private static void BuildSkin() { //IL_0039: 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_0063: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00e3: 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_0115: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Expected O, but got Unknown //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Expected O, but got Unknown //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Expected O, but got Unknown //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Expected O, but got Unknown //IL_04d9: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Expected O, but got Unknown //IL_0547: Expected O, but got Unknown //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Expected O, but got Unknown //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Expected O, but got Unknown //IL_05a8: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Expected O, but got Unknown //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Expected O, but got Unknown //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Expected O, but got Unknown //IL_066f: Expected O, but got Unknown //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Expected O, but got Unknown //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Expected O, but got Unknown //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Expected O, but got Unknown //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Expected O, but got Unknown //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Expected O, but got Unknown //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Expected O, but got Unknown //IL_07e7: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Expected O, but got Unknown //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Expected O, but got Unknown //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Expected O, but got Unknown //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Expected O, but got Unknown //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Expected O, but got Unknown //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Expected O, but got Unknown //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Expected O, but got Unknown //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Expected O, but got Unknown //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Expected O, but got Unknown //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Expected O, but got Unknown //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_097e: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_098a: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Expected O, but got Unknown //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Expected O, but got Unknown //IL_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Expected O, but got Unknown //IL_09ea: Expected O, but got Unknown //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unk
RepoMenu.dll
Decompiled an hour 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; [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("RepoMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RepoMenu")] [assembly: AssemblyTitle("RepoMenu")] [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 RepoMenu { internal static class Commands { private struct Pending { public float time; public string command; } private static readonly List<Pending> pending = new List<Pending>(); private static readonly Dictionary<string, List<string>> cache = new Dictionary<string, List<string>>(); private static string lastScene = ""; internal static string Last = ""; internal static int PendingCount => pending.Count; internal static void ClearCache() { cache.Clear(); } internal static bool Run(string command) { DebugCommandHandler commands = Game.Commands; if (!Game.Alive((Object)(object)commands)) { Last = "/" + command + ": command handler not available (load into a level first)"; return false; } int num; string last; if (Game.CallResult(commands, "Execute", out var result, command, true) && result is bool) { num = (((bool)result) ? 1 : 0); if (num != 0) { last = "/" + command + ": sent"; goto IL_007d; } } else { num = 0; } last = "/" + command + ": refused (host only / wrong place / not in a run)"; goto IL_007d; IL_007d: Last = last; return (byte)num != 0; } internal static void RunLater(string command, float seconds) { pending.Add(new Pending { time = Time.unscaledTime + seconds, command = command }); } internal static void Tick() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != lastScene) { lastScene = name; cache.Clear(); } for (int num = pending.Count - 1; num >= 0; num--) { if (!(Time.unscaledTime < pending[num].time)) { string command = pending[num].command; pending.RemoveAt(num); Run(command); } } } internal static List<string> Suggest(string partial) { if (cache.TryGetValue(partial, out var value)) { return value; } value = new List<string>(); DebugCommandHandler commands = Game.Commands; if (Game.Alive((Object)(object)commands) && Game.CallResult(commands, "GetSuggestions", out var result, partial, true) && result is IEnumerable<string> collection) { value.AddRange(collection); } cache[partial] = value; return value; } internal static bool SetMoney(int value) { try { SemiFunc.StatSetRunCurrency(value); Last = "Money set to " + value; return true; } catch (Exception ex) { Last = "Money failed: " + ex.Message; return false; } } internal static bool SetLevelNumber(int value) { try { SemiFunc.StatSetRunLevel(value); Last = "Level number set to " + value; return true; } catch (Exception ex) { Last = "Level failed: " + ex.Message; return false; } } internal static bool SetTotalHaul(int value) { try { SemiFunc.StatSetRunTotalHaul(value); Last = "Total haul set to " + value; return true; } catch (Exception ex) { Last = "Haul failed: " + ex.Message; return false; } } } internal static class Esp { private enum Kind { Player, Enemy, Valuable, Item, Extraction, Trap } private sealed class Part { public Transform t; public Vector3[] pts; } private sealed class Shape { public GameObject owner; public Part[] parts; public float built; } private sealed class Marker { public Kind kind; public GameObject go; public Transform anchor; public Vector3 offset; public string text = ""; public Color color; public float health01 = -1f; public bool dead; public Shape shape; } internal static bool Enabled; internal static bool Players = true; internal static bool Enemies = true; internal static bool Valuables = true; internal static bool Items; internal static bool Extraction = true; internal static bool Traps; internal static bool ShowNames = true; internal static bool ShowDistance = true; internal static bool ShowHealth = true; internal static bool ShowValue = true; internal static bool ShowBoxes = true; internal static bool ShowOffscreen = true; internal static bool ValueTiers; internal static bool Radar; internal static bool OutlineGlow = true; internal static bool AllGreen; internal static float OutlineThickness = 2f; internal static float MaxDistance = 120f; internal static int CameraOverride; private static readonly Color OutlineGreen = new Color(0.25f, 1f, 0.35f, 1f); private static readonly Color PlayerColor = new Color(0.3f, 0.8f, 1f, 1f); private static readonly Color EnemyColor = new Color(1f, 0.25f, 0.2f, 1f); private static readonly Color DeadColor = new Color(0.55f, 0.55f, 0.55f, 1f); private static readonly Color TrapColor = new Color(0.9f, 0.4f, 1f, 1f); private static readonly List<Marker> markers = new List<Marker>(); private static readonly Dictionary<int, Shape> shapes = new Dictionary<int, Shape>(); private static readonly List<Vector2> screenPts = new List<Vector2>(512); private static readonly List<Vector2> hull = new List<Vector2>(64); private static readonly Comparison<Vector2> ptCompare = (Vector2 a, Vector2 b) => (a.x == b.x) ? a.y.CompareTo(b.y) : a.x.CompareTo(b.x); private static float nextCollect; private static float nextPrune; private static GUIStyle labelStyle; private static GUIStyle smallStyle; private static Matrix4x4 viewProj; private static Rect area; private static bool Usable(Camera c) { if ((Object)(object)c != (Object)null) { return ((Behaviour)c).isActiveAndEnabled; } return false; } internal static Camera ActiveCamera() { if (CameraOverride > 0) { Camera[] allCameras = Camera.allCameras; int num = CameraOverride - 1; if (num >= 0 && num < allCameras.Length && Usable(allCameras[num])) { return allCameras[num]; } } GameDirector director = Game.Director; Camera val = (((Object)(object)director != (Object)null) ? director.MainCamera : null); if (Usable(val)) { return val; } val = Camera.main; if (Usable(val)) { return val; } Camera val2 = null; Camera[] allCameras2 = Camera.allCameras; foreach (Camera val3 in allCameras2) { if (Usable(val3) && ((Object)(object)val2 == (Object)null || val3.depth > val2.depth)) { val2 = val3; } } return val2; } internal static string CameraInfo() { Camera val = ActiveCamera(); if ((Object)(object)val == (Object)null) { return "none found"; } string text = (((Object)(object)val.targetTexture != (Object)null) ? (" RT " + ((Texture)val.targetTexture).width + "x" + ((Texture)val.targetTexture).height) : ""); return ((Object)val).name + " (depth " + val.depth + ")" + text + " screen " + Screen.width + "x" + Screen.height + ((CameraOverride > 0) ? (" [manual " + CameraOverride + "]") : " [auto]"); } internal static void CycleCamera() { CameraOverride = (CameraOverride + 1) % (Camera.allCameras.Length + 1); } internal static void LogCameras() { Camera[] allCameras = Camera.allCameras; Plugin.LogInfo("--- CAMERAS (" + allCameras.Length + ") ---"); for (int i = 0; i < allCameras.Length; i++) { Camera val = allCameras[i]; Plugin.LogInfo(i + 1 + ": " + ((Object)val).name + " tag=" + ((Component)val).tag + " depth=" + val.depth + " enabled=" + ((Behaviour)val).enabled + " rt=" + (((Object)(object)val.targetTexture != (Object)null) ? (((Texture)val.targetTexture).width + "x" + ((Texture)val.targetTexture).height) : "none") + " fov=" + val.fieldOfView); } } private static void SetupProjection(Camera cam) { //IL_0001: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) viewProj = cam.projectionMatrix * cam.worldToCameraMatrix; area = (Rect)(((Object)(object)cam.targetTexture == (Object)null) ? cam.pixelRect : new Rect(0f, 0f, (float)Screen.width, (float)Screen.height)); if (((Rect)(ref area)).width <= 1f || ((Rect)(ref area)).height <= 1f) { area = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height); } } private static bool Project(Vector3 w, out Vector2 s) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 val = viewProj; float num = val.m30 * w.x + val.m31 * w.y + val.m32 * w.z + val.m33; if (num < 0.05f) { s = Vector2.zero; return false; } float num2 = (val.m00 * w.x + val.m01 * w.y + val.m02 * w.z + val.m03) / num; float num3 = (val.m10 * w.x + val.m11 * w.y + val.m12 * w.z + val.m13) / num; float num4 = num2 * 0.5f + 0.5f; float num5 = num3 * 0.5f + 0.5f; s.x = Mathf.Clamp(((Rect)(ref area)).x + num4 * ((Rect)(ref area)).width, -20000f, 20000f); s.y = Mathf.Clamp((float)Screen.height - (((Rect)(ref area)).y + num5 * ((Rect)(ref area)).height), -20000f, 20000f); return true; } private static Vector3[] BoxCorners(Bounds b) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3[] array = (Vector3[])(object)new Vector3[8]; for (int i = 0; i < 8; i++) { array[i] = new Vector3(((i & 1) == 0) ? ((Bounds)(ref b)).min.x : ((Bounds)(ref b)).max.x, ((i & 2) == 0) ? ((Bounds)(ref b)).min.y : ((Bounds)(ref b)).max.y, ((i & 4) == 0) ? ((Bounds)(ref b)).min.z : ((Bounds)(ref b)).max.z); } return array; } private static Vector3[] SampleMesh(Mesh mesh, int budget) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0147: 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) Vector3[] vertices = mesh.vertices; int num = vertices.Length; if (num == 0) { return null; } List<Vector3> list = new List<Vector3>(budget + 6); int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; for (int i = 1; i < num; i++) { if (vertices[i].x < vertices[num2].x) { num2 = i; } if (vertices[i].x > vertices[num3].x) { num3 = i; } if (vertices[i].y < vertices[num4].y) { num4 = i; } if (vertices[i].y > vertices[num5].y) { num5 = i; } if (vertices[i].z < vertices[num6].z) { num6 = i; } if (vertices[i].z > vertices[num7].z) { num7 = i; } } list.Add(vertices[num2]); list.Add(vertices[num3]); list.Add(vertices[num4]); list.Add(vertices[num5]); list.Add(vertices[num6]); list.Add(vertices[num7]); int num8 = Mathf.Max(1, num / Mathf.Max(8, budget)); for (int j = 0; j < num; j += num8) { list.Add(vertices[j]); } return list.ToArray(); } private static Shape BuildShape(GameObject go) { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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) List<Renderer> list = new List<Renderer>(); Renderer[] componentsInChildren = go.GetComponentsInChildren<Renderer>(false); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && val.enabled && (val is MeshRenderer || val is SkinnedMeshRenderer)) { list.Add(val); if (list.Count >= 40) { break; } } } List<Part> list2 = new List<Part>(); int budget = Mathf.Clamp(160 / Mathf.Max(1, list.Count), 8, 96); foreach (Renderer item in list) { Vector3[] array = null; MeshRenderer val2 = (MeshRenderer)(object)((item is MeshRenderer) ? item : null); if ((Object)(object)val2 != (Object)null) { MeshFilter component = ((Component)val2).GetComponent<MeshFilter>(); Mesh val3 = (((Object)(object)component != (Object)null) ? component.sharedMesh : null); try { if ((Object)(object)val3 != (Object)null && val3.isReadable) { array = SampleMesh(val3, budget); } } catch (Exception) { array = null; } } if (array == null) { array = BoxCorners(item.localBounds); } list2.Add(new Part { t = ((Component)item).transform, pts = array }); } if (list2.Count == 0) { list2.Add(new Part { t = go.transform, pts = BoxCorners(new Bounds(Vector3.zero, Vector3.one * 0.6f)) }); } return new Shape { owner = go, parts = list2.ToArray(), built = Time.unscaledTime }; } private static Shape GetShape(GameObject go) { int instanceID = ((Object)go).GetInstanceID(); if (shapes.TryGetValue(instanceID, out var value) && (Object)(object)value.owner != (Object)null && Time.unscaledTime - value.built < 3f) { return value; } value = BuildShape(go); shapes[instanceID] = value; return value; } private static void Prune() { if (Time.unscaledTime < nextPrune) { return; } nextPrune = Time.unscaledTime + 10f; List<int> list = null; foreach (KeyValuePair<int, Shape> shape in shapes) { if ((Object)(object)shape.Value.owner == (Object)null) { if (list == null) { list = new List<int>(); } list.Add(shape.Key); } } if (list == null) { return; } foreach (int item in list) { shapes.Remove(item); } } private static Color TierColor(float value) { //IL_001c: 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_003e: Unknown result type (might be due to invalid IL or missing references) if (value >= 15000f) { return new Color(1f, 0.2f, 0.15f, 1f); } if (value >= 5000f) { return new Color(1f, 0.8f, 0.15f, 1f); } return new Color(0.4f, 1f, 0.4f, 1f); } private static void Add(Kind kind, GameObject go, Transform anchor, Vector3 offset, string text, Color color, float hp01, bool dead) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)go == (Object)null)) { markers.Add(new Marker { kind = kind, go = go, anchor = (((Object)(object)anchor != (Object)null) ? anchor : go.transform), offset = offset, text = text, color = color, health01 = hp01, dead = dead, shape = GetShape(go) }); } } private static void Collect() { nextCollect = Time.unscaledTime + 0.25f; markers.Clear(); if (Players) { Try(CollectPlayers); } if (Enemies) { Try(CollectEnemies); } if (Valuables) { Try(CollectValuables); } if (Items) { Try(CollectItems); } if (Extraction) { Try(CollectExtraction); } if (Traps) { Try(CollectTraps); } Prune(); } private static void Try(Action a) { try { a(); } catch (Exception) { } } private static void CollectPlayers() { //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar localAvatar = Game.LocalAvatar; string steamId = Game.SteamId; PlayerAvatar[] players = Game.Players; foreach (PlayerAvatar val in players) { if ((Object)(object)val == (Object)null || ((Object)(object)localAvatar != (Object)null && (Object)(object)val == (Object)(object)localAvatar)) { continue; } if (!string.IsNullOrEmpty(steamId)) { try { if (SemiFunc.PlayerGetSteamID(val) == steamId) { continue; } } catch { } } string text = (Game.Get(val, "playerName") as string) ?? "player"; bool flag = Game.Get(val, "deadSet") is bool && (bool)Game.Get(val, "deadSet"); float num = -1f; if ((Object)(object)val.playerHealth != (Object)null) { object obj2 = Game.Get(val.playerHealth, "health"); object obj3 = Game.Get(val.playerHealth, "maxHealth"); if (obj2 is int && obj3 is int && (int)obj3 > 0) { num = (float)(int)obj2 / (float)(int)obj3; } } string text2 = ""; if (ShowNames) { text2 = text2 + (flag ? "[DEAD] " : "") + text; } if (ShowHealth && num >= 0f) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "HP " + Mathf.RoundToInt(num * 100f) + "%"; } Add(Kind.Player, ((Component)val).gameObject, ((Component)val).transform, Vector3.up * 0.8f, text2, flag ? DeadColor : PlayerColor, num, flag); } } private static void CollectEnemies() { //IL_0168: 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) EnemyDirector enemyDir = Game.EnemyDir; if ((Object)(object)enemyDir == (Object)null || enemyDir.enemiesSpawned == null) { return; } foreach (EnemyParent item in enemyDir.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object target = Game.Get(item, "Enemy"); object obj = Game.Get(target, "CenterTransform"); Transform val = (Transform)((obj is Transform) ? obj : null); string text = ((Object)((Component)item).gameObject).name.Replace("(Clone)", ""); float num = -1f; object obj2 = Game.Get(target, "Health"); if (obj2 != null) { object obj3 = Game.Get(obj2, "healthCurrent"); object obj4 = Game.Get(obj2, "health"); if (obj3 is float && obj4 is float && (float)obj4 > 0f) { num = (float)obj3 / (float)obj4; } } string text2 = (ShowNames ? text : ""); if (ShowHealth && num >= 0f) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "HP " + Mathf.RoundToInt(num * 100f) + "%"; } Add(Kind.Enemy, ((Component)item).gameObject, ((Object)(object)val != (Object)null) ? val : ((Component)item).transform, Vector3.zero, text2, EnemyColor, num, dead: false); } } private static void CollectValuables() { //IL_00dc: 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_00ea: Unknown result type (might be due to invalid IL or missing references) ValuableDirector instance = ValuableDirector.instance; if ((Object)(object)instance == (Object)null || instance.valuableList == null) { return; } foreach (ValuableObject valuable in instance.valuableList) { if (!((Object)(object)valuable == (Object)null)) { string text = ((Object)((Component)valuable).gameObject).name.Replace("(Clone)", ""); float num = ((Game.Get(valuable, "dollarValueCurrent") is float) ? ((float)Game.Get(valuable, "dollarValueCurrent")) : 0f); string text2 = (ShowNames ? text : ""); if (ShowValue) { text2 = text2 + ((text2.Length > 0) ? "\n" : "") + "$" + Mathf.RoundToInt(num); } Add(Kind.Valuable, ((Component)valuable).gameObject, ((Component)valuable).transform, Vector3.zero, text2, ValueTiers ? TierColor(num) : OutlineGreen, -1f, dead: false); } } } private static void CollectItems() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) ItemManager instance = ItemManager.instance; if ((Object)(object)instance == (Object)null || instance.spawnedItems == null) { return; } foreach (ItemAttributes spawnedItem in instance.spawnedItems) { if (!((Object)(object)spawnedItem == (Object)null)) { string text = (((Object)(object)spawnedItem.item != (Object)null) ? spawnedItem.item.itemName : ((Object)((Component)spawnedItem).gameObject).name); Add(Kind.Item, ((Component)spawnedItem).gameObject, ((Component)spawnedItem).transform, Vector3.zero, ShowNames ? text : "", OutlineGreen, -1f, dead: false); } } } private static void CollectExtraction() { //IL_004b: 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_006d: Unknown result type (might be due to invalid IL or missing references) RoundDirector round = Game.Round; if ((Object)(object)round == (Object)null || !(Game.Get(round, "extractionPointList") is IEnumerable enumerable)) { return; } foreach (object item in enumerable) { GameObject val = (GameObject)((item is GameObject) ? item : null); if (!((Object)(object)val == (Object)null)) { Add(Kind.Extraction, val, val.transform, Vector3.up * 1f, ShowNames ? "EXTRACTION" : "", OutlineGreen, -1f, dead: false); } } } private static void CollectTraps() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) TrapDirector instance = TrapDirector.instance; if ((Object)(object)instance == (Object)null || instance.TrapList == null) { return; } foreach (GameObject trap in instance.TrapList) { if (!((Object)(object)trap == (Object)null)) { Add(Kind.Trap, trap, trap.transform, Vector3.zero, ShowNames ? "TRAP" : "", TrapColor, -1f, dead: false); } } } private static void EnsureStyles() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown if (labelStyle == null) { labelStyle = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)4, wordWrap = false, clipping = (TextClipping)0 }; smallStyle = new GUIStyle(labelStyle) { fontSize = 10, fontStyle = (FontStyle)0 }; } } internal static void Draw() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { return; } Event current = Event.current; if (current == null || (int)current.type != 7) { return; } Camera val = ActiveCamera(); if ((Object)(object)val == (Object)null) { return; } EnsureStyles(); if (Time.unscaledTime >= nextCollect) { Collect(); } SetupProjection(val); Color color = GUI.color; if (Radar) { DrawRadar(val); } PlayerController instance = PlayerController.instance; Vector3 val2 = (((Object)(object)instance != (Object)null) ? ((Component)instance).transform.position : ((Component)val).transform.position); float num = Screen.width; float num2 = Screen.height; for (int i = 0; i < markers.Count; i++) { Marker marker = markers[i]; if ((Object)(object)marker.go == (Object)null) { continue; } Vector3 val3 = (((Object)(object)marker.anchor != (Object)null) ? marker.anchor.position : marker.go.transform.position) + marker.offset; float num3 = Vector3.Distance(val2, val3); if (num3 > MaxDistance) { continue; } Color val4 = (AllGreen ? OutlineGreen : marker.color); bool flag = marker.kind == Kind.Player || marker.kind == Kind.Enemy || marker.kind == Kind.Extraction; if (!Project(val3, out var s)) { if (ShowOffscreen && flag) { DrawOffscreen(val, val3, val4, num3); } continue; } screenPts.Clear(); Part[] parts = marker.shape.parts; foreach (Part part in parts) { if ((Object)(object)part.t == (Object)null) { continue; } Matrix4x4 localToWorldMatrix = part.t.localToWorldMatrix; Vector3[] pts = part.pts; for (int k = 0; k < pts.Length; k++) { if (Project(((Matrix4x4)(ref localToWorldMatrix)).MultiplyPoint3x4(pts[k]), out var s2)) { screenPts.Add(s2); } } } ConvexHull(screenPts); float num4 = s.x - 8f; float num5 = s.x + 8f; float num6 = s.y - 8f; float num7 = s.y + 8f; if (hull.Count >= 3) { num4 = (num5 = hull[0].x); num6 = (num7 = hull[0].y); for (int l = 1; l < hull.Count; l++) { if (hull[l].x < num4) { num4 = hull[l].x; } if (hull[l].x > num5) { num5 = hull[l].x; } if (hull[l].y < num6) { num6 = hull[l].y; } if (hull[l].y > num7) { num7 = hull[l].y; } } } if (num5 < 0f || num4 > num || num7 < 0f || num6 > num2) { if (ShowOffscreen && flag) { DrawOffscreen(val, val3, val4, num3); } continue; } Rect box = new Rect(num4, num6, Mathf.Max(num5 - num4, 12f), Mathf.Max(num7 - num6, 12f)); if (ShowBoxes) { if (hull.Count >= 3) { DrawPolygon(hull, val4); } else { DrawDiamond(s, 9f, val4); } } DrawInfo(box, marker, val4, num3); } GUI.color = color; } private static void DrawInfo(Rect box, Marker m, Color col, float dist) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00cc: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) float num = ((Rect)(ref box)).y - 4f; if (ShowHealth && m.health01 >= 0f) { Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref box)).x, num - 5f, Mathf.Max(((Rect)(ref box)).width, 30f), 5f); GUI.color = new Color(0f, 0f, 0f, 0.85f); GUI.DrawTexture(new Rect(((Rect)(ref val)).x - 1f, ((Rect)(ref val)).y - 1f, ((Rect)(ref val)).width + 2f, ((Rect)(ref val)).height + 2f), (Texture)(object)Texture2D.whiteTexture); GUI.color = (m.dead ? DeadColor : Color.Lerp(Color.red, Color.green, m.health01)); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width * Mathf.Clamp01(m.health01), ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); num -= 8f; } string text = m.text; if (ShowDistance) { text = text + ((text.Length > 0) ? "\n" : "") + Mathf.RoundToInt(dist) + "m"; } if (text.Length == 0) { GUI.color = Color.white; return; } int num2 = 1; for (int i = 0; i < text.Length; i++) { if (text[i] == '\n') { num2++; } } float num3 = 15f * (float)num2; float num4 = num - num3; if (num4 < 2f) { num4 = ((Rect)(ref box)).yMax + 2f; } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(Mathf.Clamp(((Rect)(ref box)).center.x - 130f, 0f, (float)Screen.width - 260f), num4, 260f, num3); GUI.color = new Color(0f, 0f, 0f, 0.9f); GUI.Label(new Rect(((Rect)(ref val2)).x + 1f, ((Rect)(ref val2)).y + 1f, ((Rect)(ref val2)).width, ((Rect)(ref val2)).height), text, labelStyle); GUI.color = col; GUI.Label(val2, text, labelStyle); GUI.color = Color.white; } private static void DrawLine(Vector2 a, Vector2 b, float w) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; if (!(magnitude < 0.5f)) { Vector2 val2 = val / magnitude; a -= val2 * (w * 0.5f); magnitude += w; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; Matrix4x4 matrix = GUI.matrix; GUIUtility.RotateAroundPivot(num, a); GUI.DrawTexture(new Rect(a.x, a.y - w * 0.5f, magnitude, w), (Texture)(object)Texture2D.whiteTexture); GUI.matrix = matrix; } } private static void DrawPolygon(List<Vector2> poly, Color c) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) int count = poly.Count; float num = Mathf.Max(1f, OutlineThickness); if (OutlineGlow) { GUI.color = new Color(c.r, c.g, c.b, 0.2f); for (int i = 0; i < count; i++) { DrawLine(poly[i], poly[(i + 1) % count], num * 3.5f); } } GUI.color = new Color(0f, 0f, 0f, 0.55f); for (int j = 0; j < count; j++) { DrawLine(poly[j], poly[(j + 1) % count], num + 2f); } GUI.color = c; for (int k = 0; k < count; k++) { DrawLine(poly[k], poly[(k + 1) % count], num); } } private static void DrawDiamond(Vector2 c, float r, Color col) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) DrawPolygon(new List<Vector2>(4) { new Vector2(c.x, c.y - r), new Vector2(c.x + r, c.y), new Vector2(c.x, c.y + r), new Vector2(c.x - r, c.y) }, col); } private static float Cross(Vector2 o, Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x); } private static void ConvexHull(List<Vector2> pts) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0127: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) hull.Clear(); int count = pts.Count; if (count < 3) { hull.AddRange(pts); return; } pts.Sort(ptCompare); for (int i = 0; i < count; i++) { while (hull.Count >= 2 && Cross(hull[hull.Count - 2], hull[hull.Count - 1], pts[i]) <= 0f) { hull.RemoveAt(hull.Count - 1); } hull.Add(pts[i]); } int num = hull.Count + 1; for (int num2 = count - 2; num2 >= 0; num2--) { while (hull.Count >= num && Cross(hull[hull.Count - 2], hull[hull.Count - 1], pts[num2]) <= 0f) { hull.RemoveAt(hull.Count - 1); } hull.Add(pts[num2]); } hull.RemoveAt(hull.Count - 1); } private static void DrawOffscreen(Camera cam, Vector3 world, Color c, float dist) { //IL_0006: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c3: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00eb: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)cam).transform.InverseTransformPoint(world); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(val.x, 0f - val.y); if (((Vector2)(ref val2)).sqrMagnitude < 0.0001f) { ((Vector2)(ref val2))..ctor(0f, 1f); } ((Vector2)(ref val2)).Normalize(); Vector2 val3 = new Vector2((float)Screen.width * 0.5f, (float)Screen.height * 0.5f); float num = (float)Screen.width * 0.5f - 44f; float num2 = (float)Screen.height * 0.5f - 44f; Vector2 val4 = val3 + new Vector2(val2.x * num, val2.y * num2); Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(0f - val2.y, val2.x); DrawPolygon(new List<Vector2>(3) { val4 + val2 * 11f, val4 - val2 * 8f + val5 * 8f, val4 - val2 * 8f - val5 * 8f }, c); if (ShowDistance) { GUI.color = c; GUI.Label(new Rect(val4.x - 30f, val4.y + ((val2.y > 0f) ? (-26f) : 12f), 60f, 16f), Mathf.RoundToInt(dist) + "m", smallStyle); } GUI.color = Color.white; } private static void DrawRadar(Camera cam) { //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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_014f: 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_031e: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: 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) Rect val = default(Rect); ((Rect)(ref val))..ctor(14f, 14f, 200f, 200f); GUI.color = new Color(0f, 0f, 0f, 0.55f); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(0.3f, 0.9f, 0.5f, 1f); float num = 2f; GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, num), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).yMax - num, ((Rect)(ref val)).width, num), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, num, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).xMax - num, ((Rect)(ref val)).y, num, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); PlayerController instance = PlayerController.instance; Vector3 val2 = (((Object)(object)instance != (Object)null) ? ((Component)instance).transform.position : ((Component)cam).transform.position); Vector3 forward = ((Component)cam).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f) { forward = Vector3.forward; } ((Vector3)(ref forward)).Normalize(); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(forward.z, 0f, 0f - forward.x); Vector2 val5 = default(Vector2); for (int i = 0; i < markers.Count; i++) { Marker marker = markers[i]; if (!((Object)(object)marker.go == (Object)null) && (marker.kind == Kind.Player || marker.kind == Kind.Enemy || marker.kind == Kind.Valuable)) { Vector3 val4 = (((Object)(object)marker.anchor != (Object)null) ? marker.anchor.position : marker.go.transform.position) - val2; float num2 = Vector3.Dot(val4, val3) / 40f * 100f; float num3 = Vector3.Dot(val4, forward) / 40f * 100f; ((Vector2)(ref val5))..ctor(((Rect)(ref val)).center.x + num2, ((Rect)(ref val)).center.y - num3); if (!(val5.x < ((Rect)(ref val)).x + 3f) && !(val5.x > ((Rect)(ref val)).xMax - 3f) && !(val5.y < ((Rect)(ref val)).y + 3f) && !(val5.y > ((Rect)(ref val)).yMax - 3f)) { float num4 = ((marker.kind == Kind.Valuable) ? 4f : 6f); GUI.color = (AllGreen ? OutlineGreen : marker.color); GUI.DrawTexture(new Rect(val5.x - num4 * 0.5f, val5.y - num4 * 0.5f, num4, num4), (Texture)(object)Texture2D.whiteTexture); } } } GUI.color = Color.white; GUI.DrawTexture(new Rect(((Rect)(ref val)).center.x - 4f, ((Rect)(ref val)).center.y - 4f, 8f, 8f), (Texture)(object)Texture2D.whiteTexture); GUI.Label(new Rect(((Rect)(ref val)).x + 4f, ((Rect)(ref val)).yMax - 20f, 192f, 18f), "RADAR 40m", smallStyle); GUI.color = Color.white; } } internal static class Features { internal static bool GodMode; internal static bool InfiniteStamina; internal static bool NoTumble; internal static bool SpeedOn; internal static bool MultiJump; internal static bool Noclip; internal static bool AntiKnockback; internal static bool ZeroGravity; internal static bool NoFriction; internal static bool InfiniteReach; internal static float SpeedMultiplier = 2f; internal static float NoclipSpeed = 10f; private static float origMove; private static float origSprint; private static float origJump; private static float origGravity; private static float origFriction; private static float origSlideDecay; private static float origSlideTime; private static int origJumpExtra; private static bool multiJumpWas; private static bool origNoTumble; private static bool savedAny; private static PlayerController lastController; private static float nextGod; private static Vector3 anchorPosition; internal static void Tick() { //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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_027f: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) PlayerController controller = Game.Controller; if ((Object)(object)controller == (Object)null) { lastController = null; return; } if (controller != lastController) { if (savedAny) { RestoreValues(lastController); } lastController = controller; SaveValues(controller); savedAny = true; } if (InfiniteStamina) { controller.DebugEnergy = true; controller.EnergyCurrent = controller.EnergyStart; } else if (savedAny) { controller.DebugEnergy = false; } controller.DebugNoTumble = NoTumble; if (SpeedOn) { controller.OverrideSpeed(SpeedMultiplier, 0.25f, -1f); } if (MultiJump) { Game.Set(controller, "JumpExtra", 100); multiJumpWas = true; } else if (multiJumpWas) { Game.Set(controller, "JumpExtra", origJumpExtra); multiJumpWas = false; } if (GodMode && Time.unscaledTime >= nextGod) { nextGod = Time.unscaledTime + 0.5f; PlayerAvatar localAvatar = Game.LocalAvatar; if ((Object)(object)localAvatar != (Object)null && (Object)(object)localAvatar.playerHealth != (Object)null) { localAvatar.playerHealth.InvincibleSet(1f); } } if (AntiKnockback) { anchorPosition = ((Component)controller).transform.position; if ((Object)(object)controller.rb != (Object)null && !controller.rb.isKinematic) { controller.rb.linearVelocity = Vector3.zero; controller.rb.angularVelocity = Vector3.zero; } ((Component)controller).transform.position = anchorPosition; } if (ZeroGravity) { controller.CustomGravity = 0f; controller.AntiGravity(0.1f); } if (InfiniteReach) { PhysGrabber instance = PhysGrabber.instance; if ((Object)(object)instance != (Object)null) { instance.grabRange = 50f; } } else { PhysGrabber instance2 = PhysGrabber.instance; if ((Object)(object)instance2 != (Object)null && instance2.grabRange > 10f) { instance2.grabRange = 4f; } } if (NoFriction) { controller.SlideDecay = 0.008f; controller.SlideTime = 6f; } else if (savedAny) { controller.SlideDecay = origSlideDecay; controller.SlideTime = origSlideTime; } if (!Noclip) { return; } controller.Kinematic(0.1f); controller.AntiGravity(0.1f); Camera val = (((Object)(object)Game.Director != (Object)null) ? Game.Director.MainCamera : null); if ((Object)(object)val != (Object)null && !MenuWindow.IsOpen) { Vector3 val2 = Vector3.zero; if (Input.GetKey((KeyCode)119)) { val2 += ((Component)val).transform.forward; } if (Input.GetKey((KeyCode)115)) { val2 -= ((Component)val).transform.forward; } if (Input.GetKey((KeyCode)97)) { val2 -= ((Component)val).transform.right; } if (Input.GetKey((KeyCode)100)) { val2 += ((Component)val).transform.right; } if (Input.GetKey((KeyCode)32)) { val2 += Vector3.up; } if (Input.GetKey((KeyCode)306)) { val2 -= Vector3.up; } float num = (Input.GetKey((KeyCode)304) ? 3f : 1f); Transform transform = ((Component)controller).transform; transform.position += val2 * NoclipSpeed * num * Time.deltaTime; } } private static void SaveValues(PlayerController pc) { origMove = pc.MoveSpeed; origSprint = pc.SprintSpeed; origJump = pc.JumpForce; object obj = Game.Get(pc, "JumpExtra"); origJumpExtra = ((obj is int) ? ((int)obj) : 0); origGravity = pc.CustomGravity; origFriction = pc.MoveFriction; origSlideDecay = pc.SlideDecay; origSlideTime = pc.SlideTime; origNoTumble = pc.DebugNoTumble; } private static void RestoreValues(PlayerController pc) { if (!((Object)(object)pc == (Object)null)) { pc.MoveSpeed = origMove; pc.SprintSpeed = origSprint; pc.JumpForce = origJump; pc.CustomGravity = origGravity; pc.MoveFriction = origFriction; pc.SlideDecay = origSlideDecay; pc.SlideTime = origSlideTime; pc.DebugNoTumble = origNoTumble; pc.DebugEnergy = false; Game.Set(pc, "JumpExtra", origJumpExtra); } } internal static void RestoreAll() { if (savedAny) { RestoreValues(lastController); } savedAny = false; GodMode = (InfiniteStamina = (NoTumble = (SpeedOn = (MultiJump = (Noclip = false))))); AntiKnockback = (ZeroGravity = (NoFriction = (InfiniteReach = false))); PhysGrabber instance = PhysGrabber.instance; if ((Object)(object)instance != (Object)null && instance.grabRange > 10f) { instance.grabRange = 4f; } } } internal static class Fun { private struct ComponentState { internal MonoBehaviour Component; internal bool Enabled; } private class FrozenEnemy { internal Enemy Enemy; internal float FreezeTimer; internal readonly List<ComponentState> Components = new List<ComponentState>(); internal Behaviour Agent; internal bool AgentEnabled; internal Rigidbody Body; } internal static bool FreezeEnemies; private static readonly Dictionary<Enemy, FrozenEnemy> frozen = new Dictionary<Enemy, FrozenEnemy>(); private static bool KeepEnabled(MonoBehaviour mb) { Type type = ((object)mb).GetType(); if (!(type == typeof(Enemy)) && !(type == typeof(EnemyHealth)) && !(type == typeof(EnemyRigidbody)) && !(type.Name == "AudioSource") && !(type.Name == "PhotonView")) { return type.Name == "PhotonTransformView"; } return true; } internal static void Tick() { if (!FreezeEnemies) { if (frozen.Count > 0) { Restore(); } return; } EnemyDirector enemyDir = Game.EnemyDir; if ((Object)(object)enemyDir == (Object)null || enemyDir.enemiesSpawned == null) { return; } foreach (EnemyParent item in enemyDir.enemiesSpawned) { if (!((Object)(object)item == (Object)null)) { object obj = Game.Get(item, "Enemy"); Enemy val = (Enemy)((obj is Enemy) ? obj : null); if (!((Object)(object)val == (Object)null)) { Freeze(val); } } } if (frozen.Count <= 0) { return; } List<Enemy> list = null; foreach (KeyValuePair<Enemy, FrozenEnemy> item2 in frozen) { if ((Object)(object)item2.Value.Enemy == (Object)null) { if (list == null) { list = new List<Enemy>(); } list.Add(item2.Key); } } if (list == null) { return; } foreach (Enemy item3 in list) { frozen.Remove(item3); } } private static void Freeze(Enemy enemy) { //IL_011d: 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) if (!frozen.TryGetValue(enemy, out var value)) { value = new FrozenEnemy { Enemy = enemy, FreezeTimer = enemy.FreezeTimer }; MonoBehaviour[] components = ((Component)enemy).GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val in components) { if (!((Object)(object)val == (Object)null) && ((Behaviour)val).enabled && !KeepEnabled(val)) { value.Components.Add(new ComponentState { Component = val, Enabled = ((Behaviour)val).enabled }); ((Behaviour)val).enabled = false; } } Component component = ((Component)enemy).GetComponent("NavMeshAgent"); Behaviour val2 = (Behaviour)(object)((component is Behaviour) ? component : null); if ((Object)(object)val2 != (Object)null) { value.Agent = val2; value.AgentEnabled = val2.enabled; val2.enabled = false; } Rigidbody component2 = ((Component)enemy).GetComponent<Rigidbody>(); if ((Object)(object)component2 != (Object)null) { value.Body = component2; } frozen.Add(enemy, value); } enemy.FreezeTimer = 999999f; if ((Object)(object)value.Body != (Object)null && !value.Body.isKinematic) { value.Body.linearVelocity = Vector3.zero; value.Body.angularVelocity = Vector3.zero; } } internal static void Restore() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Enemy, FrozenEnemy> item in frozen) { FrozenEnemy value = item.Value; foreach (ComponentState component in value.Components) { if ((Object)(object)component.Component != (Object)null) { ((Behaviour)component.Component).enabled = component.Enabled; } } if ((Object)(object)value.Agent != (Object)null) { value.Agent.enabled = value.AgentEnabled; } if ((Object)(object)value.Body != (Object)null && !value.Body.isKinematic) { value.Body.linearVelocity = Vector3.zero; value.Body.angularVelocity = Vector3.zero; } if ((Object)(object)value.Enemy != (Object)null) { value.Enemy.FreezeTimer = value.FreezeTimer; } } frozen.Clear(); } } internal static class Game { private const BindingFlags Flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy; private static readonly HashSet<string> warned = new HashSet<string>(); internal static GameDirector Director => GameDirector.instance; internal static GameManager Manager => GameManager.instance; internal static PlayerController Controller => PlayerController.instance; internal static PlayerAvatar LocalAvatar => PlayerAvatar.instance; internal static StatsManager Stats => StatsManager.instance; internal static EnemyDirector EnemyDir => EnemyDirector.instance; internal static RoundDirector Round => RoundDirector.instance; internal static MetaManager Meta => MetaManager.instance; internal static ShopManager Shop => ShopManager.instance; internal static NetworkManager Net => NetworkManager.instance; internal static DebugCommandHandler Commands => DebugCommandHandler.instance; internal static InputManager Input => InputManager.instance; internal static bool IsHost { get { try { return SemiFunc.IsMasterClientOrSingleplayer(); } catch { return false; } } } internal static bool InGame { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 GameDirector director = Director; if ((Object)(object)director == (Object)null) { return false; } if ((int)director.currentState != 2) { return (int)director.currentState == 7; } return true; } } internal static string StateName { get { GameDirector director = Director; if (!((Object)(object)director == (Object)null)) { return ((object)Unsafe.As<gameState, gameState>(ref director.currentState)/*cast due to .constrained prefix*/).ToString(); } return "no director"; } } internal static int PlayerCount { get { GameDirector director = Director; if (!((Object)(object)director == (Object)null) && director.PlayerList != null) { return director.PlayerList.Count; } return 0; } } internal static PlayerAvatar[] Players { get { GameDirector director = Director; if ((Object)(object)director == (Object)null || director.PlayerList == null) { return (PlayerAvatar[])(object)new PlayerAvatar[0]; } return director.PlayerList.ToArray(); } } internal static bool InRoom { get { try { return PhotonNetwork.InRoom; } catch { return false; } } } internal static bool IsMaster { get { try { return PhotonNetwork.IsMasterClient; } catch { return false; } } } internal static int RoomPlayerCount { get { try { return (PhotonNetwork.CurrentRoom != null) ? PhotonNetwork.CurrentRoom.PlayerCount : 0; } catch { return 0; } } } internal static int Health { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "health"); if (!(obj is int)) { return -1; } return (int)obj; } } internal static int MaxHealth { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "maxHealth"); if (!(obj is int)) { return -1; } return (int)obj; } } internal static bool GodMode { get { PlayerAvatar localAvatar = LocalAvatar; object obj = Get(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "godMode"); if (obj is bool) { return (bool)obj; } return false; } set { PlayerAvatar localAvatar = LocalAvatar; Set(((Object)(object)localAvatar == (Object)null) ? null : localAvatar.playerHealth, "godMode", value); } } internal static string SteamId { get { PlayerController controller = Controller; if ((Object)(object)controller == (Object)null) { return ""; } return ReflString(controller, "playerSteamID") ?? ""; } } internal static bool Alive(Object o) { return o != (Object)null; } internal static object Get(object target, string member) { if (target == null) { return null; } Type type = target.GetType(); try { FieldInfo field = type.GetField(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (field != null) { return field.GetValue(field.IsStatic ? null : target); } PropertyInfo property = type.GetProperty(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (property != null && property.CanRead) { return property.GetValue(property.GetGetMethod(nonPublic: true).IsStatic ? null : target, null); } } catch (Exception ex) { Warn("get " + type.Name + "." + member + ": " + ex.GetType().Name); } return null; } internal static bool Set(object target, string member, object value) { if (target == null) { return false; } Type type = target.GetType(); try { FieldInfo field = type.GetField(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (field != null) { field.SetValue(field.IsStatic ? null : target, Coerce(value, field.FieldType)); return true; } PropertyInfo property = type.GetProperty(member, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); if (property != null && property.CanWrite) { property.SetValue(property.GetSetMethod(nonPublic: true).IsStatic ? null : target, Coerce(value, property.PropertyType), null); return true; } } catch (Exception ex) { Warn("set " + type.Name + "." + member + ": " + ex.GetType().Name); } return false; } internal static bool Call(object target, string method, params object[] args) { object result; return CallResult(target, method, out result, args); } internal static bool CallResult(object target, string method, out object result, params object[] args) { result = null; if (target == null) { return false; } Type type = target.GetType(); try { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name != method) { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length < args.Length) { continue; } bool flag = true; for (int j = args.Length; j < parameters.Length; j++) { if (!parameters[j].IsOptional) { flag = false; break; } } if (flag) { object[] array = new object[parameters.Length]; for (int k = 0; k < parameters.Length; k++) { array[k] = ((k < args.Length) ? Coerce(args[k], parameters[k].ParameterType) : parameters[k].DefaultValue); } result = methodInfo.Invoke(methodInfo.IsStatic ? null : target, array); return true; } } } catch (Exception ex) { Warn("call " + type.Name + "." + method + ": " + ex.GetType().Name); } return false; } private static object Coerce(object value, Type target) { if (value == null) { if (!target.IsValueType) { return null; } return Activator.CreateInstance(target); } if (target.IsInstanceOfType(value)) { return value; } if (target.IsEnum) { if (value is string) { return Enum.Parse(target, (string)value); } return Enum.ToObject(target, value); } return Convert.ChangeType(value, target); } private static void Warn(string msg) { if (warned.Add(msg)) { Plugin.LogWarn("Game: " + msg); } } private static string ReflString(object o, string name) { object obj = Get(o, name); if (obj != null) { return obj as string; } return null; } } internal static class HostPatch { private static bool applied; internal static bool ForceHostChecks; internal static void Apply() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown if (applied) { return; } try { Harmony val = new Harmony("repomenu.hostpatch"); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "IsMasterClientOrSingleplayer", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "IsMasterClient", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "MasterOnlyRPC", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); val.Patch((MethodBase)AccessTools.Method(typeof(SemiFunc), "MasterAndOwnerOnlyRPC", (Type[])null, (Type[])null), new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); MethodInfo methodInfo = AccessTools.PropertyGetter(typeof(PhotonNetwork), "IsMasterClient"); if (methodInfo != null) { val.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo2 = AccessTools.PropertyGetter(typeof(Player), "IsMasterClient"); if (methodInfo2 != null) { val.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(HostPatch), "IsMasterPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } applied = true; Plugin.LogInfo("HostPatch applied (SemiFunc host checks)."); } catch (Exception ex) { Plugin.LogWarn("HostPatch failed: " + ex.Message); } } private static bool IsMasterPrefix(ref bool __result) { if (!ForceHostChecks) { return true; } __result = true; return false; } } internal static class Theme { internal static GUISkin Skin; internal static GUIStyle Window; internal static GUIStyle Box; internal static GUIStyle Card; internal static GUIStyle Button; internal static GUIStyle ButtonActive; internal static GUIStyle Label; internal static GUIStyle Small; internal static GUIStyle Section; internal static GUIStyle Header; internal static GUIStyle TitleBar; internal static GUIStyle TabItem; internal static GUIStyle TabItemActive; internal static GUIStyle Right; internal static GUIStyle RightAccent; internal static GUIStyle SwitchLabel; internal static GUIStyle SwitchLabelOn; internal static GUIStyle ButtonLeft; internal static GUIStyle ButtonLeftActive; internal static GUIStyle Tag; internal static GUIStyle SmallMid; internal static GUIStyle RightMid; internal static GUIStyle GroupLabel; internal static GUIStyle Pill; private static bool ready; private static Texture2D texWindow; private static Texture2D texPanel; private static Texture2D texHeader; private static Texture2D texLogo; private static Texture2D texDivider; private static Texture2D texBtn; private static Texture2D texBtnHover; private static Texture2D texBtnPressed; private static Texture2D texTab; private static Texture2D texTabHover; private static Texture2D texTabActive; private static Texture2D texField; private static Texture2D texSliderTrack; private static Texture2D texSliderThumb; private static Texture2D texScrollBg; private static Texture2D texScrollThumb; private static Texture2D texToggleOff; private static Texture2D texToggleOn; private static Texture2D texSwitchOff; private static Texture2D texSwitchOn; private static Texture2D texCursorMenu; private static Texture2D texCursorOff; private static Texture2D texPill; private static Texture2D texDot; internal static readonly Vector2 CursorMenuHotspot = new Vector2(0f, 0f); internal static readonly Vector2 CursorOffHotspot = new Vector2(32f, 32f); private static readonly string[] IconNames = new string[21] { "status", "player", "players", "upgrades", "spawn", "level", "mobs", "teleport", "settings", "fun", "esp", "inspect", "profiles", "cosmetics", "visuals", "audio", "extras", "dev", "settings", "players", "mobs" }; private static readonly Texture2D[] iconSm = (Texture2D[])(object)new Texture2D[21]; private static readonly Texture2D[] iconLg = (Texture2D[])(object)new Texture2D[21]; private static readonly Color Txt = new Color(0.9f, 0.92f, 0.95f); private static readonly Color Dim = new Color(0.66f, 0.7f, 0.76f); private static readonly Color Accent = new Color(1f, 0.45f, 0.36f); internal static Texture2D Logo => texLogo; internal static Texture2D Divider => texDivider; internal static Texture2D CursorMenu => texCursorMenu; internal static Texture2D CursorOff => texCursorOff; internal static bool Ready => ready; internal static Texture2D TabIconSm(int i) { if (i < 0 || i >= iconSm.Length) { return null; } return iconSm[i]; } internal static Texture2D TabIconLg(int i) { if (i < 0 || i >= iconLg.Length) { return null; } return iconLg[i]; } private static Texture2D LoadAsset(string name) { try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); using (Stream stream = executingAssembly.GetManifestResourceStream(name)) { if (stream != 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; } } Texture2D val = NewTexture(array); if ((Object)(object)val != (Object)null) { return val; } } } string directoryName = Path.GetDirectoryName(executingAssembly.Location); string[] array2 = new string[2] { Path.Combine(directoryName, "Assets", name), Path.Combine(directoryName, "RepoMenu", "Assets", name) }; foreach (string path in array2) { if (File.Exists(path)) { Texture2D val2 = NewTexture(File.ReadAllBytes(path)); if ((Object)(object)val2 != (Object)null) { return val2; } } } } catch { } return null; } private static Texture2D NewTexture(byte[] bytes) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (!ImageConversion.LoadImage(val, bytes)) { return null; } ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Object)val).hideFlags = (HideFlags)61; return val; } internal static void Init() { //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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) if (ready) { return; } try { texWindow = LoadAsset("window_bg.png"); texPanel = LoadAsset("panel_bg.png"); texHeader = LoadAsset("header_bg.png"); texLogo = LoadAsset("logo.png"); texDivider = LoadAsset("divider.png"); texBtn = LoadAsset("button_normal.png"); texBtnHover = LoadAsset("button_hover.png"); texBtnPressed = LoadAsset("button_pressed.png"); texTab = LoadAsset("tab_normal.png"); texTabHover = LoadAsset("tab_hover.png"); texTabActive = LoadAsset("tab_active.png"); texField = LoadAsset("textfield_bg.png"); texSliderTrack = LoadAsset("slider_track.png"); texSliderThumb = LoadAsset("slider_thumb.png"); texScrollBg = LoadAsset("scrollbar_bg.png"); texScrollThumb = LoadAsset("scrollbar_thumb.png"); texToggleOff = LoadAsset("toggle_off.png"); texToggleOn = LoadAsset("toggle_on.png"); texSwitchOff = LoadAsset("switch_off.png") ?? MakeSwitch(on: false); texSwitchOn = LoadAsset("switch_on.png") ?? MakeSwitch(on: true); texCursorMenu = LoadAsset("cursor_menu.png"); texCursorOff = LoadAsset("cursor_off.png"); texPill = MakeRoundRect(48, 32, 15.5f, new Color(0.09f, 0.1f, 0.13f, 0.92f), new Color(1f, 0.45f, 0.36f, 0.95f), 1.6f); texDot = MakeRoundRect(16, 16, 8f, Color.white, Color.white, 8f); for (int i = 0; i < IconNames.Length; i++) { iconSm[i] = LoadAsset("icon_" + IconNames[i] + "_sm.png"); iconLg[i] = LoadAsset("icon_" + IconNames[i] + "_lg.png"); } BuildSkin(); ready = true; } catch (Exception) { Fallback(); } } private static void SetBg(GUIStyle s, Texture2D normal, Texture2D hover, Texture2D active, Color text) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)normal == (Object)null)) { hover = hover ?? normal; active = active ?? normal; s.normal.background = normal; s.onNormal.background = normal; s.hover.background = hover; s.onHover.background = hover; s.active.background = active; s.onActive.background = active; s.focused.background = normal; s.onFocused.background = normal; s.normal.textColor = text; s.onNormal.textColor = text; s.hover.textColor = Color.white; s.onHover.textColor = Color.white; s.active.textColor = Color.white; s.onActive.textColor = Color.white; s.focused.textColor = text; s.onFocused.textColor = text; } } private static void BuildSkin() { //IL_0039: 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_0063: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00e3: 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_0115: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Expected O, but got Unknown //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Expected O, but got Unknown //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Expected O, but got Unknown //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Expected O, but got Unknown //IL_04d9: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Expected O, but got Unknown //IL_0547: Expected O, but got Unknown //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Expected O, but got Unknown //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Expected O, but got Unknown //IL_05a8: Expected O, but got Unknown //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Expected O, but got Unknown //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Expected O, but got Unknown //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Expected O, but got Unknown //IL_066f: Expected O, but got Unknown //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Expected O, but got Unknown //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Expected O, but got Unknown //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Expected O, but got Unknown //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Expected O, but got Unknown //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Expected O, but got Unknown //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Expected O, but got Unknown //IL_07e7: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Expected O, but got Unknown //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Expected O, but got Unknown //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Expected O, but got Unknown //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Expected O, but got Unknown //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Expected O, but got Unknown //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Expected O, but got Unknown //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Expected O, but got Unknown //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Expected O, but got Unknown //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_092c: Unknown result type (might be due to invalid IL or missing references) //IL_0938: Expected O, but got Unknown //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Expected O, but got Unknown //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_097e: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_098a: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Expected O, but got Unknown //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Expected O, but got Unknown //IL_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Expected O, but got Unknown //IL_09ea: Expected O, but got Unknown //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unk