using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BoneLib; using BoneLib.BoneMenu; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using Il2CppSLZ.VRMK; using Il2CppTMPro; using LabFusion.Network; using LabFusion.Network.Serialization; using LabFusion.Player; using LabFusion.SDK.Modules; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using TacPing; using TacPing.Config; using TacPing.Fusion; using TacPing.Interaction; using TacPing.Marking; using TacPing.Menu; using TacPing.UI; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("TacPing")] [assembly: AssemblyProduct("TacPing")] [assembly: AssemblyCompany("Rocner")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: MelonInfo(typeof(TacPingMod), "TacPing", "1.0.0", "Rocner", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: MelonOptionalDependencies(new string[] { "LabFusion" })] [assembly: MelonAdditionalDependencies(new string[] { "BoneLib" })] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [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 TacPing { public sealed class TacPingMod : MelonMod { private readonly PingWheel _wheel = new PingWheel(); private readonly PingAim _aim = new PingAim(); private bool _wasDown; private float _downAt; private bool _wheelOpen; private float _rollReference; private int _updateFailures; public override void OnInitializeMelon() { Step("preferences", delegate { Prefs.Register(); PingFilter.Load(); }); Step("fusion", delegate { FusionSupport.Detect(); FusionSupport.Register(); ((MelonBase)this).LoggerInstance.Msg(FusionSupport.Available ? "LabFusion detected — pings will be shared with the lobby." : "LabFusion not present — pings are local only."); }); Step("level loading hook", delegate { Hooking.OnLevelLoading += OnLevelLoading; }); Step("bonemenu", delegate { MenuPage.Build(ClearAll); }); ((MelonBase)this).LoggerInstance.Msg("TacPing initialised."); } private void Step(string name, Action action) { try { action(); } catch (Exception ex) { ((MelonBase)this).LoggerInstance.Error("Init step '" + name + "' failed (mod continues): " + ex); } } public override void OnDeinitializeMelon() { Step("unhook", delegate { Hooking.OnLevelLoading -= OnLevelLoading; }); _wheel.Destroy(); _aim.Destroy(); MarkerManager.Destroy(); } private void OnLevelLoading(LevelInfo info) { _wheelOpen = false; _wasDown = false; _wheel.Destroy(); _aim.Destroy(); MarkerManager.Destroy(); HoloTheme.Reset(); } public override void OnUpdate() { try { Run(); } catch (Exception ex) { _updateFailures++; if (_updateFailures <= 3) { ((MelonBase)this).LoggerInstance.Error($"Update failed ({_updateFailures}): " + ex); } if (_updateFailures == 3) { ((MelonBase)this).LoggerInstance.Error("Further update errors will be suppressed."); } } } private void Run() { //IL_0144: Unknown result type (might be due to invalid IL or missing references) if (HelperMethods.IsLoading()) { return; } float deltaTime = Time.deltaTime; MarkerManager.Tick(deltaTime); if (!Prefs.Enabled) { CloseWheel(); _aim.Hide(); return; } Hand val = (Prefs.RightHand ? Player.RightHand : Player.LeftHand); BaseController val2 = (Prefs.RightHand ? Player.RightController : Player.LeftController); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { CloseWheel(); _aim.Hide(); return; } bool flag = ReadButton(val2); if (Prefs.RequireEmptyHand && HandFull(val)) { CloseWheel(); _aim.Hide(); _wasDown = flag; return; } if (flag && !_wasDown) { _downAt = Time.time; } if (flag && !_wheelOpen && Time.time - _downAt >= Mathf.Max(0.1f, Prefs.HoldTime)) { OpenWheel(val); } if (flag) { _aim.Resolve(val); _aim.Show(_wheel.Selection); } else { _aim.Hide(); } if (_wheelOpen) { _wheel.SetSelection(RollSelection(val)); _wheel.Tick(deltaTime, WheelAnchor(val)); } if (!flag && _wasDown) { PlaceMarker(val2); CloseWheel(); _aim.Hide(); } _wasDown = flag; } private void OpenWheel(Hand hand) { if (_wheel.Visible || _wheel.Build()) { _rollReference = Roll(hand); _wheel.Show(); _wheelOpen = true; } } private MarkerKind RollSelection(Hand hand) { float num = Mathf.DeltaAngle(_rollReference, Roll(hand)); int num2 = 2; return MarkerStyle.Clamp(Mathf.RoundToInt(num / Mathf.Max(5f, Prefs.RollStep)) + num2); } private static float Roll(Hand hand) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0055: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)hand).transform; Vector3 forward = transform.forward; Vector3 val = Vector3.ProjectOnPlane(Vector3.up, forward); if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { val = Vector3.ProjectOnPlane(Vector3.forward, forward); } if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { return 0f; } return Vector3.SignedAngle(((Vector3)(ref val)).normalized, transform.up, forward); } private void CloseWheel() { if (_wheelOpen) { _wheel.Hide(); _wheelOpen = false; } } private static Vector3 WheelAnchor(Hand hand) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)hand).transform; return transform.position + transform.forward * 0.1f; } private static bool HandFull(Hand hand) { try { return (Object)(object)Player.GetObjectInHand(hand) != (Object)null; } catch { return false; } } private static bool ReadButton(BaseController controller) { try { return Mathf.Clamp(Prefs.Button, 0, 2) switch { 0 => controller.GetAButton(), 2 => controller.GetMenuButton(), _ => controller.GetBButton(), }; } catch { return false; } } private void PlaceMarker(BaseController controller) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) if (!_aim.Valid) { return; } Vector3 point = _aim.Point; MarkerKind selection = _wheel.Selection; byte localId = FusionSupport.LocalId; MarkerManager.Place(point, selection, localId, FusionSupport.LocalName); if (Prefs.Networked) { FusionSupport.Broadcast(point, selection, clear: false); } if (!Prefs.Haptics) { return; } try { controller.HapticAction(0f, 0.06f, 220f, 0.75f); } catch { } } private void ClearAll() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) MarkerManager.ClearAll(); if (Prefs.Networked) { FusionSupport.Broadcast(Vector3.zero, MarkerKind.Go, clear: true); } } } internal static class BuildInfo { public const string Name = "TacPing"; public const string Author = "Rocner"; public const string Version = "1.0.0"; } } namespace TacPing.UI { internal static class Ease { public static float OutCubic(float t) { float num = 1f - Mathf.Clamp01(t); return 1f - num * num * num; } public static float OutQuint(float t) { float num = 1f - Mathf.Clamp01(t); return 1f - num * num * num * num * num; } public static float OutBack(float t) { t = Mathf.Clamp01(t); float num = t - 1f; return 1f + 2.70158f * num * num * num + 1.70158f * num * num; } public static float OutElastic(float t) { t = Mathf.Clamp01(t); if (t <= 0f) { return 0f; } if (t >= 1f) { return 1f; } return Mathf.Pow(2f, -9f * t) * Mathf.Sin((t - 0.08f) * ((float)Math.PI * 2f) / 0.32f) + 1f; } public static float InOutSine(float t) { return (0f - (Mathf.Cos((float)Math.PI * Mathf.Clamp01(t)) - 1f)) * 0.5f; } } internal enum IconKind { None, Star, Crosshair, Blade, Figure, Cube, Grid, Plus, Chevron } internal enum PlateStyle { Chip, Panel, Solid, Glow, Line, Bracket } internal static class HoloTextures { private const int LongSide = 192; private const float CornerRadius = 0.0045f; private const float BorderWorld = 0.0011f; private static readonly Dictionary Cache = new Dictionary(); public static Texture2D Plate(Vector2 worldSize, PlateStyle style) { //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_0028: 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) float num = Mathf.Max(worldSize.x, worldSize.y); if (num <= 0.0001f) { num = 0.01f; } float num2 = 192f / num; int num3 = Mathf.Clamp(Mathf.RoundToInt(worldSize.x * num2), 4, 256); int num4 = Mathf.Clamp(Mathf.RoundToInt(worldSize.y * num2), 4, 256); string key = style.ToString() + "_" + num3 + "x" + num4; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } float radius = Mathf.Min(0.0045f * num2, (float)Mathf.Min(num3, num4) * 0.42f); float border = Mathf.Max(1.2f, 0.0011f * num2); Texture2D val = Render(num3, num4, radius, border, style); Cache[key] = val; return val; } public static Texture2D Window(Vector2 worldSize) { //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_0028: 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_02dc: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(worldSize.x, worldSize.y); if (num <= 0.0001f) { num = 0.01f; } float num2 = 256f / num; int num3 = Mathf.Clamp(Mathf.RoundToInt(worldSize.x * num2), 8, 320); int num4 = Mathf.Clamp(Mathf.RoundToInt(worldSize.y * num2), 8, 320); string key = "window_" + num3 + "x" + num4; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Il2CppStructArray val = new Il2CppStructArray((long)(num3 * num4)); float num5 = (float)num3 * 0.5f; float num6 = (float)num4 * 0.5f; float num7 = Mathf.Min(0.0045f * num2, (float)Mathf.Min(num3, num4) * 0.28f); float num8 = Mathf.Max(1.6f, 0.0011f * num2 * 1.3f); float num9 = (float)num4 * 0.795f; float num10 = (float)Mathf.Min(num3, num4) * 0.1f; float num11 = (float)Mathf.Min(num3, num4) * 0.16f; for (int i = 0; i < num4; i++) { for (int j = 0; j < num3; j++) { float px = (float)j + 0.5f - num5; float py = (float)i + 0.5f - num6; float num12 = RoundedBox(px, py, num5 - 0.5f, num6 - 0.5f, num7); float num13 = Mathf.Clamp01(0.5f - num12); float num14 = Mathf.Clamp01(0.5f - (num12 + num8)); float num15 = Mathf.Clamp01(num13 - num14); float num16 = Mathf.Lerp(0.45f, 1f, (float)i / (float)num4); float num17 = num14 * 0.1f * num16; float num18 = Band(1.1f - Mathf.Abs((float)i - num9), 1.4f) * num14 * 0.65f; float num19 = (((float)(i % 7) < 1.1f) ? (0.055f * num14) : 0f); float num20 = 0f; float num21 = Mathf.Min(j, num3 - 1 - j); float num22 = Mathf.Min(i, num4 - 1 - i); if (num21 > num10 - 1.5f && num21 < num10 + 0.5f && num22 < num10 + num11) { num20 = 1f; } if (num22 > num10 - 1.5f && num22 < num10 + 0.5f && num21 < num10 + num11) { num20 = 1f; } num20 *= num14; float num23 = Mathf.Exp((0f - Mathf.Max(num12, 0f)) / Mathf.Max(2f, num7 * 0.8f)) * (1f - num13); float num24 = num15 + num17 + num18 + num19 + num20 * 0.7f + num23 * 0.35f; ((Il2CppArrayBase)(object)val)[i * num3 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Clamp01(num24) * 255f)); } } Texture2D val2 = Commit(val, num3, num4); Cache[key] = val2; return val2; } public static Texture2D Globe(int meridians, int parallels) { //IL_0112: Unknown result type (might be due to invalid IL or missing references) string key = "globe_" + meridians + "_" + parallels; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Il2CppStructArray val = new Il2CppStructArray(32768L); for (int i = 0; i < 128; i++) { for (int j = 0; j < 256; j++) { float num = ((float)j + 0.5f) / 256f; float num2 = ((float)i + 0.5f) / 128f; float num3 = LineMask(num * (float)meridians, 0.03f); float num4 = LineMask(num2 * (float)parallels, 0.045f); float num5 = Mathf.Max(LineMask(num2 * 1f + 0.5f, 0.012f), Mathf.Max(num3, num4)) * 0.85f + 0.1f; num5 *= Mathf.Lerp(0.3f, 1f, Mathf.Sin(num2 * (float)Math.PI)); ((Il2CppArrayBase)(object)val)[i * 256 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Clamp01(num5) * 255f)); } } Texture2D val2 = Commit(val, 256, 128); ((Texture)val2).wrapMode = (TextureWrapMode)0; Cache[key] = val2; return val2; } public static Texture2D Ring(int segments) { //IL_01e3: Unknown result type (might be due to invalid IL or missing references) string key = "ring_" + segments; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Il2CppStructArray val = new Il2CppStructArray(65536L); float num = 128f; float num2 = 1f / 128f; for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { float num3 = ((float)j + 0.5f - num) / num; float num4 = ((float)i + 0.5f - num) / num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Atan2(num4, num3) / ((float)Math.PI * 2f) + 0.5f; float num7 = Band(0.055f - Mathf.Abs(num5 - 0.8f), num2 * 2f); float num8 = 1f; if (segments > 0) { float num9 = num6 * (float)segments; float num10 = num9 - Mathf.Floor(num9); num8 = Mathf.Min(Band(num10, 0.06f), Band(0.7f - num10, 0.06f)); } float num11 = Band(0.012f - Mathf.Abs(num5 - 0.6f), num2 * 2f); float num12 = Band(0.008f - Mathf.Abs(num5 - 0.93f), num2 * 2f); float num13 = 0f; if (segments > 0) { float num14 = num6 * (float)segments; float num15 = num14 - Mathf.Floor(num14); float num16 = Mathf.Min(num15, 1f - num15); if (num5 > 0.62f && num5 < 0.8f) { num13 = Band(0.035f - num16, 0.02f); } } float num17 = Mathf.Max(num7 * num8, Mathf.Max(num11 * 0.55f, Mathf.Max(num12 * 0.75f, num13 * 0.6f))); ((Il2CppArrayBase)(object)val)[i * 256 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Clamp01(num17) * 255f)); } } Texture2D val2 = Commit(val, 256, 256); Cache[key] = val2; return val2; } private static float LineMask(float t, float width) { float num = t - Mathf.Floor(t); float num2 = Mathf.Min(num, 1f - num); return Mathf.Clamp01(1f - num2 / Mathf.Max(0.0001f, width)); } public static Texture2D Icon(IconKind kind) { if (kind == IconKind.None) { return null; } string key = "icon_" + kind; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = RenderIcon(kind, 64); Cache[key] = val; return val; } private static Texture2D Render(int w, int h, float radius, float border, PlateStyle style) { //IL_01a1: Unknown result type (might be due to invalid IL or missing references) Il2CppStructArray val = new Il2CppStructArray((long)(w * h)); float num = (float)w * 0.5f; float num2 = (float)h * 0.5f; float num3 = Mathf.Max(2f, radius * 0.9f); for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { float px = (float)j + 0.5f - num; float py = (float)i + 0.5f - num2; float num10; switch (style) { case PlateStyle.Line: num10 = 1f; break; case PlateStyle.Bracket: num10 = Bracket(px, py, num, num2, border); break; default: { float num4 = RoundedBox(px, py, num - 0.5f, num2 - 0.5f, radius); float num5 = Mathf.Clamp01(0.5f - num4); float num6 = Mathf.Clamp01(0.5f - (num4 + border)); float num7 = Mathf.Clamp01(num5 - num6); float num8 = Mathf.Lerp(0.62f, 1f, ((float)i + 0.5f) / (float)h); float num9 = Mathf.Exp((0f - Mathf.Max(num4, 0f)) / num3) * (1f - num5); num10 = style switch { PlateStyle.Panel => num7 * 0.95f + num6 * 0.94f * num8 + num9 * 0.22f, PlateStyle.Solid => num5 * num8, PlateStyle.Glow => num6 * 0.55f + num9 * 0.85f, _ => num7 * 1f + num6 * 0.2f * num8 + num9 * 0.3f, }; break; } } byte b = (byte)(Mathf.Clamp01(num10) * 255f); ((Il2CppArrayBase)(object)val)[i * w + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b); } } return Commit(val, w, h); } private static float RoundedBox(float px, float py, float halfW, float halfH, float radius) { float num = Mathf.Abs(px) - halfW + radius; float num2 = Mathf.Abs(py) - halfH + radius; float num3 = Mathf.Max(num, 0f); float num4 = Mathf.Max(num2, 0f); float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); return Mathf.Min(Mathf.Max(num, num2), 0f) + num5 - radius; } private static float Bracket(float px, float py, float halfW, float halfH, float border) { float num = halfW * 1.5f; float num2 = halfH * 1.5f; float num3 = Mathf.Max(1.6f, border * 1.4f); bool num4 = px < 0f - halfW + num3 && py > halfH - num2; bool flag = py > halfH - num3 && px < 0f - halfW + num; if (!(num4 || flag)) { return 0f; } return 1f; } private static Texture2D RenderIcon(IconKind kind, int size) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) Il2CppStructArray val = new Il2CppStructArray((long)(size * size)); float num = (float)size * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float x = ((float)j + 0.5f - num) / num; float y = ((float)i + 0.5f - num) / num; byte b = (byte)(Mathf.Clamp01(Sample(kind, x, y)) * 255f); ((Il2CppArrayBase)(object)val)[i * size + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b); } } return Commit(val, size, size); } private static float Sample(IconKind kind, float x, float y) { switch (kind) { case IconKind.Star: { float num20 = Mathf.Sqrt(x * x + y * y); float num21 = Mathf.Abs(Mathf.Cos((Mathf.Atan2(y, x) - (float)Math.PI / 2f) * 2.5f)); float num22 = num21 * num21 * num21 * num21 * num21; return Band(Mathf.Lerp(0.2f, 0.94f, num22) - num20, 0.045f); } case IconKind.Crosshair: { float num7 = Mathf.Sqrt(x * x + y * y); float num8 = Band(0.0595f - Mathf.Abs(num7 - 0.52f), 0.05f); float num9 = 0f; if (Mathf.Abs(y) < 0.051000003f && Mathf.Abs(x) > 0.3f && Mathf.Abs(x) < 0.86f) { num9 = 1f; } if (Mathf.Abs(x) < 0.051000003f && Mathf.Abs(y) > 0.3f && Mathf.Abs(y) < 0.86f) { num9 = 1f; } float num10 = Band(0.1f - num7, 0.05f); return Mathf.Max(num8, Mathf.Max(num9, num10)); } case IconKind.Blade: { float num2 = (x + y) * 0.7071f; float num3 = (x - y) * 0.7071f; float num4 = ((Mathf.Abs(num3) < 0.085f * Mathf.Lerp(1.6f, 0.25f, Mathf.InverseLerp(-0.15f, 0.85f, num2)) && num2 > -0.15f && num2 < 0.85f) ? 1f : 0f); float num5 = ((Mathf.Abs(num2 + 0.28f) < 0.0765f && Mathf.Abs(num3) < 0.34f) ? 1f : 0f); float num6 = ((Mathf.Abs(num3) < 0.0765f && num2 > -0.78f && num2 < -0.3f) ? 1f : 0f); return Mathf.Max(num4, Mathf.Max(num5, num6)); } case IconKind.Figure: { float num23 = Mathf.Sqrt(x * x + (y - 0.5f) * (y - 0.5f)); float num24 = Band(0.26f - num23, 0.05f); float num25 = Mathf.Lerp(0.16f, 0.46f, Mathf.InverseLerp(0.1f, -0.85f, y)); float num26 = ((y < 0.1f && y > -0.85f && Mathf.Abs(x) < num25) ? 1f : 0f); return Mathf.Max(num24, num26); } case IconKind.Cube: { float num11 = HexEdge(x, y, 0.72f, 0.06375f); float num12 = ((Mathf.Abs(x) < 0.04675f && y > -0.72f && y < 0.06f) ? 1f : 0f); float num13 = SegmentBand(x, y, 0f, 0.06f, -0.62f, 0.4f, 0.04675f); float num14 = SegmentBand(x, y, 0f, 0.06f, 0.62f, 0.4f, 0.04675f); return Mathf.Max(num11, Mathf.Max(num12, Mathf.Max(num13, num14))); } case IconKind.Grid: { float num17 = 0f; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { float num18 = x - (float)j * 0.46f; float num19 = y - (float)i * 0.46f; num17 = Mathf.Max(num17, Band(0.13f - Mathf.Sqrt(num18 * num18 + num19 * num19), 0.05f)); } } return num17; } case IconKind.Plus: { float num15 = ((Mathf.Abs(y) < 0.0765f && Mathf.Abs(x) < 0.58f) ? 1f : 0f); float num16 = ((Mathf.Abs(x) < 0.0765f && Mathf.Abs(y) < 0.58f) ? 1f : 0f); return Mathf.Max(num15, num16); } case IconKind.Chevron: { float num = Mathf.Abs(Mathf.Abs(y) - (x + 0.35f)); if (!(x > -0.55f) || !(x < 0.35f)) { return 0f; } return Band(0.085f - num, 0.05f); } default: return 0f; } } private static float HexEdge(float x, float y, float radius, float thickness) { float num = 1f; for (int i = 0; i < 6; i++) { float num2 = (float)i * (float)Math.PI / 3f; float num3 = (float)(i + 1) * (float)Math.PI / 3f; float x2 = Mathf.Cos(num2) * radius; float y2 = Mathf.Sin(num2) * radius; float x3 = Mathf.Cos(num3) * radius; float y3 = Mathf.Sin(num3) * radius; num = Mathf.Min(num, SegmentDistance(x, y, x2, y2, x3, y3)); } return Band(thickness - num, 0.05f); } private static float SegmentBand(float px, float py, float x0, float y0, float x1, float y1, float thickness) { return Band(thickness - SegmentDistance(px, py, x0, y0, x1, y1), 0.05f); } private static float SegmentDistance(float px, float py, float x0, float y0, float x1, float y1) { float num = x1 - x0; float num2 = y1 - y0; float num3 = num * num + num2 * num2; float num4 = ((num3 <= 0.0001f) ? 0f : Mathf.Clamp01(((px - x0) * num + (py - y0) * num2) / num3)); float num5 = x0 + num * num4; float num6 = y0 + num2 * num4; return Mathf.Sqrt((px - num5) * (px - num5) + (py - num6) * (py - num6)); } private static float Band(float value, float softness) { return Mathf.Clamp01(value / Mathf.Max(0.0001f, softness)); } private static Texture2D Commit(Il2CppStructArray pixels, int w, int h) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_002f: Expected O, but got Unknown Texture2D val = new Texture2D(w, h, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; val.SetPixels32(pixels); val.Apply(false, false); return val; } public static void Clear() { foreach (KeyValuePair item in Cache) { if ((Object)(object)item.Value != (Object)null) { Object.Destroy((Object)(object)item.Value); } } Cache.Clear(); } } internal static class HoloTheme { public static readonly Color Backplate = new Color(0.03f, 0.022f, 0.014f, 0.9f); public static readonly Color Frame = new Color(1f, 0.62f, 0.14f, 0.85f); public static readonly Color Divider = new Color(1f, 0.6f, 0.16f, 0.3f); public static readonly Color Stripe = new Color(1f, 0.55f, 0.12f, 0.055f); public static readonly Color Button = new Color(1f, 0.58f, 0.12f, 0.62f); public static readonly Color ButtonHover = new Color(1f, 0.8f, 0.38f, 0.95f); public static readonly Color ButtonActive = new Color(1f, 0.95f, 0.78f, 1f); public static readonly Color TabActive = new Color(1f, 0.7f, 0.18f, 0.95f); public static readonly Color SubTab = new Color(0.8f, 0.44f, 0.1f, 0.45f); public static readonly Color SubTabActive = new Color(1f, 0.66f, 0.16f, 0.85f); public static readonly Color RowEmpty = new Color(0.55f, 0.3f, 0.08f, 0.18f); public static readonly Color RowModded = new Color(0.55f, 0.78f, 1f, 0.62f); public static readonly Color Danger = new Color(1f, 0.26f, 0.1f, 0.72f); public static readonly Color FavOn = new Color(1f, 0.84f, 0.3f, 0.95f); public static readonly Color Scanline = new Color(1f, 0.78f, 0.32f, 0.13f); public static readonly Color Selection = new Color(1f, 0.72f, 0.22f, 0.55f); public static readonly Color Shard = new Color(1f, 0.9f, 0.6f, 0.95f); public static readonly Color TextPrimary = new Color(1f, 0.88f, 0.62f, 1f); public static readonly Color TextDim = new Color(0.86f, 0.58f, 0.24f, 1f); public static readonly Color TextBright = new Color(1f, 0.97f, 0.88f, 1f); private static Shader _shader; private static TMP_FontAsset _font; private static float _unitsPerFontSize = -1f; private static readonly string[] ShaderCandidates = new string[5] { "Universal Render Pipeline/Unlit", "Unlit/Transparent", "Sprites/Default", "UI/Default", "Hidden/Internal-Colored" }; public static Shader Shader { get { if ((Object)(object)_shader != (Object)null) { return _shader; } for (int i = 0; i < ShaderCandidates.Length; i++) { if (!((Object)(object)_shader == (Object)null)) { break; } _shader = Shader.Find(ShaderCandidates[i]); } if ((Object)(object)_shader == (Object)null) { Melon.Logger.Warning("No usable shader found; panel may be invisible."); } return _shader; } } public static TMP_FontAsset Font { get { if ((Object)(object)_font != (Object)null) { return _font; } try { _font = TMP_Settings.defaultFontAsset; } catch { } if ((Object)(object)_font == (Object)null) { try { Il2CppArrayBase val = Resources.FindObjectsOfTypeAll(); if (val != null && val.Length > 0) { _font = val[0]; } } catch { } } if ((Object)(object)_font == (Object)null) { Melon.Logger.Warning("No TMP font asset found; panel labels will be blank."); } return _font; } } public static void Calibrate(TMP_Text probe) { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (_unitsPerFontSize > 0f || (Object)(object)probe == (Object)null) { return; } try { float fontSize = probe.fontSize; probe.fontSize = 1f; Vector2 preferredValues = probe.GetPreferredValues("Ag"); probe.fontSize = fontSize; if (preferredValues.y > 0.0001f) { _unitsPerFontSize = preferredValues.y; } } catch { } } public static float FontSizeFor(float worldHeight) { if (!(_unitsPerFontSize > 0f)) { return worldHeight * 10f; } return worldHeight / _unitsPerFontSize; } public static Material CreateMaterial(Color color, bool onTop, Texture2D texture) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown Material val = new Material(Shader); Tint(val, color); SetTexture(val, texture); val.SetFloat("_Surface", 1f); val.SetFloat("_Blend", 0f); val.SetFloat("_ZWrite", 0f); val.SetFloat("_Cull", 0f); val.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); val.SetFloat("_ZTest", (float)(onTop ? 8 : 4)); val.renderQueue = (onTop ? 4000 : 3000); return val; } public static void SetTexture(Material material, Texture2D texture) { if (!((Object)(object)material == (Object)null) && !((Object)(object)texture == (Object)null)) { if (material.HasProperty("_BaseMap")) { material.SetTexture("_BaseMap", (Texture)(object)texture); } if (material.HasProperty("_MainTex")) { material.SetTexture("_MainTex", (Texture)(object)texture); } } } public static Color Shift(Color color, float degrees) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_000d: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(degrees) < 0.01f) { return color; } float num2 = default(float); float num3 = default(float); float num = default(float); Color.RGBToHSV(color, ref num, ref num2, ref num3); num = Mathf.Repeat(num + degrees / 360f, 1f); Color result = Color.HSVToRGB(num, num2, num3); result.a = color.a; return result; } public static void Tint(Material material, Color color) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)material == (Object)null)) { if (material.HasProperty("_BaseColor")) { material.SetColor("_BaseColor", color); } if (material.HasProperty("_Color")) { material.SetColor("_Color", color); } if (material.HasProperty("_TintColor")) { material.SetColor("_TintColor", color); } } } public static void Reset() { _shader = null; _font = null; _unitsPerFontSize = -1f; HoloTextures.Clear(); } } internal static class PlayerBody { public static bool TryResolve(out Vector3 feet, out float height, out Vector3 forward) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) feet = Vector3.zero; height = 1.78f; forward = Vector3.forward; Transform head = Player.Head; if ((Object)(object)head == (Object)null) { return false; } float num = -1f; try { RigManager rigManager = Player.RigManager; if ((Object)(object)rigManager != (Object)null) { num = head.position.y - ((Component)rigManager).transform.position.y; } } catch { } if (num < 0.6f || num > 3f) { num = AvatarHeight(); } height = Mathf.Clamp(num, 0.7f, 2.8f); feet = new Vector3(head.position.x, head.position.y - height, head.position.z); Vector3 forward2 = head.forward; forward2.y = 0f; forward = ((((Vector3)(ref forward2)).sqrMagnitude > 0.001f) ? ((Vector3)(ref forward2)).normalized : Vector3.forward); return true; } public static Vector3 Center(Vector3 feet, float height) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return feet + Vector3.up * (height * 0.58f); } private static float AvatarHeight() { try { Avatar avatar = Player.Avatar; if ((Object)(object)avatar != (Object)null && avatar._height > 0.6f && avatar._height < 3f) { return avatar._height; } } catch { } return 1.78f; } } } namespace TacPing.Menu { internal static class MenuPage { private static readonly Color Accent = new Color(0.3f, 0.85f, 1f); private static Page _players; private static readonly byte[] RosterIds = new byte[16]; private static readonly string[] RosterNames = new string[16]; public static void Build(Action clearAll) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) Page root; try { root = Page.Root.CreatePage("Tac Ping", Accent, 0, true); } catch (Exception ex) { Melon.Logger.Error("BoneMenu root page failed: " + ex); return; } Section("main", delegate { BuildMain(root, clearAll); }); Section("players", delegate { BuildPlayersPage(root); }); Section("tuning", delegate { BuildTuning(root); }); } private static void Section(string name, Action build) { try { build(); } catch (Exception ex) { Melon.Logger.Error("BoneMenu section '" + name + "' failed: " + ex); } } private static void BuildMain(Page root, Action clearAll) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) root.CreateBool("Enabled", Accent, Prefs.Enabled, (Action)delegate(bool v) { Prefs.SetEnabled(v); Prefs.Save(); }); root.CreateInt("Button: 0 A 1 B 2 Menu", Accent, Prefs.Button, 1, 0, 2, (Action)delegate(int v) { Prefs.SetButton(v); Prefs.Save(); }); root.CreateBool("Ping With Right Hand", Accent, Prefs.RightHand, (Action)delegate(bool v) { Prefs.SetRightHand(v); Prefs.Save(); }); root.CreateBool("Require Empty Hand", Accent, Prefs.RequireEmptyHand, (Action)delegate(bool v) { Prefs.SetRequireEmptyHand(v); Prefs.Save(); }); root.CreateBool("Share In Fusion Lobbies", Accent, Prefs.Networked, (Action)delegate(bool v) { Prefs.SetNetworked(v); Prefs.Save(); }); root.CreateBool("Show Other Players Markers", Accent, Prefs.ShowOthers, (Action)delegate(bool v) { Prefs.SetShowOthers(v); Prefs.Save(); }); root.CreateFunction("Clear My Markers", Color.red, clearAll); } private static void BuildPlayersPage(Page root) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _players = root.CreatePage("Players", Accent, 0, true); RefreshPlayers(); } private static void RefreshPlayers() { //IL_001c: 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_0087: 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_0137: Unknown result type (might be due to invalid IL or missing references) if (_players == null) { return; } _players.RemoveAll(); _players.CreateFunction("Refresh List", Accent, (Action)RefreshPlayers); _players.CreateFunction("Unmute Everyone", Accent, (Action)delegate { PingFilter.UnmuteAll(); RefreshPlayers(); }); if (!FusionSupport.InLobby) { _players.CreateFunction("Not in a Fusion lobby", Accent, (Action)RefreshPlayers); return; } int num = FusionSupport.Roster(RosterIds, RosterNames); if (num <= 0) { _players.CreateFunction("No other players", Accent, (Action)RefreshPlayers); return; } for (int num2 = 0; num2 < num; num2++) { byte id = RosterIds[num2]; string name = RosterNames[num2]; bool flag = !PingFilter.IsMuted(id, name); _players.CreateBool(name, Accent, flag, (Action)delegate(bool value) { PingFilter.SetMuted(id, name, !value); }); } } private static void BuildTuning(Page root) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) Page obj = root.CreatePage("Tuning", Accent, 0, true); obj.CreateFloat("Hold To Open Wheel", Accent, Prefs.HoldTime, 0.02f, 0.1f, 1f, (Action)delegate(float v) { Prefs.SetHoldTime(v); Prefs.Save(); }); obj.CreateFloat("Marker Lifetime", Accent, Prefs.Lifetime, 1f, 3f, 120f, (Action)delegate(float v) { Prefs.SetLifetime(v); Prefs.Save(); }); obj.CreateFloat("Max Range", Accent, Prefs.MaxRange, 5f, 5f, 300f, (Action)delegate(float v) { Prefs.SetMaxRange(v); Prefs.Save(); }); obj.CreateFloat("Aim Pitch Trim", Accent, Prefs.AimPitch, 2.5f, -60f, 60f, (Action)delegate(float v) { Prefs.SetAimPitch(v); Prefs.Save(); }); obj.CreateFloat("Wrist Roll Per Step", Accent, Prefs.RollStep, 2.5f, 8f, 45f, (Action)delegate(float v) { Prefs.SetRollStep(v); Prefs.Save(); }); obj.CreateInt("Max Markers Per Player", Accent, Prefs.MaxMarkers, 1, 1, 16, (Action)delegate(int v) { Prefs.SetMaxMarkers(v); Prefs.Save(); }); obj.CreateFloat("Marker Scale", Accent, Prefs.Scale, 0.1f, 0.3f, 3f, (Action)delegate(float v) { Prefs.SetScale(v); Prefs.Save(); }); obj.CreateFloat("Hue Shift", Accent, Prefs.HueShift, 15f, -180f, 180f, (Action)delegate(float v) { Prefs.SetHueShift(v); Prefs.Save(); }); obj.CreateBool("See Through Walls", Accent, Prefs.SeeThrough, (Action)delegate(bool v) { Prefs.SetSeeThrough(v); Prefs.Save(); MarkerManager.Destroy(); }); obj.CreateBool("Show Distance", Accent, Prefs.ShowDistance, (Action)delegate(bool v) { Prefs.SetShowDistance(v); Prefs.Save(); }); obj.CreateBool("Haptic Feedback", Accent, Prefs.Haptics, (Action)delegate(bool v) { Prefs.SetHaptics(v); Prefs.Save(); }); } } } namespace TacPing.Marking { internal sealed class Marker { private const float BeamHeight = 1.6f; private GameObject _root; private GameObject _beam; private GameObject _ring; private GameObject _icon; private GameObject _pulse; private Material _beamMat; private Material _ringMat; private Material _iconMat; private Material _pulseMat; private TextMeshPro _label; private float _life; private float _age; private string _owner; public bool Active { get; private set; } public MarkerKind Kind { get; private set; } public Vector3 Position { get; private set; } public byte OwnerId { get; private set; } public bool Build(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) try { _root = new GameObject("TacPing.Marker"); _root.transform.SetParent(parent, false); _beam = MakeCylinder("Beam", 3700, out _beamMat); _ring = MakeQuad("Ring", HoloTextures.Ring(28), 3701, out _ringMat); _pulse = MakeQuad("Pulse", HoloTextures.Ring(16), 3703, out _pulseMat); _icon = MakeQuad("Icon", null, 3704, out _iconMat); GameObject val = new GameObject("Label"); val.transform.SetParent(_root.transform, false); _label = val.AddComponent(); ((TMP_Text)_label).font = HoloTheme.Font; HoloTheme.Calibrate((TMP_Text)(object)_label); ((TMP_Text)_label).rectTransform.sizeDelta = new Vector2(1.2f, 0.3f); ((TMP_Text)_label).fontSize = HoloTheme.FontSizeFor(0.075f); ((TMP_Text)_label).alignment = (TextAlignmentOptions)514; ((TMP_Text)_label).enableWordWrapping = false; ((TMP_Text)_label).overflowMode = (TextOverflowModes)0; ((TMP_Text)_label).richText = false; ((TMP_Text)_label).text = string.Empty; _root.SetActive(false); return true; } catch (Exception ex) { Melon.Logger.Warning("Marker build failed: " + ex.Message); return false; } } private GameObject MakeQuad(string name, Texture2D texture, int queue, out Material material) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); Strip(obj); material = HoloTheme.CreateMaterial(Color.white, Prefs.SeeThrough, texture); material.renderQueue = queue; Apply(obj, material); return obj; } private GameObject MakeCylinder(string name, int queue, out Material material) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); Strip(obj); material = HoloTheme.CreateMaterial(Color.white, Prefs.SeeThrough, null); material.renderQueue = queue; Apply(obj, material); return obj; } private static void Strip(GameObject go) { Collider component = go.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } } private static void Apply(GameObject go, Material material) { Renderer component = go.GetComponent(); component.material = material; component.shadowCastingMode = (ShadowCastingMode)0; component.receiveShadows = false; } public void Place(Vector3 position, MarkerKind kind, byte ownerId, string owner, float lifetime) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Position = position; Kind = kind; OwnerId = ownerId; _owner = owner; _life = Mathf.Max(1f, lifetime); _age = 0f; Active = true; HoloTheme.SetTexture(_iconMat, HoloTextures.Icon(MarkerStyle.Icon(kind))); if ((Object)(object)_root != (Object)null && !_root.activeSelf) { _root.SetActive(true); } } public void Retire() { Active = false; if ((Object)(object)_root != (Object)null && _root.activeSelf) { _root.SetActive(false); } } public void Tick(float dt, Vector3 viewer) { //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) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_014a: 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_0156: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_0317: 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) //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_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0344: 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_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: 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_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: 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_02fa: Unknown result type (might be due to invalid IL or missing references) if (!Active || (Object)(object)_root == (Object)null) { return; } _age += dt; if (_age >= _life) { Retire(); return; } float num = Mathf.Max(0.2f, Prefs.Scale); float num2 = Vector3.Distance(viewer, Position); float num3 = Ease.OutBack(Mathf.Clamp01(_age * 4f)); float num4 = Mathf.Clamp01((_life - _age) / 1.5f) * Mathf.Clamp01(_age * 6f); float num5 = Mathf.Clamp(num2 * 0.045f, 1f, 4.5f) * num; Color val = MarkerStyle.Color(Kind); float num6 = 0.75f + 0.25f * Mathf.Sin(Time.time * 3.4f); _root.transform.position = Position; float num7 = 1.6f * num5 * num3; _beam.transform.localPosition = new Vector3(0f, num7 * 0.5f, 0f); _beam.transform.localScale = new Vector3(0.02f * num5, num7 * 0.5f, 0.02f * num5); Color color = val; color.a = 0.3f * num4 * num6; HoloTheme.Tint(_beamMat, color); float num8 = 0.55f * num5 * num3; _ring.transform.localPosition = new Vector3(0f, 0.02f * num5, 0f); _ring.transform.localRotation = Quaternion.Euler(90f, 0f, Time.time * 45f); _ring.transform.localScale = new Vector3(num8, num8, 1f); Color color2 = val; color2.a = 0.85f * num4; HoloTheme.Tint(_ringMat, color2); float num9 = Mathf.Clamp01(_age * 1.6f); bool flag = num9 < 1f; if (_pulse.activeSelf != flag) { _pulse.SetActive(flag); } if (flag) { float num10 = num8 * (1f + Ease.OutQuint(num9) * 4f); _pulse.transform.localPosition = new Vector3(0f, 0.03f * num5, 0f); _pulse.transform.localRotation = Quaternion.Euler(90f, 0f, 0f); _pulse.transform.localScale = new Vector3(num10, num10, 1f); Color color3 = val; color3.a = (1f - num9) * (1f - num9) * 0.8f; HoloTheme.Tint(_pulseMat, color3); } Vector3 val2 = Position + Vector3.up * (num7 + 0.22f * num5); Quaternion val3 = Billboard(val2, viewer); float num11 = 0.36f * num5 * num3; _icon.transform.position = val2; _icon.transform.rotation = val3; _icon.transform.localScale = new Vector3(num11, num11, 1f); Color color4 = Color.Lerp(val, Color.white, 0.35f); color4.a = num4; HoloTheme.Tint(_iconMat, color4); Vector3 position = val2 - val3 * Vector3.up * (num11 * 0.85f); ((Transform)((TMP_Text)_label).rectTransform).position = position; ((Transform)((TMP_Text)_label).rectTransform).rotation = val3; ((Transform)((TMP_Text)_label).rectTransform).localScale = Vector3.one * (num5 * num3); ((TMP_Text)_label).text = BuildLabel(num2); Color color5 = Color.Lerp(val, Color.white, 0.55f); color5.a = num4; ((Graphic)_label).color = color5; } private string BuildLabel(float distance) { string text = MarkerStyle.Label(Kind); if (!Prefs.ShowDistance) { if (!string.IsNullOrEmpty(_owner)) { return text + " " + _owner; } return text; } int num = Mathf.RoundToInt(distance); if (!string.IsNullOrEmpty(_owner)) { return text + " " + num + "m " + _owner; } return text + " " + num + "m"; } private static Quaternion Billboard(Vector3 position, Vector3 viewer) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - viewer; if (!(((Vector3)(ref val)).sqrMagnitude < 1E-06f)) { return Quaternion.LookRotation(val, Vector3.up); } return Quaternion.identity; } public void Destroy() { if ((Object)(object)_beamMat != (Object)null) { Object.Destroy((Object)(object)_beamMat); } if ((Object)(object)_ringMat != (Object)null) { Object.Destroy((Object)(object)_ringMat); } if ((Object)(object)_iconMat != (Object)null) { Object.Destroy((Object)(object)_iconMat); } if ((Object)(object)_pulseMat != (Object)null) { Object.Destroy((Object)(object)_pulseMat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _beam = null; _ring = null; _icon = null; _pulse = null; _label = null; Active = false; } } internal enum MarkerKind : byte { Go, Enemy, Loot, Danger, Defend } internal static class MarkerStyle { public const int Count = 5; private static readonly string[] Labels = new string[5] { "GO", "ENEMY", "LOOT", "DANGER", "DEFEND" }; private static readonly Color[] Colors = (Color[])(object)new Color[5] { new Color(0.3f, 0.85f, 1f, 1f), new Color(1f, 0.28f, 0.22f, 1f), new Color(1f, 0.78f, 0.16f, 1f), new Color(1f, 0.45f, 0.05f, 1f), new Color(0.45f, 1f, 0.45f, 1f) }; private static readonly IconKind[] Icons = new IconKind[5] { IconKind.Chevron, IconKind.Crosshair, IconKind.Star, IconKind.Plus, IconKind.Cube }; public static MarkerKind Clamp(int value) { return (MarkerKind)Mathf.Clamp(value, 0, 4); } public static string Label(MarkerKind kind) { return Labels[(uint)Clamp((int)kind)]; } public static Color Color(MarkerKind kind) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return HoloTheme.Shift(Colors[(uint)Clamp((int)kind)], Prefs.HueShift); } public static IconKind Icon(MarkerKind kind) { return Icons[(uint)Clamp((int)kind)]; } } internal static class MarkerManager { private const int PoolSize = 32; private static readonly List Pool = new List(); private static GameObject _root; private static bool _built; public static int ActiveCount { get { int num = 0; for (int i = 0; i < Pool.Count; i++) { if (Pool[i].Active) { num++; } } return num; } } private static bool EnsureBuilt() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (_built && (Object)(object)_root != (Object)null) { return true; } Destroy(); _root = new GameObject("TacPing.Markers"); for (int i = 0; i < 32; i++) { Marker marker = new Marker(); if (!marker.Build(_root.transform)) { Destroy(); return false; } Pool.Add(marker); } _built = true; return true; } public static void Place(Vector3 position, MarkerKind kind, byte ownerId, string owner) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!EnsureBuilt()) { return; } EnforceCap(ownerId); Marker marker = null; for (int i = 0; i < Pool.Count; i++) { if (marker != null) { break; } if (!Pool[i].Active) { marker = Pool[i]; } } if (marker == null) { marker = Oldest(); } marker?.Place(position, kind, ownerId, owner, Prefs.Lifetime); } private static void EnforceCap(byte ownerId) { int num = Mathf.Max(1, Prefs.MaxMarkers); while (CountFor(ownerId) >= num) { Marker marker = OldestFor(ownerId); if (marker == null) { break; } marker.Retire(); } } private static int CountFor(byte ownerId) { int num = 0; for (int i = 0; i < Pool.Count; i++) { if (Pool[i].Active && Pool[i].OwnerId == ownerId) { num++; } } return num; } private static Marker OldestFor(byte ownerId) { for (int i = 0; i < Pool.Count; i++) { if (Pool[i].Active && Pool[i].OwnerId == ownerId) { return Pool[i]; } } return null; } private static Marker Oldest() { for (int i = 0; i < Pool.Count; i++) { if (Pool[i].Active) { return Pool[i]; } } return null; } public static void Tick(float dt) { //IL_001f: 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_0024: 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) if (_built) { Transform head = Player.Head; Vector3 viewer = (((Object)(object)head != (Object)null) ? head.position : Vector3.zero); for (int i = 0; i < Pool.Count; i++) { Pool[i].Tick(dt, viewer); } } } public static void ClearAll() { for (int i = 0; i < Pool.Count; i++) { Pool[i].Retire(); } } public static void ClearMine(byte ownerId) { for (int i = 0; i < Pool.Count; i++) { if (Pool[i].Active && Pool[i].OwnerId == ownerId) { Pool[i].Retire(); } } } public static void Destroy() { for (int i = 0; i < Pool.Count; i++) { Pool[i].Destroy(); } Pool.Clear(); if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _built = false; } } internal static class PingFilter { private static readonly HashSet MutedNames = new HashSet(StringComparer.OrdinalIgnoreCase); private static readonly HashSet MutedIds = new HashSet(); public static int MutedCount => MutedNames.Count + MutedIds.Count; public static void Load() { MutedNames.Clear(); string mutedNames = Prefs.MutedNames; if (string.IsNullOrWhiteSpace(mutedNames)) { return; } string[] array = mutedNames.Split(new char[1] { '|' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (text.Length > 0) { MutedNames.Add(text); } } } private static void Persist() { Prefs.MutedNames = string.Join("|", MutedNames); Prefs.Save(); } public static bool IsMuted(byte id, string name) { if (MutedIds.Contains(id)) { return true; } if (!string.IsNullOrEmpty(name)) { return MutedNames.Contains(name); } return false; } public static bool Allows(byte id, string name) { if (!Prefs.ShowOthers) { return false; } return !IsMuted(id, name); } public static void SetMuted(byte id, string name, bool muted) { if (muted) { MutedIds.Add(id); if (!string.IsNullOrEmpty(name)) { MutedNames.Add(name); } } else { MutedIds.Remove(id); if (!string.IsNullOrEmpty(name)) { MutedNames.Remove(name); } } if (muted) { MarkerManager.ClearMine(id); } Persist(); } public static void UnmuteAll() { MutedIds.Clear(); MutedNames.Clear(); Persist(); } } } namespace TacPing.Interaction { internal sealed class PingAim { private const float ClearOfHand = 0.32f; private GameObject _root; private GameObject _beam; private GameObject _ring; private Material _beamMat; private Material _ringMat; private bool _built; private Vector3 _origin; private Vector3 _direction = Vector3.forward; private Vector3 _normal = Vector3.up; private bool _hitSurface; public Vector3 Point { get; private set; } public bool Valid { get; private set; } public void Resolve(Hand hand) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Valid = false; if ((Object)(object)hand == (Object)null) { return; } Transform transform = ((Component)hand).transform; if (!((Object)(object)transform == (Object)null)) { _direction = Trim(transform.forward); _origin = transform.position + _direction * 0.32f; float num = Mathf.Max(2f, Prefs.MaxRange); RaycastHit val = default(RaycastHit); if (Physics.Raycast(_origin, _direction, ref val, num, -1, (QueryTriggerInteraction)1)) { Point = ((RaycastHit)(ref val)).point; _normal = ((RaycastHit)(ref val)).normal; _hitSurface = true; } else { Point = _origin + _direction * num; _normal = Vector3.up; _hitSurface = false; } Valid = true; } } private static Vector3 Trim(Vector3 aim) { //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_0026: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) float aimPitch = Prefs.AimPitch; if (Mathf.Abs(aimPitch) < 0.01f) { return ((Vector3)(ref aim)).normalized; } Vector3 val = Vector3.Cross(Vector3.up, aim); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.right; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Quaternion.AngleAxis(0f - aimPitch, val) * aim; return ((Vector3)(ref val2)).normalized; } public bool Build() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) try { Destroy(); _root = new GameObject("TacPing.Aim"); _beam = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)_beam).name = "Beam"; _beam.transform.SetParent(_root.transform, false); Strip(_beam); _beamMat = HoloTheme.CreateMaterial(Color.white, onTop: true, null); _beamMat.renderQueue = 4100; Apply(_beam, _beamMat); _ring = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)_ring).name = "Ring"; _ring.transform.SetParent(_root.transform, false); Strip(_ring); _ringMat = HoloTheme.CreateMaterial(Color.white, onTop: true, HoloTextures.Ring(24)); _ringMat.renderQueue = 4101; Apply(_ring, _ringMat); _root.SetActive(false); _built = true; return true; } catch (Exception ex) { Melon.Logger.Warning("Aim preview build failed: " + ex.Message); return false; } } private static void Strip(GameObject go) { Collider component = go.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } } private static void Apply(GameObject go, Material material) { Renderer component = go.GetComponent(); component.material = material; component.shadowCastingMode = (ShadowCastingMode)0; component.receiveShadows = false; } public void Show(MarkerKind kind) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_00f6: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) if ((_built || Build()) && Valid) { if (!_root.activeSelf) { _root.SetActive(true); } Color val = MarkerStyle.Color(kind); Vector3 val2 = Point - _origin; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > 0.01f) { Vector3 val3 = val2 / magnitude; _beam.transform.position = _origin + val3 * (magnitude * 0.5f); _beam.transform.rotation = Quaternion.FromToRotation(Vector3.up, val3); _beam.transform.localScale = new Vector3(0.006f, magnitude * 0.5f, 0.006f); Color color = val; color.a = 0.4f; HoloTheme.Tint(_beamMat, color); } float num = Mathf.Clamp(Vector3.Distance(Point, _origin) * 0.08f, 0.1f, 1.2f) * Mathf.Max(0.2f, Prefs.Scale); float num2 = 1f + Mathf.Sin(Time.time * 10f) * 0.08f; Quaternion rotation = (_hitSurface ? (Quaternion.LookRotation(_normal, Vector3.up) * Quaternion.Euler(0f, 0f, Time.time * 60f)) : Quaternion.Euler(90f, 0f, Time.time * 60f)); _ring.transform.position = Point + _normal * 0.01f; _ring.transform.rotation = rotation; _ring.transform.localScale = new Vector3(num * num2, num * num2, 1f); Color color2 = Color.Lerp(val, Color.white, 0.25f); color2.a = 0.9f; HoloTheme.Tint(_ringMat, color2); } } public void Hide() { if (_built && _root.activeSelf) { _root.SetActive(false); } } public void Destroy() { if ((Object)(object)_beamMat != (Object)null) { Object.Destroy((Object)(object)_beamMat); } if ((Object)(object)_ringMat != (Object)null) { Object.Destroy((Object)(object)_ringMat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _beam = null; _ring = null; _beamMat = null; _ringMat = null; _built = false; } } internal sealed class PingWheel { private const float Radius = 0.11f; private const float SlotSize = 0.055f; private GameObject _root; private GameObject _hub; private Material _hubMat; private readonly GameObject[] _slots = (GameObject[])(object)new GameObject[5]; private readonly Material[] _slotMats = (Material[])(object)new Material[5]; private readonly GameObject[] _icons = (GameObject[])(object)new GameObject[5]; private readonly Material[] _iconMats = (Material[])(object)new Material[5]; private TextMeshPro _label; private float _open; private bool _built; public MarkerKind Selection { get; private set; } public bool Visible { get { if ((Object)(object)_root != (Object)null) { return _root.activeSelf; } return false; } } public bool Build() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) try { Destroy(); _root = new GameObject("TacPing.Wheel"); _hub = MakeQuad("Hub", HoloTextures.Ring(20), 4200, out _hubMat); for (int i = 0; i < 5; i++) { _slots[i] = MakeQuad("Slot" + i, HoloTextures.Plate(new Vector2(0.055f, 0.055f), PlateStyle.Chip), 4201, out _slotMats[i]); _icons[i] = MakeQuad("Icon" + i, HoloTextures.Icon(MarkerStyle.Icon((MarkerKind)i)), 4202, out _iconMats[i]); } GameObject val = new GameObject("Label"); val.transform.SetParent(_root.transform, false); _label = val.AddComponent(); ((TMP_Text)_label).font = HoloTheme.Font; HoloTheme.Calibrate((TMP_Text)(object)_label); ((TMP_Text)_label).rectTransform.sizeDelta = new Vector2(0.3f, 0.05f); ((TMP_Text)_label).fontSize = HoloTheme.FontSizeFor(0.014f); ((TMP_Text)_label).alignment = (TextAlignmentOptions)514; ((TMP_Text)_label).enableWordWrapping = false; ((TMP_Text)_label).richText = false; _root.SetActive(false); _built = true; return true; } catch (Exception ex) { Melon.Logger.Warning("Wheel build failed: " + ex.Message); return false; } } private GameObject MakeQuad(string name, Texture2D texture, int queue, out Material material) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } material = HoloTheme.CreateMaterial(Color.white, onTop: true, texture); material.renderQueue = queue; Renderer component2 = obj.GetComponent(); component2.material = material; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; return obj; } public void SetSelection(MarkerKind kind) { Selection = kind; } public void Show() { Toggle(visible: true); } public void Hide() { Toggle(visible: false); } private void Toggle(bool visible) { if (_built) { if (_root.activeSelf != visible) { _root.SetActive(visible); } if (!visible) { _open = 0f; } } } public void Tick(float dt, Vector3 anchor) { //IL_0050: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0145: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0311: 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_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) if (_built && _root.activeSelf) { _open = Mathf.MoveTowards(_open, 1f, dt * 6f); Transform head = Player.Head; Vector3 viewer = (((Object)(object)head != (Object)null) ? head.position : (anchor + Vector3.back)); Quaternion val = Billboard(anchor, viewer); Vector3 val2 = val * Vector3.right; Vector3 val3 = val * Vector3.up; _root.transform.position = anchor; float num = Ease.OutBack(_open); float num2 = 0.075f * num; _hub.transform.position = anchor; _hub.transform.rotation = val; _hub.transform.localScale = new Vector3(num2, num2, 1f); Color color = HoloTheme.Shift(HoloTheme.Frame, Prefs.HueShift); color.a = 0.5f * _open; HoloTheme.Tint(_hubMat, color); float num3 = 33f; for (int i = 0; i < 5; i++) { float num4 = -66f + num3 * (float)i; float num5 = (90f - num4) * ((float)Math.PI / 180f); Vector3 val4 = (val2 * Mathf.Cos(num5) + val3 * Mathf.Sin(num5)) * (0.11f * num); bool flag = i == (int)Selection; float num6 = 0.055f * num * (flag ? 1.35f : 1f); _slots[i].transform.position = anchor + val4; _slots[i].transform.rotation = val; _slots[i].transform.localScale = new Vector3(num6, num6, 1f); Color val5 = MarkerStyle.Color((MarkerKind)i); val5.a = (flag ? 0.95f : 0.4f) * _open; HoloTheme.Tint(_slotMats[i], val5); float num7 = num6 * 0.62f; _icons[i].transform.position = anchor + val4 - val * Vector3.forward * 0.002f; _icons[i].transform.rotation = val; _icons[i].transform.localScale = new Vector3(num7, num7, 1f); Color color2 = Color.Lerp(val5, Color.white, flag ? 0.6f : 0.2f); color2.a = (flag ? 1f : 0.55f) * _open; HoloTheme.Tint(_iconMats[i], color2); } Vector3 position = anchor - val3 * (0.11f * num + 0.045f); ((Transform)((TMP_Text)_label).rectTransform).position = position; ((Transform)((TMP_Text)_label).rectTransform).rotation = val; ((TMP_Text)_label).text = MarkerStyle.Label(Selection); Color color3 = MarkerStyle.Color(Selection); color3.a = _open; ((Graphic)_label).color = color3; } } private static Quaternion Billboard(Vector3 position, Vector3 viewer) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - viewer; if (!(((Vector3)(ref val)).sqrMagnitude < 1E-06f)) { return Quaternion.LookRotation(val, Vector3.up); } return Quaternion.identity; } public void Destroy() { for (int i = 0; i < _slotMats.Length; i++) { if ((Object)(object)_slotMats[i] != (Object)null) { Object.Destroy((Object)(object)_slotMats[i]); } if ((Object)(object)_iconMats[i] != (Object)null) { Object.Destroy((Object)(object)_iconMats[i]); } _slotMats[i] = null; _iconMats[i] = null; _slots[i] = null; _icons[i] = null; } if ((Object)(object)_hubMat != (Object)null) { Object.Destroy((Object)(object)_hubMat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _hub = null; _hubMat = null; _label = null; _built = false; _open = 0f; } } } namespace TacPing.Fusion { internal static class FusionBridge { public static void Register() { ModuleManager.RegisterModule(); ModuleMessageManager.RegisterHandler(); } public static bool HasServer() { return NetworkInfo.HasServer; } public static int Roster(byte[] ids, string[] names) { if (!NetworkInfo.HasServer) { return 0; } int num = 0; byte localSmallID = PlayerIDManager.LocalSmallID; foreach (PlayerID playerID in PlayerIDManager.PlayerIDs) { if (num >= ids.Length) { break; } if (playerID != null && playerID.IsValid && playerID.SmallID != localSmallID) { ids[num] = playerID.SmallID; string text = null; try { MetadataHelper.TryGetDisplayName(playerID, ref text); } catch { } names[num] = (string.IsNullOrEmpty(text) ? ("Player " + playerID.SmallID) : text); num++; } } return num; } public static byte LocalId() { return PlayerIDManager.LocalSmallID; } public static string LocalName() { string username = LocalPlayer.Username; if (!string.IsNullOrEmpty(username)) { return username; } return null; } public static bool Broadcast(Vector3 position, MarkerKind kind, bool clear) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) if (!NetworkInfo.HasServer) { return false; } PingData obj = new PingData { Sender = PlayerIDManager.LocalSmallID, Kind = (byte)kind, Clear = (clear ? ((byte)1) : ((byte)0)), X = position.x, Y = position.y, Z = position.z, Owner = LocalName() }; MessageRoute val = default(MessageRoute); ((MessageRoute)(ref val))..ctor((RelayType)2, (NetworkChannel)0); MessageRelay.RelayModule(obj, val); return true; } } internal static class FusionSupport { public static bool Available { get; private set; } public static bool InLobby { get { if (!Available) { return false; } try { return FusionBridge.HasServer(); } catch { return false; } } } public static byte LocalId { get { if (!Available) { return 0; } try { return FusionBridge.LocalId(); } catch { return 0; } } } public static string LocalName { get { if (!Available) { return null; } try { return FusionBridge.LocalName(); } catch { return null; } } } public static void Detect() { Available = HelperMethods.CheckIfAssemblyLoaded("labfusion") || IsLoaded("LabFusion"); } private static bool IsLoaded(string assemblyName) { try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { if (string.Equals(assemblies[i].GetName().Name, assemblyName, StringComparison.OrdinalIgnoreCase)) { return true; } } } catch { } return false; } public static void Register() { if (!Available) { return; } try { FusionBridge.Register(); } catch (Exception ex) { Melon.Logger.Warning("Fusion registration failed: " + ex.Message); Available = false; } } public static int Roster(byte[] ids, string[] names) { if (!Available || ids == null || names == null) { return 0; } try { return FusionBridge.Roster(ids, names); } catch { return 0; } } public static bool Broadcast(Vector3 position, MarkerKind kind, bool clear) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!Available) { return false; } try { return FusionBridge.Broadcast(position, kind, clear); } catch (Exception ex) { Melon.Logger.Warning("Ping broadcast failed: " + ex.Message); return false; } } } internal sealed class PingData : INetSerializable { public byte Sender; public byte Kind; public byte Clear; public float X; public float Y; public float Z; public string Owner; public int? GetSize() { return 15 + (Owner?.Length ?? 0) + 8; } public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref Sender); serializer.SerializeValue(ref Kind); serializer.SerializeValue(ref Clear); serializer.SerializeValue(ref X); serializer.SerializeValue(ref Y); serializer.SerializeValue(ref Z); serializer.SerializeValue(ref Owner); } } internal sealed class PingMessageHandler : ModuleMessageHandler { protected override void OnHandleMessage(ReceivedMessage received) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) PingData pingData = ((ReceivedMessage)(ref received)).ReadData(); if (pingData != null && pingData.Sender != PlayerIDManager.LocalSmallID) { if (pingData.Clear != 0) { MarkerManager.ClearMine(pingData.Sender); } else if (PingFilter.Allows(pingData.Sender, pingData.Owner)) { MarkerManager.Place(new Vector3(pingData.X, pingData.Y, pingData.Z), MarkerStyle.Clamp(pingData.Kind), pingData.Sender, pingData.Owner); } } } } internal sealed class TacPingModule : Module { public override string Name => "TacPing"; public override string Author => "Rocner"; public override Version Version => new Version(1, 0, 0); public override ConsoleColor Color => ConsoleColor.Cyan; protected override void OnModuleRegistered() { ((Module)this).LoggerInstance.Log("Tac Ping module registered — markers will be shared with the lobby.", ConsoleColor.White); } protected override void OnModuleUnregistered() { } } } namespace TacPing.Config { internal static class Prefs { private static MelonPreferences_Category _category; private static MelonPreferences_Entry _enabled; private static MelonPreferences_Entry _button; private static MelonPreferences_Entry _requireEmptyHand; private static MelonPreferences_Entry _rightHand; private static MelonPreferences_Entry _holdTime; private static MelonPreferences_Entry _lifetime; private static MelonPreferences_Entry _maxRange; private static MelonPreferences_Entry _maxMarkers; private static MelonPreferences_Entry _scale; private static MelonPreferences_Entry _hueShift; private static MelonPreferences_Entry _seeThrough; private static MelonPreferences_Entry _showDistance; private static MelonPreferences_Entry _haptics; private static MelonPreferences_Entry _networked; private static MelonPreferences_Entry _aimPitch; private static MelonPreferences_Entry _rollStep; private static MelonPreferences_Entry _showOthers; private static MelonPreferences_Entry _mutedNames; public static bool Enabled => _enabled?.Value ?? true; public static int Button => _button?.Value ?? 1; public static bool RequireEmptyHand => _requireEmptyHand?.Value ?? true; public static bool RightHand => _rightHand?.Value ?? true; public static float HoldTime => _holdTime?.Value ?? 0.32f; public static float Lifetime => _lifetime?.Value ?? 20f; public static float MaxRange => _maxRange?.Value ?? 120f; public static int MaxMarkers => _maxMarkers?.Value ?? 8; public static float Scale => _scale?.Value ?? 1f; public static float HueShift => _hueShift?.Value ?? 0f; public static bool SeeThrough => _seeThrough?.Value ?? true; public static bool ShowDistance => _showDistance?.Value ?? true; public static bool Haptics => _haptics?.Value ?? true; public static bool Networked => _networked?.Value ?? true; public static float AimPitch => _aimPitch?.Value ?? 0f; public static float RollStep => _rollStep?.Value ?? 20f; public static bool ShowOthers => _showOthers?.Value ?? true; public static string MutedNames { get { return _mutedNames?.Value ?? string.Empty; } set { if (_mutedNames != null) { _mutedNames.Value = value; } } } public static void Register() { _category = MelonPreferences.CreateCategory("TacPing", "Tac Ping"); _enabled = _category.CreateEntry("Enabled", true, "Enabled", (string)null, false, false, (ValueValidator)null, (string)null); _button = _category.CreateEntry("Button", 1, "Ping Button", (string)null, false, false, (ValueValidator)null, (string)null); _requireEmptyHand = _category.CreateEntry("RequireEmptyHand", true, "Require Empty Hand", (string)null, false, false, (ValueValidator)null, (string)null); _rightHand = _category.CreateEntry("RightHand", true, "Ping With Right Hand", (string)null, false, false, (ValueValidator)null, (string)null); _holdTime = _category.CreateEntry("HoldTime", 0.32f, "Hold To Open Wheel", (string)null, false, false, (ValueValidator)null, (string)null); _lifetime = _category.CreateEntry("Lifetime", 20f, "Marker Lifetime", (string)null, false, false, (ValueValidator)null, (string)null); _maxRange = _category.CreateEntry("MaxRange", 120f, "Max Range", (string)null, false, false, (ValueValidator)null, (string)null); _maxMarkers = _category.CreateEntry("MaxMarkers", 8, "Max Markers Per Player", (string)null, false, false, (ValueValidator)null, (string)null); _scale = _category.CreateEntry("Scale", 1f, "Marker Scale", (string)null, false, false, (ValueValidator)null, (string)null); _hueShift = _category.CreateEntry("HueShift", 0f, "Hue Shift", (string)null, false, false, (ValueValidator)null, (string)null); _seeThrough = _category.CreateEntry("SeeThrough", true, "See Through Walls", (string)null, false, false, (ValueValidator)null, (string)null); _showDistance = _category.CreateEntry("ShowDistance", true, "Show Distance", (string)null, false, false, (ValueValidator)null, (string)null); _haptics = _category.CreateEntry("Haptics", true, "Haptic Feedback", (string)null, false, false, (ValueValidator)null, (string)null); _networked = _category.CreateEntry("Networked", true, "Share In Fusion Lobbies", (string)null, false, false, (ValueValidator)null, (string)null); _aimPitch = _category.CreateEntry("AimPitch", 0f, "Aim Pitch Trim", (string)null, false, false, (ValueValidator)null, (string)null); _rollStep = _category.CreateEntry("RollStep", 20f, "Wrist Roll Per Step", (string)null, false, false, (ValueValidator)null, (string)null); _showOthers = _category.CreateEntry("ShowOthers", true, "Show Other Players Markers", (string)null, false, false, (ValueValidator)null, (string)null); _mutedNames = _category.CreateEntry("MutedNames", string.Empty, "Muted Players", (string)null, true, false, (ValueValidator)null); } public static void SetEnabled(bool v) { if (_enabled != null) { _enabled.Value = v; } } public static void SetButton(int v) { if (_button != null) { _button.Value = Mathf.Clamp(v, 0, 2); } } public static void SetRequireEmptyHand(bool v) { if (_requireEmptyHand != null) { _requireEmptyHand.Value = v; } } public static void SetRightHand(bool v) { if (_rightHand != null) { _rightHand.Value = v; } } public static void SetHoldTime(float v) { if (_holdTime != null) { _holdTime.Value = v; } } public static void SetLifetime(float v) { if (_lifetime != null) { _lifetime.Value = v; } } public static void SetMaxRange(float v) { if (_maxRange != null) { _maxRange.Value = v; } } public static void SetMaxMarkers(int v) { if (_maxMarkers != null) { _maxMarkers.Value = Mathf.Clamp(v, 1, 16); } } public static void SetScale(float v) { if (_scale != null) { _scale.Value = v; } } public static void SetHueShift(float v) { if (_hueShift != null) { _hueShift.Value = v; } } public static void SetSeeThrough(bool v) { if (_seeThrough != null) { _seeThrough.Value = v; } } public static void SetShowDistance(bool v) { if (_showDistance != null) { _showDistance.Value = v; } } public static void SetHaptics(bool v) { if (_haptics != null) { _haptics.Value = v; } } public static void SetNetworked(bool v) { if (_networked != null) { _networked.Value = v; } } public static void SetAimPitch(float v) { if (_aimPitch != null) { _aimPitch.Value = v; } } public static void SetRollStep(float v) { if (_rollStep != null) { _rollStep.Value = v; } } public static void SetShowOthers(bool v) { if (_showOthers != null) { _showOthers.Value = v; } } public static void Save() { MelonPreferences_Category category = _category; if (category != null) { category.SaveToFile(false); } } } }