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; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.Data; using Il2CppSLZ.Marrow.Pool; using Il2CppSLZ.Marrow.Warehouse; using Il2CppSLZ.VRMK; using Il2CppSystem.Collections.Generic; using Il2CppTMPro; using LabFusion.Entities; using LabFusion.Network; using LabFusion.RPC; using LabFusion.SDK.Modules; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; using WristSpawner; using WristSpawner.Catalog; using WristSpawner.Config; using WristSpawner.Fusion; using WristSpawner.Interaction; using WristSpawner.Menu; using WristSpawner.Spawning; using WristSpawner.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("WristSpawner")] [assembly: AssemblyProduct("WristSpawner")] [assembly: AssemblyCompany("Rocner")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: MelonInfo(typeof(WristSpawnerMod), "WristSpawner", "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 WristSpawner { public sealed class WristSpawnerMod : MelonMod { private readonly HoloPanel _panel = new HoloPanel(); private readonly HoloOrb _orb = new HoloOrb(); private readonly HoloDeploy _deploy = new HoloDeploy(); private readonly HoloLaser _laser = new HoloLaser(); private readonly HandPointer _pointer = new HandPointer(); private bool _hoverViaRay; private bool _focusValid; private Vector3 _focusPoint; private HoloWidget _focusWidget; private float _pokeDepth = float.MaxValue; private Transform _anchor; private bool _pokeArmed = true; private float _nextPressTime; private HoloWidget _hovered; private const float HoverDepth = 0.07f; private const float PressCooldown = 0.25f; private int _updateFailures; private float _nextCatalogAttempt; public override void OnInitializeMelon() { Step("preferences", delegate { Prefs.Register(); SpawnCatalog.LoadFavorites(); }); Step("fusion", delegate { FusionSupport.Detect(); FusionSupport.RegisterModule(); ((MelonBase)this).LoggerInstance.Msg(FusionSupport.Available ? "LabFusion detected — spawns will replicate in lobbies." : "LabFusion not present — running singleplayer."); }); Step("status event", delegate { SpawnService.OnStatus += OnSpawnStatus; }); Step("catalog event", delegate { SpawnCatalog.OnChanged += OnCatalogChanged; }); Step("warehouse hook", delegate { Hooking.OnWarehouseReady += OnWarehouseReady; }); Step("level loading hook", delegate { Hooking.OnLevelLoading += OnLevelLoading; }); Step("level loaded hook", delegate { Hooking.OnLevelLoaded += OnLevelLoaded; }); Step("bonemenu", delegate { MenuPage.Build(_panel, RebuildPanel, SummonOrb); }); ((MelonBase)this).LoggerInstance.Msg("WristSpawner 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 { SpawnService.OnStatus -= OnSpawnStatus; SpawnCatalog.OnChanged -= OnCatalogChanged; Hooking.OnWarehouseReady -= OnWarehouseReady; Hooking.OnLevelLoading -= OnLevelLoading; Hooking.OnLevelLoaded -= OnLevelLoaded; }); _panel.Destroy(); _orb.Destroy(); _deploy.Destroy(); _laser.Destroy(); } private void SummonOrb() { if (_orb.Exists) { _orb.PlaceInFront(); } } private void OnWarehouseReady() { SpawnCatalog.Rebuild(); if (_panel.Exists) { _panel.Refresh(); } } private void OnLevelLoading(LevelInfo info) { CancelDeploy(); _deploy.Destroy(); _panel.Destroy(); _orb.Destroy(); _laser.Destroy(); _pointer.Invalidate(); _anchor = null; _hovered = null; SpawnService.Reset(); HoloTheme.Reset(); } private void OnLevelLoaded(LevelInfo info) { _anchor = null; if (!SpawnCatalog.Ready) { SpawnCatalog.Rebuild(); } } 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_0086: Unknown result type (might be due to invalid IL or missing references) if (HelperMethods.IsLoading()) { return; } float deltaTime = Time.deltaTime; EnsureCatalog(); UpdateOrb(deltaTime); if (!Prefs.PanelEnabled) { if (_panel.Exists) { _panel.Destroy(); _anchor = null; _hovered = null; } _laser.Hide(); return; } if (!EnsurePanel()) { _laser.Hide(); return; } UpdateVisibility(); _pointer.Update(); ResolveFocus(); _panel.SetPointer(_focusPoint, _focusValid); _panel.Tick(deltaTime); if (!_panel.Visible) { ClearHover(); _laser.Hide(); } else { UpdateInteraction(); } } private void ResolveFocus() { //IL_0052: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) _hoverViaRay = false; _focusValid = false; _focusWidget = null; _pokeDepth = float.MaxValue; if (!_pointer.Valid || !_panel.Visible) { _laser.Hide(); return; } float depth; HoloWidget focusWidget = _panel.HitTest(_pointer.Position, out depth); _pokeDepth = depth; if (depth <= 0.07f) { _focusPoint = _pointer.Position; _focusValid = true; _focusWidget = focusWidget; _laser.Hide(); return; } if (!Prefs.LaserEnabled) { _laser.Hide(); return; } if (!_laser.Exists) { _laser.Build(); } Vector3 hitPoint; bool onPanel; HoloWidget holoWidget = _panel.RayTest(_pointer.Position, _pointer.Direction, out hitPoint, out onPanel); if (!onPanel) { _laser.Hide(); return; } Transform head = Player.Head; Vector3 viewer = (((Object)(object)head != (Object)null) ? head.position : _pointer.Position); _laser.Show(_pointer.Position, hitPoint, viewer, holoWidget?.Enabled ?? false); _focusPoint = hitPoint; _focusValid = true; _focusWidget = holoWidget; _hoverViaRay = true; } private void EnsureCatalog() { if (SpawnCatalog.Ready || Time.time < _nextCatalogAttempt) { return; } _nextCatalogAttempt = Time.time + 2f; try { SpawnCatalog.Rebuild(); if (SpawnCatalog.Ready) { ((MelonBase)this).LoggerInstance.Msg($"Catalog recovered with {SpawnCatalog.Count} spawnables."); } } catch (Exception ex) { ((MelonBase)this).LoggerInstance.Error("Catalog rebuild failed: " + ex); } } private void UpdateOrb(float dt) { if (!Prefs.OrbEnabled) { if (_orb.Exists) { CancelDeploy(); _orb.Destroy(); } } else if (!((Object)(object)Player.Head == (Object)null)) { if (!_orb.Exists) { _orb.Build(); ((MelonBase)this).LoggerInstance.Msg("Orb summoned."); } _orb.Tick(dt); if (_orb.ConsumeDeployRequest()) { ToggleDeployed(); } TickDeploy(dt); } } private void ToggleDeployed() { if (!_orb.Exists) { return; } if (_orb.Deployed) { _orb.SetDeployed(value: false); _orb.EnergyBoost(1f); ((MelonBase)this).LoggerInstance.Msg("Favorites recalled."); return; } _orb.SetDeployed(value: true); _orb.EnergyBoost(1f); if (Prefs.DeployEnabled && _deploy.Begin()) { _orb.Suspend(); } ((MelonBase)this).LoggerInstance.Msg("Favorites deployed."); } private void TickDeploy(float dt) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!_deploy.Active) { return; } if (!_orb.Exists) { _deploy.Abort(); return; } _deploy.Tick(dt); _orb.SetDeployGlow(_deploy.OrbGlow); if (_deploy.OrbFloating) { _orb.DriveTo(_deploy.OrbTarget(), dt, 6f); } if (!_deploy.Active) { FinishDeploy(); } } private void FinishDeploy() { _orb.SetDeployGlow(0f); _orb.EnergyBoost(1f); _orb.Resume(); } private void CancelDeploy() { if (_deploy.Active || _orb.Suspended) { _deploy.Abort(); if (_orb.Exists) { _orb.SetDeployGlow(0f); _orb.Resume(); } } } private void OnCatalogChanged() { if (_panel.Exists) { _panel.Refresh(); } if (_orb.Exists) { _orb.Refresh(); } } private bool EnsurePanel() { Transform wristTransform = GetWristTransform(); if ((Object)(object)wristTransform == (Object)null) { if (_panel.Exists) { _panel.Destroy(); } _anchor = null; return false; } if (_panel.Exists && (Object)(object)_anchor == (Object)(object)wristTransform) { return true; } _anchor = wristTransform; _panel.Build(wristTransform); _pointer.Invalidate(); _hovered = null; ((MelonBase)this).LoggerInstance.Msg("Wrist panel attached to " + ((Object)wristTransform).name + "."); return _panel.Exists; } private static Transform GetWristTransform() { if (!Player.HandsExist) { return null; } Hand val = (Prefs.LeftWrist ? Player.LeftHand : Player.RightHand); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).transform; } private void UpdateVisibility() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (!Prefs.RequireWristLook) { _panel.SetVisible(visible: true); return; } Transform head = Player.Head; Transform transform = _panel.Transform; if (!((Object)(object)head == (Object)null) && !((Object)(object)transform == (Object)null)) { Vector3 val = head.position - transform.position; if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f)) { float num = Vector3.Dot(-transform.forward, ((Vector3)(ref val)).normalized); _panel.SetVisible(num >= Prefs.LookThreshold); } } } private void UpdateInteraction() { if (!_focusValid) { ClearHover(); _pokeArmed = true; return; } if (_hoverViaRay) { _pokeArmed = true; } HoloWidget focusWidget = _focusWidget; if (focusWidget == null) { ClearHover(); return; } if (focusWidget != _hovered) { _hovered = focusWidget; _panel.SetHover(focusWidget); Pulse(0.25f, 0.02f); } if (!(Time.time < _nextPressTime) && ShouldPress(_pokeDepth)) { _panel.Press(focusWidget); _nextPressTime = Time.time + 0.25f; _pokeArmed = false; Pulse(0.7f, 0.06f); } } private bool ShouldPress(float depth) { if (_hoverViaRay) { return TriggerDown(); } if (_pokeArmed && depth <= Prefs.PokeDepth) { return true; } if (depth > Prefs.PokeDepth + 0.015f) { _pokeArmed = true; } return TriggerDown(); } private bool TriggerDown() { BaseController controller = _pointer.Controller; if ((Object)(object)controller == (Object)null) { return false; } try { return controller.GetPrimaryInteractionButtonDown(); } catch { return false; } } private void ClearHover() { if (_hovered != null) { _hovered = null; _panel.ClearHover(); } } private void Pulse(float amplitude, float duration) { if (!Prefs.HapticFeedback) { return; } BaseController controller = _pointer.Controller; if ((Object)(object)controller == (Object)null) { return; } try { controller.HapticAction(0f, duration, 220f, amplitude); } catch { } } private void OnSpawnStatus(string message) { if (_panel.Exists) { _panel.SetStatus(message); } } private void RebuildPanel() { _anchor = null; _panel.Destroy(); _pointer.Invalidate(); _hovered = null; } } internal static class BuildInfo { public const string Name = "WristSpawner"; public const string Author = "Rocner"; public const string Version = "1.0.0"; } } namespace WristSpawner.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 sealed class HoloDeploy { private sealed class Element { public GameObject Root; public Material Mat; public float Angle; public float Height; public float Phase; public float Spin; } private const int MaxPanels = 16; private const int MaxArcs = 10; private const int MaxMotes = 32; private const int RingCount = 3; private const float P1End = 0.075f; private const float P2Start = 0.075f; private const float P2End = 0.2f; private const float P3Start = 0.15f; private const float P3End = 0.35f; private const float P4Start = 0.25f; private const float P4End = 0.65f; private const float P5Start = 0.35f; private const float P5End = 0.75f; private const float P6Start = 0.6f; private const float P6End = 0.85f; private const float P7Start = 0.85f; private GameObject _root; private readonly Element[] _rings = new Element[3]; private readonly Element[] _panels = new Element[16]; private readonly Element[] _arcs = new Element[10]; private readonly Element[] _motes = new Element[32]; private Element _scanRing; private Element _flash; private bool _built; private bool _active; private bool _completed; private float _time; private float _duration = 2f; private Vector3 _feet; private float _height = 1.78f; private Vector3 _forward = Vector3.forward; private Vector3 _right = Vector3.right; private Vector3 _viewer; public bool Active => _active; public bool Completed => _completed; public float Progress { get { if (!(_duration > 0f)) { return 0f; } return Mathf.Clamp01(_time / _duration); } } public float OrbPulse => 1f - Span(Progress, 0f, 0.075f); public float OrbGlow { get { float progress = Progress; if (progress < 0.075f) { return Span(progress, 0f, 0.075f); } if (progress < 0.85f) { return 1f; } return 1f - Span(progress, 0.85f, 1f); } } public bool OrbFloating => Progress >= 0.075f; public bool Begin() { if (!ResolveBody()) { return false; } if (_built && (Object)(object)_root == (Object)null) { _built = false; } if (!_built && !Build()) { return false; } _time = 0f; _duration = Mathf.Max(0.4f, Prefs.DeployDuration); _active = true; _completed = false; _root.SetActive(true); return true; } public void Abort() { _active = false; _completed = false; _time = 0f; if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } } private bool ResolveBody() { //IL_0036: 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_004c: 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_005b: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) Transform head = Player.Head; if ((Object)(object)head == (Object)null) { return false; } RigManager rigManager = Player.RigManager; if ((Object)(object)rigManager == (Object)null) { return false; } Transform transform = ((Component)rigManager).transform; if ((Object)(object)transform == (Object)null) { return false; } _feet = new Vector3(head.position.x, transform.position.y, head.position.z); float num = head.position.y - transform.position.y; if (num < 0.6f || num > 3f) { num = TryAvatarHeight(); } _height = Mathf.Clamp(num, 0.7f, 2.8f); Vector3 forward = head.forward; forward.y = 0f; _forward = ((((Vector3)(ref forward)).sqrMagnitude > 0.001f) ? ((Vector3)(ref forward)).normalized : Vector3.forward); _right = Vector3.Cross(Vector3.up, _forward); _viewer = head.position; return true; } private static float TryAvatarHeight() { 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; } private bool Build() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) try { _root = new GameObject("WristSpawner.Deploy"); for (int i = 0; i < 3; i++) { _rings[i] = MakeQuad("Ring" + i, HoloTextures.Ring(24 + i * 8), 3700 + i); } _scanRing = MakeQuad("ScanRing", HoloTextures.Ring(48), 3710); for (int j = 0; j < 16; j++) { _panels[j] = MakeQuad("Panel" + j, HoloTextures.Plate(new Vector2(0.16f, 0.1f), PlateStyle.Chip), 3715); _panels[j].Angle = (float)j / 16f * (float)Math.PI * 2f; _panels[j].Height = 0.12f + (float)j * 0.0637f % 0.8f; _panels[j].Phase = (float)j * 0.137f % 1f; _panels[j].Spin = ((j % 2 == 0) ? 1f : (-1f)) * (60f + (float)j * 11f); } for (int k = 0; k < 10; k++) { _arcs[k] = MakeCylinder("Arc" + k, 3712); _arcs[k].Angle = (float)k / 10f * (float)Math.PI * 2f; _arcs[k].Phase = (float)k * 0.211f % 1f; } for (int l = 0; l < 32; l++) { _motes[l] = MakeQuad("Mote" + l, HoloTextures.Plate(new Vector2(0.02f, 0.02f), PlateStyle.Glow), 3720); _motes[l].Angle = (float)l * 1.618f; _motes[l].Phase = (float)l * 0.0731f % 1f; _motes[l].Height = (float)l * 0.0397f % 1f; } _flash = MakeQuad("Flash", HoloTextures.Plate(new Vector2(1f, 1f), PlateStyle.Glow), 3725); _root.SetActive(false); _built = true; return true; } catch (Exception ex) { Melon.Logger.Warning("Deploy effect build failed: " + ex.Message); Destroy(); return false; } } private Element MakeQuad(string name, Texture2D texture, int queue) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val).name = name; val.transform.SetParent(_root.transform, false); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Material val2 = HoloTheme.CreateMaterial(HoloTheme.Frame, onTop: false, texture); val2.renderQueue = queue; Renderer component2 = val.GetComponent(); component2.material = val2; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; val.SetActive(false); return new Element { Root = val, Mat = val2 }; } private Element MakeCylinder(string name, int queue) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val).name = name; val.transform.SetParent(_root.transform, false); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Material val2 = HoloTheme.CreateMaterial(HoloTheme.Frame, onTop: false, null); val2.renderQueue = queue; Renderer component2 = val.GetComponent(); component2.material = val2; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; val.SetActive(false); return new Element { Root = val, Mat = val2 }; } public void Tick(float dt) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!_active) { return; } if (!ResolveBody()) { Abort(); return; } _time += dt; float t = Mathf.Clamp01(_time / _duration); float intensity = Mathf.Max(0f, Prefs.DeployIntensity); float deployHue = Prefs.DeployHue; _root.transform.position = _feet; TickRings(t, intensity, deployHue); TickScan(t, intensity, deployHue); TickPanels(dt, t, intensity, deployHue); TickArcs(t, intensity, deployHue); TickMotes(t, intensity, deployHue); TickFlash(t, intensity, deployHue); if (!(_time < _duration)) { Abort(); _completed = true; } } private static float Span(float t, float from, float to) { if (to <= from) { if (!(t >= to)) { return 0f; } return 1f; } return Mathf.Clamp01((t - from) / (to - from)); } private static float Pulse(float t, float from, float to) { return Mathf.Sin(Span(t, from, to) * (float)Math.PI); } private static float Profile(float h) { if (h < 0.08f) { return Mathf.Lerp(0.3f, 0.22f, h / 0.08f); } if (h < 0.5f) { return Mathf.Lerp(0.22f, 0.3f, (h - 0.08f) / 0.42f); } if (h < 0.82f) { return Mathf.Lerp(0.3f, 0.36f, (h - 0.5f) / 0.32f); } return Mathf.Lerp(0.36f, 0.14f, (h - 0.82f) / 0.18f); } private Vector3 Around(float angle, float heightFraction, float radius) { //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_001e: 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_002f: 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_003f: 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) return _feet + Vector3.up * (_height * heightFraction) + (_right * Mathf.Cos(angle) + _forward * Mathf.Sin(angle)) * radius; } private Quaternion Billboard(Vector3 position) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) //IL_0021: 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; } private void TickRings(float t, float intensity, float hue) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) float deployRingSpin = Prefs.DeployRingSpin; float num = Mathf.Max(0.2f, Prefs.DeployRingSize) * (_height / 1.78f); for (int i = 0; i < 3; i++) { Element element = _rings[i]; float num2 = (float)i * 0.06f; float num3 = Span(t, 0.15f + num2, 0.35f + num2 + 0.12f); bool flag = num3 > 0f && num3 < 1f; Show(element, flag); if (flag) { float num4 = Ease.OutQuint(num3); float num5 = Mathf.Lerp(0.15f, num * (1f + (float)i * 0.22f), num4); float num6 = _height * (0.06f + (float)i * 0.16f); float t2 = Span(t, 0.85f, 1f); num5 *= Mathf.Lerp(1f, 0.12f, Ease.OutQuint(t2)); element.Root.transform.position = _feet + Vector3.up * num6; element.Root.transform.rotation = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 0f, Time.time * deployRingSpin * ((i % 2 == 0) ? 1f : (-0.7f))); element.Root.transform.localScale = new Vector3(num5 * 2f, num5 * 2f, 1f); Color color = HoloTheme.Shift(HoloTheme.Frame, hue); color.a = Mathf.Sin(num3 * (float)Math.PI) * 0.85f * intensity; HoloTheme.Tint(element.Mat, color); } } } private void TickScan(float t, float intensity, float hue) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(0.2f, Prefs.DeployScanSpeed); float num2 = Span(t, 0.25f, Mathf.Lerp(0.25f, 0.65f, 1f / num)); bool flag = num2 > 0f && num2 < 1f; Show(_scanRing, flag); if (flag) { float num3 = Mathf.Clamp01(num2); float num4 = Profile(num3) * (_height / 1.78f) * 1.25f; _scanRing.Root.transform.position = _feet + Vector3.up * (_height * num3); _scanRing.Root.transform.rotation = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 0f, Time.time * 220f); _scanRing.Root.transform.localScale = new Vector3(num4 * 2f, num4 * 2f, 1f); Color color = HoloTheme.Shift(HoloTheme.ButtonActive, hue); float num5 = Mathf.Min(Span(t, 0.25f, 0.3f), 1f - Span(t, 0.59999996f, 0.65f)); color.a = Mathf.Clamp01(num5) * intensity; HoloTheme.Tint(_scanRing.Mat, color); } } private void TickPanels(float dt, float t, float intensity, float hue) { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Prefs.DeployPanelCount, 0, 16); float num2 = Prefs.DeployPanelOrbit * ((float)Math.PI / 180f); float num3 = Ease.OutQuint(Span(t, 0.85f, 1f)); for (int i = 0; i < 16; i++) { Element element = _panels[i]; if (i >= num) { Show(element, visible: false); continue; } float num4 = Span(t, 0.35f + element.Phase * 0.12f, 0.75f); bool flag = num4 > 0f; Show(element, flag); if (flag) { element.Angle += num2 * dt; float num5 = Ease.OutBack(num4); float num6 = Mathf.Lerp(0.05f, Profile(element.Height) * (_height / 1.78f) * 1.9f, num5); num6 *= Mathf.Lerp(1f, 0.1f, num3); Vector3 val = Around(element.Angle, element.Height, num6); element.Root.transform.position = val; Vector3 val2 = val - (_feet + Vector3.up * (_height * element.Height)); Quaternion val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.0001f) ? Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up) : Quaternion.identity); element.Root.transform.rotation = val3 * Quaternion.Euler(0f, 0f, element.Spin * (1f - num5)); float num7 = Mathf.Lerp(0.1f, 1f, num5) * (1f - num3 * 0.7f); element.Root.transform.localScale = new Vector3(0.16f * num7, 0.1f * num7, 1f); Color color = HoloTheme.Shift(HoloTheme.ButtonHover, hue); float num8 = Mathf.Min(num4 * 2.2f, 1f) * (1f - num3 * 0.85f); color.a = num8 * 0.9f * intensity; HoloTheme.Tint(element.Mat, color); } } } private void TickArcs(float t, float intensity, float hue) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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) float num = Span(t, 0.6f, 0.85f); float num2 = Pulse(t, 0.6f, 1f); for (int i = 0; i < 10; i++) { Element element = _arcs[i]; bool flag = num > element.Phase * 0.5f && t < 1f; Show(element, flag); if (flag) { float num3 = Profile(0.5f) * (_height / 1.78f) * 1.5f; float num4 = element.Angle + Time.time * 0.8f; Vector3 val = Around(num4, 0.04f, num3); Vector3 val2 = Around(num4 + 0.5f, 0.95f, num3 * 0.7f) - val; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude < 0.01f)) { element.Root.transform.position = val + val2 * 0.5f; element.Root.transform.rotation = Quaternion.FromToRotation(Vector3.up, val2 / magnitude); element.Root.transform.localScale = new Vector3(0.008f, magnitude * 0.5f, 0.008f); Color color = HoloTheme.Shift(HoloTheme.Scanline, hue); color.a = num2 * 0.75f * intensity; HoloTheme.Tint(element.Mat, color); } } } } private void TickMotes(float t, float intensity, float hue) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(32f * Mathf.Clamp01(Prefs.DeployParticles)), 0, 32); float num2 = Span(t, 0.15f, 1f); float num3 = Ease.OutQuint(Span(t, 0.85f, 1f)); for (int i = 0; i < 32; i++) { Element element = _motes[i]; if (i >= num || num2 <= 0f) { Show(element, visible: false); continue; } Show(element, visible: true); float num4 = Mathf.Repeat(num2 * 1.6f + element.Phase, 1f); float angle = element.Angle + Time.time * 1.4f + num4 * 2f; float num5 = Profile(num4) * (_height / 1.78f) * Mathf.Lerp(2.1f, 0.6f, num4); num5 *= Mathf.Lerp(1f, 0.08f, num3); element.Root.transform.position = Around(angle, num4, num5); element.Root.transform.rotation = Billboard(element.Root.transform.position); float num6 = 0.02f * Mathf.Lerp(1.3f, 0.4f, num4); element.Root.transform.localScale = new Vector3(num6, num6, 1f); Color color = HoloTheme.Shift(HoloTheme.Shard, hue); color.a = Mathf.Sin(num4 * (float)Math.PI) * 0.85f * intensity; HoloTheme.Tint(element.Mat, color); } } private void TickFlash(float t, float intensity, float hue) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) float num = Span(t, 0.85f, 1f); bool flag = num > 0f && num < 1f; Show(_flash, flag); if (flag) { float num2 = Mathf.Max(0f, Prefs.DeployBurst); float num3 = Mathf.Lerp(0.2f, 2.4f * num2 * (_height / 1.78f), Ease.OutQuint(num)); Vector3 position = _feet + Vector3.up * (_height * 0.55f); _flash.Root.transform.position = position; _flash.Root.transform.rotation = Billboard(position); _flash.Root.transform.localScale = new Vector3(num3, num3, 1f); Color color = HoloTheme.Shift(HoloTheme.ButtonActive, hue); color.a = (1f - num) * (1f - num) * 0.9f * intensity * num2; HoloTheme.Tint(_flash.Mat, color); } } private static void Show(Element element, bool visible) { if ((Object)(object)element?.Root != (Object)null && element.Root.activeSelf != visible) { element.Root.SetActive(visible); } } public Vector3 OrbTarget() { //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_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) //IL_0022: 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_003b: Unknown result type (might be due to invalid IL or missing references) return _feet + Vector3.up * (_height * 0.62f) + _forward * Mathf.Max(0.05f, Prefs.DeployOrbDistance); } public void Destroy() { DestroyElements(_rings); DestroyElements(_panels); DestroyElements(_arcs); DestroyElements(_motes); if ((Object)(object)_scanRing?.Mat != (Object)null) { Object.Destroy((Object)(object)_scanRing.Mat); } if ((Object)(object)_flash?.Mat != (Object)null) { Object.Destroy((Object)(object)_flash.Mat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _scanRing = null; _flash = null; _built = false; _active = false; _time = 0f; for (int i = 0; i < _rings.Length; i++) { _rings[i] = null; } for (int j = 0; j < _panels.Length; j++) { _panels[j] = null; } for (int k = 0; k < _arcs.Length; k++) { _arcs[k] = null; } for (int l = 0; l < _motes.Length; l++) { _motes[l] = null; } } private static void DestroyElements(Element[] elements) { for (int i = 0; i < elements.Length; i++) { if ((Object)(object)elements[i]?.Mat != (Object)null) { Object.Destroy((Object)(object)elements[i].Mat); } } } } internal sealed class HoloLaser { private const float BeamWidth = 0.005f; private const float DotSize = 0.018f; private GameObject _root; private GameObject _beam; private GameObject _dot; private Material _beamMat; private Material _dotMat; private float _fade; public bool Exists => (Object)(object)_root != (Object)null; public void 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) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) Destroy(); _root = new GameObject("WristSpawner.Laser"); _beam = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)_beam).name = "Beam"; _beam.transform.SetParent(_root.transform, false); Strip(_beam); _beamMat = HoloTheme.CreateMaterial(HoloTheme.ButtonHover, onTop: true, null); _beamMat.renderQueue = 4014; Apply(_beam, _beamMat); _dot = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)_dot).name = "Dot"; _dot.transform.SetParent(_root.transform, false); Strip(_dot); _dotMat = HoloTheme.CreateMaterial(HoloTheme.ButtonActive, onTop: true, HoloTextures.Plate(new Vector2(0.018f, 0.018f), PlateStyle.Glow)); _dotMat.renderQueue = 4015; Apply(_dot, _dotMat); _root.SetActive(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(Vector3 from, Vector3 to, Vector3 viewer, bool armed) { //IL_0043: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00c8: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) if (!Exists) { return; } if (!_root.activeSelf) { _root.SetActive(true); } _fade = Mathf.MoveTowards(_fade, 1f, Time.deltaTime * 10f); Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude < 0.002f)) { Vector3 val2 = val / magnitude; _beam.transform.position = from + val2 * (magnitude * 0.5f); _beam.transform.rotation = Quaternion.FromToRotation(Vector3.up, val2); _beam.transform.localScale = new Vector3(0.005f, magnitude * 0.5f, 0.005f); Vector3 val3 = to - viewer; if (((Vector3)(ref val3)).sqrMagnitude < 1E-06f) { val3 = val2; } float num = 1f + Mathf.Sin(Time.time * 12f) * 0.14f; float num2 = 0.018f * num * (armed ? 1.25f : 1f); _dot.transform.position = to - val2 * 0.005f; _dot.transform.rotation = Quaternion.LookRotation(val3, Vector3.up); _dot.transform.localScale = new Vector3(num2, num2, 1f); Color color = (armed ? HoloTheme.ButtonActive : HoloTheme.ButtonHover); color.a *= 0.55f * _fade; HoloTheme.Tint(_beamMat, color); Color color2 = (armed ? HoloTheme.ButtonActive : HoloTheme.ButtonHover); color2.a *= 0.95f * _fade; HoloTheme.Tint(_dotMat, color2); } } public void Hide() { if (Exists) { _fade = 0f; if (_root.activeSelf) { _root.SetActive(false); } } } public void Destroy() { if ((Object)(object)_beamMat != (Object)null) { Object.Destroy((Object)(object)_beamMat); } if ((Object)(object)_dotMat != (Object)null) { Object.Destroy((Object)(object)_dotMat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _beam = null; _dot = null; _beamMat = null; _dotMat = null; _fade = 0f; } } internal sealed class HoloOrb { private sealed class Satellite { public GameObject Root; public GameObject Body; public Material BodyMat; public GameObject Icon; public Material IconMat; public GameObject Panel; public Material PanelMat; public GameObject Header; public Material HeaderMat; public TextMeshPro Label; public CatalogEntry Entry; public float Angle; public float Hover; public float Press; public float Detach; public bool Held; public bool HeldByLeft; public bool Free; public Vector3 FreePosition; public Vector3 Velocity; public Vector3 GrabOffset; public Quaternion Facing; public float ReturnAt; } private const int SatelliteCount = 20; private const float CoreRadius = 0.055f; private const float OrbitRadius = 0.17f; private const float SatelliteRadius = 0.03f; private const float GrabRadius = 0.13f; private const float SatelliteGrabRadius = 0.16f; private const float GripEngage = 0.5f; private const float GripRelease = 0.14f; private const float PokeRadius = 0.05f; private const float PressCooldown = 0.3f; private const float PanelWidth = 0.235f; private const float PanelHeight = 0.15f; private GameObject _root; private GameObject _core; private GameObject _shell; private GameObject _halo; private Material _coreMat; private Material _shellMat; private Material _haloMat; private GameObject _ringPulse; private Material _ringPulseMat; private float _ringLife; private readonly List _satellites = new List(); private GameObject _guideRoot; private readonly GameObject[] _guides = (GameObject[])(object)new GameObject[2]; private readonly Material[] _guideMats = (Material[])(object)new Material[2]; private readonly List _dust = new List(); private readonly List _dustMats = new List(); private TextMeshPro _title; private float _clock; private float _open; private bool _openTarget; private float _corePulse; private float _appear; private bool _held; private bool _heldByLeft; private Vector3 _grabOffset; private float _nextPress; private bool _triggerWasDown; private float _lastTapTime = -10f; private float _nextDeployTime; private float _deployGlow; private bool _deployed; private float _deployBlend; private float _blend; private Vector3 _deployForward = Vector3.forward; private bool _deployRequested; public bool Deployed => _deployed; public bool Exists => (Object)(object)_root != (Object)null; public bool Held => _held; public bool Suspended { get; private set; } public Vector3 Position { get { //IL_001f: 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) if (!((Object)(object)_root != (Object)null)) { return Vector3.zero; } return _root.transform.position; } } public BaseController HeldController { get { if (!_held) { return null; } if (!_heldByLeft) { return Player.RightController; } return Player.LeftController; } } public void SetDeployed(bool value) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) _deployed = value; if (!value) { for (int i = 0; i < _satellites.Count; i++) { _satellites[i].Free = false; _satellites[i].Held = false; _satellites[i].Velocity = Vector3.zero; } return; } _openTarget = true; for (int j = 0; j < _satellites.Count; j++) { _satellites[j].Free = false; _satellites[j].Held = false; _satellites[j].Velocity = Vector3.zero; } if (PlayerBody.TryResolve(out var _, out var _, out var forward)) { _deployForward = forward; } } public bool ConsumeDeployRequest() { if (!_deployRequested) { return false; } _deployRequested = false; return true; } public void Suspend() { Suspended = true; _held = false; _triggerWasDown = false; _lastTapTime = -10f; _deployRequested = false; for (int i = 0; i < _satellites.Count; i++) { _satellites[i].Held = false; } } public void Resume() { Suspended = false; _triggerWasDown = false; _lastTapTime = -10f; _nextDeployTime = Time.time + Prefs.DeployCooldown; } public void EnergyBoost(float amount) { _corePulse = Mathf.Max(_corePulse, amount); } public void SetDeployGlow(float amount) { _deployGlow = Mathf.Clamp01(amount); } public void DriveTo(Vector3 target, float dt, float speed) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null)) { _root.transform.position = Vector3.Lerp(_root.transform.position, target, 1f - Mathf.Exp((0f - Mathf.Max(0.1f, speed)) * dt)); } } public void Build() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0022: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Destroy(); _root = new GameObject("WristSpawner.Orb"); _core = MakeSphere("Core", 0.0341f, HoloTheme.ButtonActive, 3600, out _coreMat); _shell = MakeSphere("Shell", 0.055f, HoloTheme.Frame, 3601, out _shellMat); _halo = MakeSphere("Halo", 0.08525f, new Color(1f, 0.55f, 0.1f, 0.14f), 3602, out _haloMat); HoloTheme.SetTexture(_shellMat, HoloTextures.Globe(12, 7)); _ringPulse = MakeQuad("RingPulse", new Vector2(0.2f, 0.2f), HoloTheme.ButtonActive, PlateStyle.Glow, 3612, out _ringPulseMat); _ringPulse.SetActive(false); BuildGuides(); BuildDust(); BuildSatellites(); BuildTitle(); _appear = 0f; _open = 0f; _openTarget = false; PlaceInFront(); Refresh(); } private GameObject MakeSphere(string name, float radius, Color color, int queue, out Material material) { //IL_002a: 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_0058: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); obj.transform.localScale = Vector3.one * (radius * 2f); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } material = HoloTheme.CreateMaterial(color, onTop: false, null); material.renderQueue = queue; Renderer component2 = obj.GetComponent(); component2.material = material; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; return obj; } private GameObject MakeQuad(string name, Vector2 size, Color color, PlateStyle style, int queue, out Material material) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_005d: 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) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); obj.transform.localScale = new Vector3(size.x, size.y, 1f); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } material = HoloTheme.CreateMaterial(color, onTop: false, HoloTextures.Plate(size, style)); material.renderQueue = queue; Renderer component2 = obj.GetComponent(); component2.material = material; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; return obj; } private void BuildGuides() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) _guideRoot = new GameObject("WristSpawner.Guides"); for (int i = 0; i < _guides.Length; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val).name = "Guide" + i; val.transform.SetParent(_guideRoot.transform, false); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Material val2 = HoloTheme.CreateMaterial(HoloTheme.Frame, onTop: false, HoloTextures.Ring(40 - i * 8)); val2.renderQueue = 3598; Renderer component2 = val.GetComponent(); component2.material = val2; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; val.SetActive(false); _guides[i] = val; _guideMats[i] = val2; } } private void TickGuides() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) bool flag = _blend > 0.02f; for (int i = 0; i < _guides.Length; i++) { if ((Object)(object)_guides[i] != (Object)null && _guides[i].activeSelf != flag) { _guides[i].SetActive(flag); } } if (!flag || !PlayerBody.TryResolve(out var feet, out var height, out var _)) { return; } float num = height / 1.78f; float num2 = Mathf.Max(0.25f, Prefs.DeployOrbitRadius) * num; float num3 = feet.y + height * 0.78f; float num4 = 0.085f * height; for (int j = 0; j < _guides.Length; j++) { if (!((Object)(object)_guides[j] == (Object)null)) { bool flag2 = j == 0; float num5 = num3 + (flag2 ? num4 : (0f - num4)); float num6 = num2 * (flag2 ? 1f : 0.93f) * 2.5f; Transform transform = _guides[j].transform; transform.position = new Vector3(feet.x, num5, feet.z); transform.rotation = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 0f, _clock * (flag2 ? 12f : (-9f))); transform.localScale = new Vector3(num6, num6, 1f); Color frame = HoloTheme.Frame; frame.a *= 0.2f * _blend * _appear; HoloTheme.Tint(_guideMats[j], frame); } } } private void BuildDust() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 10; i++) { Material material; GameObject item = MakeQuad("Dust" + i, new Vector2(0.008f, 0.008f), HoloTheme.Shard, PlateStyle.Glow, 3611, out material); _dust.Add(item); _dustMats.Add(material); } } private void BuildSatellites() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_005f: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 20; i++) { GameObject val = new GameObject("Sat" + i); val.transform.SetParent(_root.transform, false); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val2).name = "Body"; val2.transform.SetParent(val.transform, false); val2.transform.localScale = Vector3.one * 0.06f; Collider component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Material val3 = HoloTheme.CreateMaterial(HoloTheme.Button, onTop: false, HoloTextures.Globe(8, 5)); val3.renderQueue = 3605; Renderer component2 = val2.GetComponent(); component2.material = val3; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; GameObject val4 = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val4).name = "Icon"; val4.transform.SetParent(val.transform, false); val4.transform.localScale = Vector3.one * 0.038999997f; Collider component3 = val4.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.DestroyImmediate((Object)(object)component3); } Material val5 = HoloTheme.CreateMaterial(HoloTheme.TextBright, onTop: false, null); val5.renderQueue = 3607; Renderer component4 = val4.GetComponent(); component4.material = val5; component4.shadowCastingMode = (ShadowCastingMode)0; component4.receiveShadows = false; Material material; GameObject panel = MakeChild(val, "Panel", (PrimitiveType)5, HoloTextures.Window(new Vector2(0.235f, 0.15f)), 3603, out material); Material material2; GameObject header = MakeChild(val, "Header", (PrimitiveType)5, HoloTextures.Plate(new Vector2(0.235f, 0.006f), PlateStyle.Solid), 3604, out material2); GameObject val6 = new GameObject("Label"); val6.transform.SetParent(val.transform, false); TextMeshPro val7 = val6.AddComponent(); ((TMP_Text)val7).font = HoloTheme.Font; HoloTheme.Calibrate((TMP_Text)(object)val7); ((TMP_Text)val7).rectTransform.sizeDelta = new Vector2(0.16f, 0.02f); ((TMP_Text)val7).fontSize = HoloTheme.FontSizeFor(0.008f); ((Graphic)val7).color = HoloTheme.TextDim; ((TMP_Text)val7).alignment = (TextAlignmentOptions)514; ((TMP_Text)val7).enableWordWrapping = false; ((TMP_Text)val7).overflowMode = (TextOverflowModes)1; ((TMP_Text)val7).richText = false; ((TMP_Text)val7).text = string.Empty; _satellites.Add(new Satellite { Root = val, Body = val2, BodyMat = val3, Icon = val4, IconMat = val5, Panel = panel, PanelMat = material, Header = header, HeaderMat = material2, Label = val7, Facing = Quaternion.identity, Angle = (float)i / 20f * (float)Math.PI * 2f }); } } private GameObject MakeChild(GameObject parent, string name, PrimitiveType type, Texture2D texture, int queue, out Material material) { //IL_0000: 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) GameObject obj = GameObject.CreatePrimitive(type); ((Object)obj).name = name; obj.transform.SetParent(parent.transform, false); Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } material = HoloTheme.CreateMaterial(HoloTheme.Button, onTop: false, texture); material.renderQueue = queue; Renderer component2 = obj.GetComponent(); component2.material = material; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; obj.SetActive(false); return obj; } private void BuildTitle() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Title"); val.transform.SetParent(_root.transform, false); _title = val.AddComponent(); ((TMP_Text)_title).font = HoloTheme.Font; HoloTheme.Calibrate((TMP_Text)(object)_title); RectTransform rectTransform = ((TMP_Text)_title).rectTransform; ((Transform)rectTransform).localPosition = new Vector3(0f, -0.235f, 0f); rectTransform.sizeDelta = new Vector2(0.3f, 0.03f); ((TMP_Text)_title).fontSize = HoloTheme.FontSizeFor(0.011f); ((Graphic)_title).color = HoloTheme.TextDim; ((TMP_Text)_title).alignment = (TextAlignmentOptions)514; ((TMP_Text)_title).enableWordWrapping = false; ((TMP_Text)_title).overflowMode = (TextOverflowModes)1; ((TMP_Text)_title).richText = false; ((TMP_Text)_title).text = "ORB"; } public void Refresh() { if (!Exists) { return; } List list = SpawnCatalog.Get(Category.Favorites); bool flag = list.Count > 0; if (!flag) { list = SpawnCatalog.Get(Category.All); } int num = Mathf.Clamp(Prefs.OrbSlots, 1, _satellites.Count); for (int i = 0; i < _satellites.Count; i++) { Satellite satellite = _satellites[i]; satellite.Entry = ((i < num && i < list.Count) ? list[i] : null); bool flag2 = satellite.Entry != null; if (satellite.Root.activeSelf != flag2) { satellite.Root.SetActive(flag2); } if (!flag2) { satellite.Held = false; continue; } ((TMP_Text)satellite.Label).text = satellite.Entry.Title; HoloTheme.SetTexture(satellite.IconMat, HoloTextures.Icon(IconFor(satellite.Entry.Category))); } ((TMP_Text)_title).text = (flag ? "FAVORITES" : "SPAWNABLES"); } private static IconKind IconFor(Category category) { return category switch { Category.Guns => IconKind.Crosshair, Category.Melee => IconKind.Blade, Category.NPCs => IconKind.Figure, Category.Props => IconKind.Cube, _ => IconKind.Grid, }; } public void PlaceInFront() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (Exists) { Transform head = Player.Head; if (!((Object)(object)head == (Object)null)) { Vector3 forward = head.forward; forward.y *= 0.35f; _root.transform.position = head.position + ((Vector3)(ref forward)).normalized * 0.75f; _appear = 0f; } } } public void Tick(float dt) { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (Exists) { _clock += dt; _appear = Mathf.MoveTowards(_appear, 1f, dt * 2.2f); _corePulse = Mathf.MoveTowards(_corePulse, 0f, dt * 2.4f); if (_deployed) { _openTarget = true; } _open = Mathf.MoveTowards(_open, _openTarget ? 1f : 0f, dt * 3.4f); _deployBlend = Mathf.MoveTowards(_deployBlend, _deployed ? 1f : 0f, dt * 1.5f); _blend = Ease.InOutSine(_deployBlend); if (!Suspended) { UpdateGrab(dt); UpdatePoke(); UpdateDoubleTap(); } FollowPlayerWhenDeployed(dt); TickFreePanels(dt); TickGuides(); float num = Mathf.Max(0.2f, Prefs.OrbScale) * Ease.OutBack(_appear); _root.transform.localScale = Vector3.one * num; _root.transform.rotation = Quaternion.identity; TickCore(); TickDust(); TickSatellites(dt); TickRing(dt); TickTitle(); } } private void FollowPlayerWhenDeployed(float dt) { //IL_0027: 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_002f: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (_deployed && !_held && !Suspended && PlayerBody.TryResolve(out var feet, out var height, out var _)) { Vector3 val = PlayerBody.Center(feet, height) + _deployForward * (0.34f * (height / 1.78f)) - Vector3.up * (0.12f * (height / 1.78f)); _root.transform.position = Vector3.Lerp(_root.transform.position, val, 1f - Mathf.Exp(-1.6f * dt)); } } private void TickCore() { //IL_0043: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) float num = 1f + Mathf.Sin(_clock * 2.4f) * 0.06f + _corePulse * 0.45f + _deployGlow * 0.35f; _core.transform.localScale = Vector3.one * (0.0682f * num); _shell.transform.localScale = Vector3.one * (0.11f * (1f + _corePulse * 0.25f + _deployGlow * 0.3f)); _halo.transform.localScale = Vector3.one * (0.1705f * (1f + _corePulse * 0.35f + _deployGlow * 0.9f)); _core.transform.localRotation = Quaternion.Euler(_clock * 12f, _clock * 20f, 0f); _shell.transform.localRotation = Quaternion.Euler(18f, _clock * 26f, 6f); _halo.transform.localRotation = Quaternion.Euler(0f, (0f - _clock) * 9f, 0f); Color color = Color.Lerp(HoloTheme.ButtonActive, Color.white, Mathf.Max(_corePulse, _deployGlow)); color.a = 0.92f * _appear; HoloTheme.Tint(_coreMat, color); Color frame = HoloTheme.Frame; frame.a = (0.42f + 0.14f * Mathf.Sin(_clock * 3.1f) + _corePulse * 0.3f + _deployGlow * 0.45f) * _appear; HoloTheme.Tint(_shellMat, frame); Color color2 = default(Color); ((Color)(ref color2))..ctor(1f, 0.55f, 0.1f, (0.1f + _corePulse * 0.22f + _deployGlow * 0.35f) * _appear); HoloTheme.Tint(_haloMat, color2); } private void TickDust() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Vector3 viewer = Viewer(); for (int i = 0; i < _dust.Count; i++) { float num = _clock * (0.6f + (float)i * 0.07f) + (float)i * 1.37f; float num2 = 0.055f * (1.9f + 0.5f * Mathf.Sin(num * 0.7f + (float)i)); float num3 = (float)i * 0.62f; _dust[i].transform.localPosition = new Vector3(Mathf.Cos(num) * num2, Mathf.Sin(num * 1.3f + num3) * num2 * 0.55f, Mathf.Sin(num) * num2); _dust[i].transform.rotation = Billboard(_dust[i].transform.position, viewer); Color shard = HoloTheme.Shard; shard.a = (0.3f + 0.3f * Mathf.Sin(num * 2f)) * _appear; HoloTheme.Tint(_dustMats[i], shard); } } private Quaternion OrbitBasis(int ring) { //IL_0035: 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) if (ring != 0) { return Quaternion.Euler(-58f, _clock * -11f, 24f); } return Quaternion.Euler(22f, _clock * 15f, 8f); } private void TickSatellites(float dt) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0060: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00da: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: 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_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: 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_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: 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_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) float num = _clock * 0.42f; float num2 = Ease.OutBack(_open); Vector3 val = Viewer(); float x = _root.transform.localScale.x; Vector3 position = _root.transform.position; float num3 = 0.17f * num2 * x; Vector3 feet = Vector3.zero; float height = 1.78f; Vector3 forward = Vector3.forward; bool flag = false; if (_blend > 0.001f) { flag = PlayerBody.TryResolve(out feet, out height, out forward); } Vector3 val2 = Vector3.zero; Vector3 val3 = Vector3.right; Vector3 val4 = Vector3.forward; float num4 = 0.72f; float num5 = 1f; float num6 = 0f; if (flag) { num5 = height / 1.78f; val2 = PlayerBody.Center(feet, height); val4 = _deployForward; val3 = Vector3.Cross(Vector3.up, _deployForward); num4 = Mathf.Max(0.25f, Prefs.DeployOrbitRadius) * num5; num6 = feet.y + height * 0.78f; } float num7 = Mathf.Lerp(1f, Mathf.Max(0.3f, Prefs.DeployedScale), _blend); float num8 = _clock * Prefs.DeployOrbitSpin * ((float)Math.PI / 180f); int num9 = 0; for (int i = 0; i < _satellites.Count; i++) { if (_satellites[i].Entry != null) { num9++; } } if (num9 <= 0) { num9 = 1; } num3 *= Mathf.Clamp(Mathf.Sqrt((float)num9 / 8f), 1f, 1.8f); int num10 = 0; for (int j = 0; j < _satellites.Count; j++) { Satellite satellite = _satellites[j]; if (satellite.Entry != null) { satellite.Hover = Mathf.MoveTowards(satellite.Hover, satellite.Held ? 1f : 0f, dt * 6f); satellite.Press = Mathf.MoveTowards(satellite.Press, 0f, dt * 3f); satellite.Detach = Mathf.MoveTowards(satellite.Detach, (satellite.Held || satellite.Free) ? 1f : 0f, dt * 5f); int num11 = num10 % 2; int num12 = num10 / 2; int num13 = Mathf.Max(1, (num9 + ((num11 == 0) ? 1 : 0)) / 2); float num14 = num * ((num11 == 0) ? 1f : (-0.82f)) + (float)num12 / (float)num13 * (float)Math.PI * 2f + (float)num11 * 0.7f; Vector3 val5 = OrbitBasis(num11) * new Vector3(Mathf.Cos(num14), 0f, Mathf.Sin(num14)); Vector3 val6 = position + val5 * num3; Vector3 val7 = val6; Quaternion val8 = Billboard(val6, val); Vector3 normalized = ((Vector3)(ref val5)).normalized; Vector3 val9 = val - position; float num15 = Mathf.Clamp01(0f - Vector3.Dot(normalized, ((Vector3)(ref val9)).normalized)); if (flag) { bool flag2 = num10 % 2 == 0; float num16 = (float)num10 / (float)num9 * (float)Math.PI * 2f + num8 + (flag2 ? 0f : 0.18f); Vector3 val10 = val3 * Mathf.Cos(num16) + val4 * Mathf.Sin(num16); float num17 = (flag2 ? 0.085f : (-0.085f)) * height; float num18 = Mathf.Sin(_clock * 0.8f + (float)num10 * 1.1f) * 0.016f * num5; float num19 = num4 * (flag2 ? 1f : 0.93f); Vector3 val11 = new Vector3(val2.x, num6, val2.z) + val10 * num19 + Vector3.up * (num17 + num18); Vector3 val12 = val11 - new Vector3(val2.x, val11.y, val2.z); Quaternion val13 = ((((Vector3)(ref val12)).sqrMagnitude > 0.0001f) ? Quaternion.LookRotation(((Vector3)(ref val12)).normalized, Vector3.up) : val8); float num20 = Mathf.Clamp((num6 - val11.y) * 55f, -22f, 22f); float num21 = Mathf.Sin(_clock * 0.55f + (float)num10 * 1.7f) * 3.5f; val13 *= Quaternion.Euler(num20, num21, 0f); val7 = Vector3.Lerp(val6, val11, _blend); val8 = Quaternion.Slerp(val8, val13, _blend); num15 *= 1f - _blend; } float num22 = Ease.OutCubic(satellite.Detach); val7 = Vector3.Lerp(val7, satellite.FreePosition, num22); satellite.Root.transform.position = val7; satellite.Root.transform.rotation = val8; float num23 = Mathf.Lerp(1f, 0.34f, num15 * (1f - num22)); float num24 = Mathf.Lerp(1f, 0.72f, num15 * (1f - num22)); float num25 = 0.32f * satellite.Press * Mathf.Cos(satellite.Press * 7f); float grow = (0.25f + 0.75f * num2) * num24 * num7 * (1f + satellite.Hover * 0.18f + num25 + num22 * 0.12f); float alpha = Mathf.Max(num2, num22) * _appear * num23; LayoutSatellite(satellite, val7, val8, grow, alpha, num5); num10++; } } } private void LayoutSatellite(Satellite satellite, Vector3 world, Quaternion facing, float grow, float alpha, float bodyScaleRef) { //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_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_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_001e: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: 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_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039b: 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_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: 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_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) satellite.Facing = facing; _ = facing * Vector3.right; Vector3 val = facing * Vector3.up; Vector3 val2 = facing * Vector3.back; float num = grow * bodyScaleRef; float num2 = Mathf.Lerp(1f, 0f, Mathf.Clamp01(_blend * 1.6f)) * grow; bool flag = _blend > 0.01f; if (satellite.Panel.activeSelf != flag) { satellite.Panel.SetActive(flag); satellite.Header.SetActive(flag); } if (flag) { satellite.Panel.transform.position = world; satellite.Panel.transform.rotation = facing; satellite.Panel.transform.localScale = new Vector3(0.235f * num, 0.15f * num, 1f); satellite.Header.transform.position = world + val * (0.066f * num) + val2 * 0.002f; satellite.Header.transform.rotation = facing; satellite.Header.transform.localScale = new Vector3(0.21620001f * num, 0.006f * num, 1f); Color val3 = Color.Lerp(HoloTheme.Button, HoloTheme.ButtonHover, satellite.Hover); val3 = Color.Lerp(val3, HoloTheme.ButtonActive, satellite.Press); val3.a *= alpha * _blend; HoloTheme.Tint(satellite.PanelMat, val3); Color color = Color.Lerp(HoloTheme.Frame, HoloTheme.ButtonActive, Mathf.Max(satellite.Hover, satellite.Press)); color.a *= alpha * _blend; HoloTheme.Tint(satellite.HeaderMat, color); } bool flag2 = num2 > 0.0005f; if (satellite.Body.activeSelf != flag2) { satellite.Body.SetActive(flag2); } satellite.Body.transform.position = world; satellite.Body.transform.localScale = Vector3.one * (0.06f * num2); satellite.Body.transform.localRotation = Quaternion.Euler(14f, _clock * 42f, 0f); Color val4 = Color.Lerp(HoloTheme.Button, HoloTheme.ButtonHover, satellite.Hover); val4 = Color.Lerp(val4, HoloTheme.ButtonActive, satellite.Press); val4.a *= alpha; HoloTheme.Tint(satellite.BodyMat, val4); float num3 = Mathf.Lerp(0.037499998f * grow, 0.066f * num, _blend); Vector3 position = Vector3.Lerp(world + val2 * (0.03f * grow * 1.05f), world + val * (0.006f * num) + val2 * 0.005f, _blend); satellite.Icon.transform.position = position; satellite.Icon.transform.rotation = facing; satellite.Icon.transform.localScale = Vector3.one * num3; Color color2 = Color.Lerp(HoloTheme.TextPrimary, HoloTheme.TextBright, Mathf.Max(satellite.Hover, satellite.Press)); color2.a *= alpha; HoloTheme.Tint(satellite.IconMat, color2); Vector3 position2 = Vector3.Lerp(world - Vector3.up * (0.06299999f * grow), world - val * (0.051000003f * num) + val2 * 0.005f, _blend); ((Transform)((TMP_Text)satellite.Label).rectTransform).position = position2; ((Transform)((TMP_Text)satellite.Label).rectTransform).rotation = facing; ((Transform)((TMP_Text)satellite.Label).rectTransform).localScale = Vector3.one * Mathf.Lerp(1f, 1.6f * bodyScaleRef, _blend); Color color3 = Color.Lerp(HoloTheme.TextDim, HoloTheme.TextBright, satellite.Hover); color3.a *= alpha; ((Graphic)satellite.Label).color = color3; } private void TickTitle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Transform)((TMP_Text)_title).rectTransform).position; ((Transform)((TMP_Text)_title).rectTransform).rotation = Billboard(position, Viewer()); Color textDim = HoloTheme.TextDim; textDim.a = _appear * Mathf.Lerp(0.4f, 1f, Ease.OutBack(_open)); ((Graphic)_title).color = textDim; } private void TickRing(float dt) { //IL_0073: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if (_ringLife <= 0f) { if (_ringPulse.activeSelf) { _ringPulse.SetActive(false); } return; } _ringLife = Mathf.Max(0f, _ringLife - dt * 1.9f); float t = 1f - _ringLife; float num = Mathf.Lerp(0.077f, 0.40800002f, Ease.OutQuint(t)); _ringPulse.transform.localPosition = Vector3.zero; _ringPulse.transform.localScale = new Vector3(num, num, 1f); _ringPulse.transform.rotation = Billboard(_ringPulse.transform.position, Viewer()); Color buttonActive = HoloTheme.ButtonActive; buttonActive.a = _ringLife * _ringLife * 0.75f * _appear; HoloTheme.Tint(_ringPulseMat, buttonActive); } private static Vector3 Viewer() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform head = Player.Head; if (!((Object)(object)head != (Object)null)) { return Vector3.zero; } return head.position; } 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; } private void UpdateGrab(float dt) { UpdateHeldSatellites(dt); UpdateHeldOrb(); if (!_held && !TryGrabSatellite(Player.LeftHand, Player.LeftController, isLeft: true) && !TryGrabSatellite(Player.RightHand, Player.RightController, isLeft: false) && !TryGrabOrb(Player.LeftHand, Player.LeftController, isLeft: true)) { TryGrabOrb(Player.RightHand, Player.RightController, isLeft: false); } } private void UpdateHeldOrb() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (_held) { Hand val = (_heldByLeft ? Player.LeftHand : Player.RightHand); BaseController val2 = (_heldByLeft ? Player.LeftController : Player.RightController); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || !IsGripping(val2, alreadyHeld: true)) { _held = false; } else { _root.transform.position = ((Component)val).transform.TransformPoint(_grabOffset); } } } private void UpdateHeldSatellites(float dt) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_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_00b8: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _satellites.Count; i++) { Satellite satellite = _satellites[i]; if (!satellite.Held) { continue; } Hand val = (satellite.HeldByLeft ? Player.LeftHand : Player.RightHand); BaseController val2 = (satellite.HeldByLeft ? Player.LeftController : Player.RightController); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || !IsGripping(val2, alreadyHeld: true)) { satellite.Held = false; satellite.ReturnAt = Time.time + Mathf.Max(0.25f, Prefs.PanelReturn); continue; } Vector3 val3 = ((Component)val).transform.TransformPoint(satellite.GrabOffset); Vector3 val4 = ((dt > 0.0001f) ? ((val3 - satellite.FreePosition) / dt) : Vector3.zero); satellite.Velocity = Vector3.Lerp(satellite.Velocity, val4, 0.55f); satellite.FreePosition = val3; if (TriggerPressed(val2) && Time.time >= _nextPress) { SpawnFromPanel(satellite, val2); } } } private bool HandBusy(bool isLeft) { if (_held && _heldByLeft == isLeft) { return true; } for (int i = 0; i < _satellites.Count; i++) { if (_satellites[i].Held && _satellites[i].HeldByLeft == isLeft) { return true; } } return false; } private bool TryGrabSatellite(Hand hand, BaseController controller, bool isLeft) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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) if ((Object)(object)hand == (Object)null || (Object)(object)controller == (Object)null || _open < 0.4f || HandBusy(isLeft) || !IsGripping(controller, alreadyHeld: false)) { return false; } float num = Mathf.Max(0.2f, Prefs.OrbScale); Vector3 position = ((Component)hand).transform.position; float num2 = Mathf.Lerp(1f, Mathf.Max(0.3f, Prefs.DeployedScale), _blend); float num3 = 0.16f * num * num2; Satellite satellite = null; for (int i = 0; i < _satellites.Count; i++) { Satellite satellite2 = _satellites[i]; if (satellite2.Entry != null && !satellite2.Held && satellite2.Root.activeSelf) { float num4 = Vector3.Distance(position, satellite2.Root.transform.position); if (!(num4 >= num3)) { num3 = num4; satellite = satellite2; } } } if (satellite == null) { return false; } satellite.Held = true; satellite.Free = true; satellite.HeldByLeft = isLeft; satellite.FreePosition = satellite.Root.transform.position; satellite.GrabOffset = ((Component)hand).transform.InverseTransformPoint(satellite.FreePosition); satellite.Velocity = Vector3.zero; satellite.ReturnAt = float.MaxValue; _corePulse = 1f; Pulse(controller, 0.5f, 0.045f); return true; } private bool TryGrabOrb(Hand hand, BaseController controller, bool isLeft) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hand == (Object)null || (Object)(object)controller == (Object)null || HandBusy(isLeft)) { return false; } float num = 0.13f * Mathf.Max(0.2f, Prefs.OrbScale); if (Vector3.Distance(((Component)hand).transform.position, _root.transform.position) > num) { return false; } if (!IsGripping(controller, alreadyHeld: false)) { return false; } _held = true; _heldByLeft = isLeft; _grabOffset = ((Component)hand).transform.InverseTransformPoint(_root.transform.position); _corePulse = 1f; Pulse(controller, 0.4f, 0.04f); return true; } private void UpdateDoubleTap() { if (!Prefs.DeployEnabled || !_held || AnySatelliteHeld()) { _triggerWasDown = false; return; } BaseController val = (_heldByLeft ? Player.LeftController : Player.RightController); if ((Object)(object)val == (Object)null) { _triggerWasDown = false; return; } bool primaryInteractionButton; try { primaryInteractionButton = val.GetPrimaryInteractionButton(); } catch { return; } bool num = primaryInteractionButton && !_triggerWasDown; _triggerWasDown = primaryInteractionButton; if (!num) { return; } float time = Time.time; if (time < _nextDeployTime) { _lastTapTime = -10f; return; } float num2 = time - _lastTapTime; if (num2 <= Prefs.DoubleTapWindow && num2 > 0.04f) { _lastTapTime = -10f; _nextDeployTime = time + Prefs.DeployCooldown; _corePulse = 1f; _deployRequested = true; Pulse(val, 1f, 0.09f); } else { _lastTapTime = time; } } private bool AnySatelliteHeld() { for (int i = 0; i < _satellites.Count; i++) { if (_satellites[i].Held) { return true; } } return false; } public CatalogEntry FirstFavorite() { for (int i = 0; i < _satellites.Count; i++) { if (_satellites[i].Entry != null) { return _satellites[i].Entry; } } return null; } private void SpawnFromPanel(Satellite satellite, BaseController controller) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (satellite.Entry != null) { _nextPress = Time.time + 0.3f; satellite.Press = 1f; _corePulse = 1f; _ringLife = 1f; _ringPulse.SetActive(true); Vector3 val = satellite.Facing * Vector3.back; Vector3 position = satellite.Root.transform.position + val * 0.3f; SpawnService.SpawnAt(satellite.Entry.Barcode, satellite.Entry.Title, position, SpawnService.FacePlayer(HeadForward())); Pulse(controller, 0.9f, 0.07f); } } private void TickFreePanels(float dt) { //IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) if (!PlayerBody.TryResolve(out var feet, out var height, out var _)) { return; } Vector3 val = PlayerBody.Center(feet, height); float num = height / 1.78f; float num2 = Mathf.Max(0.4f, Prefs.PanelLeash) * num; float num3 = Mathf.Max(0f, Prefs.PanelGravity); float num4 = Mathf.Max(0f, Prefs.PanelDrag); float num5 = Mathf.Max(0f, Prefs.PanelFloat); float num6 = feet.y + height * 0.78f; float num7 = feet.y + height * 0.42f; for (int i = 0; i < _satellites.Count; i++) { Satellite satellite = _satellites[i]; if (!satellite.Free || satellite.Held || satellite.Entry == null) { continue; } if (Time.time >= satellite.ReturnAt) { satellite.Free = false; satellite.Velocity = Vector3.zero; continue; } satellite.Velocity += Vector3.down * (num3 * dt); satellite.Velocity.y += (num6 - satellite.FreePosition.y) * (num5 * dt); satellite.Velocity *= Mathf.Exp((0f - num4) * dt); satellite.FreePosition += satellite.Velocity * dt; if (satellite.FreePosition.y < num7) { satellite.FreePosition.y = num7; satellite.Velocity.y = Mathf.Abs(satellite.Velocity.y) * 0.25f; } Vector3 val2 = satellite.FreePosition - val; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude <= num2) && !(magnitude < 0.0001f)) { Vector3 val3 = val2 / magnitude; satellite.FreePosition = val + val3 * num2; float num8 = Vector3.Dot(satellite.Velocity, val3); if (num8 > 0f) { satellite.Velocity -= val3 * (num8 * 1.5f); } } } } private static bool IsGripping(BaseController controller, bool alreadyHeld) { try { return controller.GetGripForce() > (alreadyHeld ? 0.14f : 0.5f); } catch { return false; } } private static bool TriggerPressed(BaseController controller) { try { return controller.GetPrimaryInteractionButtonDown(); } catch { return false; } } private void UpdatePoke() { if (!_held && !(Time.time < _nextPress)) { TryPoke(Player.LeftHand, Player.LeftController); TryPoke(Player.RightHand, Player.RightController); } } private void TryPoke(Hand hand, BaseController controller) { //IL_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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 ((Object)(object)hand == (Object)null || Time.time < _nextPress || ((Object)(object)controller != (Object)null && IsGripping(controller, alreadyHeld: false))) { return; } Vector3 position = ((Component)hand).transform.position; float num = Mathf.Max(0.2f, Prefs.OrbScale); if (!_deployed && Vector3.Distance(position, _root.transform.position) < 0.055f * num * 1.9f) { _openTarget = !_openTarget; _corePulse = 1f; _ringLife = 1f; _ringPulse.SetActive(true); _nextPress = Time.time + 0.3f; Pulse(controller, 0.6f, 0.05f); } else { if (_open < 0.5f) { return; } for (int i = 0; i < _satellites.Count; i++) { Satellite satellite = _satellites[i]; if (satellite.Entry != null && satellite.Root.activeSelf && !satellite.Held) { float num2 = 0.05f * num * Mathf.Lerp(1f, Mathf.Max(0.3f, Prefs.DeployedScale), _blend); if (!(Vector3.Distance(position, satellite.Root.transform.position) > num2)) { SpawnFromPanel(satellite, controller); break; } } } } } private static Vector3 HeadForward() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Transform head = Player.Head; if (!((Object)(object)head != (Object)null)) { return Vector3.forward; } return head.forward; } private static void Pulse(BaseController controller, float amplitude, float duration) { if (!Prefs.HapticFeedback || (Object)(object)controller == (Object)null) { return; } try { controller.HapticAction(0f, duration, 220f, amplitude); } catch { } } public void Destroy() { for (int i = 0; i < _satellites.Count; i++) { if ((Object)(object)_satellites[i].BodyMat != (Object)null) { Object.Destroy((Object)(object)_satellites[i].BodyMat); } if ((Object)(object)_satellites[i].IconMat != (Object)null) { Object.Destroy((Object)(object)_satellites[i].IconMat); } if ((Object)(object)_satellites[i].PanelMat != (Object)null) { Object.Destroy((Object)(object)_satellites[i].PanelMat); } if ((Object)(object)_satellites[i].HeaderMat != (Object)null) { Object.Destroy((Object)(object)_satellites[i].HeaderMat); } } for (int j = 0; j < _dustMats.Count; j++) { if ((Object)(object)_dustMats[j] != (Object)null) { Object.Destroy((Object)(object)_dustMats[j]); } } for (int k = 0; k < _guideMats.Length; k++) { if ((Object)(object)_guideMats[k] != (Object)null) { Object.Destroy((Object)(object)_guideMats[k]); } _guideMats[k] = null; _guides[k] = null; } if ((Object)(object)_guideRoot != (Object)null) { Object.Destroy((Object)(object)_guideRoot); } _guideRoot = null; if ((Object)(object)_coreMat != (Object)null) { Object.Destroy((Object)(object)_coreMat); } if ((Object)(object)_shellMat != (Object)null) { Object.Destroy((Object)(object)_shellMat); } if ((Object)(object)_haloMat != (Object)null) { Object.Destroy((Object)(object)_haloMat); } if ((Object)(object)_ringPulseMat != (Object)null) { Object.Destroy((Object)(object)_ringPulseMat); } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _core = null; _shell = null; _halo = null; _ringPulse = null; _title = null; _held = false; _satellites.Clear(); _dust.Clear(); _dustMats.Clear(); } } internal sealed class HoloPanel { private sealed class Effect { public HoloWidget Widget; public float Life; public Vector2 Origin; public Vector2 Size; public Vector2 Velocity; public float Spin; public float Angle; } private const float PanelWidth = 0.34f; private const float PanelHeight = 0.3f; private const int RowCount = 7; private const float RowHeight = 0.024f; private const float RowSpacing = 0.0255f; private const float FirstRowY = 0.052f; private const float TitleY = 0.136f; private const float TabY = 0.11f; private const float SubTabY = 0.084f; private const float FooterY = -0.124f; private const float StatusY = -0.145f; private const float TitleText = 0.015f; private const float TabText = 0.0092f; private const float SubTabText = 0.0085f; private const float RowText = 0.0125f; private const float FooterText = 0.0095f; private const float StatusText = 0.009f; private const float DepthBack = 0f; private const float DepthStripe = -0.0016f; private const float DepthGlow = -0.0034f; private const float DepthChip = -0.0055f; private const float DepthScan = -0.0092f; private const float DepthEffect = -0.0112f; private const float DockSigma = 0.03f; private const float DockAmp = 0.17f; private const float DockPush = 0.55f; private const int MaxSubTabs = 6; private const int RippleCount = 4; private const int ShockCount = 3; private const int ShardCount = 16; private static readonly Category[] Tabs = new Category[6] { Category.Favorites, Category.Guns, Category.Melee, Category.NPCs, Category.Props, Category.All }; private static readonly string[] TabLabels = new string[6] { "FAV", "GUNS", "MELEE", "NPCS", "PROPS", "ALL" }; private static readonly float[] CornerAngles = new float[4] { 0f, -90f, 90f, 180f }; private static readonly IconKind[] TabIcons = new IconKind[6] { IconKind.Star, IconKind.Crosshair, IconKind.Blade, IconKind.Figure, IconKind.Cube, IconKind.Grid }; private readonly List _widgets = new List(); private readonly HoloWidget[] _rowButtons = new HoloWidget[7]; private readonly HoloWidget[] _rowFavButtons = new HoloWidget[7]; private readonly HoloWidget[] _rowStripes = new HoloWidget[7]; private readonly HoloWidget[] _tabButtons = new HoloWidget[6]; private readonly HoloWidget[] _subTabButtons = new HoloWidget[6]; private readonly HoloWidget[] _corners = new HoloWidget[4]; private readonly List _textMaterials = new List(); private readonly List _ripples = new List(); private readonly List _shocks = new List(); private readonly List _shards = new List(); private HoloWidget _frame; private HoloWidget _scanline; private HoloWidget _selection; private HoloWidget _titleWidget; private HoloWidget _pageWidget; private HoloWidget _statusWidget; private Category _category = Category.All; private int _subIndex; private int _page; private int _transitionDir = 1; private List _visible = new List(); private string _status = "Ready"; private float _statusExpiry; private int _restingCount = -1; private float _showAnim; private bool _showTarget = true; private float _clock; private float _sweep = 1f; private float _burst; private HoloWidget _hovered; private Vector2 _selPos; private Vector2 _selSize = Vector2.one; private float _selAlpha; private float _pointerY; private bool _pointerValid; public GameObject Root { get; private set; } public Transform Transform { get { if (!((Object)(object)Root != (Object)null)) { return null; } return Root.transform; } } public bool Exists => (Object)(object)Root != (Object)null; public bool Visible { get { if (Exists) { return Root.activeSelf; } return false; } } private int PageCount { get { int count = _visible.Count; if (count > 0) { return Mathf.CeilToInt((float)count / 7f); } return 1; } } public void Build(Transform parent) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0034: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) Destroy(); bool alwaysOnTop = Prefs.AlwaysOnTop; Root = new GameObject("WristSpawner.Panel"); Root.transform.SetParent(parent, false); CreatePlate("Backplate", Vector2.zero, new Vector2(0.34f, 0.3f), HoloTheme.Backplate, alwaysOnTop, 0f, 4000, PlateStyle.Panel).Decorative = true; _frame = CreatePlate("Frame", Vector2.zero, new Vector2(0.344f, 0.30400002f), HoloTheme.Frame, alwaysOnTop, 0.0006f, 3999, PlateStyle.Chip); _frame.Decorative = true; BuildCorners(alwaysOnTop); BuildStripes(alwaysOnTop); BuildDividers(alwaysOnTop); _selection = CreatePlate("Selection", Vector2.zero, new Vector2(0.3f, 0.028f), HoloTheme.Selection, alwaysOnTop, -0.0034f, 4001, PlateStyle.Glow); _selection.Decorative = true; _selection.SetActive(active: false); _scanline = CreatePlate("Scanline", Vector2.zero, new Vector2(0.334f, 0.01f), HoloTheme.Scanline, alwaysOnTop, -0.0092f, 4008, PlateStyle.Glow); _scanline.Decorative = true; _titleWidget = CreateLabelOnly("Title", new Vector2(0f, 0.136f), new Vector2(0.32f, 0.02f), 0.015f, (TextAlignmentOptions)514, HoloTheme.TextPrimary, alwaysOnTop); BuildTabs(alwaysOnTop); BuildSubTabs(alwaysOnTop); BuildRows(alwaysOnTop); BuildFooter(alwaysOnTop); BuildEffects(alwaysOnTop); _showAnim = 0f; _showTarget = true; _sweep = 0f; ApplyTransform(); SetStatus("Wrist Spawner online"); Refresh(); } private void BuildCorners(bool onTop) { //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) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) float num = 0.161f; float num2 = 0.141f; Vector2[] array = (Vector2[])(object)new Vector2[4] { new Vector2(0f - num, num2), new Vector2(num, num2), new Vector2(0f - num, 0f - num2), new Vector2(num, 0f - num2) }; for (int i = 0; i < 4; i++) { _corners[i] = CreatePlate("Corner" + i, array[i], new Vector2(0.02f, 0.02f), HoloTheme.Frame, onTop, -0.0016f, 4002, PlateStyle.Bracket); _corners[i].Decorative = true; } } private void BuildStripes(bool onTop) { //IL_0032: 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) for (int i = 0; i < 7; i++) { float num = 0.052f - (float)i * 0.0255f; _rowStripes[i] = CreatePlate("Stripe" + i, new Vector2(0f, num), new Vector2(0.322f, 0.0255f), HoloTheme.Stripe, onTop, -0.0016f, 4001, PlateStyle.Solid); _rowStripes[i].Decorative = true; } } private void BuildDividers(bool onTop) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[2] { 0.07f, -0.11f }; for (int i = 0; i < array.Length; i++) { CreatePlate("Divider" + i, new Vector2(0f, array[i]), new Vector2(0.324f, 0.0009f), HoloTheme.Divider, onTop, -0.0016f, 4002, PlateStyle.Line).Decorative = true; } } private void BuildTabs(bool onTop) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00e5: Unknown result type (might be due to invalid IL or missing references) float[] array = Uniform(Tabs.Length, 0.053f); float[] array2 = LayoutRow(array, 0.003f); for (int i = 0; i < Tabs.Length; i++) { int index = i; HoloWidget holoWidget = CreateButton("Tab" + TabLabels[i], new Vector2(array2[i], 0.11f), new Vector2(array[i], 0.024f), HoloTheme.Button, TabLabels[i], 0.0092f, (TextAlignmentOptions)516, onTop, delegate { SelectTab(index); }); AttachIcon(holoWidget, new Vector2((0f - array[i]) * 0.5f + 0.0105f, 0f), 0.013f, onTop); holoWidget.SetIcon(HoloTextures.Icon(TabIcons[i])); ((TMP_Text)holoWidget.Label).margin = new Vector4(0.02f, 0f, 0.005f, 0f); _tabButtons[i] = holoWidget; } } private void BuildSubTabs(bool onTop) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) float[] array = Uniform(6, 0.053f); float[] array2 = LayoutRow(array, 0.003f); for (int i = 0; i < 6; i++) { int index = i; _subTabButtons[i] = CreateButton("Sub" + i, new Vector2(array2[i], 0.084f), new Vector2(array[i], 0.018f), HoloTheme.SubTab, string.Empty, 0.0085f, (TextAlignmentOptions)514, onTop, delegate { SelectSubTab(index); }); } } private void BuildRows(bool onTop) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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) float[] array = new float[2] { 0.284f, 0.038f }; float[] array2 = LayoutRow(array, 0.008f); for (int i = 0; i < 7; i++) { int index = i; float num = 0.052f - (float)i * 0.0255f; HoloWidget holoWidget = CreateButton("Row" + i, new Vector2(array2[0], num), new Vector2(array[0], 0.024f), HoloTheme.Button, string.Empty, 0.0125f, (TextAlignmentOptions)513, onTop, delegate { SpawnRow(index); }); AttachIcon(holoWidget, new Vector2((0f - array[0]) * 0.5f + 0.0135f, 0f), 0.0155f, onTop); ((TMP_Text)holoWidget.Label).margin = new Vector4(0.026f, 0f, 0.006f, 0f); _rowButtons[i] = holoWidget; HoloWidget holoWidget2 = CreateButton("Fav" + i, new Vector2(array2[1], num), new Vector2(array[1], 0.024f), HoloTheme.Button, string.Empty, 0.0125f, (TextAlignmentOptions)514, onTop, delegate { ToggleFavorite(index); }); AttachIcon(holoWidget2, Vector2.zero, 0.015f, onTop); _rowFavButtons[i] = holoWidget2; } } private void BuildFooter(bool onTop) { //IL_002c: 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_003e: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[5] { 0.036f, 0.07f, 0.036f, 0.08f, 0.08f }; float[] array2 = LayoutRow(array, 0.006f); CreateButton("Prev", new Vector2(array2[0], -0.124f), new Vector2(array[0], 0.021f), HoloTheme.Button, "<", 0.0095f, (TextAlignmentOptions)514, onTop, delegate { ChangePage(-1); }); _pageWidget = CreateButton("Page", new Vector2(array2[1], -0.124f), new Vector2(array[1], 0.021f), HoloTheme.RowEmpty, "1/1", 0.0095f, (TextAlignmentOptions)514, onTop, null); CreateButton("Next", new Vector2(array2[2], -0.124f), new Vector2(array[2], 0.021f), HoloTheme.Button, ">", 0.0095f, (TextAlignmentOptions)514, onTop, delegate { ChangePage(1); }); CreateButton("Undo", new Vector2(array2[3], -0.124f), new Vector2(array[3], 0.021f), HoloTheme.Button, "UNDO", 0.0095f, (TextAlignmentOptions)514, onTop, delegate { SpawnService.UndoLast(); Refresh(); }); CreateButton("Clear", new Vector2(array2[4], -0.124f), new Vector2(array[4], 0.021f), HoloTheme.Danger, "CLEAR", 0.0095f, (TextAlignmentOptions)514, onTop, delegate { SpawnService.ClearAll(); Refresh(); }); _statusWidget = CreateLabelOnly("Status", new Vector2(0f, -0.145f), new Vector2(0.32f, 0.016f), 0.009f, (TextAlignmentOptions)514, HoloTheme.TextDim, onTop); } private void BuildEffects(bool onTop) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { _ripples.Add(NewEffect("Ripple" + i, HoloTheme.ButtonActive, onTop, -0.0112f, 4006, PlateStyle.Chip)); } for (int j = 0; j < 3; j++) { _shocks.Add(NewEffect("Shock" + j, HoloTheme.ButtonHover, onTop, -0.010799999f, 4005, PlateStyle.Glow)); } for (int k = 0; k < 16; k++) { _shards.Add(NewEffect("Shard" + k, HoloTheme.Shard, onTop, -0.0116f, 4007, PlateStyle.Solid)); } } private Effect NewEffect(string name, Color color, bool onTop, float depth, int queue, PlateStyle style) { //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_000c: Unknown result type (might be due to invalid IL or missing references) HoloWidget holoWidget = CreatePlate(name, Vector2.zero, Vector2.one, color, onTop, depth, queue, style); holoWidget.Decorative = true; holoWidget.SetActive(active: false); return new Effect { Widget = holoWidget }; } private static float[] Uniform(int count, float width) { float[] array = new float[count]; for (int i = 0; i < count; i++) { array[i] = width; } return array; } private static float[] LayoutRow(float[] widths, float gap) { float num = gap * (float)(widths.Length - 1); for (int i = 0; i < widths.Length; i++) { num += widths[i]; } float[] array = new float[widths.Length]; float num2 = (0f - num) * 0.5f; for (int j = 0; j < widths.Length; j++) { array[j] = num2 + widths[j] * 0.5f; num2 += widths[j] + gap; } return array; } private HoloWidget CreatePlate(string name, Vector2 center, Vector2 size, Color color, bool onTop, float depth, int queue, PlateStyle style) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(Root.transform, false); val.transform.localPosition = new Vector3(center.x, center.y, depth); val.transform.localRotation = Quaternion.identity; GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val2).name = "Plate"; val2.transform.SetParent(val.transform, false); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = new Vector3(size.x, size.y, 1f); Collider component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Renderer component2 = val2.GetComponent(); Material val3 = HoloTheme.CreateMaterial(color, onTop, HoloTextures.Plate(size, style)); val3.renderQueue = queue; component2.material = val3; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; HoloWidget holoWidget = new HoloWidget { Root = val, Quad = val2, Renderer = component2, Material = val3, Center = center, Size = size, Depth = depth, BaseColor = color, Enabled = false }; _widgets.Add(holoWidget); return holoWidget; } private void AttachIcon(HoloWidget widget, Vector2 offset, float size, bool onTop) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val).name = "Icon"; val.transform.SetParent(widget.Root.transform, false); val.transform.localPosition = new Vector3(offset.x, offset.y, -0.0018f); val.transform.localRotation = Quaternion.identity; val.transform.localScale = new Vector3(size, size, 1f); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } Renderer component2 = val.GetComponent(); Material val2 = HoloTheme.CreateMaterial(HoloTheme.TextDim, onTop, null); val2.renderQueue = 4009; component2.material = val2; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; widget.IconObject = val; widget.IconRenderer = component2; widget.IconMaterial = val2; val.SetActive(false); } private TextMeshPro CreateText(Transform parent, string name, Vector2 size, float worldHeight, TextAlignmentOptions alignment, Color color, bool onTop) { //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_0040: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); TextMeshPro val2 = val.AddComponent(); ((TMP_Text)val2).font = HoloTheme.Font; HoloTheme.Calibrate((TMP_Text)(object)val2); RectTransform rectTransform = ((TMP_Text)val2).rectTransform; ((Transform)rectTransform).localPosition = new Vector3(0f, 0f, -0.0026f); ((Transform)rectTransform).localRotation = Quaternion.identity; ((Transform)rectTransform).localScale = Vector3.one; rectTransform.sizeDelta = size; ((TMP_Text)val2).fontSize = HoloTheme.FontSizeFor(worldHeight); ((Graphic)val2).color = color; ((TMP_Text)val2).alignment = alignment; ((TMP_Text)val2).enableWordWrapping = false; ((TMP_Text)val2).overflowMode = (TextOverflowModes)1; ((TMP_Text)val2).richText = false; ((TMP_Text)val2).margin = new Vector4(0.006f, 0f, 0.006f, 0f); ((TMP_Text)val2).text = string.Empty; if (onTop) { ApplyTextOnTop(val2); } return val2; } private void ApplyTextOnTop(TextMeshPro text) { try { Material fontMaterial = ((TMP_Text)text).fontMaterial; if (!((Object)(object)fontMaterial == (Object)null)) { _textMaterials.Add(fontMaterial); if (fontMaterial.HasProperty("_ZTestMode")) { fontMaterial.SetFloat("_ZTestMode", 8f); } if (fontMaterial.HasProperty("_ZTest")) { fontMaterial.SetFloat("_ZTest", 8f); } fontMaterial.renderQueue = 4012; } } catch { } } private HoloWidget CreateLabelOnly(string name, Vector2 center, Vector2 size, float worldHeight, TextAlignmentOptions alignment, Color color, bool onTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0054: 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_006a: 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_0072: 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_008f: 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) GameObject val = new GameObject(name); val.transform.SetParent(Root.transform, false); val.transform.localPosition = new Vector3(center.x, center.y, -0.0055f); HoloWidget holoWidget = new HoloWidget { Root = val, Center = center, Size = size, Depth = -0.0055f, BaseColor = Color.clear, TextColor = color, Enabled = false }; holoWidget.Label = CreateText(val.transform, "Label", size, worldHeight, alignment, color, onTop); _widgets.Add(holoWidget); return holoWidget; } private HoloWidget CreateButton(string name, Vector2 center, Vector2 size, Color color, string label, float worldHeight, TextAlignmentOptions alignment, bool onTop, Action onPress) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) HoloWidget holoWidget = CreatePlate(name, center, size, color, onTop, -0.0055f, 4003, PlateStyle.Chip); holoWidget.Enabled = onPress != null; holoWidget.OnPress = onPress; holoWidget.Label = CreateText(holoWidget.Root.transform, "Label", size, worldHeight, alignment, HoloTheme.TextPrimary, onTop); ((TMP_Text)holoWidget.Label).text = label ?? string.Empty; return holoWidget; } private void SelectTab(int index) { _transitionDir = ((index > Array.IndexOf(Tabs, _category)) ? 1 : (-1)); _category = Tabs[index]; _subIndex = 0; _page = 0; _burst = 1f; Refresh(); } private void SelectSubTab(int index) { SubCategory[] subCategories = SpawnCatalog.GetSubCategories(_category); if (index < subCategories.Length) { _transitionDir = ((index >= _subIndex) ? 1 : (-1)); _subIndex = index; _page = 0; Refresh(); } } private void ChangePage(int delta) { int pageCount = PageCount; _transitionDir = ((delta >= 0) ? 1 : (-1)); _page = ((_page + delta) % pageCount + pageCount) % pageCount; Refresh(); } private void SpawnRow(int row) { CatalogEntry catalogEntry = EntryAt(row); if (catalogEntry != null) { SpawnService.Spawn(catalogEntry.Barcode, catalogEntry.Title); _burst = 1f; EmitShards(_rowButtons[row]); } } private void ToggleFavorite(int row) { CatalogEntry catalogEntry = EntryAt(row); if (catalogEntry != null) { SpawnCatalog.ToggleFavorite(catalogEntry.Barcode); SetStatus((catalogEntry.IsFavorite ? "Favorited: " : "Unfavorited: ") + catalogEntry.Title); Refresh(); } } private CatalogEntry EntryAt(int row) { int num = _page * 7 + row; if (num < 0 || num >= _visible.Count) { return null; } return _visible[num]; } private static IconKind IconFor(Category category) { return category switch { Category.Guns => IconKind.Crosshair, Category.Melee => IconKind.Blade, Category.NPCs => IconKind.Figure, Category.Props => IconKind.Cube, _ => IconKind.Grid, }; } public void Refresh() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) if (!Exists) { return; } _visible = SpawnCatalog.Get(_category, _subIndex); int pageCount = PageCount; _page = Mathf.Clamp(_page, 0, pageCount - 1); float num = 0.075f * (float)_transitionDir; for (int i = 0; i < Tabs.Length; i++) { bool flag = Tabs[i] == _category; _tabButtons[i].SetBaseColor(flag ? HoloTheme.TabActive : HoloTheme.Button); _tabButtons[i].SetTextColor(flag ? HoloTheme.TextBright : HoloTheme.TextDim); } SubCategory[] subCategories = SpawnCatalog.GetSubCategories(_category); for (int j = 0; j < 6; j++) { HoloWidget holoWidget = _subTabButtons[j]; bool flag2 = j < subCategories.Length; holoWidget.SetActive(flag2); holoWidget.Enabled = flag2; if (flag2) { holoWidget.SetText(subCategories[j].Label); holoWidget.SetBaseColor((j == _subIndex) ? HoloTheme.SubTabActive : HoloTheme.SubTab); holoWidget.SetTextColor((j == _subIndex) ? HoloTheme.TextBright : HoloTheme.TextDim); holoWidget.PlayIntro(new Vector2(0f, 0.02f), 0f, (float)j * 0.018f); } } for (int k = 0; k < 7; k++) { CatalogEntry catalogEntry = EntryAt(k); HoloWidget holoWidget2 = _rowButtons[k]; HoloWidget holoWidget3 = _rowFavButtons[k]; HoloWidget holoWidget4 = _rowStripes[k]; float num2 = (float)k * 0.032f; holoWidget2.PlayIntro(new Vector2(num, 0f), -6f * (float)_transitionDir, num2); if (catalogEntry == null) { holoWidget2.SetText(string.Empty); holoWidget2.Enabled = false; holoWidget2.SetBaseColor(HoloTheme.RowEmpty); holoWidget2.SetIcon(null); holoWidget2.ResetDock(); holoWidget3.SetActive(active: false); holoWidget3.Enabled = false; holoWidget3.ResetDock(); holoWidget4.SetActive(active: false); } else { holoWidget2.SetText(catalogEntry.Title); holoWidget2.Enabled = true; holoWidget2.SetBaseColor(catalogEntry.Modded ? HoloTheme.RowModded : HoloTheme.Button); holoWidget2.SetTextColor(HoloTheme.TextPrimary); holoWidget2.SetIcon(HoloTextures.Icon(IconFor(catalogEntry.Category))); holoWidget4.SetActive(k % 2 == 0); holoWidget3.SetActive(active: true); holoWidget3.Enabled = true; holoWidget3.PlayIntro(new Vector2(num, 0f), 0f, num2 + 0.012f); holoWidget3.SetBaseColor(catalogEntry.IsFavorite ? HoloTheme.FavOn : HoloTheme.Button); holoWidget3.SetTextColor(catalogEntry.IsFavorite ? HoloTheme.TextBright : HoloTheme.TextDim); holoWidget3.SetIcon(HoloTextures.Icon(catalogEntry.IsFavorite ? IconKind.Star : IconKind.Plus)); } } string text = ((_subIndex > 0 && _subIndex < subCategories.Length) ? (" " + subCategories[_subIndex].Label) : string.Empty); _titleWidget.SetText(TabLabels[Array.IndexOf(Tabs, _category)] + text + " " + _visible.Count); _titleWidget.PlayIntro(new Vector2(0f, 0.012f), 0f, 0f); _pageWidget.SetText(_page + 1 + "/" + pageCount); } public void SetStatus(string message) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) _status = message; _statusExpiry = Time.time + 4f; _restingCount = -1; if (_statusWidget != null) { _statusWidget.SetText(message); _statusWidget.PlayIntro(new Vector2(0f, -0.01f), 0f, 0f); _statusWidget.Flash(); } } private void TickStatus() { if (_statusWidget != null && !(Time.time < _statusExpiry)) { int trackedCount = SpawnService.TrackedCount; if (trackedCount != _restingCount) { _restingCount = trackedCount; _status = ((trackedCount > 0) ? (trackedCount + " SPAWNED") : "WRIST SPAWNER"); _statusWidget.SetText(_status); } } } public void SetPointer(Vector3 worldPoint, bool valid) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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) _pointerValid = valid && Exists && Root.activeSelf; if (_pointerValid) { Vector3 val = Root.transform.InverseTransformPoint(worldPoint); _pointerY = val.y; } } private void TickDock(float alpha) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Vector2 dockOffsetTarget = default(Vector2); for (int i = 0; i < 7; i++) { HoloWidget holoWidget = _rowButtons[i]; HoloWidget holoWidget2 = _rowFavButtons[i]; if (!_pointerValid || !holoWidget.Enabled) { holoWidget.ResetDock(); holoWidget2.ResetDock(); continue; } float num = 0.052f - (float)i * 0.0255f; float num2 = (num - _pointerY) / 0.03f; float num3 = Mathf.Exp((0f - num2) * num2); float dockScaleTarget = 1f + 0.17f * num3; ((Vector2)(ref dockOffsetTarget))..ctor(0f, 0.55f * (num - _pointerY) * num3); holoWidget.DockScaleTarget = dockScaleTarget; holoWidget.DockOffsetTarget = dockOffsetTarget; holoWidget2.DockScaleTarget = dockScaleTarget; holoWidget2.DockOffsetTarget = dockOffsetTarget; } } public void Tick(float dt) { if (!Exists) { return; } _clock += dt; _showAnim = Mathf.MoveTowards(_showAnim, _showTarget ? 1f : 0f, dt * 4.5f); _burst = Mathf.MoveTowards(_burst, 0f, dt * 2.2f); if (_showAnim <= 0f) { if (Root.activeSelf) { Root.SetActive(false); } return; } if (!Root.activeSelf) { Root.SetActive(true); } TickStatus(); TickRoot(); float num = Ease.OutCubic(_showAnim); TickDock(num); for (int i = 0; i < _widgets.Count; i++) { if (!_widgets[i].Decorative) { _widgets[i].Tick(dt, num); } } TickFrame(num); TickCorners(num); TickStripes(num); TickScanline(dt, num); TickSelection(dt, num); TickRipples(dt, num); TickShocks(dt, num); TickShards(dt, num); } private void TickRoot() { //IL_006d: 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_007d: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) float num = Ease.OutElastic(_showAnim); float num2 = Mathf.Sin(_clock * 1.4f) * 0.0018f; float num3 = 1f + Mathf.Sin(_clock * 2.1f) * 0.005f; float num4 = Mathf.Max(0.1f, Prefs.PanelScale) * (0.55f + 0.45f * num) * num3; Root.transform.localScale = Vector3.one * num4; Vector3 offset = Prefs.Offset; offset.y += num2; Root.transform.localPosition = offset; float num5 = (1f - Ease.OutQuint(_showAnim)) * 38f; Root.transform.localRotation = Quaternion.Euler(Prefs.RotationEuler) * Quaternion.Euler(0f, num5, 0f); } private void TickFrame(float alpha) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0060: 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_0071: Unknown result type (might be due to invalid IL or missing references) float num = 0.62f + 0.38f * (0.5f + 0.5f * Mathf.Sin(_clock * 2.6f)); Color frame = HoloTheme.Frame; frame.a *= alpha * Mathf.Lerp(num, 1f, _burst); frame = Color.Lerp(frame, HoloTheme.ButtonActive, _burst * 0.5f); HoloTheme.Tint(_frame.Material, frame); } private void TickCorners(float alpha) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _corners.Length; i++) { HoloWidget holoWidget = _corners[i]; if (holoWidget != null) { float num = _clock * 2.2f + (float)i * 0.6f; float num2 = 0.55f + 0.45f * (0.5f + 0.5f * Mathf.Sin(num)); float num3 = 1f + 0.28f * _burst; holoWidget.Root.transform.localScale = new Vector3(num3, num3, 1f); holoWidget.Root.transform.localRotation = Quaternion.Euler(0f, 0f, CornerAngles[i]); Color color = Color.Lerp(HoloTheme.Frame, HoloTheme.ButtonActive, _burst); color.a *= alpha * num2; HoloTheme.Tint(holoWidget.Material, color); } } } private void TickStripes(float alpha) { //IL_003b: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 7; i++) { HoloWidget holoWidget = _rowStripes[i]; if (holoWidget != null && holoWidget.Active) { HoloWidget holoWidget2 = _rowButtons[i]; holoWidget.Root.transform.localPosition = new Vector3(holoWidget.Center.x + holoWidget2.LiveCenter.x - holoWidget2.Center.x, holoWidget2.LiveCenter.y, holoWidget.Depth); Color stripe = HoloTheme.Stripe; stripe.a *= alpha; HoloTheme.Tint(holoWidget.Material, stripe); } } } private void TickScanline(float dt, float alpha) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) _sweep += dt * 0.28f; if (_sweep > 1.4f) { _sweep = 0f; } float num = Mathf.Clamp01(_sweep); float num2 = Mathf.Lerp(0.15f, -0.15f, num); float num3 = Mathf.Sin(num * (float)Math.PI); Transform transform = _scanline.Root.transform; transform.localPosition = new Vector3(0f, num2, _scanline.Depth); transform.localScale = new Vector3(1f, 1f + _burst * 1.5f, 1f); Color scanline = HoloTheme.Scanline; scanline.a *= alpha * num3 * ((_sweep <= 1f) ? 1f : 0f); HoloTheme.Tint(_scanline.Material, scanline); } private void TickSelection(float dt, float alpha) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_018f: Unknown result type (might be due to invalid IL or missing references) bool flag = _hovered != null && _hovered.Enabled; if (flag) { float num = 1f - Mathf.Exp(-20f * dt); _selPos = Vector2.Lerp(_selPos, _hovered.LiveCenter, num); _selSize = Vector2.Lerp(_selSize, _hovered.LiveSize + new Vector2(0.01f, 0.01f), num); } _selAlpha = Mathf.MoveTowards(_selAlpha, flag ? 1f : 0f, dt * 6f); if (_selAlpha <= 0f) { _selection.SetActive(active: false); return; } _selection.SetActive(active: true); Transform transform = _selection.Root.transform; transform.localPosition = new Vector3(_selPos.x, _selPos.y, _selection.Depth); transform.localScale = new Vector3(_selSize.x / _selection.Size.x, _selSize.y / _selection.Size.y, 1f); float num2 = 0.72f + 0.28f * Mathf.Sin(_clock * 9f); Color selection = HoloTheme.Selection; selection.a *= alpha * _selAlpha * num2; HoloTheme.Tint(_selection.Material, selection); } private void TickRipples(float dt, float alpha) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _ripples.Count; i++) { Effect effect = _ripples[i]; if (!(effect.Life <= 0f)) { effect.Life = Mathf.Max(0f, effect.Life - dt * 2.2f); if (effect.Life <= 0f) { effect.Widget.SetActive(active: false); continue; } float num = 1f - effect.Life; float num2 = 1f + Ease.OutQuint(num) * 1.8f; Transform transform = effect.Widget.Root.transform; transform.localPosition = new Vector3(effect.Origin.x, effect.Origin.y, effect.Widget.Depth); transform.localScale = new Vector3(effect.Size.x * num2, effect.Size.y * num2, 1f); transform.localRotation = Quaternion.Euler(0f, 0f, num * 14f); Color buttonActive = HoloTheme.ButtonActive; buttonActive.a *= effect.Life * effect.Life * alpha * 0.9f; HoloTheme.Tint(effect.Widget.Material, buttonActive); } } } private void TickShocks(float dt, float alpha) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _shocks.Count; i++) { Effect effect = _shocks[i]; if (!(effect.Life <= 0f)) { effect.Life = Mathf.Max(0f, effect.Life - dt * 3.2f); if (effect.Life <= 0f) { effect.Widget.SetActive(active: false); continue; } float num = 1f - effect.Life; float num2 = Mathf.Lerp(effect.Size.x, 0.3468f, Ease.OutQuint(num)); float num3 = Mathf.Lerp(effect.Size.y * 0.9f, 0.0015f, num); Transform transform = effect.Widget.Root.transform; transform.localPosition = new Vector3(0f, effect.Origin.y, effect.Widget.Depth); transform.localScale = new Vector3(num2, num3, 1f); Color buttonHover = HoloTheme.ButtonHover; buttonHover.a *= effect.Life * alpha * 0.9f; HoloTheme.Tint(effect.Widget.Material, buttonHover); } } } private void TickShards(float dt, float alpha) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _shards.Count; i++) { Effect effect = _shards[i]; if (!(effect.Life <= 0f)) { effect.Life = Mathf.Max(0f, effect.Life - dt * 2f); if (effect.Life <= 0f) { effect.Widget.SetActive(active: false); continue; } float num = 1f - effect.Life; effect.Angle += effect.Spin * dt; Vector2 val = effect.Origin + effect.Velocity * Ease.OutQuint(num); float num2 = Mathf.Lerp(1f, 0.15f, num); Transform transform = effect.Widget.Root.transform; transform.localPosition = new Vector3(val.x, val.y, effect.Widget.Depth); transform.localScale = new Vector3(effect.Size.x * num2, effect.Size.y * num2, 1f); transform.localRotation = Quaternion.Euler(0f, 0f, effect.Angle); Color shard = HoloTheme.Shard; shard.a *= effect.Life * alpha; HoloTheme.Tint(effect.Widget.Material, shard); } } } private void SpawnRipple(HoloWidget source) { //IL_001d: 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_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) Effect effect = Take(_ripples); if (effect != null) { effect.Life = 1f; effect.Origin = source.LiveCenter; effect.Size = source.LiveSize; effect.Widget.SetActive(active: true); } } private void SpawnShock(HoloWidget source) { //IL_001d: 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_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) Effect effect = Take(_shocks); if (effect != null) { effect.Life = 1f; effect.Origin = source.LiveCenter; effect.Size = source.LiveSize; effect.Widget.SetActive(active: true); } } private void EmitShards(HoloWidget source) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 6; i++) { Effect effect = Take(_shards); if (effect == null) { break; } float num = Random.Range(0f, (float)Math.PI * 2f); float num2 = Random.Range(0.035f, 0.085f); effect.Life = 1f; effect.Origin = source.LiveCenter; effect.Size = new Vector2(Random.Range(0.004f, 0.01f), Random.Range(0.002f, 0.005f)); effect.Velocity = new Vector2(Mathf.Cos(num), Mathf.Sin(num)) * num2; effect.Spin = Random.Range(-360f, 360f); effect.Angle = Random.Range(0f, 360f); effect.Widget.SetActive(active: true); } } private static Effect Take(List pool) { for (int i = 0; i < pool.Count; i++) { if (pool[i].Life <= 0f) { return pool[i]; } } return null; } public HoloWidget HitTest(Vector3 worldPoint, out float depth) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) depth = float.MaxValue; if (!Exists || !Root.activeSelf) { return null; } Vector3 val = Root.transform.InverseTransformPoint(worldPoint); depth = Mathf.Abs(val.z) * Root.transform.lossyScale.z; Vector2 localPoint = default(Vector2); ((Vector2)(ref localPoint))..ctor(val.x, val.y); for (int i = 0; i < _widgets.Count; i++) { if (_widgets[i].Contains(localPoint)) { return _widgets[i]; } } return null; } public HoloWidget RayTest(Vector3 origin, Vector3 direction, out Vector3 hitPoint, out bool onPanel) { //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_0033: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_005b: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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) hitPoint = Vector3.zero; onPanel = false; if (!Exists || !Root.activeSelf) { return null; } Transform transform = Root.transform; Vector3 val = -transform.forward; float num = Vector3.Dot(direction, val); if (Mathf.Abs(num) < 1E-05f) { return null; } float num2 = Vector3.Dot(transform.position - origin, val) / num; if (num2 <= 0.02f || num2 > 6f) { return null; } hitPoint = origin + direction * num2; Vector3 val2 = transform.InverseTransformPoint(hitPoint); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(val2.x, val2.y); if (Mathf.Abs(val3.x) > 0.1904f || Mathf.Abs(val3.y) > 0.16800001f) { return null; } onPanel = true; for (int i = 0; i < _widgets.Count; i++) { if (_widgets[i].Contains(val3)) { return _widgets[i]; } } return null; } public void ClearHover() { _hovered = null; for (int i = 0; i < _widgets.Count; i++) { _widgets[i].SetHovered(hovered: false); } } public void SetHover(HoloWidget hovered) { //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) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (_hovered == null && hovered != null) { _selPos = hovered.LiveCenter; _selSize = hovered.LiveSize; } _hovered = hovered; for (int i = 0; i < _widgets.Count; i++) { _widgets[i].SetHovered(_widgets[i] == hovered); } } public void Press(HoloWidget widget) { if (widget != null && widget.Enabled && widget.OnPress != null) { widget.Punch(); SpawnRipple(widget); SpawnShock(widget); widget.OnPress(); } } public void ApplyTransform() { //IL_0014: 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_0043: 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) if (Exists) { Root.transform.localPosition = Prefs.Offset; Root.transform.localRotation = Quaternion.Euler(Prefs.RotationEuler); Root.transform.localScale = Vector3.one * Mathf.Max(0.1f, Prefs.PanelScale); } } public void SetVisible(bool visible) { if (visible && !_showTarget && _showAnim <= 0f) { ReplayIntro(); } _showTarget = visible; } private void ReplayIntro() { //IL_002c: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) _sweep = 0f; _burst = 1f; for (int i = 0; i < 7; i++) { _rowButtons[i].PlayIntro(new Vector2(0.07f, 0f), -6f, (float)i * 0.032f); _rowFavButtons[i].PlayIntro(new Vector2(0.07f, 0f), 0f, (float)i * 0.032f + 0.012f); } for (int j = 0; j < Tabs.Length; j++) { _tabButtons[j].PlayIntro(new Vector2(0f, 0.025f), 0f, (float)j * 0.02f); } for (int k = 0; k < 6; k++) { _subTabButtons[k].PlayIntro(new Vector2(0f, 0.02f), 0f, (float)k * 0.018f); } } public void Destroy() { for (int i = 0; i < _widgets.Count; i++) { _widgets[i].DestroyMaterial(); } for (int j = 0; j < _textMaterials.Count; j++) { if ((Object)(object)_textMaterials[j] != (Object)null) { Object.Destroy((Object)(object)_textMaterials[j]); } } _textMaterials.Clear(); if ((Object)(object)Root != (Object)null) { Object.Destroy((Object)(object)Root); } Root = null; _widgets.Clear(); _ripples.Clear(); _shocks.Clear(); _shards.Clear(); Array.Clear(_rowButtons, 0, _rowButtons.Length); Array.Clear(_rowFavButtons, 0, _rowFavButtons.Length); Array.Clear(_rowStripes, 0, _rowStripes.Length); Array.Clear(_tabButtons, 0, _tabButtons.Length); Array.Clear(_subTabButtons, 0, _subTabButtons.Length); Array.Clear(_corners, 0, _corners.Length); _frame = null; _scanline = null; _selection = null; _titleWidget = null; _pageWidget = null; _statusWidget = null; _hovered = null; _visible = new List(); } } 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 sealed class HoloWidget { public GameObject Root; public GameObject Quad; public Renderer Renderer; public Material Material; public TextMeshPro Label; public GameObject IconObject; public Renderer IconRenderer; public Material IconMaterial; public Vector2 Center; public Vector2 Size; public float Depth; public Color BaseColor; public Color TextColor = HoloTheme.TextPrimary; public Action OnPress; public bool Enabled = true; public bool Decorative; public float DockScaleTarget = 1f; public Vector2 DockOffsetTarget; private const float HoverSpeed = 10f; private const float PressSpeed = 3.4f; private const float IntroSpeed = 2.6f; private const float DockSpeed = 16f; private bool _hoverTarget; private float _hover; private float _press; private float _intro = 1f; private float _introDelay; private Vector2 _introOffset; private float _introSpin; private float _flash; private float _dockScale = 1f; private Vector2 _dockOffset; public Vector2 LiveCenter => Center + _dockOffset; public Vector2 LiveSize => Size * _dockScale; public bool Active { get { if ((Object)(object)Root != (Object)null) { return Root.activeSelf; } return false; } } public bool Contains(Vector2 localPoint) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!Enabled || (Object)(object)Root == (Object)null || !Root.activeSelf) { return false; } Vector2 liveCenter = LiveCenter; Vector2 liveSize = LiveSize; if (Mathf.Abs(localPoint.x - liveCenter.x) <= liveSize.x * 0.5f) { return Mathf.Abs(localPoint.y - liveCenter.y) <= liveSize.y * 0.5f; } return false; } public void SetHovered(bool hovered) { _hoverTarget = hovered; } public void Punch() { _press = 1f; _flash = 1f; } public void Flash() { _flash = 1f; } public void PlayIntro(Vector2 offset, float spin, float delay) { //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) _intro = 0f; _introDelay = delay; _introOffset = offset; _introSpin = spin; } public void ResetDock() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) DockScaleTarget = 1f; DockOffsetTarget = Vector2.zero; } public void SetBaseColor(Color color) { //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) BaseColor = color; } public void SetText(string text) { if ((Object)(object)Label != (Object)null) { ((TMP_Text)Label).text = text ?? string.Empty; } } public void SetTextColor(Color color) { //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) TextColor = color; } public void SetIcon(Texture2D texture) { if (!((Object)(object)IconObject == (Object)null)) { bool flag = (Object)(object)texture != (Object)null; if (IconObject.activeSelf != flag) { IconObject.SetActive(flag); } if (flag) { HoloTheme.SetTexture(IconMaterial, texture); } } } public void SetActive(bool active) { if ((Object)(object)Root != (Object)null && Root.activeSelf != active) { Root.SetActive(active); } } public void Tick(float dt, float panelAlpha) { //IL_003c: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Root == (Object)null)) { float num = 1f - Mathf.Exp(-16f * dt); _dockScale = Mathf.Lerp(_dockScale, DockScaleTarget, num); _dockOffset = Vector2.Lerp(_dockOffset, DockOffsetTarget, num); _hover = Mathf.MoveTowards(_hover, _hoverTarget ? 1f : 0f, dt * 10f); _press = Mathf.MoveTowards(_press, 0f, dt * 3.4f); _flash = Mathf.MoveTowards(_flash, 0f, dt * 5f); if (_introDelay > 0f) { _introDelay -= dt; } else { _intro = Mathf.MoveTowards(_intro, 1f, dt * 2.6f); } float num2 = Ease.OutBack(_intro); float num3 = Mathf.Clamp01(_intro * 2f); float num4 = 0.3f * _press * Mathf.Cos(_press * 7.2f); float num5 = (0.82f + 0.18f * num2) * _dockScale * (1f + _hover * 0.04f + num4); Vector2 val = _introOffset * (1f - num2) + _dockOffset; Root.transform.localScale = new Vector3(num5, num5, 1f); Root.transform.localPosition = new Vector3(Center.x + val.x, Center.y + val.y, Depth - _hover * 0.0028f - _press * 0.0032f - (_dockScale - 1f) * 0.02f); Root.transform.localRotation = Quaternion.Euler(0f, 0f, _introSpin * (1f - num2)); float num6 = panelAlpha * num3; Color val2 = Color.Lerp(BaseColor, HoloTheme.ButtonHover, _hover); val2 = Color.Lerp(val2, HoloTheme.ButtonActive, Mathf.Max(_press, _flash)); val2.a *= num6; HoloTheme.Tint(Material, val2); if ((Object)(object)Label != (Object)null) { Color color = Color.Lerp(TextColor, HoloTheme.TextBright, Mathf.Max(_hover * 0.7f, _flash)); color.a *= num6; ((Graphic)Label).color = color; } if ((Object)(object)IconMaterial != (Object)null) { Color color2 = Color.Lerp(TextColor, HoloTheme.TextBright, Mathf.Max(_hover, _flash)); color2.a *= num6; HoloTheme.Tint(IconMaterial, color2); } } } public void DestroyMaterial() { if ((Object)(object)Material != (Object)null) { Object.Destroy((Object)(object)Material); } if ((Object)(object)IconMaterial != (Object)null) { Object.Destroy((Object)(object)IconMaterial); } } } 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 WristSpawner.Spawning { internal static class SpawnService { private sealed class Tracked { public GameObject Object; public ushort NetworkId; } private static readonly List Spawned = new List(); private static readonly Action LocalSpawnCallback = OnLocalSpawned; private static readonly Action NetworkSpawnCallback = Track; public static int TrackedCount { get { Prune(); return Spawned.Count; } } public static event Action OnStatus; public static void Spawn(string barcode, string displayName) { //IL_0018: 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) if (!GetSpawnPoint(out var position, out var rotation)) { Report("No player rig"); } else { SpawnAt(barcode, displayName, position, rotation); } } public static void SpawnAt(string barcode, string displayName, Vector3 position, Quaternion rotation) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(barcode)) { bool num = FusionSupport.TrySpawn(barcode, position, rotation, NetworkSpawnCallback); if (!num) { HelperMethods.SpawnCrate(barcode, position, rotation, Vector3.one, false, LocalSpawnCallback, (Action)null); } Report((num ? "Synced: " : "Spawned: ") + displayName); } } private static void OnLocalSpawned(GameObject go) { Track(go, 0); } private static void Track(GameObject go, ushort networkId) { if (IsDead((Object)(object)go)) { Melon.Logger.Warning("Spawn callback delivered no object; nothing to track."); return; } Spawned.Add(new Tracked { Object = go, NetworkId = networkId }); Melon.Logger.Msg($"Tracking '{((Object)go).name}' (net {networkId}); {Spawned.Count} tracked."); } private static bool GetSpawnPoint(out Vector3 position, out Quaternion rotation) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_009b: 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) position = Vector3.zero; rotation = Quaternion.identity; Transform head = Player.Head; if ((Object)(object)head == (Object)null) { return false; } float num = Mathf.Max(Prefs.SpawnDistance, 0.55f); Vector3 forward = head.forward; Vector3 val = head.position + forward * 0.45f; float num2 = num - 0.45f; RaycastHit val2 = default(RaycastHit); position = (Physics.Raycast(val, forward, ref val2, num2, -1, (QueryTriggerInteraction)1) ? (((RaycastHit)(ref val2)).point + Vector3.up * 0.15f) : (val + forward * num2)); rotation = FacePlayer(forward); return true; } public static Quaternion FacePlayer(Vector3 forward) { //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_0006: 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_0033: 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) Vector3 val = -forward; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude > 0.001f)) { return Quaternion.identity; } return Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); } public static void UndoLast() { Prune(); if (Spawned.Count == 0) { Report("Nothing to undo"); return; } int index = Spawned.Count - 1; bool num = Despawn(Spawned[index]); Spawned.RemoveAt(index); Report(num ? "Removed last spawn" : "Could not remove last spawn"); } public static void ClearAll() { Prune(); int count = Spawned.Count; if (count == 0) { Melon.Logger.Msg("Clear requested but nothing is tracked."); Report("Nothing to clear"); return; } int num = 0; for (int i = 0; i < Spawned.Count; i++) { if (Despawn(Spawned[i])) { num++; } } Spawned.Clear(); Melon.Logger.Msg($"Cleared {num} of {count} tracked objects."); Report((num == count) ? $"Cleared {num}" : $"Cleared {num} of {count}"); } private static bool Despawn(Tracked tracked) { if (FusionSupport.TryDespawn(tracked.NetworkId)) { return true; } GameObject val = tracked.Object; if (IsDead((Object)(object)val)) { return false; } try { Poolee component = val.GetComponent(); if (!IsDead((Object)(object)component)) { component.Despawn(); return true; } } catch (Exception ex) { Melon.Logger.Warning("Poolee despawn failed, destroying instead: " + ex.Message); } try { val.SetActive(false); Object.Destroy((Object)(object)val); return true; } catch (Exception ex2) { Melon.Logger.Warning("Destroy failed: " + ex2.Message); return false; } } private static bool IsDead(Object target) { if (target == null) { return true; } try { return target == (Object)null; } catch { return true; } } private static void Prune() { for (int num = Spawned.Count - 1; num >= 0; num--) { if (IsDead((Object)(object)Spawned[num].Object)) { Spawned.RemoveAt(num); } } } public static void Reset() { Spawned.Clear(); } private static void Report(string message) { SpawnService.OnStatus?.Invoke(message); } } } namespace WristSpawner.Menu { internal static class MenuPage { private static readonly Color Accent = new Color(1f, 0.62f, 0.14f); public static void Build(HoloPanel panel, Action rebuild, Action summonOrb) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) Page root; try { root = Page.Root.CreatePage("Wrist Spawner", Accent, 0, true); } catch (Exception ex) { Melon.Logger.Error("BoneMenu root page failed: " + ex); return; } Section("orb", delegate { BuildOrbSection(root, summonOrb); }); Section("deployment", delegate { BuildDeployPage(root); }); Section("panel", delegate { BuildPanelSection(root, panel, rebuild); }); Section("laser", delegate { BuildLaserPage(root); }); Section("placement", delegate { BuildPlacementPage(root, panel); }); Section("actions", delegate { BuildActionsSection(root, panel, rebuild); }); } private static void Section(string name, Action build) { try { build(); } catch (Exception ex) { Melon.Logger.Error("BoneMenu section '" + name + "' failed: " + ex); } } private static void BuildOrbSection(Page root, Action summonOrb) { //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_004d: 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) root.CreateBool("Orb Mode", Accent, Prefs.OrbEnabled, (Action)delegate(bool value) { Prefs.SetOrbEnabled(value); Prefs.Save(); }); root.CreateFunction("Summon Orb To Me", Accent, summonOrb); root.CreateFloat("Orb Scale", Accent, Prefs.OrbScale, 0.1f, 0.3f, 3f, (Action)delegate(float value) { Prefs.SetOrbScale(value); Prefs.Save(); }); root.CreateInt("Favorite Slots", Accent, Prefs.OrbSlots, 1, 1, 20, (Action)delegate(int value) { Prefs.SetOrbSlots(value); Prefs.Save(); SpawnCatalog.Notify(); }); } private static void BuildPanelSection(Page root, HoloPanel panel, Action rebuild) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_0181: Unknown result type (might be due to invalid IL or missing references) root.CreateBool("Wrist Panel", Accent, Prefs.PanelEnabled, (Action)delegate(bool value) { Prefs.SetPanelEnabled(value); Prefs.Save(); }); root.CreateBool("Mount On Left Wrist", Accent, Prefs.LeftWrist, (Action)delegate(bool value) { Prefs.SetLeftWrist(value); Prefs.Save(); rebuild(); }); root.CreateBool("Draw Through Geometry", Accent, Prefs.AlwaysOnTop, (Action)delegate(bool value) { Prefs.SetAlwaysOnTop(value); Prefs.Save(); rebuild(); }); root.CreateBool("Only Show When Facing You", Accent, Prefs.RequireWristLook, (Action)delegate(bool value) { Prefs.SetRequireWristLook(value); Prefs.Save(); }); root.CreateFloat("Facing Sensitivity", Accent, Prefs.LookThreshold, 0.05f, -1f, 1f, (Action)delegate(float value) { Prefs.SetLookThreshold(value); Prefs.Save(); }); root.CreateFloat("Panel Scale", Accent, Prefs.PanelScale, 0.05f, 0.4f, 2.5f, (Action)delegate(float value) { Prefs.SetPanelScale(value); Prefs.Save(); panel.ApplyTransform(); }); root.CreateFloat("Spawn Distance", Accent, Prefs.SpawnDistance, 0.25f, 0.5f, 8f, (Action)delegate(float value) { Prefs.SetSpawnDistance(value); Prefs.Save(); }); root.CreateBool("Haptic Feedback", Accent, Prefs.HapticFeedback, (Action)delegate(bool value) { Prefs.SetHaptics(value); Prefs.Save(); }); } private static void BuildActionsSection(Page root, HoloPanel panel, Action rebuild) { //IL_0013: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) root.CreateBool("Hide Redacted Crates", Accent, Prefs.HideRedacted, (Action)delegate(bool value) { Prefs.SetHideRedacted(value); Prefs.Save(); SpawnCatalog.Rebuild(); panel.Refresh(); }); root.CreateFunction("Rescan Warehouse", Accent, (Action)delegate { SpawnCatalog.Rebuild(); panel.Refresh(); }); root.CreateFunction("Clear Spawned Objects", Color.red, (Action)SpawnService.ClearAll); root.CreateFunction("Rebuild Panel", Accent, rebuild); } private static void BuildLaserPage(Page root) { //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) root.CreateBool("Laser Pointer", Accent, Prefs.LaserEnabled, (Action)delegate(bool value) { Prefs.SetLaserEnabled(value); Prefs.Save(); }); Page obj = root.CreatePage("Laser Aim", Accent, 0, true); obj.CreateInt("Aim: 0 Finger 1 Palm 2 Hand", Accent, Prefs.LaserSource, 1, 0, 2, (Action)delegate(int value) { Prefs.SetLaserSource(value); Prefs.Save(); }); obj.CreateFloat("Laser Pitch", Accent, Prefs.LaserPitch, 2.5f, -80f, 80f, (Action)delegate(float value) { Prefs.SetLaserPitch(value); Prefs.Save(); }); obj.CreateFloat("Laser Yaw", Accent, Prefs.LaserYaw, 2.5f, -80f, 80f, (Action)delegate(float value) { Prefs.SetLaserYaw(value); Prefs.Save(); }); obj.CreateFunction("Reset Laser Aim", Accent, (Action)delegate { Prefs.SetLaserPitch(0f); Prefs.SetLaserYaw(0f); Prefs.Save(); }); } private static void BuildDeployPage(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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) Page obj = root.CreatePage("Deployment", Accent, 0, true); obj.CreateBool("Deployment Effect", Accent, Prefs.DeployEnabled, (Action)delegate(bool value) { Prefs.SetDeployEnabled(value); Prefs.Save(); }); obj.CreateFloat("Orbit Radius", Accent, Prefs.DeployOrbitRadius, 0.05f, 0.25f, 2f, (Action)delegate(float value) { Prefs.SetDeployOrbitRadius(value); Prefs.Save(); }); obj.CreateFloat("Deployed Size", Accent, Prefs.DeployedScale, 0.1f, 0.5f, 3f, (Action)delegate(float value) { Prefs.SetDeployedScale(value); Prefs.Save(); }); obj.CreateFloat("Orbit Drift Speed", Accent, Prefs.DeployOrbitSpin, 1f, -60f, 60f, (Action)delegate(float value) { Prefs.SetDeployOrbitSpin(value); Prefs.Save(); }); obj.CreateFloat("Double Tap Window", Accent, Prefs.DoubleTapWindow, 0.02f, 0.12f, 0.6f, (Action)delegate(float value) { Prefs.SetDoubleTapWindow(value); Prefs.Save(); }); obj.CreateFloat("Cooldown", Accent, Prefs.DeployCooldown, 0.5f, 0f, 15f, (Action)delegate(float value) { Prefs.SetDeployCooldown(value); Prefs.Save(); }); obj.CreateFloat("Duration", Accent, Prefs.DeployDuration, 0.25f, 0.75f, 6f, (Action)delegate(float value) { Prefs.SetDeployDuration(value); Prefs.Save(); }); obj.CreateFloat("Effect Intensity", Accent, Prefs.DeployIntensity, 0.1f, 0f, 2f, (Action)delegate(float value) { Prefs.SetDeployIntensity(value); Prefs.Save(); }); obj.CreateFloat("Effect Hue Shift", Accent, Prefs.DeployHue, 15f, -180f, 180f, (Action)delegate(float value) { Prefs.SetDeployHue(value); Prefs.Save(); }); BuildDeployTuning(obj); } private static void BuildDeployTuning(Page deploy) { //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_011d: 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_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_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) Page obj = deploy.CreatePage("Fine Tuning", Accent, 0, true); obj.CreateFloat("Ring Size", Accent, Prefs.DeployRingSize, 0.1f, 0.3f, 3f, (Action)delegate(float value) { Prefs.SetDeployRingSize(value); Prefs.Save(); }); obj.CreateFloat("Ring Spin Speed", Accent, Prefs.DeployRingSpin, 10f, 0f, 360f, (Action)delegate(float value) { Prefs.SetDeployRingSpin(value); Prefs.Save(); }); obj.CreateFloat("Scan Speed", Accent, Prefs.DeployScanSpeed, 0.1f, 0.3f, 3f, (Action)delegate(float value) { Prefs.SetDeployScanSpeed(value); Prefs.Save(); }); obj.CreateInt("Panel Count", Accent, Prefs.DeployPanelCount, 1, 0, 16, (Action)delegate(int value) { Prefs.SetDeployPanelCount(value); Prefs.Save(); }); obj.CreateFloat("Panel Orbit Speed", Accent, Prefs.DeployPanelOrbit, 10f, -360f, 360f, (Action)delegate(float value) { Prefs.SetDeployPanelOrbit(value); Prefs.Save(); }); obj.CreateFloat("Particle Density", Accent, Prefs.DeployParticles, 0.1f, 0f, 1f, (Action)delegate(float value) { Prefs.SetDeployParticles(value); Prefs.Save(); }); obj.CreateFloat("Orb Float Distance", Accent, Prefs.DeployOrbDistance, 0.05f, 0.05f, 1.2f, (Action)delegate(float value) { Prefs.SetDeployOrbDistance(value); Prefs.Save(); }); obj.CreateFloat("Final Burst", Accent, Prefs.DeployBurst, 0.1f, 0f, 3f, (Action)delegate(float value) { Prefs.SetDeployBurst(value); Prefs.Save(); }); obj.CreateFloat("Panel Gravity", Accent, Prefs.PanelGravity, 0.1f, 0f, 9.8f, (Action)delegate(float value) { Prefs.SetPanelGravity(value); Prefs.Save(); }); obj.CreateFloat("Panel Drag", Accent, Prefs.PanelDrag, 0.1f, 0f, 6f, (Action)delegate(float value) { Prefs.SetPanelDrag(value); Prefs.Save(); }); obj.CreateFloat("Panel Max Distance", Accent, Prefs.PanelLeash, 0.25f, 0.5f, 8f, (Action)delegate(float value) { Prefs.SetPanelLeash(value); Prefs.Save(); }); obj.CreateFloat("Panel Float", Accent, Prefs.PanelFloat, 0.25f, 0f, 10f, (Action)delegate(float value) { Prefs.SetPanelFloat(value); Prefs.Save(); }); obj.CreateFloat("Panel Return Delay", Accent, Prefs.PanelReturn, 0.5f, 0.5f, 60f, (Action)delegate(float value) { Prefs.SetPanelReturn(value); Prefs.Save(); }); } private static void BuildPlacementPage(Page root, HoloPanel panel) { //IL_0013: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) Page obj = root.CreatePage("Placement", Accent, 0, true); Vector3 offset = Prefs.Offset; Vector3 rotationEuler = Prefs.RotationEuler; obj.CreateFloat("Offset X", Accent, offset.x, 0.005f, -0.5f, 0.5f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 offset2 = Prefs.Offset; offset2.x = value; Prefs.SetOffset(offset2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFloat("Offset Y", Accent, offset.y, 0.005f, -0.5f, 0.5f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 offset2 = Prefs.Offset; offset2.y = value; Prefs.SetOffset(offset2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFloat("Offset Z", Accent, offset.z, 0.005f, -0.5f, 0.5f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 offset2 = Prefs.Offset; offset2.z = value; Prefs.SetOffset(offset2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFloat("Rotate X", Accent, rotationEuler.x, 5f, -180f, 180f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 rotationEuler2 = Prefs.RotationEuler; rotationEuler2.x = value; Prefs.SetRotation(rotationEuler2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFloat("Rotate Y", Accent, rotationEuler.y, 5f, -180f, 180f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 rotationEuler2 = Prefs.RotationEuler; rotationEuler2.y = value; Prefs.SetRotation(rotationEuler2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFloat("Rotate Z", Accent, rotationEuler.z, 5f, -180f, 180f, (Action)delegate(float value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 rotationEuler2 = Prefs.RotationEuler; rotationEuler2.z = value; Prefs.SetRotation(rotationEuler2); Prefs.Save(); panel.ApplyTransform(); }); obj.CreateFunction("Reset Placement", Accent, (Action)delegate { //IL_000f: 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) Prefs.SetOffset(new Vector3(0f, 0.06f, -0.1f)); Prefs.SetRotation(Vector3.zero); Prefs.Save(); panel.ApplyTransform(); }); } } } namespace WristSpawner.Interaction { internal enum AimSource { Finger, Palm, Hand } internal sealed class HandPointer { private Transform _fingertip; private Transform _fingerBase; private Transform _resolvedFor; public Vector3 Position { get; private set; } public Vector3 Direction { get; private set; } = Vector3.forward; public bool Valid { get; private set; } public Hand Hand { get { if (!Prefs.LeftWrist) { return Player.LeftHand; } return Player.RightHand; } } public BaseController Controller { get { if (!Prefs.LeftWrist) { return Player.LeftController; } return Player.RightController; } } public void Invalidate() { _fingertip = null; _fingerBase = null; _resolvedFor = null; Valid = false; } public void Update() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00ac: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) Valid = false; Hand hand = Hand; if ((Object)(object)hand == (Object)null) { return; } Transform transform = ((Component)hand).transform; if (!((Object)(object)transform == (Object)null)) { if ((Object)(object)_resolvedFor != (Object)(object)transform) { ResolveFinger(transform); _resolvedFor = transform; } Transform val = null; try { val = hand.palmPositionTransform; } catch { } Transform val2 = (((Object)(object)val != (Object)null) ? val : transform); AimSource aimSource = (AimSource)Mathf.Clamp(Prefs.LaserSource, 0, 2); Vector3 aim; if (aimSource == AimSource.Finger && (Object)(object)_fingertip != (Object)null) { Position = _fingertip.position; Vector3 val3 = (((Object)(object)_fingerBase != (Object)null) ? (_fingertip.position - _fingerBase.position) : (_fingertip.position - val2.position)); float magnitude = ((Vector3)(ref val3)).magnitude; aim = ((magnitude > 0.004f && magnitude < 0.16f) ? (val3 / magnitude) : val2.forward); } else if (aimSource == AimSource.Hand) { Position = (((Object)(object)_fingertip != (Object)null) ? _fingertip.position : (val2.position + transform.forward * 0.05f)); aim = transform.forward; } else { Position = (((Object)(object)_fingertip != (Object)null) ? _fingertip.position : (val2.position + val2.forward * 0.055f)); aim = val2.forward; } Direction = ApplyTrim(aim); Valid = true; } } private static Vector3 ApplyTrim(Vector3 aim) { //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_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0076: 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_004d: 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) float laserPitch = Prefs.LaserPitch; float laserYaw = Prefs.LaserYaw; if (Mathf.Abs(laserPitch) < 0.01f && Mathf.Abs(laserYaw) < 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(laserYaw, Vector3.up) * Quaternion.AngleAxis(0f - laserPitch, val) * aim; return ((Vector3)(ref val2)).normalized; } private void ResolveFinger(Transform root) { _fingertip = null; _fingerBase = null; Transform best = null; int bestDepth = -1; Search(root, 0, ref best, ref bestDepth); if (!((Object)(object)best == (Object)null)) { _fingertip = best; _fingerBase = (((Object)(object)best.parent != (Object)null) ? best.parent : root); } } private static void Search(Transform current, int depth, ref Transform best, ref int bestDepth) { if (depth > 8) { return; } string name = ((Object)current).name; if (!string.IsNullOrEmpty(name)) { string text = name.ToLowerInvariant(); if ((text.Contains("index") || text.Contains("point")) && depth > bestDepth) { best = current; bestDepth = depth; } } int childCount = current.childCount; for (int i = 0; i < childCount; i++) { Search(current.GetChild(i), depth + 1, ref best, ref bestDepth); } } } } namespace WristSpawner.Fusion { internal static class FusionBridge { public static void RegisterModule() { ModuleManager.RegisterModule(); } public static bool HasServer() { return NetworkInfo.HasServer; } public static bool Spawn(string barcode, Vector3 position, Quaternion rotation, Action onSpawned) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!NetworkInfo.HasServer) { return false; } Spawnable val = new Spawnable { crateRef = new SpawnableCrateReference(barcode), policyData = null }; AssetSpawner.Register(val); NetworkAssetSpawner.Spawn(new SpawnRequestInfo { Spawnable = val, Position = position, Rotation = rotation, SpawnEffect = true, SpawnSource = (EntitySource)2, SpawnCallback = delegate(SpawnCallbackInfo info) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) ushort arg = 0; NetworkEntity entity = info.Entity; if (entity != null) { arg = entity.ID; } onSpawned?.Invoke(info.Spawned, arg); } }); return true; } public static bool Despawn(ushort entityId) { //IL_000b: 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) if (!NetworkInfo.HasServer) { return false; } NetworkAssetSpawner.Despawn(new DespawnRequestInfo { EntityID = entityId, DespawnEffect = true }); 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 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 RegisterModule() { if (!Available) { return; } try { FusionBridge.RegisterModule(); } catch (Exception ex) { Melon.Logger.Warning("Fusion module registration failed: " + ex.Message); Available = false; } } public static bool TrySpawn(string barcode, Vector3 position, Quaternion rotation, Action onSpawned) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!Available) { return false; } try { return FusionBridge.Spawn(barcode, position, rotation, onSpawned); } catch (Exception ex) { Melon.Logger.Warning("Networked spawn failed, falling back to local: " + ex.Message); return false; } } public static bool TryDespawn(ushort entityId) { if (!Available || entityId == 0) { return false; } try { return FusionBridge.Despawn(entityId); } catch (Exception ex) { Melon.Logger.Warning("Networked despawn failed: " + ex.Message); return false; } } } internal sealed class WristSpawnerModule : Module { public override string Name => "WristSpawner"; 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("Wrist Spawner module registered — spawns will sync to the lobby.", ConsoleColor.White); } protected override void OnModuleUnregistered() { } } } namespace WristSpawner.Config { internal static class Prefs { private static MelonPreferences_Category _category; private static MelonPreferences_Entry _leftWrist; private static MelonPreferences_Entry _alwaysOnTop; private static MelonPreferences_Entry _requireWristLook; private static MelonPreferences_Entry _lookThreshold; private static MelonPreferences_Entry _panelScale; private static MelonPreferences_Entry _offsetX; private static MelonPreferences_Entry _offsetY; private static MelonPreferences_Entry _offsetZ; private static MelonPreferences_Entry _rotX; private static MelonPreferences_Entry _rotY; private static MelonPreferences_Entry _rotZ; private static MelonPreferences_Entry _spawnDistance; private static MelonPreferences_Entry _pokeDepth; private static MelonPreferences_Entry _hapticFeedback; private static MelonPreferences_Entry _hideRedacted; private static MelonPreferences_Entry _laserEnabled; private static MelonPreferences_Entry _laserPitch; private static MelonPreferences_Entry _laserYaw; private static MelonPreferences_Entry _laserSource; private static MelonPreferences_Entry _orbEnabled; private static MelonPreferences_Entry _panelEnabled; private static MelonPreferences_Entry _orbScale; private static MelonPreferences_Entry _deployEnabled; private static MelonPreferences_Entry _doubleTapWindow; private static MelonPreferences_Entry _deployCooldown; private static MelonPreferences_Entry _deployDuration; private static MelonPreferences_Entry _deployRingSize; private static MelonPreferences_Entry _deployRingSpin; private static MelonPreferences_Entry _deployScanSpeed; private static MelonPreferences_Entry _deployPanelCount; private static MelonPreferences_Entry _deployPanelOrbit; private static MelonPreferences_Entry _deployParticles; private static MelonPreferences_Entry _deployIntensity; private static MelonPreferences_Entry _deployHue; private static MelonPreferences_Entry _deployOrbDistance; private static MelonPreferences_Entry _deployBurst; private static MelonPreferences_Entry _deployOrbitRadius; private static MelonPreferences_Entry _deployedScale; private static MelonPreferences_Entry _deployOrbitSpin; private static MelonPreferences_Entry _panelGravity; private static MelonPreferences_Entry _panelDrag; private static MelonPreferences_Entry _panelLeash; private static MelonPreferences_Entry _panelFloat; private static MelonPreferences_Entry _panelReturn; private static MelonPreferences_Entry _orbSlots; private static MelonPreferences_Entry _favorites; public static bool LeftWrist => _leftWrist?.Value ?? true; public static bool AlwaysOnTop => _alwaysOnTop?.Value ?? true; public static bool RequireWristLook => _requireWristLook?.Value ?? false; public static float LookThreshold => _lookThreshold?.Value ?? 0.45f; public static float PanelScale => _panelScale?.Value ?? 1f; public static float SpawnDistance => _spawnDistance?.Value ?? 2f; public static float PokeDepth => _pokeDepth?.Value ?? 0.035f; public static bool HapticFeedback => _hapticFeedback?.Value ?? true; public static bool HideRedacted => _hideRedacted?.Value ?? true; public static bool LaserEnabled => _laserEnabled?.Value ?? true; public static float LaserPitch => _laserPitch?.Value ?? 0f; public static float LaserYaw => _laserYaw?.Value ?? 0f; public static int LaserSource => _laserSource?.Value ?? 0; public static bool OrbEnabled => _orbEnabled?.Value ?? false; public static bool PanelEnabled => _panelEnabled?.Value ?? true; public static float OrbScale => _orbScale?.Value ?? 1f; public static bool DeployEnabled => _deployEnabled?.Value ?? true; public static float DoubleTapWindow => _doubleTapWindow?.Value ?? 0.32f; public static float DeployCooldown => _deployCooldown?.Value ?? 3f; public static float DeployDuration => _deployDuration?.Value ?? 2f; public static float DeployRingSize => _deployRingSize?.Value ?? 1.15f; public static float DeployRingSpin => _deployRingSpin?.Value ?? 95f; public static float DeployScanSpeed => _deployScanSpeed?.Value ?? 1f; public static int DeployPanelCount => _deployPanelCount?.Value ?? 12; public static float DeployPanelOrbit => _deployPanelOrbit?.Value ?? 110f; public static float DeployParticles => _deployParticles?.Value ?? 1f; public static float DeployIntensity => _deployIntensity?.Value ?? 1f; public static float DeployHue => _deployHue?.Value ?? 0f; public static float DeployOrbDistance => _deployOrbDistance?.Value ?? 0.45f; public static float DeployBurst => _deployBurst?.Value ?? 1f; public static float DeployOrbitRadius => _deployOrbitRadius?.Value ?? 0.72f; public static float DeployedScale => _deployedScale?.Value ?? 1.5f; public static float DeployOrbitSpin => _deployOrbitSpin?.Value ?? 7f; public static float PanelGravity => _panelGravity?.Value ?? 1.1f; public static float PanelDrag => _panelDrag?.Value ?? 1.4f; public static float PanelLeash => _panelLeash?.Value ?? 2.2f; public static float PanelFloat => _panelFloat?.Value ?? 3.5f; public static float PanelReturn => _panelReturn?.Value ?? 4f; public static int OrbSlots => _orbSlots?.Value ?? 20; public static Vector3 Offset => new Vector3(_offsetX?.Value ?? 0f, _offsetY?.Value ?? 0.06f, _offsetZ?.Value ?? (-0.1f)); public static Vector3 RotationEuler => new Vector3(_rotX?.Value ?? 0f, _rotY?.Value ?? 0f, _rotZ?.Value ?? 0f); public static string FavoritesRaw { get { return _favorites?.Value ?? string.Empty; } set { if (_favorites != null) { _favorites.Value = value; Save(); } } } public static void Register() { _category = MelonPreferences.CreateCategory("WristSpawner", "Wrist Spawner"); _leftWrist = _category.CreateEntry("LeftWrist", true, "Mount On Left Wrist", (string)null, false, false, (ValueValidator)null, (string)null); _alwaysOnTop = _category.CreateEntry("AlwaysOnTop", true, "Draw Through Geometry", "Keeps the panel visible even when your arm mesh would cover it.", false, false, (ValueValidator)null, (string)null); _requireWristLook = _category.CreateEntry("RequireWristLook", false, "Only Show When Facing You", (string)null, false, false, (ValueValidator)null, (string)null); _lookThreshold = _category.CreateEntry("LookThreshold", 0.45f, "Facing Sensitivity", (string)null, false, false, (ValueValidator)null, (string)null); _panelScale = _category.CreateEntry("PanelScale", 1f, "Panel Scale", (string)null, false, false, (ValueValidator)null, (string)null); _offsetX = _category.CreateEntry("OffsetX", 0f, "Offset X", (string)null, false, false, (ValueValidator)null, (string)null); _offsetY = _category.CreateEntry("OffsetY", 0.06f, "Offset Y", (string)null, false, false, (ValueValidator)null, (string)null); _offsetZ = _category.CreateEntry("OffsetZ", -0.1f, "Offset Z", (string)null, false, false, (ValueValidator)null, (string)null); _rotX = _category.CreateEntry("RotX", 0f, "Rotation X", (string)null, false, false, (ValueValidator)null, (string)null); _rotY = _category.CreateEntry("RotY", 0f, "Rotation Y", (string)null, false, false, (ValueValidator)null, (string)null); _rotZ = _category.CreateEntry("RotZ", 0f, "Rotation Z", (string)null, false, false, (ValueValidator)null, (string)null); _spawnDistance = _category.CreateEntry("SpawnDistance", 2f, "Spawn Distance", (string)null, false, false, (ValueValidator)null, (string)null); _pokeDepth = _category.CreateEntry("PokeDepth", 0.035f, "Poke Depth", (string)null, false, false, (ValueValidator)null, (string)null); _hapticFeedback = _category.CreateEntry("Haptics", true, "Haptic Feedback", (string)null, false, false, (ValueValidator)null, (string)null); _hideRedacted = _category.CreateEntry("HideRedacted", true, "Hide Redacted Crates", (string)null, false, false, (ValueValidator)null, (string)null); _laserEnabled = _category.CreateEntry("LaserEnabled", true, "Laser Pointer", (string)null, false, false, (ValueValidator)null, (string)null); _laserPitch = _category.CreateEntry("LaserPitch", 0f, "Laser Pitch", (string)null, false, false, (ValueValidator)null, (string)null); _laserYaw = _category.CreateEntry("LaserYaw", 0f, "Laser Yaw", (string)null, false, false, (ValueValidator)null, (string)null); _laserSource = _category.CreateEntry("LaserSource", 0, "Laser Aim Source", (string)null, false, false, (ValueValidator)null, (string)null); _orbEnabled = _category.CreateEntry("OrbEnabled", false, "Orb Mode", (string)null, false, false, (ValueValidator)null, (string)null); _panelEnabled = _category.CreateEntry("PanelEnabled", true, "Wrist Panel", (string)null, false, false, (ValueValidator)null, (string)null); _orbScale = _category.CreateEntry("OrbScale", 1f, "Orb Scale", (string)null, false, false, (ValueValidator)null, (string)null); _deployEnabled = _category.CreateEntry("DeployEnabled", true, "Deployment Effect", (string)null, false, false, (ValueValidator)null, (string)null); _doubleTapWindow = _category.CreateEntry("DoubleTapWindow", 0.32f, "Double Tap Window", (string)null, false, false, (ValueValidator)null, (string)null); _deployCooldown = _category.CreateEntry("DeployCooldown", 3f, "Deploy Cooldown", (string)null, false, false, (ValueValidator)null, (string)null); _deployDuration = _category.CreateEntry("DeployDuration", 2f, "Deploy Duration", (string)null, false, false, (ValueValidator)null, (string)null); _deployRingSize = _category.CreateEntry("DeployRingSize", 1.15f, "Ring Size", (string)null, false, false, (ValueValidator)null, (string)null); _deployRingSpin = _category.CreateEntry("DeployRingSpin", 95f, "Ring Spin Speed", (string)null, false, false, (ValueValidator)null, (string)null); _deployScanSpeed = _category.CreateEntry("DeployScanSpeed", 1f, "Scan Speed", (string)null, false, false, (ValueValidator)null, (string)null); _deployPanelCount = _category.CreateEntry("DeployPanelCount", 12, "Panel Count", (string)null, false, false, (ValueValidator)null, (string)null); _deployPanelOrbit = _category.CreateEntry("DeployPanelOrbit", 110f, "Panel Orbit Speed", (string)null, false, false, (ValueValidator)null, (string)null); _deployParticles = _category.CreateEntry("DeployParticles", 1f, "Particle Density", (string)null, false, false, (ValueValidator)null, (string)null); _deployIntensity = _category.CreateEntry("DeployIntensity", 1f, "Effect Intensity", (string)null, false, false, (ValueValidator)null, (string)null); _deployHue = _category.CreateEntry("DeployHue", 0f, "Effect Hue Shift", (string)null, false, false, (ValueValidator)null, (string)null); _deployOrbDistance = _category.CreateEntry("DeployOrbDistance", 0.45f, "Orb Float Distance", (string)null, false, false, (ValueValidator)null, (string)null); _deployBurst = _category.CreateEntry("DeployBurst", 1f, "Final Burst Intensity", (string)null, false, false, (ValueValidator)null, (string)null); _deployOrbitRadius = _category.CreateEntry("DeployOrbitRadius", 0.72f, "Orbit Radius", (string)null, false, false, (ValueValidator)null, (string)null); _deployedScale = _category.CreateEntry("DeployedScale", 1.5f, "Deployed Size", (string)null, false, false, (ValueValidator)null, (string)null); _deployOrbitSpin = _category.CreateEntry("DeployOrbitSpin", 7f, "Orbit Drift Speed", (string)null, false, false, (ValueValidator)null, (string)null); _panelGravity = _category.CreateEntry("PanelGravity", 1.1f, "Panel Gravity", (string)null, false, false, (ValueValidator)null, (string)null); _panelDrag = _category.CreateEntry("PanelDrag", 1.4f, "Panel Drag", (string)null, false, false, (ValueValidator)null, (string)null); _panelLeash = _category.CreateEntry("PanelLeash", 2.2f, "Panel Max Distance", (string)null, false, false, (ValueValidator)null, (string)null); _panelFloat = _category.CreateEntry("PanelFloat", 3.5f, "Panel Float", (string)null, false, false, (ValueValidator)null, (string)null); _panelReturn = _category.CreateEntry("PanelReturn", 4f, "Panel Return Delay", (string)null, false, false, (ValueValidator)null, (string)null); _orbSlots = _category.CreateEntry("OrbSlots", 20, "Favorite Slots", (string)null, false, false, (ValueValidator)null, (string)null); _favorites = _category.CreateEntry("Favorites", string.Empty, "Favorites", (string)null, true, false, (ValueValidator)null); } public static void SetOffset(Vector3 v) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_offsetX != null) { _offsetX.Value = v.x; _offsetY.Value = v.y; _offsetZ.Value = v.z; } } public static void SetRotation(Vector3 v) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_rotX != null) { _rotX.Value = v.x; _rotY.Value = v.y; _rotZ.Value = v.z; } } public static void SetLeftWrist(bool value) { if (_leftWrist != null) { _leftWrist.Value = value; } } public static void SetAlwaysOnTop(bool value) { if (_alwaysOnTop != null) { _alwaysOnTop.Value = value; } } public static void SetRequireWristLook(bool value) { if (_requireWristLook != null) { _requireWristLook.Value = value; } } public static void SetLookThreshold(float value) { if (_lookThreshold != null) { _lookThreshold.Value = value; } } public static void SetPanelScale(float value) { if (_panelScale != null) { _panelScale.Value = value; } } public static void SetSpawnDistance(float value) { if (_spawnDistance != null) { _spawnDistance.Value = value; } } public static void SetHaptics(bool value) { if (_hapticFeedback != null) { _hapticFeedback.Value = value; } } public static void SetHideRedacted(bool value) { if (_hideRedacted != null) { _hideRedacted.Value = value; } } public static void SetLaserEnabled(bool value) { if (_laserEnabled != null) { _laserEnabled.Value = value; } } public static void SetLaserPitch(float value) { if (_laserPitch != null) { _laserPitch.Value = value; } } public static void SetLaserYaw(float value) { if (_laserYaw != null) { _laserYaw.Value = value; } } public static void SetLaserSource(int value) { if (_laserSource != null) { _laserSource.Value = Mathf.Clamp(value, 0, 2); } } public static void SetOrbEnabled(bool value) { if (_orbEnabled != null) { _orbEnabled.Value = value; } } public static void SetPanelEnabled(bool value) { if (_panelEnabled != null) { _panelEnabled.Value = value; } } public static void SetOrbScale(float value) { if (_orbScale != null) { _orbScale.Value = value; } } public static void SetDeployEnabled(bool value) { if (_deployEnabled != null) { _deployEnabled.Value = value; } } public static void SetDoubleTapWindow(float value) { if (_doubleTapWindow != null) { _doubleTapWindow.Value = value; } } public static void SetDeployCooldown(float value) { if (_deployCooldown != null) { _deployCooldown.Value = value; } } public static void SetDeployDuration(float value) { if (_deployDuration != null) { _deployDuration.Value = value; } } public static void SetDeployRingSize(float value) { if (_deployRingSize != null) { _deployRingSize.Value = value; } } public static void SetDeployRingSpin(float value) { if (_deployRingSpin != null) { _deployRingSpin.Value = value; } } public static void SetDeployScanSpeed(float value) { if (_deployScanSpeed != null) { _deployScanSpeed.Value = value; } } public static void SetDeployPanelCount(int value) { if (_deployPanelCount != null) { _deployPanelCount.Value = value; } } public static void SetDeployPanelOrbit(float value) { if (_deployPanelOrbit != null) { _deployPanelOrbit.Value = value; } } public static void SetDeployParticles(float value) { if (_deployParticles != null) { _deployParticles.Value = value; } } public static void SetDeployIntensity(float value) { if (_deployIntensity != null) { _deployIntensity.Value = value; } } public static void SetDeployHue(float value) { if (_deployHue != null) { _deployHue.Value = value; } } public static void SetDeployOrbDistance(float value) { if (_deployOrbDistance != null) { _deployOrbDistance.Value = value; } } public static void SetDeployBurst(float value) { if (_deployBurst != null) { _deployBurst.Value = value; } } public static void SetDeployOrbitRadius(float value) { if (_deployOrbitRadius != null) { _deployOrbitRadius.Value = value; } } public static void SetDeployedScale(float value) { if (_deployedScale != null) { _deployedScale.Value = value; } } public static void SetDeployOrbitSpin(float value) { if (_deployOrbitSpin != null) { _deployOrbitSpin.Value = value; } } public static void SetPanelGravity(float value) { if (_panelGravity != null) { _panelGravity.Value = value; } } public static void SetPanelDrag(float value) { if (_panelDrag != null) { _panelDrag.Value = value; } } public static void SetPanelLeash(float value) { if (_panelLeash != null) { _panelLeash.Value = value; } } public static void SetPanelFloat(float value) { if (_panelFloat != null) { _panelFloat.Value = value; } } public static void SetPanelReturn(float value) { if (_panelReturn != null) { _panelReturn.Value = value; } } public static void SetOrbSlots(int value) { if (_orbSlots != null) { _orbSlots.Value = Mathf.Clamp(value, 1, 20); } } public static void Save() { MelonPreferences_Category category = _category; if (category != null) { category.SaveToFile(false); } } } } namespace WristSpawner.Catalog { internal enum Category { Favorites, Guns, Melee, NPCs, Props, All } internal sealed class CatalogEntry { public string Barcode; public string Title; public Category Category; public string Haystack; public bool Modded; public bool IsFavorite => SpawnCatalog.IsFavorite(Barcode); } internal sealed class SubCategory { public string Label; public Func Match; public static SubCategory All => new SubCategory("ALL", (CatalogEntry _) => true); public SubCategory(string label, Func match) { Label = label; Match = match; } public static SubCategory Keywords(string label, params string[] hints) { return new SubCategory(label, delegate(CatalogEntry e) { for (int i = 0; i < hints.Length; i++) { if (e.Haystack.Contains(hints[i])) { return true; } } return false; }); } } internal static class SpawnCatalog { private static readonly List All = new List(); private static readonly Dictionary> ByCategory = new Dictionary>(); private static readonly HashSet FavoriteBarcodes = new HashSet(StringComparer.OrdinalIgnoreCase); private static readonly string[] GunHints = new string[20] { "gun", "rifle", "pistol", "smg", "shotgun", "revolver", "launcher", "blaster", "m1911", "eder", "p350", "ak4", "m16", "mk18", "uzi", "mp5", "sniper", "auto", "firearm", "weapon.gun" }; private static readonly string[] MeleeHints = new string[17] { "melee", "sword", "knife", "axe", "hammer", "bat", "blade", "spear", "katana", "machete", "crowbar", "baton", "club", "pipe", "shovel", "wrench", "dagger" }; private static readonly string[] NpcHints = new string[16] { "npc", "enemy", "nullbody", "skeleton", "ford", "peasant", "crablet", "omniturret", "securityguard", "brett", "jimmy", "cultist", "zombie", "hazmat", "swat", "turret" }; private static readonly Dictionary SubCategories = new Dictionary { [Category.Favorites] = new SubCategory[4] { SubCategory.All, SubCategory.Keywords("GUN", "gun", "rifle", "pistol", "shotgun", "smg"), SubCategory.Keywords("MELEE", "melee", "sword", "knife", "axe", "hammer", "bat"), new SubCategory("MODS", (CatalogEntry e) => e.Modded) }, [Category.Guns] = new SubCategory[6] { SubCategory.All, SubCategory.Keywords("PISTOL", "pistol", "m1911", "eder", "p350", "revolver", "handgun"), SubCategory.Keywords("SMG", "smg", "uzi", "mp5", "m1928", "pdw"), SubCategory.Keywords("RIFLE", "rifle", "ak4", "m16", "mk18", "sniper", "carbine"), SubCategory.Keywords("HEAVY", "shotgun", "launcher", "minigun", "lmg", "m590"), new SubCategory("MODS", (CatalogEntry e) => e.Modded) }, [Category.Melee] = new SubCategory[5] { SubCategory.All, SubCategory.Keywords("BLADE", "sword", "knife", "blade", "katana", "machete", "dagger"), SubCategory.Keywords("BLUNT", "hammer", "bat", "club", "baton", "pipe", "wrench"), SubCategory.Keywords("POLE", "spear", "axe", "shovel", "crowbar", "polearm"), new SubCategory("MODS", (CatalogEntry e) => e.Modded) }, [Category.NPCs] = new SubCategory[5] { SubCategory.All, SubCategory.Keywords("HUMAN", "peasant", "ford", "brett", "jimmy", "guard", "swat", "cultist"), SubCategory.Keywords("ROBOT", "nullbody", "omniturret", "turret", "bot", "drone"), SubCategory.Keywords("BEAST", "crablet", "skeleton", "zombie", "dog", "creature"), new SubCategory("MODS", (CatalogEntry e) => e.Modded) }, [Category.Props] = new SubCategory[5] { SubCategory.All, SubCategory.Keywords("BALL", "ball", "sphere", "orb"), SubCategory.Keywords("BOX", "crate", "box", "barrel", "container", "cube"), SubCategory.Keywords("TOOL", "tool", "key", "battery", "canister", "device", "gadget"), new SubCategory("MODS", (CatalogEntry e) => e.Modded) }, [Category.All] = new SubCategory[3] { SubCategory.All, new SubCategory("BASE", (CatalogEntry e) => !e.Modded), new SubCategory("MODS", (CatalogEntry e) => e.Modded) } }; public static bool Ready { get; private set; } public static int Count => All.Count; public static event Action OnChanged; public static void Rebuild() { All.Clear(); ByCategory.Clear(); foreach (Category value in Enum.GetValues(typeof(Category))) { ByCategory[value] = new List(); } AssetWarehouse instance = AssetWarehouse.Instance; if (instance == null) { Melon.Logger.Warning("AssetWarehouse not ready; catalog empty."); return; } List crates = instance.GetCrates(); if (crates == null) { return; } for (int i = 0; i < crates.Count; i++) { Crate val = crates[i]; if ((Object)(object)val == (Object)null) { continue; } SpawnableCrate val2 = ((Il2CppObjectBase)val).TryCast(); if (!((Object)(object)val2 == (Object)null) && (!Prefs.HideRedacted || !((Scannable)val2).Redacted)) { string text = SafeBarcode((Scannable)(object)val2); if (!string.IsNullOrEmpty(text)) { string text2 = SafeTitle((Scannable)(object)val2, text); string haystack = (text + " " + text2).ToLowerInvariant(); CatalogEntry catalogEntry = new CatalogEntry { Barcode = text, Title = text2, Haystack = haystack, Modded = !text.StartsWith("SLZ.", StringComparison.OrdinalIgnoreCase), Category = Classify(haystack) }; All.Add(catalogEntry); ByCategory[catalogEntry.Category].Add(catalogEntry); ByCategory[Category.All].Add(catalogEntry); } } } All.Sort(CompareByTitle); foreach (KeyValuePair> item in ByCategory) { item.Value.Sort(CompareByTitle); } RefreshFavorites(); Ready = true; SpawnCatalog.OnChanged?.Invoke(); Melon.Logger.Msg($"Catalog built: {All.Count} spawnables ({ByCategory[Category.Guns].Count} guns, {ByCategory[Category.Melee].Count} melee, {ByCategory[Category.NPCs].Count} NPCs, {ByCategory[Category.Props].Count} props)."); } private static int CompareByTitle(CatalogEntry a, CatalogEntry b) { return string.Compare(a.Title, b.Title, StringComparison.OrdinalIgnoreCase); } private static string SafeBarcode(Scannable scannable) { try { Barcode barcode = scannable.Barcode; return (barcode != null) ? barcode.ID : null; } catch { return null; } } private static string SafeTitle(Scannable scannable, string fallbackBarcode) { string text = null; try { text = scannable.Title; } catch { } if (!string.IsNullOrWhiteSpace(text)) { return text; } int num = fallbackBarcode.LastIndexOf('.'); if (num < 0 || num >= fallbackBarcode.Length - 1) { return fallbackBarcode; } return fallbackBarcode.Substring(num + 1); } private static Category Classify(string haystack) { if (ContainsAny(haystack, NpcHints)) { return Category.NPCs; } if (ContainsAny(haystack, GunHints)) { return Category.Guns; } if (ContainsAny(haystack, MeleeHints)) { return Category.Melee; } return Category.Props; } private static bool ContainsAny(string haystack, string[] needles) { for (int i = 0; i < needles.Length; i++) { if (haystack.Contains(needles[i])) { return true; } } return false; } public static List Get(Category category) { if (!ByCategory.TryGetValue(category, out var value)) { return new List(); } return value; } public static SubCategory[] GetSubCategories(Category category) { if (!SubCategories.TryGetValue(category, out var value)) { return new SubCategory[1] { SubCategory.All }; } return value; } public static List Get(Category category, int subIndex) { List list = Get(category); SubCategory[] subCategories = GetSubCategories(category); if (subIndex <= 0 || subIndex >= subCategories.Length) { return list; } Func match = subCategories[subIndex].Match; List list2 = new List(); for (int i = 0; i < list.Count; i++) { if (match(list[i])) { list2.Add(list[i]); } } return list2; } public static void LoadFavorites() { FavoriteBarcodes.Clear(); string favoritesRaw = Prefs.FavoritesRaw; if (!string.IsNullOrWhiteSpace(favoritesRaw)) { string[] array = favoritesRaw.Split(new char[1] { '|' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in array) { FavoriteBarcodes.Add(text.Trim()); } } } public static void Notify() { SpawnCatalog.OnChanged?.Invoke(); } public static bool IsFavorite(string barcode) { return FavoriteBarcodes.Contains(barcode); } public static void ToggleFavorite(string barcode) { if (!FavoriteBarcodes.Remove(barcode)) { FavoriteBarcodes.Add(barcode); } Prefs.FavoritesRaw = string.Join("|", FavoriteBarcodes); RefreshFavorites(); SpawnCatalog.OnChanged?.Invoke(); } private static void RefreshFavorites() { List list = ByCategory[Category.Favorites]; list.Clear(); for (int i = 0; i < All.Count; i++) { if (FavoriteBarcodes.Contains(All[i].Barcode)) { list.Add(All[i]); } } list.Sort(CompareByTitle); } } }