using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Cryptography; using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; using BoneHub.Api; using BoneHub.Avatars; using BoneHub.Compatibility; using BoneHub.Configuration; using BoneHub.Downloads; using BoneHub.Installation; using BoneHub.Interaction; using BoneHub.Mod; using BoneHub.Models; using BoneHub.Persistence; using BoneLib; using BoneLib.BoneMenu; using Il2CppCysharp.Threading.Tasks; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Bonelab; using Il2CppSLZ.Bonelab.SaveData; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.Data; using Il2CppSLZ.Marrow.Forklift.Model; using Il2CppSLZ.Marrow.Pool; using Il2CppSLZ.Marrow.SaveData; using Il2CppSLZ.Marrow.SceneStreaming; using Il2CppSLZ.Marrow.Utilities; using Il2CppSLZ.Marrow.Warehouse; using Il2CppSLZ.VRMK; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppTMPro; using LabFusion.Data; using LabFusion.Entities; using LabFusion.Marrow; using LabFusion.Marrow.Patching; using LabFusion.Menu; using LabFusion.Network; using LabFusion.Player; using LabFusion.RPC; using LabFusion.Representation; using LabFusion.SDK.Lobbies; using LabFusion.SDK.Modules; using LabFusion.Scene; using MelonLoader; using MelonLoader.Utils; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using WristHub.SDK; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(BoneHubMod), "WristHubV4", "4.0.1", "WristHub contributors", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: AssemblyMetadata("WristHubPlatform", "QuestStandalone")] [assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] [assembly: AssemblyCompany("WristHub")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("4.0.1.0")] [assembly: AssemblyInformationalVersion("4.0.1")] [assembly: AssemblyProduct("WristHub")] [assembly: AssemblyTitle("WristHub")] [assembly: AssemblyVersion("4.0.1.0")] [module: RefSafetyRules(11)] namespace BoneHub.Mod; internal sealed class BoneHubAvatarBrowser : IDisposable { private enum ButtonIconKind { None, Back, Forward, Close, Search, Settings, Download, Avatar, Apps, Map, Compass, Portal, Fusion, Players, Gamemode, QuickJoin, Home, Refresh, Equip, Delete, Join } private sealed class TouchButton { public Transform Space { get; init; } public GameObject Root { get; init; } public Image Panel { get; init; } public TMP_Text Label { get; init; } public Vector3 Center { get; init; } public Vector3 Half { get; init; } public Action Action { get; init; } public TouchDebounce Debounce { get; } = new TouchDebounce(); public bool IsAlive { get { try { return (Object)(object)Root != (Object)null && (Object)(object)Space != (Object)null && (Object)(object)Panel != (Object)null && (Object)(object)Label != (Object)null; } catch { return false; } } } public bool Contains(Vector3 worldPoint) { //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_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_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_0051: 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_0069: 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_0081: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)Root == (Object)null || (Object)(object)Space == (Object)null || !Root.activeInHierarchy) { return false; } Vector3 val = Space.InverseTransformPoint(worldPoint) - Center; return Mathf.Abs(val.x) <= Half.x && Mathf.Abs(val.y) <= Half.y && Mathf.Abs(val.z) <= Half.z; } catch { return false; } } } private sealed class PackRow { public TouchButton Button { get; init; } public TouchButton DeleteButton { get; init; } public RawImage Artwork { get; init; } public TMP_Text Name { get; init; } public TMP_Text Creator { get; init; } public TMP_Text State { get; init; } public string Identity { get; set; } = string.Empty; public int Generation { get; set; } public bool IsAlive { get { if (Button.IsAlive && DeleteButton.IsAlive && (Object)(object)Artwork != (Object)null && (Object)(object)Name != (Object)null && (Object)(object)Creator != (Object)null) { return (Object)(object)State != (Object)null; } return false; } } } private enum IconPrimitiveType { Line, Ring, Disc, Box } private readonly record struct IconPrimitive(IconPrimitiveType Type, Vector2 A, Vector2 B, float Radius, float Stroke); private enum PortalPlacementStage { None, LocalEntrance, LocalExit, WorldEntrance, FusionServerEntrance } private enum WristKeyboardPurpose { Avatars, CodeMods, Spawnables, PortalLevels, FusionServerCode, CodeModString, SdkText } private enum SpawnableBrowseMode { All, Groups, Recent, Favorites } private enum CodeModCatalogMode { All, Community, Managers, BoneMenu, Loaded } private sealed class OsControlRow { public TouchButton Main { get; init; } public TouchButton Minus { get; init; } public TouchButton Plus { get; init; } public TMP_Text Detail { get; init; } public object? Source { get; set; } } private sealed class MiniMapPeerVisual { public int PeerId { get; set; } = -1; public bool Active { get; set; } public Vector3 TargetWorldPosition { get; set; } public Vector3 WorldPosition { get; set; } public float TargetHeadingDegrees { get; set; } public float HeadingDegrees { get; set; } public MiniMapPeerRole Role { get; set; } public Transform? TrackingTransform { get; set; } public bool HasDisplayPose { get; set; } public float LastSeenAt { get; set; } } private sealed record CodeModSnapshot(string Name, string Detail, object? Page, object? Element = null); private sealed record LoadedCodeModSnapshot(string Name, string Author, string Version); private sealed class ReflectedManagerControl { private readonly Func _detail; private readonly Action _activate; private readonly Action? _adjust; public string Label { get; } public string Detail => _detail(); public bool Adjustable => _adjust != null; public ReflectedManagerControl(string label, Func detail, Action activate, Action? adjust = null) { Label = label; _detail = detail; _activate = activate; _adjust = adjust; } public void Activate() { _activate(); } public void Adjust(int direction) { _adjust?.Invoke(direction); } } private sealed class RuntimeSdkHost : IWristHubHost { private readonly BoneHubAvatarBrowser _owner; public WristHubRuntimeInfo Runtime => new WristHubRuntimeInfo(true, _owner._constrainedRendering, IsFusionConnected(), ((object)_owner._preferences.HologramTheme/*cast due to .constrained prefix*/).ToString(), 2); public RuntimeSdkHost(BoneHubAvatarBrowser owner) { _owner = owner; } public void Notify(string appId, string message, WristHubNotificationKind kind) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _owner._sdkNotifications.Enqueue(new SdkNotification(appId, message, kind)); } public void RequestOpen(string appId) { _owner._sdkOpenRequests.Enqueue(appId); } } private readonly record struct SdkNotification(string AppId, string Message, WristHubNotificationKind Kind) { [CompilerGenerated] public void Deconstruct(out string AppId, out string Message, out WristHubNotificationKind Kind) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown AppId = this.AppId; Message = this.Message; Kind = (WristHubNotificationKind)(int)this.Kind; } } private sealed class RuntimeWristOsApp : IWristOsApp { private readonly Action _open; public WristOsAppId Id { get; } public string DisplayName { get; } public bool IsAvailable => true; public int NotificationCount => 0; public RuntimeWristOsApp(WristOsAppId id, string name, Action open) { //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) Id = id; DisplayName = name; _open = open; } public void Open() { _open(); } public void Close() { } public void Tick(double nowSeconds) { } public bool HandleBack() { return false; } } private const float ChestRadius = 0.22f; private static readonly Color Glass = new Color(0.012f, 0.027f, 0.04f, 1f); private static readonly Color Surface = new Color(0.025f, 0.075f, 0.105f, 0.96f); private static readonly Color Green = new Color(0.32f, 0.9f, 0.62f, 1f); private static readonly Color Amber = new Color(1f, 0.67f, 0.22f, 1f); private static readonly Color Red = new Color(1f, 0.38f, 0.46f, 1f); private readonly BoneHubService _service; private readonly BoneHubRuntime _runtime; private readonly BoneHubThumbnailCache _thumbnails; private readonly ConcurrentQueue _mainThread; private readonly BoneHubPreferences _preferences; private readonly bool _constrainedRendering; private readonly Instance _log; private readonly LobbyAvatarSharingBridge _sharing; private readonly List _buttons = new List(); private readonly Dictionary _touchCaptures = new Dictionary(); private readonly HashSet _activeProbeIds = new HashSet(); private readonly List _staleCaptureIds = new List(2); private readonly Dictionary _onlineMods = new Dictionary(); private readonly Dictionary _jobs = new Dictionary(); private readonly Dictionary> _downloadBatches = new Dictionary>(); private readonly Dictionary _previewMetrics = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly Dictionary _previewRoutes = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly Dictionary _rigValidations = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly HashSet _startingDownloads = new HashSet(); private readonly BoneHubFingertipProbeProvider _fingertips = BoneHubFingertipProbeProvider.Shared; private readonly TabletKeyboardBuffer _keyboard = new TabletKeyboardBuffer(); private readonly LookAwayDismissal _promptDismissal = new LookAwayDismissal(); private readonly FocusedResultCursor _cursor = new FocusedResultCursor(); private readonly FourRowPageCursor _packCursor = new FourRowPageCursor(); private readonly PresentationGeneration _artworkGeneration = new PresentationGeneration(); private readonly ErrorLogThrottle _runtimeErrorThrottle = new ErrorLogThrottle(); private readonly SurfaceInputRearmGate _inputRearm = new SurfaceInputRearmGate(0.1); private readonly InstalledPackFocus _installedFocus = new InstalledPackFocus(); private readonly BoneHubForearmProjectionAnchorProvider _projectionAnchors = new BoneHubForearmProjectionAnchorProvider(); private readonly List _packRows = new List(); private readonly Action _projectionTickAction; private readonly Action _projectionRecoveryAction; private readonly Action _touchTickAction; private readonly Action _touchRecoveryAction; private readonly Action _installationFocusTickAction; private readonly Action _previewTickAction; private readonly Action _previewRecoveryAction; private readonly Action _downloadTickAction; private readonly Action _sharingTickAction; private readonly Action _compassTickAction; private readonly Action _portalStateReceiver; private readonly Action _portalRemoveReceiver; private IReadOnlyList _entries = Array.Empty(); private IReadOnlyList _mergedEntries = Array.Empty(); private IReadOnlyList _onlineEntries = Array.Empty(); private IReadOnlyList _packs = Array.Empty(); private GameObject? _root; private GameObject? _launcher; private GameObject? _hub; private GameObject? _browser; private GameObject? _canvasRoot; private GameObject? _packPage; private GameObject? _detailPage; private GameObject? _optionsPage; private GameObject? _watchPlacementPage; private GameObject? _downloadsPage; private GameObject? _packOptionsPage; private GameObject? _keyboardPage; private GameObject? _deletePage; private GameObject? _compassPage; private GameObject? _denseGlassChrome; private GameObject? _denseGlassBackground; private GameObject? _denseGlassOverlay; private bool _wristLocalPoseValid; private int _wristLocalHandId; private Vector3 _wristLocalPosition; private float _wristLocalHeightRatio; private float _wristLocalWatchScale; private float _wristLocalOutwardOffset; private float _wristLocalFingerOffset; private GameObject? _leftArcWing; private GameObject? _rightArcWing; private GameObject? _metadataArc; private CanvasGroup? _canvasGroup; private TMP_Text? _packTitle; private TMP_Text? _packStatus; private TMP_Text? _packPosition; private TMP_Text? _packSearchText; private TMP_Text? _sortText; private TMP_Text? _wristText; private TMP_Text? _scaleText; private TMP_Text? _motionText; private TMP_Text? _themeText; private TMP_Text? _clockText; private TMP_Text? _startingViewText; private TMP_Text? _watchForearmText; private TMP_Text? _scopeText; private TMP_Text? _downloadsSummary; private TMP_Text? _deleteTitle; private TMP_Text? _deleteDetails; private TMP_Text? _keyboardText; private TMP_Text? _keyboardTitle; private TMP_Text? _keyboardShiftText; private TMP_Text? _searchText; private TMP_Text? _compassHeadingText; private TMP_Text? _compassCalibrationText; private RectTransform? _compassNeedle; private RectTransform? _compassDecorRing; private TMP_Text? _positionText; private TMP_Text? _selectedName; private TMP_Text? _creatorText; private TMP_Text? _modText; private TMP_Text? _statusText; private TMP_Text? _heightText; private GameObject? _heightRuler; private GameObject? _progressRoot; private RectTransform? _progressFill; private TMP_Text? _progressText; private TMP_Text? _actionLabel; private Image? _actionPanel; private TouchButton? _trashButton; private RawImage? _centralArtwork; private Texture2D? _placeholderTexture; private Texture2D? _roundedTexture; private Sprite? _roundedSprite; private BoneHubForearmProjection? _hologramProjection; private BoneHubHologramCarousel? _hologramCarousel; private BoneHubChestEquipGuide? _chestEquipGuide; private TouchButton? _actionButton; private GameObject? _previewShell; private GameObject? _previewFallback; private GameObject? _previewModel; private readonly List _ownedPreviewMeshes = new List(); private BoneHubAvatar? _previewAvatar; private BoneHubAvatar? _pendingPreviewAvatar; private string _loadedPreviewBarcode = string.Empty; private string _requestedPreviewBarcode = string.Empty; private float _previewLoadAt; private bool _previewReady; private bool _previewInteractionReady; private AvatarPreviewVisualSource _previewVisualSource; private bool _previewHeld; private Hand? _dragHand; private bool _dragIsLeft; private bool _dragUsesPinch; private Vector3 _dragLocalOffset; private Quaternion _dragRotationOffset = Quaternion.identity; private float _dragTrackingLostAt = -1f; private bool _dragWasInsideChest; private bool _previewReturning; private float _returnStarted; private Vector3 _returnFrom; private Quaternion _returnRotation; private int _previewGeneration; private int _searchGeneration; private string _query = string.Empty; private bool _downloadsOnly; private string _selectedIdentity = string.Empty; private string _trashConfirmIdentity = string.Empty; private bool _deleteReturnToPackPage; private bool _trashInProgress; private long? _selectedPackId; private AvatarPackSort _packSort; private AvatarBrowseScope _scope; private AvatarBrowseScope _scopeBeforeSearch; private Guid _progressJobId; private double _displayedProgress; private double _targetProgress; private int _lastProgressPercent = -1; private AvatarDownloadState? _lastProgressState; private AvatarBrowserViewState _viewState = (AvatarBrowserViewState)2; private AvatarBrowserViewState _viewStateBeforeKeyboard = (AvatarBrowserViewState)2; private bool _disposed; private bool _wasPlayerDead; private AvatarSharingState _sharingState; private BoneHubAvatar? _pendingSharingAvatar; private ModIoSharingMetadata? _pendingSharingMetadata; private string _sharingRetryBarcode = string.Empty; private float _nextSharingCheckAt; private float _sharingDeadline; private bool _sharingRefreshRequested; private string _carouselIdentity = string.Empty; private float _hubControlsReadyAt; private HologramDashboardLifecycle _lifecycle; private float _lifecycleStartedAt; private bool _closeNotificationPending; private HologramDashboardProgress _closeVisualStart = new HologramDashboardProgress((HologramProjectionPhase)5, 1f, 1f, 1f, 1f, 1f, true); private string _compassSceneKey = "unknown-scene"; private float _compassSmoothedHeading; private bool _compassHeadingValid; private int _lastCompassDegree = -1; private GameObject? _fusionHomePage; private GameObject? _fusionPlayersPage; private TMP_Text? _fusionHomeTitle; private TMP_Text? _fusionHomeSummary; private TMP_Text? _fusionHomeStatus; private TouchButton? _fusionDisconnectButton; private readonly List _fusionPlayerRows = new List(4); private readonly List _fusionPlayerImages = new List(4); private readonly int[] _fusionPlayerImageGenerations = new int[4]; private readonly long[] _fusionPlayerImageModIds = new long[4]; private FusionServerEntry? _fusionPlayersSource; private int _fusionPlayerPageIndex; private TMP_Text? _fusionPlayerPosition; private TMP_Text? _fusionPlayerStatus; private readonly Dictionary _buttonIconSprites = new Dictionary(); private readonly List _buttonIconTextures = new List(); private Sprite? _miniMapRingSprite; private Sprite? _miniMapMaskSprite; private readonly RaycastHit[] _portalRayHits = (RaycastHit[])(object)new RaycastHit[12]; private readonly PortalTraversalGuard _portalEntranceGuard = new PortalTraversalGuard(); private readonly PortalTraversalGuard _portalExitGuard = new PortalTraversalGuard(); private readonly List _portalLevels = new List(); private readonly List _installedPortalLevels = new List(); private readonly List _fusionServers = new List(); private readonly List _fusionServerRows = new List(); private readonly List _fusionServerRowArtwork = new List(); private readonly string[] _fusionServerRowArtworkCodes = new string[4]; private readonly int[] _fusionServerRowArtworkGenerations = new int[4]; private readonly Dictionary _portalLevelCrates = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly Dictionary _portalOnlineMods = new Dictionary(); private GameObject? _portalsPage; private GameObject? _portalLevelsPage; private GameObject? _fusionServersPage; private GameObject? _fusionServerDetailsPage; private TMP_Text? _portalStatus; private TMP_Text? _portalModeText; private TouchButton? _portalLocalButton; private TouchButton? _portalWorldButton; private TouchButton? _portalRemoveButton; private TouchButton? _portalLevelsButton; private TouchButton? _portalServersButton; private TouchButton? _portalLevelActionButton; private TMP_Text? _portalLevelName; private TMP_Text? _portalLevelDetails; private TMP_Text? _portalLevelPosition; private TMP_Text? _portalLevelStatus; private TouchButton? _fusionServerActionButton; private TouchButton? _fusionServerJoinButton; private RawImage? _fusionServerArtwork; private TMP_Text? _fusionServerListPosition; private TMP_Text? _fusionServerListStatus; private TMP_Text? _fusionServerName; private TMP_Text? _fusionServerDetails; private TMP_Text? _fusionServerPosition; private TMP_Text? _fusionServerStatus; private TMP_Text? _fusionServerDescription; private TMP_Text? _fusionServerMembers; private PortalPlacementStage _portalPlacementStage; private PortalEndpoint? _pendingPortalEntrance; private PortalLinkState? _activePortal; private bool _activePortalLocallyCreated; private int _portalGeneration; private bool _portalTriggerHeld; private float _portalPointerReadyAt; private LineRenderer? _portalPointerLine; private GameObject? _portalPointerReticle; private Renderer? _portalPointerRenderer; private Material? _portalMaterial; private MaterialPropertyBlock? _portalPropertyBlock; private BoneHubPortalVisual? _portalVisual; private Vector3 _previousPortalHead; private bool _hasPreviousPortalHead; private float _nextPortalLevelScan; private string _selectedPortalLevelBarcode = string.Empty; private int _portalLevelIndex; private string _portalLevelQuery = string.Empty; private int _portalLevelSearchGeneration; private int _fusionServerRequestGeneration; private int _fusionServerIndex; private int _fusionServerPageIndex; private string _selectedFusionServerCode = string.Empty; private string _fusionServerCodeInput = string.Empty; private int _fusionServerArtworkGeneration; private string _fusionServerArtworkCode = string.Empty; private long _pendingPortalLevelModId; private float _pendingPortalLevelDeadline; private float _nextPortalInstallScan; private readonly HashSet _portalLevelBarcodesBeforeDownload = new HashSet(StringComparer.OrdinalIgnoreCase); private static TMP_FontAsset? _osWordmarkFont; private static bool _osWordmarkFontResolved; private readonly List _codeModRows = new List(4); private readonly List _codeModItems = new List(); private readonly List _loadedCodeMods = new List(); private readonly ConcurrentQueue _sdkOpenRequests = new ConcurrentQueue(); private readonly ConcurrentQueue _sdkNotifications = new ConcurrentQueue(); private const int MiniMapTextureSize = 32; private readonly Color[] _miniMapPixels = (Color[])(object)new Color[1024]; private readonly float[] _miniMapHeights = new float[1024]; private readonly byte[] _miniMapCellState = new byte[1024]; private readonly List _miniMapPeerVisuals = new List(16); private readonly List _miniMapPortalDots = new List(2); private readonly List _spawnableEntries = new List(); private readonly List _spawnableCatalog = new List(); private readonly Dictionary _spawnableCrates = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly RaycastHit[] _miniMapHits = (RaycastHit[])(object)new RaycastHit[12]; private readonly RaycastHit[] _spawnPointerHits = (RaycastHit[])(object)new RaycastHit[16]; private readonly List _spawnedObjects = new List(32); private readonly WristOsRouter _osRouter = new WristOsRouter(); private readonly FusionMiniMapBridge _miniMapFusion = new FusionMiniMapBridge(); private readonly List _miniMapPeers = new List(16); private readonly List _miniMapSuppressedRenderers = new List(64); private GameObject? _codeModsPage; private GameObject? _miniMapPage; private GameObject? _spawnablesPage; private GameObject? _notificationsPage; private TMP_Text? _osStatusText; private TMP_Text? _codeModTitle; private TMP_Text? _codeModPosition; private TouchButton? _codeModCommunityButton; private TMP_Text? _miniMapHeading; private TMP_Text? _miniMapRangeText; private TMP_Text? _miniMapScanText; private TouchButton? _miniMapModeButton; private TMP_Text? _miniMapRangeValue; private TMP_Text? _spawnableName; private TMP_Text? _spawnableDetails; private TMP_Text? _spawnablePosition; private TMP_Text? _spawnableStatus; private TMP_Text? _notificationText; private GameObject? _spawnablePreview; private GameObject? _spawnableNativePreview; private GameObject? _spawnPlacementPreview; private GameObject? _spawnPointerReticle; private LineRenderer? _spawnPointerLine; private TouchButton? _spawnActionButton; private TouchButton? _spawnableModeButton; private TouchButton? _spawnableFavoriteButton; private TouchButton? _spawnDeleteButton; private Mesh? _spawnablePreviewMesh; private MiniMapPeerOverlay? _miniMapPeerOverlay; private RectTransform? _miniMapViewport; private RectTransform? _miniMapGeometryRoot; private Image? _miniMapLayoutImage; private Texture2D? _miniMapLayoutTexture; private Sprite? _miniMapLayoutSprite; private GameObject? _miniMapCaptureObject; private Camera? _miniMapCaptureCamera; private RenderTexture? _miniMapCaptureTexture; private RenderTexture? _miniMapCaptureBackTexture; private RawImage? _miniMapSceneImage; private RectTransform? _miniMapBearingRoot; private RectTransform? _miniMapMarkerRoot; private object? _activeBoneMenuPage; private object? _managerControlCachePage; private IReadOnlyList _managerControlCache = Array.Empty(); private float _managerControlCacheUntil; private object? _activeCodeModStringElement; private WristHubApp? _activeSdkApp; private WristHubPage? _activeSdkPage; private WristHubTextInput? _activeSdkText; private RuntimeSdkHost? _sdkHost; private bool _showLegacyBoneMenu; private bool _optionsReturnToHub; private string _latestSdkNotification = string.Empty; private WristKeyboardPurpose _wristKeyboardPurpose; private string _codeModQuery = string.Empty; private CodeModCatalogMode _codeModCatalogMode; private string _spawnableQuery = string.Empty; private TouchButton? _keyboardSubmitButton; private int _codeModPageIndex; private int _spawnableIndex; private int _spawnablePreviewGeneration; private int _spawnableManifestCount = -1; private bool _spawnPlacementActive; private bool _spawnDeleteActive; private bool _spawnTriggerHeld; private Hand? _spawnPlacementHand; private float _spawnPlacementYaw; private float _spawnPlacementDistance = 1.5f; private GameObject? _spawnDeleteTarget; private GameObject? _pendingGrabObject; private Hand? _pendingGrabHand; private float _pendingGrabDeadline; private float _nextPendingGrabAttempt; private float _spawnPointerReadyAt; private Material? _spawnPointerMaterial; private MaterialPropertyBlock? _spawnPointerBlock; private Renderer? _spawnPointerRenderer; private SpawnableBrowseMode _spawnableMode; private float _nextCodeModRefresh; private float _nextLoadedCodeModScan; private string _lastCodeModCatalogSignature = string.Empty; private float _nextMiniMapPeerRefresh; private float _nextMiniMapOverlayRender; private float _nextMiniMapOverlayRecovery; private bool _miniMapOverlayDiagnosticLogged; private bool _miniMapOverlayRecovering; private float _nextSpawnableRefresh; private int _lastMiniMapDegree = -1; private int _lastMiniMapPeerCount = -1; private int _miniMapRasterCursor; private int _miniMapRasterSamplesRemaining; private bool _miniMapTextureDirty; private float _nextMiniMapTextureUpload; private bool _miniMapCaptureValid; private Vector3 _miniMapCaptureCenter; private Vector3 _miniMapPendingCaptureCenter; private Vector3 _miniMapScanOrigin; private float _miniMapReferenceFloorY; private bool _miniMapScanOriginValid; private Color Cyan => WristHubThemePalette.Accent(_preferences.HologramTheme); private Color DimCyan => WristHubThemePalette.Dim(_preferences.HologramTheme); public bool IsOpen { get { if ((Object)(object)_browser != (Object)null) { return _browser.activeSelf; } return false; } } public bool IsLauncherOpen { get { if ((Object)(object)_root != (Object)null) { return _root.activeSelf; } return false; } } public bool IsClosing => (int)_lifecycle == 3; public string Query => _query; public event Action? Closed; public BoneHubAvatarBrowser(BoneHubService service, BoneHubRuntime runtime, BoneHubThumbnailCache thumbnails, ConcurrentQueue mainThread, BoneHubPreferences preferences, bool constrainedRendering, Instance log, LobbyAvatarSharingBridge? sharing = null) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_0159: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Expected O, but got Unknown _service = service; _runtime = runtime; _thumbnails = thumbnails; _mainThread = mainThread; _preferences = preferences; _constrainedRendering = constrainedRendering; _log = log; _sharing = sharing ?? new LobbyAvatarSharingBridge(log); _projectionTickAction = TickProjectionStage; _projectionRecoveryAction = RecoverProjectionStage; _touchTickAction = TickTouchStage; _touchRecoveryAction = ResetTouchButtons; _installationFocusTickAction = UpdateInstalledPackFocus; _previewTickAction = ProcessPendingPreview; _previewRecoveryAction = RecoverPreviewStage; _downloadTickAction = UpdateDownloadProgress; _sharingTickAction = TickSharingRegistration; _compassTickAction = TickCompass; _portalStateReceiver = ReceivePortalState; _portalRemoveReceiver = ReceivePortalRemoval; } public void OpenLauncher() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); if (!((Object)(object)_root == (Object)null) && !((Object)(object)_hub == (Object)null) && !((Object)(object)_browser == (Object)null)) { _wristLocalPoseValid = false; FollowWrist(immediate: true); _root.SetActive(true); if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } _hub.SetActive(true); _browser.SetActive(false); _hologramCarousel?.SetVisible(visible: false); _viewState = (AvatarBrowserViewState)1; _osRouter.ShowHome(); _promptDismissal.Reset(); RefreshEntries(); StartHologramProjection(); _hubControlsReadyAt = Time.unscaledTime + (_preferences.ReducedMotion ? 0f : 0.55f); RequireInputRearm(); _log.Msg("WristHub compact module hub projection opened."); } } public void Open() { //IL_0080: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) OpenLauncher(); if (!((Object)(object)_browser == (Object)null)) { if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } _browser.SetActive(true); StartHologramProjection(); _query = string.Empty; _downloadsOnly = false; _selectedPackId = null; _scope = AvatarBrowseStartup.Resolve(_preferences.AvatarBrowserStartupMode, _preferences.LastAvatarBrowseScope); _scopeBeforeSearch = _scope; _viewState = (AvatarBrowserViewState)2; RememberScope(); RefreshEntries(); ShowScopePage(); } } public void OpenSearch() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) OpenLauncher(); if (!((Object)(object)_browser == (Object)null)) { if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } _browser.SetActive(true); StartHologramProjection(); _selectedPackId = null; _scope = AvatarBrowseStartup.Resolve(_preferences.AvatarBrowserStartupMode, _preferences.LastAvatarBrowseScope); _scopeBeforeSearch = _scope; RefreshEntries(); OpenKeyboard(); } } public void Close() { BeginClose(_preferences.ReducedMotion); } private void BeginClose(bool immediate) { //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_0007: 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_000c: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) HologramDashboardLifecycle lifecycle = _lifecycle; if (((int)lifecycle != 0 && (int)lifecycle != 3) || 1 == 0) { if (_previewHeld) { EndPreviewDrag(equipIfAtChest: false); } CancelSpawnPlacement(); _osRouter.BeginClose(); ResetTouchButtons(); ResetTrashConfirmation(); CancelPendingSharingRegistration(); _closeVisualStart = CurrentVisibleProgress(); _lifecycle = (HologramDashboardLifecycle)3; _lifecycleStartedAt = Time.unscaledTime; _closeNotificationPending = true; _hologramProjection?.Hide(immediate); _chestEquipGuide?.Hide(immediate: true); _artworkGeneration.Next(); _previewGeneration++; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _promptDismissal.Reset(); if (immediate) { FinalizeClose(); } } } private void FinalizeClose() { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } if ((Object)(object)_browser != (Object)null) { _browser.SetActive(false); } if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } _hologramCarousel?.SetVisible(visible: false); _hologramProjection?.Hide(immediate: true); _loadedPreviewBarcode = string.Empty; _previewReady = false; _previewInteractionReady = false; _lifecycle = (HologramDashboardLifecycle)0; if (_closeNotificationPending) { _closeNotificationPending = false; this.Closed?.Invoke(); } } public void SetQuery(string value) { //IL_00c6: 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_017f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = 1f; } if ((Object)(object)_root != (Object)null) { _root.SetActive(true); } if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } if ((Object)(object)_browser != (Object)null) { _browser.SetActive(true); } _query = value?.Trim() ?? string.Empty; _downloadsOnly = false; _onlineEntries = Array.Empty(); _viewState = (AvatarBrowserViewState)((_query.Length == 0) ? 2 : 15); _log.Msg($"Avatar search submitted ({_query.Length} characters). Query text is not logged."); RefreshEntries(); if (_query.Length == 0) { ShowScopePage(); } else { _scope = (AvatarBrowseScope)0; _selectedPackId = null; RefreshEntries(); ShowDetailPage(); } int generation = ++_searchGeneration; if (_query.Length != 0 && _service.ModIoReady) { SetStatus("Searching BONELAB mod.io…", Cyan); SearchOnlineAsync(_query, generation); } } public void Refresh() { RefreshEntries(); RefreshVisiblePage(); } public void Select(string identity) { AvatarEntry val = ((IEnumerable)_entries).FirstOrDefault((Func)((AvatarEntry item) => string.Equals(item.Identity, identity, StringComparison.OrdinalIgnoreCase))); if (!(val == (AvatarEntry)null)) { _selectedIdentity = val.Identity; _cursor.Keep(_entries.Count, IndexOf(val.Identity)); ShowDetailPage(); RefreshSelection(val); } } public void OnDownloadChanged(DownloadJob job) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_007f: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //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_0129: 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_012d: Invalid comparison between Unknown and I4 //IL_01a3: 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_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected I4, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) _jobs[job.Mod.Id] = job; if ((int)job.State == 6) { _log.Warning("WristHub download failed: " + Readable(job.Error ?? "Unknown download failure.")); } else if ((int)job.State == 5) { _log.Msg("WristHub download and safe installation completed."); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null && downloadsPage.activeSelf) { RefreshDownloadsPage(); } DownloadState state = job.State; if (state - 5 <= 2) { _startingDownloads.Remove(job.Mod.Id); } if ((int)job.State == 5 && _installedFocus.Active && _installedFocus.ModId == job.Mod.Id) { InstalledPackFocus installedFocus = _installedFocus; long id = job.Mod.Id; double num = Time.unscaledTime; InstalledModRecord result = job.Result; installedFocus.MarkDownloaded(id, num, (IEnumerable)((result != null) ? result.InstalledDirectories : null), 12.0); _log.Msg("Downloaded root pack completed; waiting for its runtime avatar crates."); } else { state = job.State; bool flag = state - 6 <= 1; if (flag && _installedFocus.ModId == job.Mod.Id) { _installedFocus.Clear(); } } RefreshEntries(); AvatarEntry? obj = Selected(); if (((obj != null) ? new long?(obj.ModId) : ((long?)null)) == job.Mod.Id) { state = job.State; _viewState = (AvatarBrowserViewState)((state - 5) switch { 1 => 19, 0 => 18, 2 => 16, _ => 17, }); RefreshVisiblePage(); } } public void OnRuntimeStatusChanged(string status) { //IL_006e: 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_005f: Unknown result type (might be due to invalid IL or missing references) GameObject? browser = _browser; if (browser != null && browser.activeSelf && !string.IsNullOrWhiteSpace(status)) { bool flag = status.Contains("failed", StringComparison.OrdinalIgnoreCase) || status.Contains("could not", StringComparison.OrdinalIgnoreCase) || status.Contains("rejected", StringComparison.OrdinalIgnoreCase); SetStatus(status, flag ? Red : (status.Contains("sharing", StringComparison.OrdinalIgnoreCase) ? Cyan : Green)); } } public void OnEquipFinished(BoneHubAvatar avatar, bool success) { //IL_0051: 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) if (success) { AvatarEntry? obj = Selected(); if (string.Equals((obj != null) ? obj.Barcode : null, avatar.Barcode, StringComparison.OrdinalIgnoreCase) && _previewMetrics.TryGetValue(avatar.Barcode, out var value)) { SetHeight(((AvatarPreviewMetrics)(ref value)).HeightDisplayText, ((AvatarPreviewMetrics)(ref value)).Valid ? Green : Red); } } } public void OnAvatarsChanged(long modId, IReadOnlyList avatars) { //IL_0062: 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) _previewMetrics.Clear(); _previewRoutes.Clear(); _rigValidations.Clear(); if (avatars.Any((BoneHubAvatar avatar) => string.Equals(avatar.Barcode, _loadedPreviewBarcode, StringComparison.OrdinalIgnoreCase))) { _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; } _fingertips.Invalidate(); _projectionAnchors.Invalidate(); _hologramProjection?.BeginTrackingGrace(); RefreshEntries(); if (_installedFocus.TryBind(modId, avatars.Select((BoneHubAvatar avatar) => avatar.Barcode))) { _selectedPackId = modId; _query = string.Empty; _onlineEntries = Array.Empty(); _downloadsOnly = false; IReadOnlyList avatars2 = _runtime.GetAvatars(modId); _entries = ((avatars2.Count > 0) ? avatars2 : avatars).Select((BoneHubAvatar avatar) => avatar.ToEntry()).OrderBy((AvatarEntry entry) => entry.AvatarName, StringComparer.OrdinalIgnoreCase).ToArray(); _selectedIdentity = _entries.First((AvatarEntry entry) => string.Equals(entry.Barcode, _installedFocus.SelectedBarcode, StringComparison.OrdinalIgnoreCase)).Identity; _cursor.Keep(_entries.Count, IndexOf(_selectedIdentity)); ShowDetailPage(); SetStatus("Downloaded - ready to equip", Green); _log.Msg($"Downloaded avatar pack bound to {avatars.Count} runtime crate{((avatars.Count == 1) ? string.Empty : "s")}; Equip is ready."); return; } if (avatars.Count > 0) { AvatarEntry? obj = Selected(); if (obj != null && obj.ModId == modId) { AvatarEntry? obj2 = Selected(); if (string.IsNullOrWhiteSpace((obj2 != null) ? obj2.Barcode : null)) { _selectedIdentity = avatars[0].ToEntry().Identity; RefreshEntries(); } } } RefreshVisiblePage(); } public void OnSceneChanged(string sceneName = "") { //IL_00be: Unknown result type (might be due to invalid IL or missing references) _compassSceneKey = NormalizeSceneKey(sceneName); _compassHeadingValid = false; _lastCompassDegree = -1; _fingertips.Invalidate(); _projectionAnchors.Invalidate(); _wristLocalPoseValid = false; _hologramProjection?.BeginTrackingGrace(); ResetTouchButtons(); OnWristOsSceneChanged(); if ((Object)(object)_root == (Object)null) { return; } bool reportRecovery = PreviewShellRecovery.RequiresRebuild((Object)(object)_previewShell != (Object)null, (Object)(object)_previewFallback != (Object)null); if (EnsurePreviewShell(reportRecovery)) { ClearPreviewModel(); _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; GameObject? detailPage = _detailPage; if (detailPage != null && detailPage.activeSelf) { RefreshFocusedResult(); } } } public void Tick() { //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Invalid comparison between Unknown and I4 //IL_0061: Unknown result type (might be due to invalid IL or missing references) _hologramProjection?.Tick(_preferences.ReducedMotion); BoneHubHologramCarousel? hologramCarousel = _hologramCarousel; if (hologramCarousel != null) { float assemblyProgress = _hologramProjection?.SideAvatarProgress ?? 1f; bool reducedMotion = _preferences.ReducedMotion; BoneHubForearmProjection? hologramProjection = _hologramProjection; hologramCarousel.Tick(assemblyProgress, reducedMotion, (HoloPerformanceTier)((hologramProjection == null) ? (_constrainedRendering ? 1 : 0) : ((int)hologramProjection.PerformanceTier))); } _chestEquipGuide?.Tick(_preferences.ReducedMotion); if (IsLocalPlayerDead()) { if (!_wasPlayerDead && _activePortal != (PortalLinkState)null) { RemovePortal(IsFusionHost(), hideImmediately: true); } if (!_wasPlayerDead && IsLauncherOpen) { _log.Msg("WristHub closed because the local player died."); BeginClose(immediate: true); } _wasPlayerDead = true; return; } _wasPlayerDead = false; try { FusionPortalBridge.Attach(_portalStateReceiver, _portalRemoveReceiver); _portalVisual?.Tick(Time.unscaledTime, _preferences.ReducedMotion); if (_activePortal != (PortalLinkState)null) { TickPortals(); } } catch (Exception ex) { string text = "portal-global|" + ex.GetType().FullName; if (_runtimeErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Error("WristHub portal update recovered (repeats suppressed): " + ex.Message); } } if (!IsLauncherOpen || (Object)(object)Player.Head == (Object)null) { return; } if ((int)_lifecycle == 3) { FollowWrist(); UpdateLifecycleVisuals(); if ((double)(Time.unscaledTime - _lifecycleStartedAt) >= 0.35) { FinalizeClose(); } } else { RunGuarded("projection", _projectionTickAction, _projectionRecoveryAction); RunGuarded("touch", _touchTickAction, _touchRecoveryAction); RunGuarded("installation-focus", _installationFocusTickAction); RunGuarded("preview", _previewTickAction, _previewRecoveryAction); RunGuarded("download", _downloadTickAction); RunGuarded("sharing", _sharingTickAction, CancelPendingSharingRegistration); RunGuarded("compass", _compassTickAction); RunGuarded("wrist-os", TickWristOs); } } private void TickProjectionStage() { FollowWrist(); UpdateHologramProjection(); UpdateLifecycleVisuals(); } private void RecoverProjectionStage() { _projectionAnchors.Invalidate(); _hologramProjection?.BeginTrackingGrace(); } private void TickTouchStage() { UpdatePushPromptVisibility(); PollButtons(); } private void RecoverPreviewStage() { EndPreviewDrag(equipIfAtChest: false); } public void LateTick() { if (!IsLauncherOpen || (Object)(object)Player.Head == (Object)null) { return; } try { FollowWrist(immediate: true); UpdateHologramProjection(finalPoseOnly: true); UpdatePreview(); } catch (Exception ex) { string text = "late-drag|" + ex.GetType().FullName; if (_runtimeErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Error($"WristHub preview drag recovered: {ex}"); } EndPreviewDrag(equipIfAtChest: false); } } private void RunGuarded(string subsystem, Action action, Action? recover = null) { try { action(); } catch (Exception ex) { string text = ex.StackTrace?.Split('\n').FirstOrDefault()?.Trim() ?? "no-stack"; string text2 = subsystem + "|" + ex.GetType().FullName + "|" + text; if (_runtimeErrorThrottle.ShouldLog(text2, (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Error($"WristHub {subsystem} update recovered (repeats suppressed): {ex}"); } try { recover?.Invoke(); } catch { } } } public void Dispose() { if (!_disposed) { _disposed = true; _searchGeneration++; DisposeWristOs(); ResetUiReferences(destroyOwnedObjects: true); } } private void EnsureBuilt() { if (!((Object)(object)_root != (Object)null)) { ResetUiReferences(destroyOwnedObjects: true); BuildTablet(); } } private void ResetUiReferences(bool destroyOwnedObjects) { //IL_043e: Unknown result type (might be due to invalid IL or missing references) ResetWristOsReferences(destroyOwnedObjects); foreach (PackRow packRow in _packRows) { packRow.Generation++; } ResetTouchButtons(); _buttons.Clear(); _packRows.Clear(); _touchCaptures.Clear(); _activeProbeIds.Clear(); _staleCaptureIds.Clear(); _artworkGeneration.Next(); _previewGeneration++; if (destroyOwnedObjects) { try { if ((Object)(object)_previewModel != (Object)null) { Object.Destroy((Object)(object)_previewModel); } } catch { } foreach (Mesh ownedPreviewMesh in _ownedPreviewMeshes) { try { if ((Object)(object)ownedPreviewMesh != (Object)null) { Object.Destroy((Object)(object)ownedPreviewMesh); } } catch { } } try { if ((Object)(object)_previewShell != (Object)null) { Object.Destroy((Object)(object)_previewShell); } } catch { } try { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } } catch { } try { if ((Object)(object)_placeholderTexture != (Object)null) { Object.Destroy((Object)(object)_placeholderTexture); } } catch { } try { if ((Object)(object)_roundedSprite != (Object)null) { Object.Destroy((Object)(object)_roundedSprite); } } catch { } try { if ((Object)(object)_roundedTexture != (Object)null) { Object.Destroy((Object)(object)_roundedTexture); } } catch { } DisposeButtonIconSprites(); try { _hologramProjection?.Dispose(); } catch { } try { _hologramCarousel?.Dispose(); } catch { } try { _chestEquipGuide?.Dispose(); } catch { } } _ownedPreviewMeshes.Clear(); _hologramProjection = null; _hologramCarousel = null; _chestEquipGuide = null; _root = null; _launcher = null; _hub = null; _browser = null; _canvasRoot = null; _packPage = null; _detailPage = null; _optionsPage = null; _watchPlacementPage = null; _downloadsPage = null; _packOptionsPage = null; _keyboardPage = null; _deletePage = null; _compassPage = null; _denseGlassChrome = null; _denseGlassBackground = null; _denseGlassOverlay = null; _wristLocalPoseValid = false; _wristLocalHandId = 0; _leftArcWing = null; _rightArcWing = null; _metadataArc = null; _canvasGroup = null; _carouselIdentity = string.Empty; _packTitle = null; _packStatus = null; _packPosition = null; _packSearchText = null; _sortText = null; _wristText = null; _scaleText = null; _motionText = null; _themeText = null; _clockText = null; _startingViewText = null; _watchForearmText = null; _scopeText = null; _downloadsSummary = null; _deleteTitle = null; _deleteDetails = null; _keyboardText = null; _keyboardTitle = null; _keyboardShiftText = null; _searchText = null; _compassHeadingText = null; _compassCalibrationText = null; _compassNeedle = null; _compassDecorRing = null; _positionText = null; _selectedName = null; _creatorText = null; _modText = null; _statusText = null; _heightText = null; _heightRuler = null; _progressRoot = null; _progressFill = null; _progressText = null; _actionLabel = null; _actionPanel = null; _trashButton = null; _centralArtwork = null; _placeholderTexture = null; _roundedTexture = null; _roundedSprite = null; _actionButton = null; _previewShell = null; _previewFallback = null; _previewModel = null; _previewAvatar = null; _pendingPreviewAvatar = null; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _previewReady = false; _previewInteractionReady = false; _previewHeld = false; _dragHand = null; _dragWasInsideChest = false; _previewReturning = false; _lifecycle = (HologramDashboardLifecycle)0; _closeNotificationPending = false; CancelPendingSharingRegistration(); } private void BuildTablet() { //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_0063: 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_0092: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_015f: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_01be: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_0243: 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_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_03af: 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_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_0410: 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_042a: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0491: 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_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Expected O, but got Unknown //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Expected O, but got Unknown //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Expected O, but got Unknown //IL_082b: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Expected O, but got Unknown //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_092f: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_0a21: Unknown result type (might be due to invalid IL or missing references) //IL_0a26: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Unknown result type (might be due to invalid IL or missing references) //IL_0a8b: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ace: Unknown result type (might be due to invalid IL or missing references) //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0ad8: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Unknown result type (might be due to invalid IL or missing references) //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b39: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0b7b: Unknown result type (might be due to invalid IL or missing references) //IL_0b80: Unknown result type (might be due to invalid IL or missing references) //IL_0b85: Unknown result type (might be due to invalid IL or missing references) //IL_0bbd: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd2: Unknown result type (might be due to invalid IL or missing references) //IL_0c0a: Unknown result type (might be due to invalid IL or missing references) //IL_0c0f: Unknown result type (might be due to invalid IL or missing references) //IL_0c14: Unknown result type (might be due to invalid IL or missing references) //IL_0c19: Unknown result type (might be due to invalid IL or missing references) //IL_0c1f: Unknown result type (might be due to invalid IL or missing references) //IL_0c60: Unknown result type (might be due to invalid IL or missing references) //IL_0c6b: Unknown result type (might be due to invalid IL or missing references) //IL_0c97: Unknown result type (might be due to invalid IL or missing references) //IL_0ca1: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Unknown result type (might be due to invalid IL or missing references) //IL_0cf8: Unknown result type (might be due to invalid IL or missing references) //IL_0d16: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0d47: Unknown result type (might be due to invalid IL or missing references) //IL_0d73: Unknown result type (might be due to invalid IL or missing references) //IL_0d7e: Unknown result type (might be due to invalid IL or missing references) //IL_0db0: Unknown result type (might be due to invalid IL or missing references) //IL_0db5: Unknown result type (might be due to invalid IL or missing references) //IL_0dba: Unknown result type (might be due to invalid IL or missing references) //IL_0dbf: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Unknown result type (might be due to invalid IL or missing references) _roundedTexture = CreateRoundedTexture(); _roundedSprite = Sprite.Create(_roundedTexture, new Rect(0f, 0f, (float)((Texture)_roundedTexture).width, (float)((Texture)_roundedTexture).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(16f, 16f, 16f, 16f)); ((Object)_roundedSprite).name = "WristHub Rounded UI Sprite"; _root = new GameObject("[WristHub] Wrist Avatar Browser"); Object.DontDestroyOnLoad((Object)(object)_root); BuildHologramProjection(); _hub = new GameObject("WristHub Module Hub"); _hub.transform.SetParent(_root.transform, false); BuildModuleStage(_hub.transform); GameObject val = CreateCanvas(_hub.transform, "Radial Module UI", 230f, 176f, 0.009f); BuildWristOsHome(val.transform); _hub.SetActive(false); _placeholderTexture = CreatePlaceholderTexture(); _browser = new GameObject("Compact 30x19cm Arc Hologram Dashboard"); _browser.transform.SetParent(_root.transform, false); _browser.transform.localScale = Vector3.one * 0.88f; _denseGlassChrome = new GameObject("Dense Glass Panel Chrome"); _denseGlassChrome.transform.SetParent(_browser.transform, false); CreatePanel(_denseGlassChrome.transform, "Glass Panel Shadow", new Vector3(0.006f, -0.007f, -0.006f), new Vector3(0.35f, 0.22f, 0.009f), new Color(0f, 0f, 0f, 0.62f), (PrimitiveType)3); CreatePanel(_denseGlassChrome.transform, "Curved Glass Panel", Vector3.zero, new Vector3(0.34f, 0.21f, 0.007f), new Color(Glass.r, Glass.g, Glass.b, 0.94f), (PrimitiveType)3); _canvasRoot = CreateCanvas(_browser.transform, "WristHub Tablet Canvas", 340f, 210f, 0.006f); _canvasGroup = _canvasRoot.AddComponent(); RawImage val2 = CreateRawImage(_canvasRoot.transform, "WristHub Background", AvatarTabletLayout.Tablet, BoneHubTheme.Background ?? _placeholderTexture, Color.white); _denseGlassBackground = ((Component)val2).gameObject; ((Graphic)val2).raycastTarget = false; Image val3 = CreateImage(_canvasRoot.transform, "Calm Dark Overlay", AvatarTabletLayout.Tablet, new Color(0.005f, 0.024f, 0.038f, 0.72f)); _denseGlassOverlay = ((Component)val3).gameObject; ((Graphic)val3).raycastTarget = false; _packPage = new GameObject("Mod Pack Library Page"); _packPage.transform.SetParent(_canvasRoot.transform, false); _packTitle = CreateText(_packPage.transform, "GROUPS", new TabletRect(92f, 83f, 64f, 25f), 15f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser.transform, _packPage.transform, "BACK", new Vector3(-0.145f, 0.083f, 0.007f), new Vector3(0.042f, 0.028f, 0.014f), DimCyan, BackFromPackPage, 9f); TouchButton touchButton = CreateButton(_browser.transform, _packPage.transform, "SEARCH", new Vector3(-0.09f, 0.083f, 0.007f), new Vector3(0.064f, 0.028f, 0.014f), DimCyan, OpenKeyboard, 11f); _packSearchText = touchButton.Label; CreateButton(_browser.transform, _packPage.transform, "ALL", new Vector3(-0.034f, 0.083f, 0.007f), new Vector3(0.046f, 0.028f, 0.014f), Cyan, ShowAllAvatars, 12f); CreateButton(_browser.transform, _packPage.transform, "OPTIONS", new Vector3(0.025f, 0.083f, 0.007f), new Vector3(0.068f, 0.028f, 0.014f), DimCyan, ShowOptionsPage, 9f); CreateButton(_browser.transform, _packPage.transform, "X", new Vector3(0.148f, 0.083f, 0.007f), new Vector3(0.026f, 0.028f, 0.014f), Red, Close, 19f); for (int i = 0; i < 4; i++) { CreatePackRow(i); } CreateButton(_browser.transform, _packPage.transform, "<", new Vector3(-0.135f, -0.091f, 0.007f), new Vector3(0.05f, 0.026f, 0.014f), DimCyan, delegate { MovePackPage(-1); }, 22f); _packPosition = CreateText(_packPage.transform, "1 / 1", new TabletRect(0f, -91f, 90f, 24f), 14f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser.transform, _packPage.transform, ">", new Vector3(0.135f, -0.091f, 0.007f), new Vector3(0.05f, 0.026f, 0.014f), DimCyan, delegate { MovePackPage(1); }, 22f); _packStatus = CreateText(_packPage.transform, string.Empty, new TabletRect(0f, -72f, 250f, 10f), 11f, new Color(0.7f, 0.82f, 0.88f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _detailPage = new GameObject("Arc Dashboard Avatar Page"); _detailPage.transform.SetParent(_canvasRoot.transform, false); _leftArcWing = new GameObject("Left Curved Glass Wing"); _leftArcWing.transform.SetParent(_detailPage.transform, false); CreateImage(_leftArcWing.transform, "Left Wing Glass", ArcDashboardLayout.LeftWing, new Color(0.006f, 0.026f, 0.038f, 0.92f)); CreateImage(_leftArcWing.transform, "Left Wing Cyan Edge", new TabletRect(((TabletRect)(ref ArcDashboardLayout.LeftWing)).Right - 1.5f, ((TabletRect)(ref ArcDashboardLayout.LeftWing)).Y, 3f, ((TabletRect)(ref ArcDashboardLayout.LeftWing)).Height - 14f), new Color(Cyan.r, Cyan.g, Cyan.b, 0.55f)); _rightArcWing = new GameObject("Right Curved Glass Wing"); _rightArcWing.transform.SetParent(_detailPage.transform, false); CreateImage(_rightArcWing.transform, "Right Wing Glass", ArcDashboardLayout.RightWing, new Color(0.006f, 0.026f, 0.038f, 0.92f)); CreateImage(_rightArcWing.transform, "Right Wing Cyan Edge", new TabletRect(((TabletRect)(ref ArcDashboardLayout.RightWing)).Left + 1.5f, ((TabletRect)(ref ArcDashboardLayout.RightWing)).Y, 3f, ((TabletRect)(ref ArcDashboardLayout.RightWing)).Height - 14f), new Color(Cyan.r, Cyan.g, Cyan.b, 0.55f)); _metadataArc = new GameObject("Floating Avatar Metadata Arc"); _metadataArc.transform.SetParent(_detailPage.transform, false); CreateImage(_metadataArc.transform, "Upper Metadata Glass", new TabletRect(0f, 73f, 184f, 38f), new Color(0.006f, 0.026f, 0.038f, 0.78f)); CreateImage(_metadataArc.transform, "Lower Metadata Glass", new TabletRect(0f, -53f, 206f, 24f), new Color(0.006f, 0.026f, 0.038f, 0.82f)); CreateImage(_detailPage.transform, "Circular Hologram Stage", ArcDashboardLayout.Stage, new Color(0.01f, 0.18f, 0.24f, 0.1f)); CreateButton(_browser.transform, _detailPage.transform, "BACK", PixelCenter(ArcDashboardLayout.Back), PixelSize(ArcDashboardLayout.Back), DimCyan, BackFromDetailPage, 8f); TouchButton touchButton2 = CreateButton(_browser.transform, _detailPage.transform, "SEARCH", PixelCenter(ArcDashboardLayout.Search), PixelSize(ArcDashboardLayout.Search), DimCyan, OpenKeyboard, 9f); _searchText = touchButton2.Label; CreateButton(_browser.transform, _detailPage.transform, "PACK", PixelCenter(ArcDashboardLayout.Pack), PixelSize(ArcDashboardLayout.Pack), DimCyan, ShowPackOptionsPage, 9f); TouchButton touchButton3 = CreateButton(_browser.transform, _detailPage.transform, "ALL", PixelCenter(ArcDashboardLayout.Scope), PixelSize(ArcDashboardLayout.Scope), Cyan, ToggleScopeOrDownloads, 10f); _scopeText = touchButton3.Label; CreateButton(_browser.transform, _detailPage.transform, "OPTIONS", PixelCenter(ArcDashboardLayout.Options), PixelSize(ArcDashboardLayout.Options), DimCyan, ShowOptionsPage, 8f); CreateButton(_browser.transform, _detailPage.transform, "X", PixelCenter(ArcDashboardLayout.Close), PixelSize(ArcDashboardLayout.Close), Red, Close, 18f); CreateButton(_browser.transform, _detailPage.transform, "<", PixelCenter(ArcDashboardLayout.Previous), PixelSize(ArcDashboardLayout.Previous), DimCyan, delegate { MoveFocused(-1); }, 25f); CreateButton(_browser.transform, _detailPage.transform, ">", PixelCenter(ArcDashboardLayout.Next), PixelSize(ArcDashboardLayout.Next), DimCyan, delegate { MoveFocused(1); }, 25f); _centralArtwork = CreateRawImage(_detailPage.transform, "Selected Artwork", new TabletRect(0f, 5f, 88f, 96f), _placeholderTexture, Color.white); ((Graphic)_centralArtwork).raycastTarget = false; _selectedName = CreateText(_metadataArc.transform, "Select an avatar", ArcDashboardLayout.Name, 15f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _creatorText = CreateText(_metadataArc.transform, string.Empty, ArcDashboardLayout.Creator, 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); _modText = CreateText(_metadataArc.transform, string.Empty, ArcDashboardLayout.PackName, 9f, new Color(0.72f, 0.82f, 0.88f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _positionText = CreateText(_metadataArc.transform, "0 / 0", ArcDashboardLayout.Position, 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateTabletHeightRuler(); _statusText = CreateText(_metadataArc.transform, "Ready", ArcDashboardLayout.Status, 8.5f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _actionButton = CreateButton(_browser.transform, _detailPage.transform, "EQUIP", PixelCenter(ArcDashboardLayout.Action), PixelSize(ArcDashboardLayout.Action), Cyan, ActivateSelected, 16f); _actionLabel = _actionButton.Label; _actionPanel = _actionButton.Panel; _trashButton = null; CreateTabletProgressBar(); BuildOptionsPage(); BuildWatchPlacementPage(); BuildDownloadsPage(); BuildPackOptionsPage(); BuildCompassPage(); BuildWristOsPages(); BuildKeyboardPage(); BuildDeletePage(); _packPage.SetActive(true); _detailPage.SetActive(false); GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? watchPlacementPage = _watchPlacementPage; if (watchPlacementPage != null) { watchPlacementPage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } HideWristOsAppPages(); GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } _browser.SetActive(false); CreatePreviewShell(); if ((Object)(object)_root != (Object)null) { _hologramCarousel = null; _root.SetActive(false); } } private void BuildHologramProjection() { if (_hologramProjection == null) { _hologramProjection = new BoneHubForearmProjection(_log, _constrainedRendering); } } private void BuildModuleStage(Transform parent) { //IL_003f: 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_00b3: 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_00e0: 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_0066: 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_0088: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 32; i++) { float num = (float)i / 32f * (float)Math.PI * 2f; ((Component)CreatePanel(parent, "Projected Module Ring", new Vector3(Mathf.Sin(num) * 0.061f, Mathf.Cos(num) * 0.061f, 0.002f), new Vector3(0.007f, 0.0011f, 0.0011f), (i % 4 == 0) ? Cyan : DimCyan, (PrimitiveType)3)).transform.localRotation = Quaternion.Euler(0f, 0f, (0f - num) * 57.29578f); } ((Component)CreatePanel(parent, "Module Emitter Core", new Vector3(0f, 0f, -0.002f), new Vector3(0.012f, 0.012f, 0.001f), new Color(0.08f, 0.6f, 0.72f, 0.45f), (PrimitiveType)2)).transform.localRotation = Quaternion.Euler(90f, 0f, 0f); } private void BuildDownloadsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00fc: 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_0116: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _downloadsPage = new GameObject("WristHub Downloads Glass Panel"); _downloadsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_downloadsPage.transform, "Downloads Glass", new TabletRect(0f, 0f, 286f, 168f), new Color(0.008f, 0.03f, 0.043f, 0.88f)); CreateText(_downloadsPage.transform, "DOWNLOADS", new TabletRect(-55f, 66f, 150f, 26f), 18f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser.transform, _downloadsPage.transform, "BACK", new Vector3(0.092f, 0.066f, 0.007f), new Vector3(0.06f, 0.026f, 0.014f), DimCyan, ShowHub, 10f); CreateButton(_browser.transform, _downloadsPage.transform, "X", new Vector3(0.13f, 0.066f, 0.007f), new Vector3(0.024f, 0.026f, 0.014f), Red, Close, 17f); _downloadsSummary = CreateText(_downloadsPage.transform, "No downloads yet", new TabletRect(0f, 5f, 252f, 88f), 12f, Color.white, (TextAlignmentOptions)257, (FontStyles)0); CreateButton(_browser.transform, _downloadsPage.transform, "CANCEL ACTIVE", new Vector3(0f, -0.065f, 0.007f), new Vector3(0.13f, 0.03f, 0.014f), Amber, CancelActiveDownload, 10f); _downloadsPage.SetActive(false); } } private void BuildPackOptionsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00fc: 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_0116: 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_0171: 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_01be: 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_01d7: 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_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _packOptionsPage = new GameObject("Avatar Pack Options Glass Panel"); _packOptionsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_packOptionsPage.transform, "Pack Options Glass", new TabletRect(0f, 0f, 250f, 150f), new Color(0.008f, 0.03f, 0.043f, 0.9f)); CreateText(_packOptionsPage.transform, "PACK OPTIONS", new TabletRect(0f, 53f, 190f, 25f), 17f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser.transform, _packOptionsPage.transform, "BACK", new Vector3(-0.076f, -0.052f, 0.007f), new Vector3(0.08f, 0.03f, 0.014f), DimCyan, ShowDetailPage, 11f); CreateButton(_browser.transform, _packOptionsPage.transform, "SETTINGS", new Vector3(0f, 0.012f, 0.007f), new Vector3(0.15f, 0.034f, 0.014f), DimCyan, ShowOptionsPage, 12f); CreateButton(_browser.transform, _packOptionsPage.transform, "DELETE PACK", new Vector3(0f, -0.029f, 0.007f), new Vector3(0.15f, 0.034f, 0.014f), Red, ShowDeleteConfirmation, 11f); CreateButton(_browser.transform, _packOptionsPage.transform, "X", new Vector3(0.108f, 0.054f, 0.007f), new Vector3(0.024f, 0.026f, 0.014f), Red, Close, 17f); _packOptionsPage.SetActive(false); } } private void BuildCompassPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f6: 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_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_026b: 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_02aa: 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_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Expected O, but got Unknown //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Expected O, but got Unknown //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_0717: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0744: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _compassPage = new GameObject("Projected Compass App"); _compassPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_compassPage.transform, "Compact Compass Glass", new TabletRect(0f, 0f, 154f, 178f), new Color(0.004f, 0.022f, 0.032f, 0.9f)); CreateText(_compassPage.transform, "COMPASS", new TabletRect(0f, 78f, 90f, 18f), 13f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateImage(_compassPage.transform, "Eleven Centimeter Dial", new TabletRect(0f, 7f, 110f, 110f), new Color(0.008f, 0.075f, 0.095f, 0.72f)); for (int i = 0; i < 32; i++) { float num = (float)i / 32f * (float)Math.PI * 2f; float num2 = 51f; bool flag = i % 4 == 0; ((Transform)((Graphic)CreateImage(_compassPage.transform, flag ? "Major Bearing Tick" : "Bearing Tick", new TabletRect(Mathf.Sin(num) * num2, 7f + Mathf.Cos(num) * num2, flag ? 2.2f : 1.2f, flag ? 8f : 5f), (Color)(flag ? Cyan : new Color(Cyan.r, Cyan.g, Cyan.b, 0.46f)))).rectTransform).localRotation = Quaternion.Euler(0f, 0f, (0f - num) * 57.29578f); } CreateText(_compassPage.transform, "N", new TabletRect(0f, 48f, 18f, 16f), 12f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateText(_compassPage.transform, "E", new TabletRect(44f, 7f, 18f, 16f), 10f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateText(_compassPage.transform, "S", new TabletRect(0f, -34f, 18f, 16f), 10f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateText(_compassPage.transform, "W", new TabletRect(-44f, 7f, 18f, 16f), 10f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); (string, float, float)[] array = new(string, float, float)[4] { ("NE", 31f, 36f), ("SE", 31f, -22f), ("SW", -31f, -22f), ("NW", -31f, 36f) }; for (int j = 0; j < array.Length; j++) { (string, float, float) tuple = array[j]; CreateText(_compassPage.transform, tuple.Item1, new TabletRect(tuple.Item2, tuple.Item3, 17f, 10f), 6.5f, new Color(0.6f, 0.82f, 0.88f, 1f), (TextAlignmentOptions)514, (FontStyles)1); } GameObject val = new GameObject("Smooth North Needle"); val.transform.SetParent(_compassPage.transform, false); _compassNeedle = val.AddComponent(); SetRect(_compassNeedle, new TabletRect(0f, 7f, 110f, 110f)); CreateImage((Transform)(object)_compassNeedle, "North Arrow", new TabletRect(0f, 22f, 4f, 40f), Cyan); CreateImage((Transform)(object)_compassNeedle, "Needle Tail", new TabletRect(0f, -15f, 2f, 27f), new Color(0.2f, 0.48f, 0.54f, 0.8f)); CreateImage((Transform)(object)_compassNeedle, "Needle Hub", new TabletRect(0f, 0f, 9f, 9f), Color.white); GameObject val2 = new GameObject("Slow Compass Detail Ring"); val2.transform.SetParent(_compassPage.transform, false); _compassDecorRing = val2.AddComponent(); SetRect(_compassDecorRing, new TabletRect(0f, 7f, 116f, 116f)); CreateImage((Transform)(object)_compassDecorRing, "Decor North Arc", new TabletRect(0f, 55f, 30f, 2f), new Color(Cyan.r, Cyan.g, Cyan.b, 0.7f)); _compassHeadingText = CreateText(_compassPage.transform, "N • 000°", new TabletRect(0f, -52f, 118f, 18f), 12f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _compassCalibrationText = CreateText(_compassPage.transform, "WORLD NORTH", new TabletRect(0f, -65f, 112f, 10f), 7f, new Color(0.62f, 0.78f, 0.84f, 1f), (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser.transform, _compassPage.transform, "BACK", new Vector3(-0.058f, 0.077f, 0.007f), new Vector3(0.048f, 0.022f, 0.014f), DimCyan, ShowHub, 8f); CreateButton(_browser.transform, _compassPage.transform, "X", new Vector3(0.061f, 0.077f, 0.007f), new Vector3(0.026f, 0.022f, 0.014f), Red, Close, 14f); CreateButton(_browser.transform, _compassPage.transform, "SET NORTH", new Vector3(0f, -0.08f, 0.007f), new Vector3(0.084f, 0.024f, 0.014f), new Color(0.025f, 0.28f, 0.34f, 1f), SetCompassNorth, 8f); _compassPage.SetActive(false); } } private void StartHologramProjection() { //IL_0023: 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) UpdatePresentationMode(); _lifecycleStartedAt = Time.unscaledTime; _lifecycle = (HologramDashboardLifecycle)((!_preferences.ReducedMotion) ? 1 : 2); _closeNotificationPending = false; if (!_preferences.HologramEffects) { if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = 1f; } _hologramProjection?.Hide(immediate: true); _lifecycle = (HologramDashboardLifecycle)2; UpdateLifecycleVisuals(); } else { if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = (_preferences.ReducedMotion ? 1f : 0.02f); } _hologramProjection?.Show(); UpdateLifecycleVisuals(); } } private void UpdateHologramProjection(bool finalPoseOnly = false) { //IL_00d2: 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_0127: 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_0082: 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 (_hologramProjection == null) { return; } GameObject? browser = _browser; object obj; if (browser == null || !browser.activeSelf) { GameObject? hub = _hub; obj = ((hub != null && hub.activeSelf) ? _hub.transform : null); } else { obj = _browser.transform; } Transform val = (Transform)obj; if (!_preferences.HologramEffects) { if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = 1f; } if ((Object)(object)val != (Object)null) { val.localPosition = Vector3.zero; val.localScale = Vector3.one; } _hologramProjection.Hide(immediate: true); _hologramCarousel?.SetVisible(visible: false); return; } if ((Object)(object)val == (Object)null) { _hologramProjection.Hide(); return; } _hologramProjection.SetAccent(Cyan); float num = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()); if (!_projectionAnchors.TryGet(_preferences.UseLeftWrist, num, out var anchor)) { _hologramProjection.BeginTrackingGrace(); _hologramProjection.UpdateTrackingLost(); return; } anchor = anchor with { EmitterPosition = anchor.EmitterPosition + anchor.ArmDirection * (_preferences.WatchForearmOffset * num) }; _hologramProjection.UpdatePose(anchor, val, _preferences.ReducedMotion, _preferences.HologramBrightness, finalPoseOnly); if (!finalPoseOnly) { float num2 = (_preferences.ReducedMotion ? 1f : _hologramProjection.RevealProgress); if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = Mathf.Lerp(0.02f, 1f, num2); } } } private void UpdateLifecycleVisuals() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Invalid comparison between Unknown and I4 //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_00e6: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) HologramDashboardProgress val3 = default(HologramDashboardProgress); if ((int)_lifecycle == 3) { HologramDashboardProgress val = HologramDashboardTimeline.Closing((double)(Time.unscaledTime - _lifecycleStartedAt), _preferences.ReducedMotion); HologramDashboardProgress val2 = val; ((HologramDashboardProgress)(ref val2)).set_Rays(((HologramDashboardProgress)(ref val)).Rays * ((HologramDashboardProgress)(ref _closeVisualStart)).Rays); ((HologramDashboardProgress)(ref val2)).set_Stage(((HologramDashboardProgress)(ref val)).Stage * ((HologramDashboardProgress)(ref _closeVisualStart)).Stage); ((HologramDashboardProgress)(ref val2)).set_Wings(((HologramDashboardProgress)(ref val)).Wings * ((HologramDashboardProgress)(ref _closeVisualStart)).Wings); ((HologramDashboardProgress)(ref val2)).set_Avatars(((HologramDashboardProgress)(ref val)).Avatars * ((HologramDashboardProgress)(ref _closeVisualStart)).Avatars); ((HologramDashboardProgress)(ref val2)).set_Labels(((HologramDashboardProgress)(ref val)).Labels * ((HologramDashboardProgress)(ref _closeVisualStart)).Labels); val3 = val2; } else if ((int)_lifecycle == 1) { val3 = HologramDashboardTimeline.Opening((double)(Time.unscaledTime - _lifecycleStartedAt), _preferences.ReducedMotion); if (((HologramDashboardProgress)(ref val3)).ControlsReady) { _lifecycle = (HologramDashboardLifecycle)2; } } else { ((HologramDashboardProgress)(ref val3))..ctor((HologramProjectionPhase)5, 1f, 1f, 1f, 1f, 1f, (int)_lifecycle == 2); } float num = Mathf.Lerp(0.015f, 1f, ((HologramDashboardProgress)(ref val3)).Stage); GameObject val4 = ActiveVisualPage(); if ((Object)(object)val4 != (Object)null) { val4.transform.localScale = new Vector3(num, num, 1f); val4.transform.localPosition = new Vector3(0f, Mathf.Lerp(-54f, 0f, ((HologramDashboardProgress)(ref val3)).Stage), 0f); } if ((Object)(object)_hub != (Object)null && _hub.activeSelf) { _hub.transform.localScale = Vector3.one * num; } if ((Object)(object)_leftArcWing != (Object)null) { _leftArcWing.transform.localScale = new Vector3(Mathf.Max(0.02f, ((HologramDashboardProgress)(ref val3)).Wings), 1f, 1f); } if ((Object)(object)_rightArcWing != (Object)null) { _rightArcWing.transform.localScale = new Vector3(Mathf.Max(0.02f, ((HologramDashboardProgress)(ref val3)).Wings), 1f, 1f); } if ((Object)(object)_metadataArc != (Object)null) { _metadataArc.transform.localScale = new Vector3(Mathf.Max(0.02f, ((HologramDashboardProgress)(ref val3)).Labels), 1f, 1f); } if ((Object)(object)_canvasGroup != (Object)null) { _canvasGroup.alpha = Mathf.Clamp01(Mathf.Max(((HologramDashboardProgress)(ref val3)).Stage * 0.82f, ((HologramDashboardProgress)(ref val3)).Labels)); } BoneHubHologramCarousel? hologramCarousel = _hologramCarousel; if (hologramCarousel != null) { GameObject? detailPage = _detailPage; hologramCarousel.SetVisible(detailPage != null && detailPage.activeSelf && ((HologramDashboardProgress)(ref val3)).Avatars > 0.02f); } if ((Object)(object)_previewShell != (Object)null && !_previewHeld && !_previewReturning) { GameObject? detailPage2 = _detailPage; if (detailPage2 != null && detailPage2.activeSelf) { _previewShell.SetActive(((HologramDashboardProgress)(ref val3)).Avatars > 0.02f && _previewReady); } } } private HologramDashboardProgress CurrentVisibleProgress() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_004a: 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 ((int)_lifecycle == 1) { return HologramDashboardTimeline.Opening((double)(Time.unscaledTime - _lifecycleStartedAt), _preferences.ReducedMotion); } return new HologramDashboardProgress((HologramProjectionPhase)5, 1f, 1f, 1f, 1f, 1f, (int)_lifecycle == 2); } private GameObject? ActiveVisualPage() { GameObject val = ActiveWristOsPage(); if ((Object)(object)val != (Object)null) { return val; } GameObject? compassPage = _compassPage; if (compassPage != null && compassPage.activeSelf) { return _compassPage; } GameObject? detailPage = _detailPage; if (detailPage != null && detailPage.activeSelf) { return _detailPage; } GameObject? packPage = _packPage; if (packPage != null && packPage.activeSelf) { return _packPage; } GameObject? optionsPage = _optionsPage; if (optionsPage != null && optionsPage.activeSelf) { return _optionsPage; } GameObject? watchPlacementPage = _watchPlacementPage; if (watchPlacementPage != null && watchPlacementPage.activeSelf) { return _watchPlacementPage; } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null && downloadsPage.activeSelf) { return _downloadsPage; } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null && packOptionsPage.activeSelf) { return _packOptionsPage; } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null && keyboardPage.activeSelf) { return _keyboardPage; } GameObject? deletePage = _deletePage; if (deletePage != null && deletePage.activeSelf) { return _deletePage; } return null; } private void UpdatePresentationMode() { GameObject? browser = _browser; int num; if (browser != null && browser.activeSelf) { GameObject? detailPage = _detailPage; if (detailPage == null || !detailPage.activeSelf) { GameObject? compassPage = _compassPage; if (compassPage == null || !compassPage.activeSelf) { num = (IsWristOsFocusedPageActive() ? 1 : 0); goto IL_0048; } } num = 1; } else { num = 0; } goto IL_0048; IL_0048: bool flag = (byte)num != 0; bool flag2 = flag && _preferences.HologramEffects; if ((Object)(object)_denseGlassChrome != (Object)null) { _denseGlassChrome.SetActive(!flag2); } if ((Object)(object)_denseGlassBackground != (Object)null) { _denseGlassBackground.SetActive(!flag2); } if ((Object)(object)_denseGlassOverlay != (Object)null) { _denseGlassOverlay.SetActive(!flag2); } _hologramCarousel?.SetVisible(flag2); _hologramProjection?.SetPanelVisible(!flag); } private void BuildDeletePage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00fb: 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_013e: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _deletePage = new GameObject("Delete Pack Confirmation Page"); _deletePage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_deletePage.transform, "Delete Header", new TabletRect(0f, 76f, 310f, 38f), new Color(0.3f, 0.035f, 0.055f, 0.98f)); _deleteTitle = CreateText(_deletePage.transform, "DELETE AVATAR PACK?", new TabletRect(0f, 76f, 280f, 28f), 20f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _deleteDetails = CreateText(_deletePage.transform, string.Empty, new TabletRect(0f, 15f, 280f, 72f), 15f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); CreateText(_deletePage.transform, "Locked packs finish safely on the next BONELAB launch. Undo stays available.", new TabletRect(0f, -37f, 280f, 34f), 11f, new Color(0.75f, 0.82f, 0.86f, 1f), (TextAlignmentOptions)514, (FontStyles)0); CreateButton(_browser.transform, _deletePage.transform, "CANCEL", new Vector3(-0.082f, -0.077f, 0.007f), new Vector3(0.13f, 0.038f, 0.014f), DimCyan, CancelDelete, 16f); CreateButton(_browser.transform, _deletePage.transform, "DELETE PACK", new Vector3(0.082f, -0.077f, 0.007f), new Vector3(0.13f, 0.038f, 0.014f), Red, TrashSelected, 16f); _deletePage.SetActive(false); } } private void ShowHub() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) DeactivateAvatarPreview(); HideWristOsAppPages(); _osRouter.ShowHome(); GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } if ((Object)(object)_launcher != (Object)null) { _launcher.SetActive(false); } if ((Object)(object)_hub != (Object)null) { _hub.SetActive(true); } if ((Object)(object)_browser != (Object)null) { _browser.SetActive(false); } _viewState = (AvatarBrowserViewState)1; StartHologramProjection(); _hubControlsReadyAt = Time.unscaledTime + (_preferences.ReducedMotion ? 0f : 0.55f); ResetTouchButtons(); RequireInputRearm(); _log.Msg("WristHub wrist module hub opened."); } private void ShowCompassPage() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null) && !((Object)(object)_browser == (Object)null) && !((Object)(object)_compassPage == (Object)null)) { _root.SetActive(true); if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } _browser.SetActive(true); GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } _compassPage.SetActive(true); HideWristOsAppPages(_compassPage); DeactivateAvatarPreview(); _viewState = (AvatarBrowserViewState)5; _compassHeadingValid = false; _lastCompassDegree = -1; CompassCalibrationRecord val = CompassCalibrationStore.Find((IReadOnlyList)_preferences.CompassCalibrations, _compassSceneKey); if (val != null) { val.LastUsedUtc = DateTimeOffset.UtcNow; SavePreferences(); } RefreshCompassCalibrationLabel(); StartHologramProjection(); UpdatePresentationMode(); RequireInputRearm(); _log.Msg("WristHub Compass app opened."); } } private void TickCompass() { //IL_00b4: 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_00f4: Unknown result type (might be due to invalid IL or missing references) GameObject? compassPage = _compassPage; if (compassPage != null && compassPage.activeSelf && !((Object)(object)Player.Head == (Object)null) && !((Object)(object)_compassNeedle == (Object)null) && TryGetCompassWorldYaw(out var yaw)) { CompassCalibrationRecord val = CompassCalibrationStore.Find((IReadOnlyList)_preferences.CompassCalibrations, _compassSceneKey); float num = CompassHeadingMath.Heading(yaw, (val != null) ? val.NorthYawDegrees : 0f); _compassSmoothedHeading = (_compassHeadingValid ? CompassHeadingMath.Smooth(_compassSmoothedHeading, num, Time.unscaledDeltaTime, 12f) : num); _compassHeadingValid = true; ((Transform)_compassNeedle).localRotation = Quaternion.Euler(0f, 0f, CompassHeadingMath.NeedleRotation(_compassSmoothedHeading)); if ((Object)(object)_compassDecorRing != (Object)null) { ((Transform)_compassDecorRing).localRotation = (_preferences.ReducedMotion ? Quaternion.identity : Quaternion.Euler(0f, 0f, Time.unscaledTime * 3.5f)); } int num2 = Mathf.RoundToInt(_compassSmoothedHeading) % 360; if (num2 != _lastCompassDegree && !((Object)(object)_compassHeadingText == (Object)null)) { _lastCompassDegree = num2; _compassHeadingText.text = $"{CompassHeadingMath.Cardinal(_compassSmoothedHeading)} • {num2:000}°"; } } } private void SetCompassNorth() { if (TryGetCompassWorldYaw(out var yaw)) { CompassCalibrationStore.Upsert(_preferences.CompassCalibrations, _compassSceneKey, yaw, DateTimeOffset.UtcNow); _compassSmoothedHeading = 0f; _compassHeadingValid = true; _lastCompassDegree = -1; RefreshCompassCalibrationLabel(); SavePreferences(); _log.Msg("WristHub Compass north was calibrated for the current level."); } } private void RefreshCompassCalibrationLabel() { if (!((Object)(object)_compassCalibrationText == (Object)null)) { _compassCalibrationText.text = ((CompassCalibrationStore.Find((IReadOnlyList)_preferences.CompassCalibrations, _compassSceneKey) == null) ? "WORLD NORTH" : "CALIBRATED FOR THIS LEVEL"); } } private static bool TryGetCompassWorldYaw(out float yaw) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) yaw = 0f; if ((Object)(object)Player.Head == (Object)null) { return false; } Vector3 val = Vector3.ProjectOnPlane(Player.Head.forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0025f) { return false; } ((Vector3)(ref val)).Normalize(); yaw = CompassHeadingMath.Normalize(Mathf.Atan2(val.x, val.z) * 57.29578f); return true; } private static string NormalizeSceneKey(string value) { if (string.IsNullOrWhiteSpace(value)) { return "unknown-scene"; } string text = value.Trim(); if (text.Length > 128) { return text.Substring(0, 128); } return text; } private void ShowDownloadsPage() { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null) && !((Object)(object)_browser == (Object)null) && !((Object)(object)_downloadsPage == (Object)null)) { _root.SetActive(true); if ((Object)(object)_hub != (Object)null) { _hub.SetActive(false); } _browser.SetActive(true); GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } _downloadsPage.SetActive(true); HideWristOsAppPages(); _viewState = (AvatarBrowserViewState)4; StartHologramProjection(); UpdatePresentationMode(); RefreshDownloadsPage(); RequireInputRearm(); _log.Msg("WristHub download panel opened."); } } private void ShowPackOptionsPage() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_packOptionsPage == (Object)null) && !(Selected() == (AvatarEntry)null)) { _deleteReturnToPackPage = (int)_scope == 1 && _selectedPackId.HasValue; GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } _packOptionsPage.SetActive(true); HideWristOsAppPages(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } _viewState = (AvatarBrowserViewState)12; UpdatePresentationMode(); RequireInputRearm(); } } private void RefreshDownloadsPage() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_downloadsSummary == (Object)null) { return; } DownloadJob[] array = _jobs.Values.Reverse().Take(6).ToArray(); if (array.Length == 0) { _downloadsSummary.text = "No downloads yet.\n\nSearch for an avatar pack to start one."; ((Graphic)_downloadsSummary).color = new Color(0.66f, 0.78f, 0.84f, 1f); return; } _downloadsSummary.text = string.Join("\n", array.Select(delegate(DownloadJob job) { //IL_0027: 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) int value = Mathf.Clamp(Mathf.RoundToInt((float)job.Progress * 100f), 0, 100); return $"{((object)job.State/*cast due to .constrained prefix*/).ToString().ToUpperInvariant(),-11} {value,3}% {Readable(job.Mod.Name)}"; })); ((Graphic)_downloadsSummary).color = Color.white; } private void CancelActiveDownload() { DownloadJob val = ((IEnumerable)_jobs.Values).LastOrDefault((Func)delegate(DownloadJob job) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 DownloadState state = job.State; return (int)state <= 4; }); if (val == null) { return; } if (_downloadBatches.TryGetValue(val.Mod.Id, out IReadOnlyList value)) { foreach (Guid item in value) { _service.CancelDownload(item); } } else { _service.CancelDownload(val.Id); } RefreshDownloadsPage(); } private void CreatePackRow(int index) { //IL_0080: 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_010c: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: 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_0224: 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_023e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_packPage == (Object)null) && !((Object)(object)_placeholderTexture == (Object)null)) { float num = 50f - (float)index * 34f; TouchButton touchButton = CreateButton(_browser.transform, _packPage.transform, string.Empty, new Vector3(-0.036f, num / 1000f, 0.007f), new Vector3(0.228f, 0.03f, 0.014f), Surface, delegate { OpenPackRow(index); }, 1f); RawImage artwork = CreateRawImage(touchButton.Root.transform, $"Pack {index + 1} Artwork", new TabletRect(-96f, 0f, 26f, 24f), _placeholderTexture, Color.white); TMP_Text name = CreateText(touchButton.Root.transform, string.Empty, new TabletRect(-28f, 5f, 104f, 13f), 12f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); TMP_Text creator = CreateText(touchButton.Root.transform, string.Empty, new TabletRect(-24f, -7f, 112f, 10f), 9f, new Color(0.65f, 0.8f, 0.86f, 1f), (TextAlignmentOptions)4097, (FontStyles)0); TMP_Text state = CreateText(touchButton.Root.transform, string.Empty, new TabletRect(78f, 0f, 54f, 18f), 9f, Cyan, (TextAlignmentOptions)4100, (FontStyles)1); TouchButton deleteButton = CreateButton(_browser.transform, _packPage.transform, "PACK", new Vector3(0.125f, num / 1000f, 0.007f), new Vector3(0.052f, 0.03f, 0.014f), DimCyan, delegate { ShowPackOptionsForPack(index); }, 8f); _packRows.Add(new PackRow { Button = touchButton, DeleteButton = deleteButton, Artwork = artwork, Name = name, Creator = creator, State = state }); } } private void BuildOptionsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00cd: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_0277: 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_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: 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_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0466: 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) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _optionsPage = new GameObject("WristHub Options Page"); _optionsPage.transform.SetParent(_canvasRoot.transform, false); CreateText(_optionsPage.transform, "SETTINGS", new TabletRect(-92f, 82f, 112f, 28f), 18f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser.transform, _optionsPage.transform, "BACK", new Vector3(0.108f, 0.082f, 0.007f), new Vector3(0.064f, 0.028f, 0.014f), DimCyan, BackFromOptions, 12f); CreateButton(_browser.transform, _optionsPage.transform, "X", new Vector3(0.151f, 0.082f, 0.007f), new Vector3(0.026f, 0.028f, 0.014f), Red, Close, 19f); _startingViewText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, 51f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser.transform, _optionsPage.transform, "CHANGE", new Vector3(0.112f, 0.051f, 0.007f), new Vector3(0.072f, 0.02f, 0.014f), Cyan, CycleStartingView, 8f); _sortText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, 30f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "CHANGE", new Vector3(0.112f, 0.03f, 0.007f), new Vector3(0.072f, 0.02f, 0.014f), DimCyan, CyclePackSort, 8f); _themeText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, 9f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "THEME", new Vector3(0.112f, 0.009f, 0.007f), new Vector3(0.072f, 0.02f, 0.014f), DimCyan, CycleTheme, 8f); _clockText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, -12f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "SWITCH", new Vector3(0.112f, -0.012f, 0.007f), new Vector3(0.072f, 0.02f, 0.014f), DimCyan, ToggleClockFormat, 8f); _wristText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, -33f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "SIDE", new Vector3(0.088f, -0.033f, 0.007f), new Vector3(0.03f, 0.02f, 0.014f), DimCyan, ToggleWrist, 7f); CreateButton(_browser.transform, _optionsPage.transform, "PLACE", new Vector3(0.132f, -0.033f, 0.007f), new Vector3(0.046f, 0.02f, 0.014f), Cyan, ShowWatchPlacementPage, 7f); _scaleText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, -54f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "-", new Vector3(0.086f, -0.054f, 0.007f), new Vector3(0.036f, 0.02f, 0.014f), DimCyan, delegate { ChangeScale(-0.1f); }, 16f); CreateButton(_browser.transform, _optionsPage.transform, "+", new Vector3(0.138f, -0.054f, 0.007f), new Vector3(0.036f, 0.02f, 0.014f), DimCyan, delegate { ChangeScale(0.1f); }, 16f); _motionText = CreateText(_optionsPage.transform, string.Empty, new TabletRect(-58f, -75f, 194f, 17f), 11f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); CreateButton(_browser.transform, _optionsPage.transform, "TOGGLE", new Vector3(0.112f, -0.075f, 0.007f), new Vector3(0.072f, 0.02f, 0.014f), DimCyan, ToggleMotion, 8f); RefreshOptionLabels(); } } private void BuildWatchPlacementPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00fc: 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_0116: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_0215: 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) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: 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_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _watchPlacementPage = new GameObject("WristHub Watch Placement Page"); _watchPlacementPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_watchPlacementPage.transform, "Watch Placement Glass", new TabletRect(0f, 0f, 304f, 202f), new Color(0.004f, 0.02f, 0.045f, 0.985f)); CreateText(_watchPlacementPage.transform, "WATCH POSITION", new TabletRect(-44f, 82f, 176f, 26f), 17f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser.transform, _watchPlacementPage.transform, "BACK", new Vector3(-0.132f, 0.082f, 0.007f), new Vector3(0.046f, 0.026f, 0.014f), DimCyan, ShowOptionsPage, 8f); CreateButton(_browser.transform, _watchPlacementPage.transform, "X", new Vector3(0.145f, 0.082f, 0.007f), new Vector3(0.028f, 0.026f, 0.014f), Red, Close, 16f); CreateText(_watchPlacementPage.transform, "Move the watch along your lower arm. The projector follows it automatically.", new TabletRect(0f, 50f, 266f, 28f), 10f, new Color(0.7f, 0.84f, 0.91f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _watchForearmText = CreateText(_watchPlacementPage.transform, "Wrist joint", new TabletRect(0f, 18f, 238f, 28f), 15f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser.transform, _watchPlacementPage.transform, "< ELBOW", new Vector3(-0.078f, -0.018f, 0.007f), new Vector3(0.126f, 0.034f, 0.014f), DimCyan, delegate { ChangeWatchForearmOffset(-0.01f); }, 11f); CreateButton(_browser.transform, _watchPlacementPage.transform, "HAND >", new Vector3(0.078f, -0.018f, 0.007f), new Vector3(0.126f, 0.034f, 0.014f), Cyan, delegate { ChangeWatchForearmOffset(0.01f); }, 11f); CreateButton(_browser.transform, _watchPlacementPage.transform, "RESET TO WRIST JOINT", new Vector3(0f, -0.062f, 0.007f), new Vector3(0.18f, 0.028f, 0.014f), new Color(0.12f, 0.28f, 0.4f, 1f), ResetWatchForearmOffset, 9f); CreateText(_watchPlacementPage.transform, "Changes save instantly", new TabletRect(0f, -88f, 220f, 14f), 7.5f, new Color(0.58f, 0.72f, 0.8f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _watchPlacementPage.SetActive(false); RefreshWatchForearmLabel(); } } private void BuildKeyboardPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: 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_00b8: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: 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_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0341: 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_035b: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _keyboardPage = new GameObject("WristHub Tablet Keyboard"); _keyboardPage.transform.SetParent(_canvasRoot.transform, false); _keyboardTitle = CreateText(_keyboardPage.transform, "SEARCH AVATARS", new TabletRect(-70f, 84f, 180f, 24f), 17f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser.transform, _keyboardPage.transform, "X", new Vector3(0.151f, 0.084f, 0.007f), new Vector3(0.026f, 0.026f, 0.014f), Red, CancelKeyboard, 19f); CreateImage(_keyboardPage.transform, "Search Input", new TabletRect(-35f, 55f, 236f, 30f), Surface); _keyboardText = CreateText(_keyboardPage.transform, "Type an avatar name", new TabletRect(-35f, 55f, 218f, 24f), 15f, Color.white, (TextAlignmentOptions)4097, (FontStyles)0); _keyboardSubmitButton = CreateButton(_browser.transform, _keyboardPage.transform, "SEARCH", new Vector3(0.125f, 0.055f, 0.007f), new Vector3(0.064f, 0.03f, 0.014f), Cyan, SubmitKeyboard, 10f); CreateKeyboardRow("1234567890", -135f, 25f, 27f, 3f); CreateKeyboardRow("QWERTYUIOP", -135f, -2f, 27f, 3f); CreateKeyboardRow("ASDFGHJKL", -120f, -29f, 27f, 3f); CreateKeyboardRow("ZXCVBNM", -105f, -56f, 27f, 3f); TouchButton touchButton = CreateButton(_browser.transform, _keyboardPage.transform, "SHIFT", new Vector3(-0.139f, -0.087f, 0.007f), new Vector3(0.052f, 0.024f, 0.014f), DimCyan, ToggleKeyboardShift, 10f); _keyboardShiftText = touchButton.Label; CreateButton(_browser.transform, _keyboardPage.transform, "SPACE", new Vector3(-0.073f, -0.087f, 0.007f), new Vector3(0.072f, 0.024f, 0.014f), DimCyan, AppendKeyboardSpace, 10f); CreateButton(_browser.transform, _keyboardPage.transform, "BACK", new Vector3(0f, -0.087f, 0.007f), new Vector3(0.062f, 0.024f, 0.014f), DimCyan, BackspaceKeyboard, 10f); CreateButton(_browser.transform, _keyboardPage.transform, "CLEAR", new Vector3(0.061f, -0.087f, 0.007f), new Vector3(0.05f, 0.024f, 0.014f), DimCyan, ClearKeyboard, 9f); CreateButton(_browser.transform, _keyboardPage.transform, "-", new Vector3(0.103f, -0.087f, 0.007f), new Vector3(0.026f, 0.024f, 0.014f), DimCyan, delegate { AppendKeyboardCharacter('-'); }, 12f); CreateButton(_browser.transform, _keyboardPage.transform, "_", new Vector3(0.136f, -0.087f, 0.007f), new Vector3(0.026f, 0.024f, 0.014f), DimCyan, delegate { AppendKeyboardCharacter('_'); }, 12f); _keyboardPage.SetActive(false); } } private void CreateKeyboardRow(string keys, float startX, float y, float width, float gap) { //IL_007e: 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_009b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_browser == (Object)null || (Object)(object)_keyboardPage == (Object)null) { return; } for (int i = 0; i < keys.Length; i++) { char key = keys[i]; float num = startX + (float)i * (width + gap); CreateButton(_browser.transform, _keyboardPage.transform, key.ToString(), new Vector3(num / 1000f, y / 1000f, 0.007f), new Vector3(width / 1000f, 0.026f, 0.014f), DimCyan, delegate { AppendKeyboardCharacter(key); }, 12f); } } private void HandlePackSearch() { //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_0019: 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_001e: Invalid comparison between Unknown and I4 bool flag = _query.Length > 0; if (!flag) { AvatarBrowserViewState viewState = _viewState; bool flag2 = viewState - 15 <= 1; flag = flag2; } if (flag) { OpenKeyboard(); } else { OpenSearchPage(); } } private void OpenSearchPage() { OpenKeyboard(); } private void BackFromPackPage() { //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_0019: 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_001e: Invalid comparison between Unknown and I4 //IL_0056: Unknown result type (might be due to invalid IL or missing references) bool flag = _query.Length > 0; if (!flag) { AvatarBrowserViewState viewState = _viewState; bool flag2 = viewState - 15 <= 1; flag = flag2; } if (flag) { _query = string.Empty; _downloadsOnly = false; _onlineEntries = Array.Empty(); _selectedPackId = null; _viewState = (AvatarBrowserViewState)2; RefreshEntries(); ShowPackPage(); } else { ShowHub(); } } private void BackFromDetailPage() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //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_0045: Unknown result type (might be due to invalid IL or missing references) if (_query.Length > 0) { _query = string.Empty; _downloadsOnly = false; _onlineEntries = Array.Empty(); _scope = _scopeBeforeSearch; _selectedPackId = null; _viewState = (AvatarBrowserViewState)2; RefreshEntries(); ShowScopePage(); } else if ((int)_scope == 1 && _selectedPackId.HasValue) { ShowPackPage(); } else { ShowHub(); } } private void ShowScopePage() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)_scope == 1) { ShowPackPage(); } else { ShowAllAvatars(); } } private void ShowAllAvatars() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) _scope = (AvatarBrowseScope)0; _selectedPackId = null; RememberScope(); RefreshEntries(); if (!_entries.Any((AvatarEntry entry) => entry.Identity == _selectedIdentity)) { AvatarEntry? obj = _entries.FirstOrDefault(); _selectedIdentity = ((obj != null) ? obj.Identity : null) ?? string.Empty; } _cursor.Keep(_entries.Count, IndexOf(_selectedIdentity)); ShowDetailPage(); } private void ShowGroups() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) _scope = (AvatarBrowseScope)1; _selectedPackId = null; RememberScope(); ShowPackPage(); } private void ToggleBrowseScope() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)_scope == 0) { ShowGroups(); } else { ShowAllAvatars(); } } private void ToggleScopeOrDownloads() { if (_query.Length == 0) { ToggleBrowseScope(); return; } _downloadsOnly = !_downloadsOnly; _selectedPackId = null; RefreshEntries(); AvatarEntry? obj = _entries.FirstOrDefault(); _selectedIdentity = ((obj != null) ? obj.Identity : null) ?? string.Empty; _cursor.Reset(_entries.Count); RefreshFocusedResult(); _log.Msg(_downloadsOnly ? $"Downloadable search section opened with {_entries.Count} results." : $"All search results reopened with {_entries.Count} results."); } private void RememberScope() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (_query.Length <= 0) { _preferences.LastAvatarBrowseScope = _scope; SavePreferences(); } } private void ShowPackPage() { if (!((Object)(object)_browser == (Object)null) && _browser.activeSelf && !_previewHeld) { GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(true); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } HideWristOsAppPages(); UpdatePresentationMode(); _previewGeneration++; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } RefreshEntries(); RefreshPackRows(); RequireInputRearm(); } } private void ShowDetailPage() { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Invalid comparison between Unknown and I4 //IL_00c8: 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) if (!((Object)(object)_browser == (Object)null) && _browser.activeSelf) { GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(true); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } HideWristOsAppPages(); UpdatePresentationMode(); if (_query.Length == 0) { _viewState = (AvatarBrowserViewState)3; } else if ((int)_viewState != 15) { _viewState = (AvatarBrowserViewState)16; } RefreshFocusedResult(); RequireInputRearm(); } } private void ShowOptionsPage() { //IL_0190: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null) && !((Object)(object)_browser == (Object)null) && !((Object)(object)_optionsPage == (Object)null)) { GameObject? watchPlacementPage = _watchPlacementPage; if (watchPlacementPage == null || !watchPlacementPage.activeSelf) { GameObject? hub = _hub; _optionsReturnToHub = hub != null && hub.activeSelf; } _root.SetActive(true); GameObject? launcher = _launcher; if (launcher != null) { launcher.SetActive(false); } GameObject? hub2 = _hub; if (hub2 != null) { hub2.SetActive(false); } _browser.SetActive(true); GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } _optionsPage.SetActive(true); GameObject? watchPlacementPage2 = _watchPlacementPage; if (watchPlacementPage2 != null) { watchPlacementPage2.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } HideWristOsAppPages(); StartHologramProjection(); UpdatePresentationMode(); _previewGeneration++; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } _viewState = (AvatarBrowserViewState)13; RefreshOptionLabels(); RequireInputRearm(); } } private void RefreshVisiblePage() { if (!RefreshVisibleWristOsPage()) { if ((Object)(object)_detailPage != (Object)null && _detailPage.activeSelf) { RefreshFocusedResult(); } else if ((Object)(object)_packPage != (Object)null && _packPage.activeSelf) { RefreshPackRows(); } else if ((Object)(object)_optionsPage != (Object)null && _optionsPage.activeSelf) { RefreshOptionLabels(); } else if ((Object)(object)_watchPlacementPage != (Object)null && _watchPlacementPage.activeSelf) { RefreshWatchForearmLabel(); } else if ((Object)(object)_downloadsPage != (Object)null && _downloadsPage.activeSelf) { RefreshDownloadsPage(); } } } private void RefreshPackRows() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Invalid comparison between Unknown and I4 //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Invalid comparison between Unknown and I4 //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_packPage == (Object)null || !_packPage.activeSelf || (Object)(object)_placeholderTexture == (Object)null) { return; } _packCursor.Keep(_packs.Count); bool flag = _query.Length > 0; if (!flag) { AvatarBrowserViewState viewState = _viewState; bool flag2 = viewState - 15 <= 1; flag = flag2; } bool flag3 = flag; if ((Object)(object)_packTitle != (Object)null) { _packTitle.text = ((_query.Length > 0) ? "RESULTS" : "GROUPS"); } if ((Object)(object)_packSearchText != (Object)null) { _packSearchText.text = "SEARCH"; } if ((Object)(object)_packPosition != (Object)null) { _packPosition.text = _packCursor.PositionText; } if ((Object)(object)_packStatus != (Object)null) { _packStatus.text = ((flag3 && _query.Length == 0) ? "Touch the search field, type, and submit to search automatically" : (((int)_viewState == 15 && _query.Length > 0) ? "Searching BONELAB mod.io..." : ((_packs.Count != 0) ? $"{_packs.Count} pack{((_packs.Count == 1) ? string.Empty : "s")} - touch a row to open" : ((_query.Length == 0) ? "No installed avatar packs found" : "No matching avatars found")))); } int num = _packCursor.Page * 4; int num2 = Math.Min(4, _packRows.Count); for (int i = 0; i < num2; i++) { PackRow row = _packRows[i]; if (!row.IsAlive) { continue; } row.Generation++; int num3 = num + i; if (num3 >= _packs.Count) { row.Identity = string.Empty; row.Button.Root.SetActive(false); row.DeleteButton.Root.SetActive(false); continue; } AvatarPackEntry pack = _packs[num3]; row.Identity = pack.Identity; row.Button.Root.SetActive(true); row.DeleteButton.Root.SetActive(pack.Installed && pack.AvatarCount > 0); row.Name.text = pack.Name; row.Creator.text = "By " + pack.Creator; row.State.text = (pack.Installed ? $"{pack.AvatarCount} AVATAR{((pack.AvatarCount == 1) ? string.Empty : "S")}" : CardStatus(pack.Avatars[0])); ((Graphic)row.State).color = (((int)pack.DownloadState == 5) ? Red : (pack.Installed ? Green : Cyan)); row.Artwork.texture = (Texture)(object)_placeholderTexture; int generation = row.Generation; if (string.IsNullOrWhiteSpace(pack.ThumbnailUrl)) { continue; } _thumbnails.Load(pack.ThumbnailUrl, delegate(Texture2D texture) { if (!_disposed && row.IsAlive && row.Generation == generation && row.Identity == pack.Identity && (Object)(object)texture != (Object)null) { row.Artwork.texture = (Texture)(object)texture; } }); } } private void OpenPackRow(int slot) { int num = _packCursor.Page * 4 + slot; if (num >= 0 && num < _packs.Count) { AvatarPackEntry val = _packs[num]; _selectedPackId = val.ModId; _entries = val.Avatars; AvatarEntry? obj = _entries.FirstOrDefault(); _selectedIdentity = ((obj != null) ? obj.Identity : null) ?? string.Empty; _cursor.Reset(_entries.Count); _log.Msg($"Avatar pack opened ({val.AvatarCount} installed avatars). Pack name is not logged."); ShowDetailPage(); } } private void ShowDeleteConfirmationForPack(int slot) { int num = _packCursor.Page * 4 + slot; if (num >= 0 && num < _packs.Count) { AvatarPackEntry val = _packs[num]; AvatarEntry val2 = ((IEnumerable)val.Avatars).FirstOrDefault((Func)((AvatarEntry entry) => entry.Installed && !string.IsNullOrWhiteSpace(entry.Barcode))); if (!(val2 == (AvatarEntry)null)) { _selectedPackId = val.ModId; _entries = val.Avatars; _selectedIdentity = val2.Identity; _cursor.Reset(_entries.Count); _deleteReturnToPackPage = true; ShowDeleteConfirmation(); } } } private void ShowPackOptionsForPack(int slot) { int num = _packCursor.Page * 4 + slot; if (num >= 0 && num < _packs.Count) { AvatarPackEntry val = _packs[num]; AvatarEntry val2 = ((IEnumerable)val.Avatars).FirstOrDefault((Func)((AvatarEntry entry) => entry.Installed && !string.IsNullOrWhiteSpace(entry.Barcode))); if (!(val2 == (AvatarEntry)null)) { _selectedPackId = val.ModId; _entries = val.Avatars; _selectedIdentity = val2.Identity; _cursor.Reset(_entries.Count); _deleteReturnToPackPage = true; ShowPackOptionsPage(); } } } private void MovePackPage(int direction) { _packCursor.Move(direction); RefreshPackRows(); } private void SetPackSort(AvatarPackSort sort) { //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) _packSort = sort; _selectedPackId = null; RefreshEntries(); ShowPackPage(); } private void CyclePackSort() { //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_0007: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_001b: 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_0019: Unknown result type (might be due to invalid IL or missing references) AvatarPackSort packSort = _packSort; AvatarPackSort packSort2 = (((int)packSort == 0) ? ((AvatarPackSort)1) : (((int)packSort != 1) ? ((AvatarPackSort)0) : ((AvatarPackSort)2))); SetPackSort(packSort2); ShowOptionsPage(); } private void CycleStartingView() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_001e: 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_0019: Invalid comparison between Unknown and I4 //IL_0028: 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_0026: Unknown result type (might be due to invalid IL or missing references) BoneHubPreferences preferences = _preferences; BrowserStartupMode avatarBrowserStartupMode = _preferences.AvatarBrowserStartupMode; BrowserStartupMode avatarBrowserStartupMode2 = (((int)avatarBrowserStartupMode == 1) ? ((BrowserStartupMode)2) : (((int)avatarBrowserStartupMode != 2) ? ((BrowserStartupMode)1) : ((BrowserStartupMode)0))); preferences.AvatarBrowserStartupMode = avatarBrowserStartupMode2; RefreshOptionLabels(); SavePreferences(); } private void ToggleWrist() { _preferences.UseLeftWrist = !_preferences.UseLeftWrist; _fingertips.Invalidate(); FollowWrist(immediate: true); RefreshOptionLabels(); SavePreferences(); } private void ShowWatchPlacementPage() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null) && !((Object)(object)_browser == (Object)null) && !((Object)(object)_watchPlacementPage == (Object)null)) { _root.SetActive(true); GameObject? hub = _hub; if (hub != null) { hub.SetActive(false); } _browser.SetActive(true); HideStandardPages(); HideWristOsAppPages(); _watchPlacementPage.SetActive(true); DeactivateAvatarPreview(); _viewState = (AvatarBrowserViewState)13; RefreshWatchForearmLabel(); StartHologramProjection(); UpdatePresentationMode(); RequireInputRearm(); } } private void ChangeWatchForearmOffset(float amount) { float num = Mathf.Round((_preferences.WatchForearmOffset + amount) * 100f) / 100f; _preferences.WatchForearmOffset = Mathf.Clamp(num, -0.08f, 0.03f); _wristLocalPoseValid = false; RefreshWatchForearmLabel(); SavePreferences(); } private void ResetWatchForearmOffset() { _preferences.WatchForearmOffset = 0f; _wristLocalPoseValid = false; RefreshWatchForearmLabel(); SavePreferences(); } private void RefreshWatchForearmLabel() { if (!((Object)(object)_watchForearmText == (Object)null)) { float num = _preferences.WatchForearmOffset * 100f; _watchForearmText.text = ((Mathf.Abs(num) < 0.1f) ? "AT WRIST JOINT" : ((num < 0f) ? $"{Mathf.Abs(num):0} CM TOWARD ELBOW" : $"{num:0} CM TOWARD HAND")); } } private void ChangeScale(float amount) { _preferences.WatchScale = Mathf.Clamp(_preferences.WatchScale + amount, 0.65f, 1.6f); FollowWrist(immediate: true); RefreshOptionLabels(); SavePreferences(); } private void ToggleMotion() { _preferences.ReducedMotion = !_preferences.ReducedMotion; RefreshOptionLabels(); SavePreferences(); } private void CycleTheme() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected I4, but got Unknown //IL_0030: 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_0038: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0054: 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_009d: Unknown result type (might be due to invalid IL or missing references) WristHubTheme hologramTheme = _preferences.HologramTheme; BoneHubPreferences preferences = _preferences; preferences.HologramTheme = (WristHubTheme)((int)hologramTheme switch { 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, _ => 0, }); ApplyThemeToBuiltUi(WristHubThemePalette.Accent(hologramTheme), WristHubThemePalette.Dim(hologramTheme)); if (_activePortal != (PortalLinkState)null) { if (_portalVisual == null) { _portalVisual = new BoneHubPortalVisual(_constrainedRendering); } _portalVisual.Show(_activePortal, _preferences.ReducedMotion, Cyan); } RefreshOptionLabels(); SavePreferences(); } private void ToggleClockFormat() { _preferences.Use24HourClock = !_preferences.Use24HourClock; RefreshOptionLabels(); SavePreferences(); } private void ApplyThemeToBuiltUi(Color oldAccent, Color oldDim) { //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_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_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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0098: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00e8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } Color cyan = Cyan; Color dimCyan = DimCyan; foreach (TMP_Text componentsInChild in _root.GetComponentsInChildren(true)) { if (SimilarColor(((Graphic)componentsInChild).color, oldAccent)) { ((Graphic)componentsInChild).color = cyan; } else if (SimilarColor(((Graphic)componentsInChild).color, oldDim)) { ((Graphic)componentsInChild).color = dimCyan; } } foreach (Image componentsInChild2 in _root.GetComponentsInChildren(true)) { if (SimilarColor(((Graphic)componentsInChild2).color, oldAccent)) { ((Graphic)componentsInChild2).color = cyan; } else if (SimilarColor(((Graphic)componentsInChild2).color, oldDim)) { ((Graphic)componentsInChild2).color = dimCyan; } } _hologramProjection?.SetAccent(cyan); } private static bool SimilarColor(Color left, Color right) { //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_0012: 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_0025: 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) return Mathf.Abs(left.r - right.r) + Mathf.Abs(left.g - right.g) + Mathf.Abs(left.b - right.b) < 0.12f; } private void RefreshOptionLabels() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0026: Invalid comparison between Unknown and I4 //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Invalid comparison between Unknown and I4 //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_startingViewText != (Object)null) { TMP_Text startingViewText = _startingViewText; BrowserStartupMode avatarBrowserStartupMode = _preferences.AvatarBrowserStartupMode; string text = (((int)avatarBrowserStartupMode == 0) ? "Remember last" : (((int)avatarBrowserStartupMode != 2) ? "All avatars" : "Groups")); startingViewText.text = "Starting view: " + text; } if ((Object)(object)_sortText != (Object)null) { _sortText.text = "Library order: " + (((int)_packSort == 0) ? "Recent" : ((object)Unsafe.As(ref _packSort)/*cast due to .constrained prefix*/).ToString()); } if ((Object)(object)_wristText != (Object)null) { _wristText.text = "Wrist: " + (_preferences.UseLeftWrist ? "Left" : "Right"); } if ((Object)(object)_scaleText != (Object)null) { _scaleText.text = $"UI scale: {_preferences.WatchScale:0.0}x"; } if ((Object)(object)_motionText != (Object)null) { _motionText.text = "Reduced motion: " + (_preferences.ReducedMotion ? "On" : "Off"); } if ((Object)(object)_themeText != (Object)null) { _themeText.text = "Theme: " + (((int)_preferences.HologramTheme == 1) ? "Graphite / Arkham" : ((object)_preferences.HologramTheme/*cast due to .constrained prefix*/).ToString()); } if ((Object)(object)_clockText != (Object)null) { _clockText.text = "Clock: " + (_preferences.Use24HourClock ? "24 hour" : "12 hour"); } } private void SavePreferences() { SavePreferencesGuardedAsync(); } private async Task SavePreferencesGuardedAsync() { try { await _service.SavePreferencesAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); } catch (Exception ex) { Exception exception = ex; _mainThread.Enqueue(delegate { _log.Error("Could not save WristHub tablet options: " + exception.Message); }); } } private void CreateTabletHeightRuler() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //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) if (!((Object)(object)_metadataArc == (Object)null)) { _heightRuler = new GameObject("Accurate Pre-Equip Height"); _heightRuler.transform.SetParent(_metadataArc.transform, false); _heightText = CreateText(_heightRuler.transform, "Height after download", ArcDashboardLayout.Height, 8.5f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); } } private void CreateTabletProgressBar() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_003b: 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_0052: 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_00a3: 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_0115: 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) if (!((Object)(object)_detailPage == (Object)null)) { _progressRoot = new GameObject("Download Progress Capsule"); _progressRoot.transform.SetParent(_detailPage.transform, false); TabletRect progress = ArcDashboardLayout.Progress; CreateImage(_progressRoot.transform, "Progress Track", progress, new Color(0.025f, 0.105f, 0.145f, 0.98f)); Image val = CreateImage(_progressRoot.transform, "Progress Fill", new TabletRect(((TabletRect)(ref progress)).Left + 0.25f, ((TabletRect)(ref progress)).Y, 0.5f, ((TabletRect)(ref progress)).Height), new Color(Amber.r, Amber.g, Amber.b, 0.88f)); _progressFill = ((Graphic)val).rectTransform; _progressText = CreateText(_progressRoot.transform, string.Empty, new TabletRect(((TabletRect)(ref progress)).X, ((TabletRect)(ref progress)).Y, ((TabletRect)(ref progress)).Width - 8f, ((TabletRect)(ref progress)).Height), 8.5f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _progressRoot.SetActive(false); } } private void RefreshEntries() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) AvatarEntry[] array = (from avatar in _runtime.GetAllAvatars() select avatar.ToEntry()).ToArray(); IEnumerable enumerable = ((IEnumerable)_onlineEntries).Select((Func)delegate(AvatarEntry entry) { //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) if (_runtime.IsModInstalled(entry.ModId)) { AvatarEntry obj = entry.$(); obj.set_Installed(true); obj.set_DownloadState((AvatarDownloadState)4); return obj; } DownloadJob value; return (!_jobs.TryGetValue(entry.ModId, out value)) ? entry : entry.WithDownload(Map(value.State), value.Progress, value.Error); }); _mergedEntries = AvatarLibrary.Merge((IEnumerable)array, enumerable, _query, (IEnumerable)_service.RecentlyEquippedAvatarBarcodes); _packs = AvatarPackLibrary.Group((IEnumerable)_mergedEntries, (IEnumerable)_service.RecentlyEquippedAvatarBarcodes, _packSort); AvatarPackEntry val = (_selectedPackId.HasValue ? ((IEnumerable)_packs).FirstOrDefault((Func)((AvatarPackEntry pack) => pack.ModId == _selectedPackId.Value)) : null); AvatarEntry[] array2 = (_selectedPackId.HasValue ? (from avatar in _runtime.GetAvatars(_selectedPackId.Value) select avatar.ToEntry()).OrderBy((AvatarEntry entry) => entry.AvatarName, StringComparer.OrdinalIgnoreCase).ToArray() : Array.Empty()); if (val == (AvatarPackEntry)null && array2.Length != 0) { val = AvatarPackLibrary.Group((IEnumerable)array2, (IEnumerable)_service.RecentlyEquippedAvatarBarcodes, _packSort).FirstOrDefault(); } IReadOnlyList readOnlyList = (IReadOnlyList)((_query.Length > 0 && _downloadsOnly) ? ((IEnumerable)AvatarLibrary.Downloadable((IEnumerable)_mergedEntries)) : ((IEnumerable)_mergedEntries)); object entries; if (array2.Length == 0) { entries = ((val != null) ? val.Avatars : null) ?? readOnlyList; } else { IReadOnlyList readOnlyList2 = array2; entries = readOnlyList2; } _entries = (IReadOnlyList)entries; if (_entries.Count == 0) { _selectedIdentity = string.Empty; } else if (!_entries.Any((AvatarEntry entry) => entry.Identity == _selectedIdentity)) { _selectedIdentity = _entries[0].Identity; } _cursor.Keep(_entries.Count, IndexOf(_selectedIdentity)); if ((Object)(object)_searchText != (Object)null) { _searchText.text = "SEARCH"; } } private void RefreshFocusedResult() { //IL_005d: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Invalid comparison between Unknown and I4 //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Invalid comparison between Unknown and I4 //IL_0288: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_browser == (Object)null || !_browser.activeSelf) { return; } if ((Object)(object)_searchText != (Object)null) { _searchText.text = "SEARCH"; } if ((Object)(object)_scopeText != (Object)null) { _scopeText.text = ((_query.Length <= 0) ? (((int)_scope == 0) ? "ALL AVATARS" : "GROUPS") : (_downloadsOnly ? "ALL RESULTS" : "DOWNLOADS")); } if ((Object)(object)_positionText != (Object)null) { _positionText.text = _cursor.PositionText; } AvatarEntry val = Selected(); if (val != (AvatarEntry)null) { RefreshHologramCarousel(val); if (_actionButton != null) { _actionButton.Root.SetActive(true); } RefreshSelection(val); return; } _artworkGeneration.Next(); RefreshHologramCarousel(null); _previewGeneration++; _previewAvatar = null; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } if ((Object)(object)_centralArtwork != (Object)null) { ((Component)_centralArtwork).gameObject.SetActive(true); _centralArtwork.texture = (Texture)(object)_placeholderTexture; } if ((Object)(object)_selectedName != (Object)null) { _selectedName.text = (((int)_viewState == 15) ? "Searching..." : (_downloadsOnly ? "No downloads found" : "No avatars found")); } if ((Object)(object)_creatorText != (Object)null) { _creatorText.text = string.Empty; } if ((Object)(object)_modText != (Object)null) { _modText.text = string.Empty; } if ((Object)(object)_heightText != (Object)null) { _heightText.text = "Height unavailable"; } if (_actionButton != null) { _actionButton.Root.SetActive(false); } if (_trashButton != null) { _trashButton.Root.SetActive(false); } ResetTrashConfirmation(); SetStatus(((int)_viewState == 15) ? "Searching BONELAB mod.io..." : (_downloadsOnly ? "No downloadable matches" : "Try another search"), Cyan); SetProgressVisible(visible: false); } private void RefreshSelection(AvatarEntry entry) { //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Invalid comparison between Unknown and I4 //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Invalid comparison between Unknown and I4 //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_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Invalid comparison between Unknown and I4 //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Invalid comparison between Unknown and I4 //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Invalid comparison between Unknown and I4 //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Invalid comparison between Unknown and I4 //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Invalid comparison between Unknown and I4 //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Invalid comparison between Unknown and I4 //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: 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_054a: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Invalid comparison between Unknown and I4 //IL_03f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_selectedName == (Object)null || (Object)(object)_creatorText == (Object)null || (Object)(object)_modText == (Object)null || (Object)(object)_actionLabel == (Object)null || (Object)(object)_actionPanel == (Object)null || _actionButton == null) { return; } _selectedName.text = entry.AvatarName; _creatorText.text = "By " + entry.Creator; _modText.text = entry.ModName; if (!string.Equals(_trashConfirmIdentity, entry.Identity, StringComparison.OrdinalIgnoreCase)) { ResetTrashConfirmation(); } if (_trashButton != null) { _trashButton.Root.SetActive(entry.Installed); } if ((Object)(object)_positionText != (Object)null) { _positionText.text = _cursor.PositionText; } _previewAvatar = (string.IsNullOrWhiteSpace(entry.Barcode) ? null : _runtime.FindAvatar(entry.Barcode)); if (_previewAvatar != null) { if (PreviewShellRecovery.ShouldSchedule(_previewAvatar.Barcode, _loadedPreviewBarcode, _requestedPreviewBarcode)) { SchedulePreview(_previewAvatar); } SetHeight(_previewMetrics.TryGetValue(_previewAvatar.Barcode, out var value) ? ((AvatarPreviewMetrics)(ref value)).HeightDisplayText : "Calculating avatar height…", ((AvatarPreviewMetrics)(ref value)).Valid ? Green : Cyan); if (!_previewReady && _jobs.TryGetValue(entry.ModId, out DownloadJob value2) && (int)value2.State == 5) { ConfigureProgress(entry); } else { SetProgressVisible(visible: false); } bool flag = string.Equals(_pendingSharingAvatar?.Barcode, _previewAvatar.Barcode, StringComparison.OrdinalIgnoreCase); bool flag2 = string.Equals(_sharingRetryBarcode, _previewAvatar.Barcode, StringComparison.OrdinalIgnoreCase); _actionLabel.text = (flag2 ? "RESCAN" : (flag ? "WAIT" : "EQUIP")); ((Graphic)_actionPanel).color = Green; if (_rigValidations.TryGetValue(_previewAvatar.Barcode, out var value3) && !((AvatarRigValidationResult)(ref value3)).CanEquip) { _actionLabel.text = "BROKEN"; ((Graphic)_actionPanel).color = Red; SetStatus("BROKEN AVATAR - CANNOT EQUIP", Red); } else if (flag2) { SetStatus("SHARING NOT READY - touch RESCAN", Red); } else if (flag) { SetStatus("Registering avatar pack with Fusion...", Cyan); } else if (!_previewReady) { SetStatus("Preparing preview", Cyan); } else if (_previewInteractionReady) { InstalledModRecord? obj = ((IEnumerable)_service.Installed).FirstOrDefault((Func)((InstalledModRecord item) => item.ModId == entry.ModId)); ModIoSharingMetadata val = ((obj != null) ? obj.Sharing : null); AvatarPlatformAvailability val2 = default(AvatarPlatformAvailability); ((AvatarPlatformAvailability)(ref val2))..ctor((val != null) ? val.WindowsFileId : ((long?)null), (val != null) ? val.AndroidFileId : ((long?)null)); if (((AvatarPlatformAvailability)(ref val2)).IsLimited) { SetStatus(((AvatarPlatformAvailability)(ref val2)).Badge + " - unsupported peers may see PolyBlank", new Color(1f, 0.72f, 0.28f, 1f)); } else { SetStatus(((((AvatarPlatformAvailability)(ref val2)).HasWindows && ((AvatarPlatformAvailability)(ref val2)).HasAndroid) ? (((AvatarPlatformAvailability)(ref val2)).Badge + " - ") : string.Empty) + (((int)_previewVisualSource == 1) ? "Ready - grip, pinch, or equip" : "3D preview ready - grip, pinch, or equip"), Green); } } else { SetStatus("Preview limited - Equip is still available", Cyan); } } else { if (_trashButton != null) { _trashButton.Root.SetActive(false); } ShowArtwork(entry); AvatarDownloadState downloadState = entry.DownloadState; bool flag3 = downloadState - 1 <= 2; bool flag4 = flag3; bool flag5 = entry.Installed || (int)entry.DownloadState == 4; _actionLabel.text = (flag4 ? "CANCEL" : (((int)entry.DownloadState == 5) ? "RETRY" : ((flag5 && (int)_installedFocus.State == 4) ? "RESCAN" : (flag5 ? "PREPARING" : "DOWNLOAD")))); ((Graphic)_actionPanel).color = (((int)entry.DownloadState == 5) ? Red : Amber); SetStatus((!flag5) ? (flag4 ? string.Empty : DownloadStatus(entry)) : (((int)_installedFocus.State == 4) ? "Installed pack needs a pallet rescan" : "Preparing installed avatar pack"), ((int)entry.DownloadState == 5) ? Red : Cyan); SetHeight("Height calculated after download", Cyan); ConfigureProgress(entry); } } private void ShowArtwork(AvatarEntry entry) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) _previewGeneration++; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } if ((Object)(object)_centralArtwork == (Object)null) { return; } ((Component)_centralArtwork).gameObject.SetActive(true); _centralArtwork.texture = (Texture)(object)_placeholderTexture; int generation = _artworkGeneration.Next(); if (string.IsNullOrWhiteSpace(entry.ThumbnailUrl)) { return; } _thumbnails.Load(entry.ThumbnailUrl, delegate(Texture2D texture) { if (!_disposed && _artworkGeneration.IsCurrent(generation)) { AvatarEntry? obj = Selected(); if (((obj != null) ? obj.Identity : null) == entry.Identity && (Object)(object)_centralArtwork != (Object)null) { _centralArtwork.texture = (Texture)(object)texture; } } }); } private void ActivateSelected() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Invalid comparison between Unknown and I4 //IL_012c: 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_010c: Unknown result type (might be due to invalid IL or missing references) AvatarEntry val = Selected(); if (val == (AvatarEntry)null) { return; } if (_previewAvatar != null) { EquipWithSharingReady(_previewAvatar); return; } if (val.Installed || (int)val.DownloadState == 4) { RetryInstalledPack(val.ModId); return; } DownloadJob value; bool flag = _jobs.TryGetValue(val.ModId, out value); if (flag) { DownloadState state = value.State; bool flag2 = (int)state <= 4; flag = flag2; } if (flag) { if (_downloadBatches.TryGetValue(val.ModId, out IReadOnlyList value2)) { foreach (Guid item in value2) { _service.CancelDownload(item); } return; } _service.CancelDownload(value.Id); } else if (!_startingDownloads.Contains(val.ModId)) { if (!_onlineMods.TryGetValue(val.ModId, out ModIoMod value3)) { SetStatus("This online result is unavailable. Search again.", Red); return; } _startingDownloads.Add(val.ModId); _viewState = (AvatarBrowserViewState)17; SetStatus(string.Empty, Cyan); ConfigureProgress(val); StartDownloadAsync(value3); } } private void ShowDeleteConfirmation() { AvatarEntry val = Selected(); if (val == (AvatarEntry)null || !val.Installed || _trashInProgress) { return; } bool flag = _runtime.IsWearingPack(val.ModId); GameObject? packPage = _packPage; if (packPage == null || !packPage.activeSelf) { GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage == null || !packOptionsPage.activeSelf) { _deleteReturnToPackPage = false; } } _trashConfirmIdentity = val.Identity; GameObject? packPage2 = _packPage; if (packPage2 != null) { packPage2.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage2 = _packOptionsPage; if (packOptionsPage2 != null) { packOptionsPage2.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(true); } UpdatePresentationMode(); if ((Object)(object)_deleteTitle != (Object)null) { _deleteTitle.text = "DELETE PACK?"; } if ((Object)(object)_deleteDetails != (Object)null) { int count = _runtime.GetAvatars(val.ModId).Count; bool flag2 = _sharing.IsSubscribed(val.ModId); _deleteDetails.text = $"{val.ModName}\n{count} avatar{((count == 1) ? string.Empty : "s")} will be removed" + (flag2 ? "\nThis also unsubscribes it from mod.io." : string.Empty) + (flag ? "\nYou are wearing this pack. WristHub will switch to PolyBlank first." : string.Empty); } ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } ResetTouchButtons(); RequireInputRearm(); _log.Msg($"Delete confirmation opened for an installed pack (active={flag})."); } private void CancelDelete() { _trashConfirmIdentity = string.Empty; GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } if (_deleteReturnToPackPage) { ShowPackPage(); } else { ShowDetailPage(); } } private void SetDeleteStatus(string value, Color color) { //IL_003d: 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) GameObject? packPage = _packPage; if (packPage != null && packPage.activeSelf && (Object)(object)_packStatus != (Object)null) { _packStatus.text = value; ((Graphic)_packStatus).color = color; } else { SetStatus(value, color); } } private void ReturnFromDelete(string message, Color color) { //IL_004f: 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) GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } if (_deleteReturnToPackPage) { ShowPackPage(); if ((Object)(object)_packStatus != (Object)null) { _packStatus.text = message; ((Graphic)_packStatus).color = color; } } else { ShowDetailPage(); SetStatus(message, color); } } private void TrashSelected() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) AvatarEntry entry = Selected(); if (entry == (AvatarEntry)null || !entry.Installed || _trashInProgress) { return; } if (!string.Equals(_trashConfirmIdentity, entry.Identity, StringComparison.OrdinalIgnoreCase)) { ShowDetailPage(); SetStatus("The selected pack changed. Touch Delete Pack again.", Red); return; } if (_runtime.IsWearingPack(entry.ModId)) { _trashInProgress = true; if ((Object)(object)_deleteTitle != (Object)null) { _deleteTitle.text = "SWITCHING AVATAR..."; } if ((Object)(object)_deleteDetails != (Object)null) { _deleteDetails.text = "Switching to BONELAB's PolyBlank so this pack can be removed safely."; } _log.Msg("Delete is switching away from the active avatar pack before removal."); _runtime.LeavePackForDeletion(entry.ModId, delegate(bool success, string? error) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) _trashInProgress = false; if (!success) { _log.Warning("Delete could not leave the active pack: " + Readable(error ?? "Unknown failure")); ReturnFromDelete("Delete paused: " + Readable(error ?? "Could not switch avatars"), Red); } else { _log.Msg("Safe avatar is active; continuing pack deletion."); TrashSelected(); } }); return; } IReadOnlyList directories = _runtime.GetPackDirectories(entry.ModId); if (directories.Count == 0) { InstalledModRecord val = ((IEnumerable)_service.Installed).FirstOrDefault((Func)((InstalledModRecord item) => item.ModId == entry.ModId)); IReadOnlyList readOnlyList; if (val != null) { IReadOnlyList installedDirectories = val.InstalledDirectories; readOnlyList = installedDirectories; } else { IReadOnlyList installedDirectories = Array.Empty(); readOnlyList = installedDirectories; } directories = readOnlyList; } if (directories.Count == 0) { if ((Object)(object)_deleteDetails != (Object)null) { _deleteDetails.text = "This pack's local folder could not be identified.\nNothing was deleted."; } _log.Warning("Delete was blocked because no local pack folder matched the selected mod ID."); return; } _trashInProgress = true; if ((Object)(object)_deleteTitle != (Object)null) { _deleteTitle.text = "REMOVING PACK..."; } long modId = entry.ModId; string modName = entry.ModName; bool subscribed = _sharing.IsSubscribed(modId); string[] removedBarcodes = (from avatar in _runtime.GetAvatars(modId) select avatar.Barcode).ToArray(); if (subscribed && !_sharing.Unsubscribe(modId)) { _trashInProgress = false; CancelDelete(); SetStatus("Could not unsubscribe this pack. Nothing was deleted.", Red); _log.Warning("Delete was cancelled because ModioModNetworker could not unsubscribe the pack."); return; } _log.Msg($"Pack deletion started with {directories.Count} local folder{((directories.Count == 1) ? string.Empty : "s")}."); Task.Run(async delegate { try { await _service.UninstallSubscribedAsync(modId, modName, directories, subscribed, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); await _service.ForgetAvatarBarcodesAsync((IEnumerable)removedBarcodes, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) _trashInProgress = false; _selectedIdentity = string.Empty; ResetTrashConfirmation(); _runtime.ForgetAvatars(removedBarcodes); string[] array = removedBarcodes; foreach (string key in array) { _previewMetrics.Remove(key); _previewRoutes.Remove(key); } _runtime.RemovePack(modId); _sharing.RequestRefresh(immediate: true); GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } RefreshEntries(); ShowScopePage(); SetStatus("Avatar pack removed. Undo is available in BoneMenu.", Green); _log.Msg("Avatar pack deletion completed and the local library refresh was requested."); }); } catch (Exception ex) { Exception exception = ex; if ((exception is UnauthorizedAccessException || exception is IOException) ? true : false) { try { await _service.QueueDeletionAsync(modId, modName, directories, subscribed, (IEnumerable)removedBarcodes, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) _trashInProgress = false; _selectedIdentity = string.Empty; ResetTrashConfirmation(); _runtime.ForgetAvatars(removedBarcodes); _runtime.SetPendingDeletions(_service.PendingDeletionModIds); string[] array = removedBarcodes; foreach (string key in array) { _previewMetrics.Remove(key); _previewRoutes.Remove(key); } _sharing.RequestRefresh(immediate: true); GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } RefreshEntries(); ShowScopePage(); SetStatus("Pack queued for deletion - restart BONELAB once", Green); _log.Msg("Locked avatar pack was hidden and queued for deletion during the next startup."); }); return; } catch (Exception ex2) { Exception ex3 = ex2; Exception queueError = ex3; if (subscribed) { _sharing.Subscribe(modId); } _mainThread.Enqueue(delegate { //IL_0055: Unknown result type (might be due to invalid IL or missing references) _trashInProgress = false; ResetTrashConfirmation(); ReturnFromDelete("Delete failed: " + Readable(queueError.Message), Red); _log.Warning("Avatar pack could not be queued after a file lock: " + Readable(queueError.Message)); }); return; } } if (subscribed) { _sharing.Subscribe(modId); } _mainThread.Enqueue(delegate { //IL_0046: Unknown result type (might be due to invalid IL or missing references) _trashInProgress = false; ResetTrashConfirmation(); ReturnFromDelete("Delete failed: " + Readable(exception.Message), Red); _log.Warning("Avatar pack deletion rolled back: " + Readable(exception.Message)); }); } }); } private void ResetTrashConfirmation() { _trashConfirmIdentity = string.Empty; if (_trashButton != null) { _trashButton.Label.text = "DELETE PACK"; } } private void UpdateInstalledPackFocus() { //IL_0017: 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) if (_installedFocus.UpdateTimeout((double)Time.unscaledTime)) { _viewState = (AvatarBrowserViewState)19; RefreshEntries(); RefreshFocusedResult(); SetStatus("Installed pack was not loaded. Touch RESCAN.", Red); _log.Warning("An installed avatar pack timed out before a runtime crate became equip-ready."); } } private void RetryInstalledPack(long modId) { //IL_00ba: 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) IReadOnlyList avatars = _runtime.GetAvatars(modId); if (avatars.Count > 0) { if (!_installedFocus.Active || _installedFocus.ModId != modId) { _installedFocus.Begin(modId, (double)Time.unscaledTime, (IEnumerable)null, 45.0); } OnAvatarsChanged(modId, avatars); return; } if (!_installedFocus.Active || _installedFocus.ModId != modId) { _installedFocus.Begin(modId, (double)Time.unscaledTime, (IEnumerable)null, 45.0); } else { _installedFocus.Retry((double)Time.unscaledTime, 45.0); } _selectedPackId = modId; _viewState = (AvatarBrowserViewState)18; bool flag = _runtime.RetryInstallation(modId); if (!flag) { _runtime.RefreshLocalLibrary(); } RefreshEntries(); RefreshFocusedResult(); SetStatus(flag ? "Rescanning installed avatar pack..." : "Refreshing installed avatar library...", Cyan); _log.Msg("Targeted installed-pack rescan requested for equip handoff."); } private async Task StartDownloadAsync(ModIoMod mod) { try { _installedFocus.BeginDownload(mod.Id); _log.Msg("Download started with a dedicated root-pack equip handoff."); IReadOnlyList jobs = await _service.InstallWithDependenciesAsync(mod, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { foreach (DownloadJob item in jobs) { _jobs[item.Mod.Id] = item; } _downloadBatches[mod.Id] = jobs.Select((DownloadJob job) => job.Id).ToArray(); _startingDownloads.Remove(mod.Id); RefreshEntries(); RefreshFocusedResult(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (_installedFocus.ModId == mod.Id) { _installedFocus.Clear(); } _startingDownloads.Remove(mod.Id); SetStatus(Readable(exception.Message), Red); }); } } private async Task SearchOnlineAsync(string query, int generation) { try { ModIoPage page = await _service.SearchAsync(new ModSearchRequest(query, "Avatar", (string)null, (ModSort)0, 0, 100), default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && generation == _searchGeneration) { _onlineMods.Clear(); foreach (ModIoMod datum in page.Data) { _onlineMods[datum.Id] = datum; } _onlineEntries = page.Data.Select((ModIoMod mod) => AvatarEntry.FromOnline(mod, _runtime.IsModInstalled(mod.Id))).ToArray(); _viewState = (AvatarBrowserViewState)16; RefreshEntries(); ShowDetailPage(); _log.Msg($"Avatar search completed with {_entries.Count} merged results."); SetStatus((_entries.Count == 0) ? "No avatars found" : $"{_entries.Count} avatar result{((_entries.Count == 1) ? string.Empty : "s")}", Cyan); } }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { //IL_003d: 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) if (!_disposed && generation == _searchGeneration) { _viewState = (AvatarBrowserViewState)19; SetStatus(Readable(exception.Message), Red); } }); } } private void CreatePreviewShell() { EnsurePreviewShell(reportRecovery: false); } private bool EnsurePreviewShell(bool reportRecovery) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown if (!PreviewShellRecovery.RequiresRebuild((Object)(object)_previewShell != (Object)null, (Object)(object)_previewFallback != (Object)null)) { return true; } try { try { if ((Object)(object)_previewShell != (Object)null) { Object.Destroy((Object)(object)_previewShell); } } catch { } _previewShell = new GameObject("[WristHub] Grabbable Avatar Preview"); Object.DontDestroyOnLoad((Object)(object)_previewShell); _previewShell.SetActive(false); _previewFallback = CreateSilhouette(_previewShell.transform); PlacePreviewImmediately(); if (reportRecovery) { _log.Msg("WristHub restored its 3D preview shell after a scene or Fusion rig transition."); } return (Object)(object)_previewFallback != (Object)null; } catch (Exception ex) { _previewShell = null; _previewFallback = null; string text = "preview-shell|" + ex.GetType().FullName; if (_runtimeErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Error($"WristHub could not restore the 3D preview shell: {ex}"); } return false; } } private void LoadPreview(BoneHubAvatar avatar) { //IL_019e: 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_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_004e: 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_0119: Expected O, but got Unknown if (!EnsurePreviewShell(reportRecovery: true)) { _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = true; _previewInteractionReady = false; SetStatus("Preview unavailable - use Equip", Red); return; } int generation = ++_previewGeneration; _viewState = (AvatarBrowserViewState)18; _loadedPreviewBarcode = avatar.Barcode; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; ClearPreviewModel(); if ((Object)(object)_centralArtwork != (Object)null) { ((Component)_centralArtwork).gameObject.SetActive(false); } if ((Object)(object)_previewShell == (Object)null || (Object)(object)_previewFallback == (Object)null) { return; } _previewShell.SetActive(IsOpen); _previewFallback.SetActive(true); PlacePreviewImmediately(); try { AvatarCrate crate = ((CrateReferenceT)new AvatarCrateReference(avatar.Barcode)).Crate; if ((Object)(object)crate == (Object)null) { FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, (AvatarPreviewHeightSource)0, interactionReady: false, "The avatar crate is unavailable."); return; } LoadNativePreviewPlaceholder(crate, avatar, generation); ((CrateT)(object)crate).LoadAsset(Action.op_Implicit((Action)delegate(GameObject prefab) { _mainThread.Enqueue(delegate { //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0485: 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_0083: 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: Invalid comparison between Unknown and I4 //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_02c6: Invalid comparison between Unknown and I4 //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_0301: 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) if (_disposed || (Object)(object)prefab == (Object)null || generation != _previewGeneration || (Object)(object)_previewShell == (Object)null) { return; } try { AvatarRigValidationResult value = BoneHubAvatarRigValidator.Validate(prefab); _rigValidations[avatar.Barcode] = value; if (!((AvatarRigValidationResult)(ref value)).CanEquip) { _log.Msg("A malformed avatar was blocked before BONELAB ArtRig: " + Readable(((AvatarRigValidationResult)(ref value)).Reason)); } float realtimeSinceStartup = Time.realtimeSinceStartup; RenderOnlyPreviewResult fullColorResult = BoneHubRenderOnlyPreviewBuilder.Build(prefab, _previewShell.transform, _constrainedRendering); float num = Time.realtimeSinceStartup - realtimeSinceStartup; if (num > 0.5f) { _log.Msg($"A full-color preview took {num:0.00}s to prepare; the native placeholder remained available."); } AvatarPreviewMetrics value2 = default(AvatarPreviewMetrics); ((AvatarPreviewMetrics)(ref value2))..ctor(avatar.Barcode, fullColorResult.GameplayHeightMeters, (int)fullColorResult.HeightSource == 1 && AvatarPreviewMath.IsDisplayableGameplayHeight(fullColorResult.GameplayHeightMeters)); _previewMetrics[avatar.Barcode] = value2; AvatarEntry? obj = Selected(); if (((obj != null) ? obj.Barcode : null) == avatar.Barcode) { SetHeight(((AvatarPreviewMetrics)(ref value2)).HeightDisplayText, ((AvatarPreviewMetrics)(ref value2)).Valid ? Green : Red); } if (!fullColorResult.Valid || (Object)(object)fullColorResult.Root == (Object)null) { _log.Msg($"Full-color preview unavailable (declared {fullColorResult.DeclaredRendererCount}, usable {fullColorResult.RendererCount}): {Readable(fullColorResult.Error ?? "unsafe preview data")}"); if ((int)_previewVisualSource == 2 && (Object)(object)_previewModel != (Object)null) { FinishPreviewPreparation(avatar, _previewVisualSource, fullColorResult.HeightSource, interactionReady: true, null); } else { LoadNativePreviewFallback(crate, avatar, generation, fullColorResult); } } else { ClearPreviewModel(); _previewModel = fullColorResult.Root; _ownedPreviewMeshes.AddRange(fullColorResult.OwnedMeshes.Where((Mesh mesh) => (Object)(object)mesh != (Object)null)); _previewFallback.SetActive(false); FinishPreviewPreparation(avatar, fullColorResult.VisualSource, fullColorResult.HeightSource, fullColorResult.InteractionReady, null); } } catch (Exception ex2) { _previewMetrics[avatar.Barcode] = new AvatarPreviewMetrics(avatar.Barcode, 0f, false); AvatarEntry? obj2 = Selected(); if (((obj2 != null) ? obj2.Barcode : null) == avatar.Barcode) { SetHeight("Height unavailable", Red); } FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, (AvatarPreviewHeightSource)0, interactionReady: false, ex2.Message); _log.Msg("Avatar preview fallback used: " + ex2.Message); } }); })); } catch (Exception ex) { _previewMetrics[avatar.Barcode] = new AvatarPreviewMetrics(avatar.Barcode, 0f, false); SetHeight("Height unavailable", Red); FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, (AvatarPreviewHeightSource)0, interactionReady: false, ex.Message); _log.Msg("Avatar preview could not load: " + ex.Message); } } private void LoadNativePreviewPlaceholder(AvatarCrate crate, BoneHubAvatar avatar, int generation) { try { MarrowAssetT previewMesh = ((GameObjectCrate)crate).PreviewMesh; GameObject? previewFallback = _previewFallback; object obj; if (previewFallback == null) { obj = null; } else { Renderer componentInChildren = previewFallback.GetComponentInChildren(true); obj = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null); } Material material = (Material)obj; if ((MarrowAsset)(object)previewMesh == (MarrowAsset)null || (Object)(object)material == (Object)null || (Object)(object)_previewShell == (Object)null) { return; } previewMesh.LoadAsset(Action.op_Implicit((Action)delegate(Mesh mesh) { _mainThread.Enqueue(delegate { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && !((Object)(object)mesh == (Object)null) && generation == _previewGeneration && !((Object)(object)_previewShell == (Object)null) && (int)_previewVisualSource != 1 && !((Object)(object)_previewModel != (Object)null)) { RenderOnlyPreviewResult renderOnlyPreviewResult = BoneHubRenderOnlyPreviewBuilder.BuildNativePreview(mesh, material, _previewShell.transform, _constrainedRendering, 0f, (AvatarPreviewHeightSource)0, 0, null); if (renderOnlyPreviewResult.Valid && !((Object)(object)renderOnlyPreviewResult.Root == (Object)null)) { _previewModel = renderOnlyPreviewResult.Root; _previewVisualSource = (AvatarPreviewVisualSource)2; _previewInteractionReady = renderOnlyPreviewResult.InteractionReady; if ((Object)(object)_previewFallback != (Object)null) { _previewFallback.SetActive(false); } AvatarEntry? obj3 = Selected(); if (((obj3 != null) ? obj3.Barcode : null) == avatar.Barcode) { SetHeight("Reading game height...", Cyan); } SetStatus("Preparing full-color preview...", Cyan); } } }); })); } catch { } } private void LoadNativePreviewFallback(AvatarCrate crate, BoneHubAvatar avatar, int generation, RenderOnlyPreviewResult fullColorResult) { //IL_00bd: 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) try { MarrowAssetT previewMesh = ((GameObjectCrate)crate).PreviewMesh; GameObject? previewFallback = _previewFallback; object obj; if (previewFallback == null) { obj = null; } else { Renderer componentInChildren = previewFallback.GetComponentInChildren(true); obj = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null); } Material fallbackMaterial = (Material)obj; if ((MarrowAsset)(object)previewMesh == (MarrowAsset)null || (Object)(object)fallbackMaterial == (Object)null) { FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, fullColorResult.HeightSource, interactionReady: false, fullColorResult.Error ?? "The native preview mesh is unavailable."); return; } previewMesh.LoadAsset(Action.op_Implicit((Action)delegate(Mesh mesh) { _mainThread.Enqueue(delegate { //IL_00da: 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_010d: Invalid comparison between Unknown and I4 //IL_0078: 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_01f4: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && generation == _previewGeneration && !((Object)(object)_previewShell == (Object)null)) { if ((Object)(object)mesh == (Object)null) { FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, fullColorResult.HeightSource, interactionReady: false, "The native preview mesh did not load."); } else { RenderOnlyPreviewResult renderOnlyPreviewResult = BoneHubRenderOnlyPreviewBuilder.BuildNativePreview(mesh, fallbackMaterial, _previewShell.transform, _constrainedRendering, fullColorResult.GameplayHeightMeters, fullColorResult.HeightSource, fullColorResult.DeclaredRendererCount, fullColorResult.Error); bool flag = (int)renderOnlyPreviewResult.HeightSource == 1 && AvatarPreviewMath.IsDisplayableGameplayHeight(renderOnlyPreviewResult.GameplayHeightMeters); AvatarPreviewMetrics value = default(AvatarPreviewMetrics); ((AvatarPreviewMetrics)(ref value))..ctor(avatar.Barcode, renderOnlyPreviewResult.GameplayHeightMeters, flag); _previewMetrics[avatar.Barcode] = value; AvatarEntry? obj2 = Selected(); if (((obj2 != null) ? obj2.Barcode : null) == avatar.Barcode) { SetHeight(((AvatarPreviewMetrics)(ref value)).HeightDisplayText, ((AvatarPreviewMetrics)(ref value)).Valid ? Green : Red); } if (!renderOnlyPreviewResult.Valid || (Object)(object)renderOnlyPreviewResult.Root == (Object)null) { FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, renderOnlyPreviewResult.HeightSource, interactionReady: false, renderOnlyPreviewResult.Error); } else { _previewModel = renderOnlyPreviewResult.Root; if ((Object)(object)_previewFallback != (Object)null) { _previewFallback.SetActive(false); } FinishPreviewPreparation(avatar, renderOnlyPreviewResult.VisualSource, renderOnlyPreviewResult.HeightSource, renderOnlyPreviewResult.InteractionReady, null); } } } }); })); } catch (Exception ex) { FinishPreviewPreparation(avatar, (AvatarPreviewVisualSource)0, fullColorResult.HeightSource, interactionReady: false, ex.Message); } } private void SchedulePreview(BoneHubAvatar avatar) { //IL_0087: 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) if (!EnsurePreviewShell(reportRecovery: true)) { _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = true; _previewInteractionReady = false; SetStatus("Preview unavailable - use Equip", Red); return; } _previewGeneration++; _requestedPreviewBarcode = avatar.Barcode; _pendingPreviewAvatar = avatar; _previewLoadAt = Time.unscaledTime + 0.2f; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; ClearPreviewModel(); if ((Object)(object)_centralArtwork != (Object)null) { ((Component)_centralArtwork).gameObject.SetActive(false); } if ((Object)(object)_previewShell == (Object)null || (Object)(object)_previewFallback == (Object)null) { _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; } else { _previewShell.SetActive(IsOpen); _previewFallback.SetActive(true); PlacePreviewImmediately(); } } private void ProcessPendingPreview() { if (!(_pendingPreviewAvatar == null) && !(Time.unscaledTime < _previewLoadAt)) { BoneHubAvatar pendingPreviewAvatar = _pendingPreviewAvatar; _pendingPreviewAvatar = null; AvatarEntry? obj = Selected(); if (((obj != null) ? obj.Barcode : null) != pendingPreviewAvatar.Barcode) { _requestedPreviewBarcode = string.Empty; } else { LoadPreview(pendingPreviewAvatar); } } } private void FinishPreviewPreparation(BoneHubAvatar avatar, AvatarPreviewVisualSource visualSource, AvatarPreviewHeightSource heightSource, bool interactionReady, string? error) { //IL_0008: 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_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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_00d8: Invalid comparison between Unknown and I4 //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) _previewReady = true; _previewVisualSource = visualSource; AvatarRigValidationResult value; bool flag = !_rigValidations.TryGetValue(avatar.Barcode, out value) || ((AvatarRigValidationResult)(ref value)).CanEquip; _previewInteractionReady = interactionReady && flag; _previewRoutes[avatar.Barcode] = new AvatarPreviewRouteMetadata(visualSource, heightSource, interactionReady); _viewState = (AvatarBrowserViewState)16; SetProgressVisible(visible: false); AvatarEntry? obj = Selected(); if (((obj != null) ? obj.Barcode : null) != avatar.Barcode) { return; } if (!flag) { if ((Object)(object)_actionLabel != (Object)null) { _actionLabel.text = "BROKEN"; } if ((Object)(object)_actionPanel != (Object)null) { ((Graphic)_actionPanel).color = Red; } SetStatus("BROKEN AVATAR - CANNOT EQUIP", Red); } else if (interactionReady) { SetStatus(((int)visualSource == 1) ? "Ready - grip, pinch, or equip" : "3D preview ready - grip, pinch, or equip", Green); } else { SetStatus("Preview unavailable - use Equip", Red); _log.Msg("Avatar preview unavailable: " + Readable(error ?? "No safe 3D preview source was available.")); } } private void ConfigureProgress(AvatarEntry entry) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Invalid comparison between Unknown and I4 bool flag = _startingDownloads.Contains(entry.ModId); DownloadJob value; bool flag2 = _jobs.TryGetValue(entry.ModId, out value); bool flag3 = flag; if (!flag3) { bool flag4 = flag2; if (flag4) { DownloadState state = value.State; bool flag5 = state - 6 <= 1; flag4 = !flag5; } flag3 = flag4; } bool flag6 = flag3; SetProgressVisible(flag6); if (!flag6) { return; } if (flag2 && value != null) { if (_progressJobId != value.Id) { _progressJobId = value.Id; _displayedProgress = 0.0; _targetProgress = 0.0; } _targetProgress = (((int)value.State == 5) ? 1.0 : Math.Max(_targetProgress, value.Progress)); } else if (flag) { _progressJobId = Guid.Empty; _displayedProgress = 0.0; _targetProgress = 0.0; } UpdateProgressText(entry); } private void UpdateDownloadProgress() { //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_0093: 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) if (!((Object)(object)_progressRoot == (Object)null) && _progressRoot.activeSelf && !((Object)(object)_progressFill == (Object)null)) { _displayedProgress = (_preferences.ReducedMotion ? _targetProgress : DownloadPresentationMath.Smooth(_displayedProgress, _targetProgress, (double)Time.unscaledDeltaTime, 8.0)); TabletRect progress = ArcDashboardLayout.Progress; float num = ((TabletRect)(ref progress)).Width * (float)_displayedProgress; _progressFill.sizeDelta = new Vector2(Mathf.Max(0.5f, num), ((TabletRect)(ref progress)).Height); _progressFill.anchoredPosition = new Vector2(((TabletRect)(ref progress)).Left + num * 0.5f, ((TabletRect)(ref progress)).Y); AvatarEntry val = Selected(); if (val != (AvatarEntry)null) { UpdateProgressText(val); } } } private void UpdateProgressText(AvatarEntry entry) { //IL_005f: 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_007b: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected I4, but got Unknown //IL_003b: 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_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_01e1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_progressText == (Object)null)) { int num = Mathf.Clamp(Mathf.RoundToInt((float)_displayedProgress * 100f), 0, 100); if (_lastProgressPercent != num || _lastProgressState != (AvatarDownloadState?)entry.DownloadState) { _lastProgressPercent = num; _lastProgressState = entry.DownloadState; TMP_Text progressText = _progressText; AvatarDownloadState downloadState = entry.DownloadState; progressText.text = (downloadState - 1) switch { 0 => "QUEUED", 1 => $"DOWNLOADING {num}%", 2 => $"INSTALLING {num}%", 3 => "100% PREPARING PREVIEW", 4 => $"FAILED {num}%", 5 => $"CANCELLED {num}%", _ => _startingDownloads.Contains(entry.ModId) ? "PREPARING DOWNLOAD" : $"{num}%", }; ((Graphic)_progressText).color = Color.white; } } } private void SetProgressVisible(bool visible) { if ((Object)(object)_progressRoot != (Object)null) { _progressRoot.SetActive(visible); } if (!visible) { _lastProgressPercent = -1; _lastProgressState = null; } } private void UpdatePreview() { //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0497: 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) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: 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_014b: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_017f: 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_0199: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0258: 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_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0336: 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_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: 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_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_previewShell == (Object)null || !_previewShell.activeSelf || (Object)(object)_root == (Object)null) { _chestEquipGuide?.Hide(immediate: true); return; } UpdateDetachedPreviewScale(); IReadOnlyList probes = _fingertips.GetProbes(); if (_previewHeld) { BoneHubFingertipProbe probe = default(BoneHubFingertipProbe); for (int i = 0; i < probes.Count; i++) { BoneHubFingertipProbe boneHubFingertipProbe = probes[i]; if (boneHubFingertipProbe.IsLeft == _dragIsLeft) { probe = boneHubFingertipProbe; break; } } if ((Object)(object)probe.Hand == (Object)null) { if (_dragTrackingLostAt < 0f) { _dragTrackingLostAt = Time.unscaledTime; } if (!(Time.unscaledTime - _dragTrackingLostAt <= 0.18f)) { EndPreviewDrag(equipIfAtChest: false); } return; } _dragTrackingLostAt = -1f; if (!PreviewInputActive(probe, alreadyDragging: true, _dragUsesPinch)) { EndPreviewDrag(equipIfAtChest: true); return; } if (!probe.TryGetDragAnchor(_dragUsesPinch, out var position, out var rotation)) { if (_dragTrackingLostAt < 0f) { _dragTrackingLostAt = Time.unscaledTime; } if (Time.unscaledTime - _dragTrackingLostAt > 0.18f) { EndPreviewDrag(equipIfAtChest: false); } return; } _previewShell.transform.position = position + rotation * _dragLocalOffset; _previewShell.transform.rotation = rotation * _dragRotationOffset; Vector3 val = ChestPosition(); float num = ChestInteractionRadius(); bool flag = ChestEquipGuideMath.ResolveLocked(Vector3.Distance(_previewShell.transform.position, val), _dragWasInsideChest, num, 1.12f); if (flag && !_dragWasInsideChest) { Pulse(probe.Hand); } _dragWasInsideChest = flag; _chestEquipGuide?.UpdatePose(_previewShell.transform.position, val, ((Object)(object)Player.Head != (Object)null) ? Player.Head.position : (val - Vector3.forward), num, flag, _preferences.ReducedMotion, AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight())); SetStatus(flag ? "Release to equip" : "Pull to your chest", flag ? Green : Cyan); return; } if (_previewInteractionReady && _previewAvatar != null && !_previewReturning) { for (int j = 0; j < probes.Count; j++) { BoneHubFingertipProbe probe2 = probes[j]; bool num2 = ControllerGripActive(probe2, alreadyDragging: false); bool flag2 = !num2 && probe2.HasTrackedFingers && PreviewDragMath.PinchActive(probe2.PinchDistance, false, 0.03f, 0.045f); if ((num2 || flag2) && PreviewContains(probe2.Position) && probe2.TryGetDragAnchor(flag2, out var position2, out var rotation2)) { _previewHeld = true; _hologramProjection?.SetSelectedDetached(detached: true); _dragHand = probe2.Hand; _dragIsLeft = probe2.IsLeft; _dragUsesPinch = flag2; Vector3 val2 = Quaternion.Inverse(rotation2) * (_previewShell.transform.position - position2); Vector3 vector = PreviewDragMath.LimitAnchorOffset(new Vector3(val2.x, val2.y, val2.z), flag2 ? 0.06f : 0.085f); _dragLocalOffset = new Vector3(vector.X, vector.Y, vector.Z); _dragRotationOffset = Quaternion.Inverse(rotation2) * _previewShell.transform.rotation; _dragTrackingLostAt = -1f; _dragWasInsideChest = false; if (_chestEquipGuide == null) { _chestEquipGuide = new BoneHubChestEquipGuide(_log); } _chestEquipGuide.Show(); Pulse(probe2.Hand); SetStatus("Move the avatar to your chest", Cyan); return; } } } Vector3 val3 = PreviewSlot(); Quaternion rotation3 = _root.transform.rotation; if (_previewReturning) { float num3 = Mathf.Clamp01((Time.unscaledTime - _returnStarted) / 0.28f); float num4 = num3 * num3 * (3f - 2f * num3); _previewShell.transform.position = Vector3.Lerp(_returnFrom, val3, num4); _previewShell.transform.rotation = Quaternion.Slerp(_returnRotation, rotation3, num4); if (num3 >= 1f) { _previewReturning = false; } } else { _previewShell.transform.SetPositionAndRotation(val3, rotation3); } } private bool PreviewContains(Vector3 worldPosition) { //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) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_previewShell == (Object)null) { return false; } Vector3 val = _previewShell.transform.InverseTransformPoint(worldPosition); return PreviewDragMath.IsInside(new Vector3(val.x, val.y, val.z), new Vector3(0.08f, 0.115f, 0.075f)); } private static bool ControllerGripActive(BoneHubFingertipProbe probe, bool alreadyDragging) { try { return (Object)(object)probe.Hand.Controller != (Object)null && PreviewDragMath.GripActive(probe.Hand.Controller.GetGripForce(), alreadyDragging, 0.62f, 0.28f); } catch { return false; } } private static bool PreviewInputActive(BoneHubFingertipProbe probe, bool alreadyDragging, bool usePinch) { if (!usePinch) { return ControllerGripActive(probe, alreadyDragging); } if (probe.HasTrackedFingers) { return PreviewDragMath.PinchActive(probe.PinchDistance, alreadyDragging, 0.03f, 0.045f); } return false; } private void EndPreviewDrag(bool equipIfAtChest) { //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_00de: 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_00f4: 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) if (_previewHeld && !((Object)(object)_previewShell == (Object)null)) { Hand dragHand = _dragHand; bool num = equipIfAtChest && _previewAvatar != null && Vector3.Distance(_previewShell.transform.position, ChestPosition()) <= ChestInteractionRadius(); _previewHeld = false; _hologramProjection?.SetSelectedDetached(detached: false); _dragHand = null; _dragUsesPinch = false; _dragTrackingLostAt = -1f; _dragWasInsideChest = false; _chestEquipGuide?.Hide(); if (num) { EquipWithSharingReady(_previewAvatar); } if ((Object)(object)dragHand != (Object)null) { Pulse(dragHand); } _previewReturning = true; _returnStarted = Time.unscaledTime; _returnFrom = _previewShell.transform.position; _returnRotation = _previewShell.transform.rotation; } } private void EquipWithSharingReady(BoneHubAvatar avatar) { //IL_0036: 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_00f3: 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_01bf: 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_0159: Unknown result type (might be due to invalid IL or missing references) if (_rigValidations.TryGetValue(avatar.Barcode, out var value) && !((AvatarRigValidationResult)(ref value)).CanEquip) { SetStatus("BROKEN AVATAR - CANNOT EQUIP", Red); if ((Object)(object)_actionLabel != (Object)null) { _actionLabel.text = "BROKEN"; } return; } InstalledModRecord? obj = ((IEnumerable)_service.Installed).FirstOrDefault((Func)((InstalledModRecord item) => item.ModId == avatar.ModId)); ModIoSharingMetadata val = ((obj != null) ? obj.Sharing : null); if (!_runtime.FusionSessionActive || val == null || val.PalletBarcodes.Count == 0) { CancelPendingSharingRegistration(); _sharingRetryBarcode = string.Empty; _runtime.Equip(avatar); return; } if (!_sharing.Available) { _sharingState = (AvatarSharingState)5; _sharingRetryBarcode = avatar.Barcode; SetStatus("SHARING NOT READY - ModioModNetworker is missing", Red); RefreshSelection(avatar.ToEntry()); return; } if (_sharing.IsRegistered(val.PalletBarcodes, val.ModId)) { CancelPendingSharingRegistration(); _sharingRetryBarcode = string.Empty; AvatarPlatformAvailability val2 = new AvatarPlatformAvailability(val.WindowsFileId, val.AndroidFileId); _sharingState = (AvatarSharingState)(((AvatarPlatformAvailability)(ref val2)).IsLimited ? 4 : 2); _runtime.Equip(avatar); return; } _sharingState = (AvatarSharingState)1; _sharingRetryBarcode = string.Empty; _pendingSharingAvatar = avatar; _pendingSharingMetadata = val; _nextSharingCheckAt = 0f; _sharingDeadline = Time.unscaledTime + 20f; _sharingRefreshRequested = false; SetStatus("Registering avatar pack with Fusion...", Cyan); if ((Object)(object)_actionLabel != (Object)null) { _actionLabel.text = "WAIT"; } } private void TickSharingRegistration() { //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_00ae: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) BoneHubAvatar pendingSharingAvatar = _pendingSharingAvatar; ModIoSharingMetadata pendingSharingMetadata = _pendingSharingMetadata; if (pendingSharingAvatar == null || pendingSharingMetadata == null) { return; } AvatarEntry? obj = Selected(); if (!string.Equals((obj != null) ? obj.Barcode : null, pendingSharingAvatar.Barcode, StringComparison.OrdinalIgnoreCase)) { CancelPendingSharingRegistration(); } else { if (Time.unscaledTime < _nextSharingCheckAt) { return; } _nextSharingCheckAt = Time.unscaledTime + 0.25f; if (_sharing.IsRegistered(pendingSharingMetadata.PalletBarcodes, pendingSharingMetadata.ModId)) { CancelPendingSharingRegistration(); _sharingRetryBarcode = string.Empty; AvatarPlatformAvailability val = new AvatarPlatformAvailability(pendingSharingMetadata.WindowsFileId, pendingSharingMetadata.AndroidFileId); _sharingState = (AvatarSharingState)(((AvatarPlatformAvailability)(ref val)).IsLimited ? 4 : 2); SetStatus("Sharing ready - equipping avatar", Green); if ((Object)(object)_actionLabel != (Object)null) { _actionLabel.text = "EQUIP"; } _log.Msg("The selected avatar pallet is registered; Fusion equip is continuing through its normal sender."); _runtime.Equip(pendingSharingAvatar); return; } if (!_sharingRefreshRequested && !_sharing.RegistrationRefreshBusy) { _sharingRefreshRequested = true; _sharing.RequestRefresh(immediate: true); } if (_sharing.RegistrationRefreshBusy) { _sharingDeadline = Math.Max(_sharingDeadline, Time.unscaledTime + 2f); } else if (!(Time.unscaledTime < _sharingDeadline)) { CancelPendingSharingRegistration(); _sharingState = (AvatarSharingState)5; _sharingRetryBarcode = pendingSharingAvatar.Barcode; SetStatus("SHARING NOT READY - touch RESCAN", Red); if ((Object)(object)_actionLabel != (Object)null) { _actionLabel.text = "RESCAN"; } _log.Warning("Fusion equip was paused because the exact pallet was not registered by ModioModNetworker."); } } } private void CancelPendingSharingRegistration() { _pendingSharingAvatar = null; _pendingSharingMetadata = null; _nextSharingCheckAt = 0f; _sharingDeadline = 0f; _sharingRefreshRequested = false; } private void FollowWrist(bool immediate = false, bool positionOnly = false) { //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_01fc: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ff: 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_010c: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0163: 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_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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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_0252: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null || (Object)(object)Player.Head == (Object)null) { return; } Hand obj = (_preferences.UseLeftWrist ? Player.LeftHand : Player.RightHand); Transform val = ((obj != null) ? ((Component)obj).transform : null); if (!((Object)(object)val == (Object)null)) { float num = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()); int instanceID = ((Object)val).GetInstanceID(); if (!_wristLocalPoseValid || _wristLocalHandId != instanceID || Mathf.Abs(_wristLocalHeightRatio - num) > 0.0001f || Mathf.Abs(_wristLocalWatchScale - _preferences.WatchScale) > 0.0001f || Mathf.Abs(_wristLocalOutwardOffset - _preferences.OutwardOffset) > 0.0001f || Mathf.Abs(_wristLocalFingerOffset - _preferences.FingerOffset) > 0.0001f) { Vector3 val2 = (_preferences.UseLeftWrist ? (-1f) : 1f) * val.right; Vector3 val3 = val.position + Vector3.up * (0.12f * num) + val2 * ((_preferences.OutwardOffset + 0.09f) * num) + val.forward * (_preferences.FingerOffset * num); _wristLocalPosition = val.InverseTransformPoint(val3); _wristLocalHandId = instanceID; _wristLocalHeightRatio = num; _wristLocalWatchScale = _preferences.WatchScale; _wristLocalOutwardOffset = _preferences.OutwardOffset; _wristLocalFingerOffset = _preferences.FingerOffset; _wristLocalPoseValid = true; } Vector3 val4 = val.TransformPoint(_wristLocalPosition); Vector3 val5 = Player.Head.position - val4; Vector3 val6 = ((Vector3)(ref val5)).normalized; if (((Vector3)(ref val6)).sqrMagnitude < 0.01f) { val6 = -val.forward; } val5 = Vector3.ProjectOnPlane(Vector3.up, val6); Vector3 val7 = ((Vector3)(ref val5)).normalized; if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val5 = Vector3.ProjectOnPlane(Player.Head.up, val6); val7 = ((Vector3)(ref val5)).normalized; } if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val7 = Vector3.up; } _root.transform.SetPositionAndRotation(val4, Quaternion.LookRotation(-val6, val7)); _root.transform.localScale = Vector3.one * (_preferences.WatchScale * num); } } private static float CurrentPlayerHeight() { try { RigManager rigManager = Player.RigManager; float? obj; if (rigManager == null) { obj = null; } else { Avatar avatar = rigManager.avatar; obj = ((avatar != null) ? new float?(avatar.height) : ((float?)null)); } float? num = obj; float valueOrDefault = num.GetValueOrDefault(); return AvatarPreviewMath.IsUsableHeight(valueOrDefault) ? valueOrDefault : 1.75f; } catch { return 1.75f; } } private static bool IsLocalPlayerDead() { try { RigManager rigManager = Player.RigManager; Health val = ((rigManager != null) ? rigManager.health : null); return (Object)(object)val != (Object)null && (!val.alive || val.deathIsImminent); } catch { return false; } } private void UpdatePushPromptVisibility() { //IL_0001: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if ((int)_viewState != 0 || (Object)(object)_launcher == (Object)null || !_launcher.activeSelf || (Object)(object)Player.Head == (Object)null) { _promptDismissal.Reset(); return; } Vector3 val = _launcher.transform.position - Player.Head.position; float magnitude = ((Vector3)(ref val)).magnitude; float num = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()); bool flag = magnitude >= 0.08f * num && magnitude <= 0.9f * num && magnitude > 0.01f && Vector3.Dot(Player.Head.forward, val / magnitude) >= 0.75f; if (_promptDismissal.Update(flag, (double)Time.unscaledDeltaTime, 0.35)) { Close(); } } private void PollButtons() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_014c: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) if ((int)_lifecycle != 2 || ((int)_viewState == 1 && Time.unscaledTime < _hubControlsReadyAt)) { return; } for (int num = _buttons.Count - 1; num >= 0; num--) { if (!_buttons[num].IsAlive) { _buttons.RemoveAt(num); } } IReadOnlyList probes = _fingertips.GetProbes(); if (_inputRearm.Required) { bool flag = false; for (int i = 0; i < probes.Count; i++) { if (flag) { break; } BoneHubFingertipProbe boneHubFingertipProbe = probes[i]; if ((Object)(object)boneHubFingertipProbe.Hand == (Object)null) { continue; } for (int j = 0; j < _buttons.Count; j++) { if (_buttons[j].Contains(boneHubFingertipProbe.Position)) { flag = true; break; } } } if (!_inputRearm.CanInteract(flag, (double)Time.unscaledTime)) { return; } } _activeProbeIds.Clear(); for (int k = 0; k < probes.Count; k++) { BoneHubFingertipProbe boneHubFingertipProbe2 = probes[k]; if ((Object)(object)boneHubFingertipProbe2.Hand == (Object)null) { continue; } int instanceID = ((Object)boneHubFingertipProbe2.Hand).GetInstanceID(); _activeProbeIds.Add(instanceID); if (_touchCaptures.TryGetValue(instanceID, out TouchButton value)) { if (!value.Contains(boneHubFingertipProbe2.Position)) { ReleaseTouchCapture(instanceID, value); } continue; } TouchButton touchButton = null; float num2 = float.MaxValue; for (int l = 0; l < _buttons.Count; l++) { TouchButton touchButton2 = _buttons[l]; if (touchButton2.Contains(boneHubFingertipProbe2.Position)) { float num3 = TouchDistanceScore(touchButton2, boneHubFingertipProbe2.Position); if (!(num3 >= num2)) { num2 = num3; touchButton = touchButton2; } } } if (touchButton != null && touchButton.Debounce.Update(true)) { _touchCaptures[instanceID] = touchButton; Transform transform = ((Component)touchButton.Panel).transform; transform.localPosition += Vector3.forward * 0.003f; Pulse(boneHubFingertipProbe2.Hand); touchButton.Action(); if (_inputRearm.Required) { break; } } } _staleCaptureIds.Clear(); foreach (KeyValuePair touchCapture in _touchCaptures) { if (!_activeProbeIds.Contains(touchCapture.Key)) { _staleCaptureIds.Add(touchCapture.Key); } } foreach (int staleCaptureId in _staleCaptureIds) { if (_touchCaptures.TryGetValue(staleCaptureId, out TouchButton value2)) { ReleaseTouchCapture(staleCaptureId, value2); } } } private static float TouchDistanceScore(TouchButton button, Vector3 worldPosition) { //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_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_0030: 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_004d: 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_0070: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)button.Space == (Object)null) { return float.MaxValue; } Vector3 val = button.Space.InverseTransformPoint(worldPosition) - button.Center; float num = val.x / Mathf.Max(button.Half.x, 0.0001f); float num2 = val.y / Mathf.Max(button.Half.y, 0.0001f); float num3 = val.z / Mathf.Max(button.Half.z, 0.0001f); return num * num + num2 * num2 + num3 * num3; } catch { return float.MaxValue; } } private void ReleaseTouchCapture(int probeId, TouchButton button) { //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) _touchCaptures.Remove(probeId); if (!button.Debounce.Latched) { return; } button.Debounce.Update(false); try { if ((Object)(object)button.Panel != (Object)null) { Transform transform = ((Component)button.Panel).transform; transform.localPosition -= Vector3.forward * 0.003f; } } catch { } } private void ResetTouchButtons() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) foreach (TouchButton button in _buttons) { if (!button.Debounce.Latched) { continue; } button.Debounce.Update(false); try { if ((Object)(object)button.Panel != (Object)null) { Transform transform = ((Component)button.Panel).transform; transform.localPosition -= Vector3.forward * 0.003f; } } catch { } } _touchCaptures.Clear(); } private void RequireInputRearm() { ResetTouchButtons(); _inputRearm.Require(); } private void OpenKeyboard() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_012c: Unknown result type (might be due to invalid IL or missing references) _wristKeyboardPurpose = WristKeyboardPurpose.Avatars; if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_keyboardPage == (Object)null)) { if (_query.Length == 0) { _scopeBeforeSearch = _scope; } _viewStateBeforeKeyboard = _viewState; _keyboard.Set(_query); if ((Object)(object)_keyboardTitle != (Object)null) { _keyboardTitle.text = "SEARCH AVATARS"; } _keyboardPage.SetActive(true); GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } HideWristOsAppPages(); UpdatePresentationMode(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } _viewState = (AvatarBrowserViewState)14; RefreshKeyboardText(); RequireInputRearm(); _log.Msg("WristHub tablet keyboard opened for avatar search."); } } private void AppendKeyboardCharacter(char character) { _keyboard.Append(character); RefreshKeyboardText(); } private void AppendKeyboardSpace() { _keyboard.AppendSpace(); RefreshKeyboardText(); } private void BackspaceKeyboard() { _keyboard.Backspace(); RefreshKeyboardText(); } private void ClearKeyboard() { _keyboard.Clear(); RefreshKeyboardText(); } private void ToggleKeyboardShift() { _keyboard.ToggleShift(); RefreshKeyboardText(); } private void RefreshKeyboardText() { //IL_00ca: 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) if ((Object)(object)_keyboardText != (Object)null) { string text; switch (_wristKeyboardPurpose) { case WristKeyboardPurpose.CodeMods: text = "Type a code mod name"; break; case WristKeyboardPurpose.Spawnables: text = "Type a spawnable name"; break; case WristKeyboardPurpose.PortalLevels: text = "Type a map name"; break; case WristKeyboardPurpose.FusionServerCode: text = "Type a Fusion server code"; break; case WristKeyboardPurpose.CodeModString: case WristKeyboardPurpose.SdkText: text = "Type a value"; break; default: text = "Type an avatar name"; break; } string text2 = text; _keyboardText.text = ((_keyboard.Value.Length == 0) ? text2 : _keyboard.VisibleValue(36)); ((Graphic)_keyboardText).color = (Color)((_keyboard.Value.Length == 0) ? new Color(0.55f, 0.68f, 0.74f, 1f) : Color.white); } if ((Object)(object)_keyboardShiftText != (Object)null) { _keyboardShiftText.text = (_keyboard.Shifted ? "SHIFT ON" : "SHIFT"); } if (_keyboardSubmitButton != null) { _keyboardSubmitButton.Label.text = ((_wristKeyboardPurpose == WristKeyboardPurpose.FusionServerCode) ? "JOIN" : "SEARCH"); } } private void SubmitKeyboard() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) string text = _keyboard.Value.Trim(); switch (_wristKeyboardPurpose) { case WristKeyboardPurpose.CodeMods: _codeModQuery = text; ShowCodeModsPage(); return; case WristKeyboardPurpose.Spawnables: _spawnableQuery = text; _spawnableIndex = 0; ShowSpawnablesPage(); return; case WristKeyboardPurpose.PortalLevels: SubmitPortalLevelSearch(text); return; case WristKeyboardPurpose.FusionServerCode: SubmitFusionServerCode(text); return; case WristKeyboardPurpose.CodeModString: ApplyCodeModString(text); ShowCodeModsPage(); return; case WristKeyboardPurpose.SdkText: ApplySdkText(text); ShowCodeModsPage(); return; } if (text.Length == 0) { _scope = _scopeBeforeSearch; } SetQuery(text); } private void CancelKeyboard() { //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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Invalid comparison between Unknown and I4 GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } if (_wristKeyboardPurpose == WristKeyboardPurpose.CodeMods || _wristKeyboardPurpose == WristKeyboardPurpose.CodeModString || _wristKeyboardPurpose == WristKeyboardPurpose.SdkText) { ShowCodeModsPage(); return; } if (_wristKeyboardPurpose == WristKeyboardPurpose.Spawnables) { ShowSpawnablesPage(); return; } if (_wristKeyboardPurpose == WristKeyboardPurpose.PortalLevels) { ShowPortalLevelsPage(); return; } if (_wristKeyboardPurpose == WristKeyboardPurpose.FusionServerCode) { ShowFusionServersPage(); return; } _viewState = _viewStateBeforeKeyboard; if ((int)_viewStateBeforeKeyboard == 0) { ShowHub(); return; } if ((int)_viewStateBeforeKeyboard == 3) { ShowDetailPage(); return; } ShowScopePage(); _log.Msg("WristHub tablet keyboard cancelled."); } private void MoveFocused(int direction) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (_entries.Count == 0) { return; } try { ResetTrashConfirmation(); int index = _cursor.Move(direction); _selectedIdentity = _entries[index].Identity; RefreshFocusedResult(); } catch (Exception value) { _viewState = (AvatarBrowserViewState)19; SetStatus("Could not change avatar. Try again.", Red); _log.Error($"Avatar paging failed: {value}"); } } private AvatarEntry? Selected() { return ((IEnumerable)_entries).FirstOrDefault((Func)((AvatarEntry entry) => entry.Identity == _selectedIdentity)); } private void RefreshHologramCarousel(AvatarEntry? selected) { //IL_0074: 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) if (_hologramCarousel == null) { return; } string text = ((selected != null) ? selected.Identity : null) ?? string.Empty; if (selected == (AvatarEntry)null || _entries.Count < 2) { if (!string.Equals(_carouselIdentity, text, StringComparison.OrdinalIgnoreCase)) { _carouselIdentity = text; _hologramProjection?.SetSelection(text); BoneHubHologramCarousel? hologramCarousel = _hologramCarousel; BoneHubForearmProjection? hologramProjection = _hologramProjection; hologramCarousel.SetSelection(null, null, (HoloPerformanceTier)((hologramProjection != null) ? ((int)hologramProjection.PerformanceTier) : 0), showPrevious: false, showNext: false); } return; } int num = IndexOf(text); AvatarEntry val = _entries[HologramCarouselPresentation.Wrap(num - 1, _entries.Count)]; AvatarEntry val2 = _entries[HologramCarouselPresentation.Wrap(num + 1, _entries.Count)]; string text2 = val.Identity + "|" + text + "|" + val2.Identity; if (!string.Equals(_carouselIdentity, text2, StringComparison.OrdinalIgnoreCase)) { _carouselIdentity = text2; _hologramProjection?.SetSelection(text); BoneHubAvatar previous = (string.IsNullOrWhiteSpace(val.Barcode) ? null : _runtime.FindAvatar(val.Barcode)); BoneHubAvatar next = (string.IsNullOrWhiteSpace(val2.Barcode) ? null : _runtime.FindAvatar(val2.Barcode)); BoneHubHologramCarousel? hologramCarousel2 = _hologramCarousel; BoneHubForearmProjection? hologramProjection2 = _hologramProjection; hologramCarousel2.SetSelection(previous, next, (HoloPerformanceTier)((hologramProjection2 == null) ? (_constrainedRendering ? 1 : 0) : ((int)hologramProjection2.PerformanceTier))); } } private int IndexOf(string identity) { for (int i = 0; i < _entries.Count; i++) { if (string.Equals(_entries[i].Identity, identity, StringComparison.OrdinalIgnoreCase)) { return i; } } return 0; } private Vector3 PreviewSlot() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null)) { return _root.transform.TransformPoint(new Vector3(0f, -0.006f, -0.03f)); } return Vector3.zero; } private static Vector3 ChestPosition() { //IL_0023: 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_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_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_0054: 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 ((Object)(object)Player.Head == (Object)null) { return Vector3.zero; } float num = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()); return Player.Head.position - Vector3.up * (0.34f * num) + Player.Head.forward * (0.05f * num); } private float ChestInteractionRadius() { return 0.22f * _preferences.EquipZoneScale * AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()); } private void PlacePreviewImmediately() { //IL_002f: 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) if (!((Object)(object)_previewShell == (Object)null) && !((Object)(object)_root == (Object)null)) { UpdateDetachedPreviewScale(); _previewShell.transform.SetPositionAndRotation(PreviewSlot(), _root.transform.rotation); } } private void UpdateDetachedPreviewScale() { //IL_0028: 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) if (!((Object)(object)_previewShell == (Object)null) && !((Object)(object)_root == (Object)null)) { float num = Mathf.Abs(_root.transform.lossyScale.x); float num2 = ((!_preferences.HologramEffects || _previewHeld || _previewReturning) ? 1f : Mathf.Lerp(0.08f, 1f, _hologramProjection?.CenterAvatarProgress ?? 1f)); float num3 = AvatarUiScaleMath.ResolveDetachedContentScale(num) * num2; _previewShell.transform.localScale = Vector3.one * num3; } } private void ClearPreviewModel() { if ((Object)(object)_previewModel != (Object)null) { Object.Destroy((Object)(object)_previewModel); } _previewModel = null; foreach (Mesh ownedPreviewMesh in _ownedPreviewMeshes) { if ((Object)(object)ownedPreviewMesh != (Object)null) { Object.Destroy((Object)(object)ownedPreviewMesh); } } _ownedPreviewMeshes.Clear(); if ((Object)(object)_previewFallback != (Object)null) { _previewFallback.SetActive(true); } } private void DeactivateAvatarPreview() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (_previewHeld) { EndPreviewDrag(equipIfAtChest: false); } _previewGeneration++; _loadedPreviewBarcode = string.Empty; _requestedPreviewBarcode = string.Empty; _pendingPreviewAvatar = null; _previewReady = false; _previewInteractionReady = false; _previewVisualSource = (AvatarPreviewVisualSource)0; ClearPreviewModel(); if ((Object)(object)_previewShell != (Object)null) { _previewShell.SetActive(false); } } private void SetHeight(string value, Color color) { //IL_0020: 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_0078: 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_0071: 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) if ((Object)(object)_heightText != (Object)null) { _heightText.text = value; ((Graphic)_heightText).color = color; } if ((Object)(object)_heightRuler == (Object)null) { return; } foreach (Graphic componentsInChild in _heightRuler.GetComponentsInChildren(true)) { componentsInChild.color = ((color == Green) ? Green : ((color == Red) ? Red : DimCyan)); } } private GameObject CreateSilhouette(Transform parent) { //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_0017: 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_0045: 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_0057: 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_0085: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown GameObject val = new GameObject("Clean Avatar Silhouette"); val.transform.SetParent(parent, false); CreatePanel(val.transform, "Head", new Vector3(0f, 0.06f, 0f), new Vector3(0.043f, 0.043f, 0.025f), Cyan, (PrimitiveType)0); CreatePanel(val.transform, "Body", new Vector3(0f, 0f, 0f), new Vector3(0.07f, 0.08f, 0.028f), DimCyan, (PrimitiveType)3); CreatePanel(val.transform, "Leg L", new Vector3(-0.02f, -0.065f, 0f), new Vector3(0.022f, 0.06f, 0.02f), DimCyan, (PrimitiveType)3); CreatePanel(val.transform, "Leg R", new Vector3(0.02f, -0.065f, 0f), new Vector3(0.022f, 0.06f, 0.02f), DimCyan, (PrimitiveType)3); return val; } private TouchButton CreateButton(Transform space, Transform visualParent, string label, Vector3 center, Vector3 size, Color color, Action action, float fontSize) { //IL_0002: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0042: 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_005c: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00ee: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0226: 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_0364: 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_03b3: 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_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) ((Vector3)(ref center))..ctor(center.x, center.y, 0f - Mathf.Abs(center.z)); GameObject val = new GameObject("Button - " + label); val.transform.SetParent(visualParent, false); TabletRect bounds = default(TabletRect); ((TabletRect)(ref bounds))..ctor(center.x * 1000f, center.y * 1000f, size.x * 1000f, size.y * 1000f); Image val2 = val.AddComponent(); if ((Object)(object)_roundedSprite != (Object)null) { val2.sprite = _roundedSprite; val2.type = (Type)1; } ((Graphic)val2).color = new Color(color.r, color.g, color.b, Mathf.Max(0.94f, color.a)); ((Graphic)val2).raycastTarget = false; SetRect(((Graphic)val2).rectTransform, bounds); Outline obj = val.AddComponent(); ((Shadow)obj).effectColor = new Color(Mathf.Lerp(color.r, 1f, 0.45f), Mathf.Lerp(color.g, 1f, 0.45f), Mathf.Lerp(color.b, 1f, 0.45f), 0.34f); ((Shadow)obj).effectDistance = new Vector2(1.1f, -1.1f); ((Shadow)obj).useGraphicAlpha = true; ((Graphic)CreateImage(val.transform, "Button Top Highlight", new TabletRect(0f, ((TabletRect)(ref bounds)).Height * 0.34f, Mathf.Max(4f, ((TabletRect)(ref bounds)).Width - 8f), Mathf.Clamp(((TabletRect)(ref bounds)).Height * 0.1f, 1.2f, 2.2f)), new Color(1f, 1f, 1f, 0.11f))).raycastTarget = false; ((Graphic)CreateImage(val.transform, "Button Lower Depth", new TabletRect(0f, (0f - ((TabletRect)(ref bounds)).Height) * 0.39f, Mathf.Max(4f, ((TabletRect)(ref bounds)).Width - 8f), Mathf.Clamp(((TabletRect)(ref bounds)).Height * 0.08f, 1f, 1.8f)), new Color(0f, 0.02f, 0.035f, 0.32f))).raycastTarget = false; ButtonIconKind buttonIconKind = ResolveButtonIcon(label); string text = label.Trim().ToUpperInvariant(); bool flag; if (text != null) { switch (text.Length) { case 1: { char c = text[0]; if ((uint)c <= 62u) { if (c != '<' && c != '>') { break; } } else if (c != 'X' && c != '⚙') { break; } goto IL_0302; } case 3: { char c = text[0]; if (c != 'S') { if (c != 'â' || !(text == "âš™")) { break; } } else if (!(text == "SET")) { break; } goto IL_0302; } case 2: { if (!(text == "DL")) { break; } goto IL_0302; } IL_0302: flag = true; goto IL_030a; } } flag = false; goto IL_030a; IL_030a: bool flag2 = flag; bool flag3 = buttonIconKind != ButtonIconKind.None && ((TabletRect)(ref bounds)).Height >= 18f && (((TabletRect)(ref bounds)).Width >= 48f || flag2); TabletRect bounds2 = ((flag3 && !flag2) ? new TabletRect(Mathf.Min(10f, ((TabletRect)(ref bounds)).Width * 0.1f), 0f, ((TabletRect)(ref bounds)).Width - Mathf.Min(28f, ((TabletRect)(ref bounds)).Width * 0.3f), ((TabletRect)(ref bounds)).Height - 5f) : new TabletRect(0f, 0f, ((TabletRect)(ref bounds)).Width - 9f, ((TabletRect)(ref bounds)).Height - 5f)); TMP_Text val3 = CreateText(val.transform, (flag2 && flag3) ? string.Empty : label, bounds2, fontSize, new Color(0.96f, 0.985f, 1f, 1f), (TextAlignmentOptions)514, (FontStyles)1); val3.outlineWidth = 0.08f; val3.outlineColor = new Color32((byte)0, (byte)10, (byte)18, (byte)185); if (flag3) { float centerX = (flag2 ? 0f : ((0f - ((TabletRect)(ref bounds)).Width) * 0.5f + Mathf.Clamp(((TabletRect)(ref bounds)).Height * 0.56f, 9f, 14f))); CreateButtonIcon(val.transform, buttonIconKind, centerX, 0f, Mathf.Clamp(((TabletRect)(ref bounds)).Height * 0.42f, 6.5f, 11f), new Color(Mathf.Lerp(color.r, 1f, 0.62f), Mathf.Lerp(color.g, 1f, 0.62f), Mathf.Lerp(color.b, 1f, 0.62f), 0.96f)); } TouchButton touchButton = new TouchButton { Space = space, Root = val, Panel = val2, Label = val3, Center = center, Half = new Vector3(size.x * 0.55f, size.y * 0.6f, Mathf.Max(0.009f, size.z * 0.65f)), Action = action }; _buttons.Add(touchButton); return touchButton; } private static ButtonIconKind ResolveButtonIcon(string label) { string text = label.Trim().ToUpperInvariant(); if ((text == "X" || text == "CLOSE") ? true : false) { return ButtonIconKind.Close; } bool flag; switch (text) { case "<": case "BACK": case "PREV": case "SERVERS": flag = true; break; default: flag = false; break; } if (flag) { return ButtonIconKind.Back; } if ((text == ">" || text == "NEXT") ? true : false) { return ButtonIconKind.Forward; } if (text.Contains("SEARCH", StringComparison.Ordinal) || text.Contains("BROWSE", StringComparison.Ordinal)) { return ButtonIconKind.Search; } flag = text.Contains("OPTION", StringComparison.Ordinal) || text.Contains("SETTING", StringComparison.Ordinal); if (!flag) { bool flag2; switch (text) { case "SET": case "⚙": case "âš™": flag2 = true; break; default: flag2 = false; break; } flag = flag2; } if (flag) { return ButtonIconKind.Settings; } if (text == "DL" || text.Contains("DOWNLOAD", StringComparison.Ordinal)) { return ButtonIconKind.Download; } if (text.Contains("DELETE", StringComparison.Ordinal) || text.Contains("REMOVE", StringComparison.Ordinal)) { return ButtonIconKind.Delete; } if (text.Contains("AVATAR", StringComparison.Ordinal) || text.Contains("EQUIP", StringComparison.Ordinal)) { if (!text.Contains("EQUIP", StringComparison.Ordinal)) { return ButtonIconKind.Avatar; } return ButtonIconKind.Equip; } if (text.Contains("MOD APP", StringComparison.Ordinal) || text.Contains("CODE MOD", StringComparison.Ordinal) || text.Contains("COMMUNITY", StringComparison.Ordinal) || text.Contains("MANAGER", StringComparison.Ordinal) || text.Contains("BONEMENU", StringComparison.Ordinal) || text.Contains("LOADED", StringComparison.Ordinal) || text.Contains("ALL APP", StringComparison.Ordinal)) { return ButtonIconKind.Apps; } if (text.Contains("MAP", StringComparison.Ordinal)) { return ButtonIconKind.Map; } if (text.Contains("COMPASS", StringComparison.Ordinal)) { return ButtonIconKind.Compass; } if (text.Contains("PORTAL", StringComparison.Ordinal) || text.Contains("GATE", StringComparison.Ordinal)) { return ButtonIconKind.Portal; } if (text.Contains("FUSION", StringComparison.Ordinal)) { return ButtonIconKind.Fusion; } if (text.Contains("PLAYER", StringComparison.Ordinal)) { return ButtonIconKind.Players; } if (text.Contains("GAMEMODE", StringComparison.Ordinal)) { return ButtonIconKind.Gamemode; } if (text.Contains("QUICK", StringComparison.Ordinal)) { return ButtonIconKind.QuickJoin; } if (text == "HOME") { return ButtonIconKind.Home; } if (text.Contains("REFRESH", StringComparison.Ordinal) || text.Contains("RESCAN", StringComparison.Ordinal)) { return ButtonIconKind.Refresh; } if (text.Contains("JOIN", StringComparison.Ordinal) || text.Contains("SPAWN", StringComparison.Ordinal)) { return ButtonIconKind.Join; } if (text.Contains("DISCONNECT", StringComparison.Ordinal)) { return ButtonIconKind.Close; } return ButtonIconKind.None; } private void CreateButtonIcon(Transform parent, ButtonIconKind kind, float centerX, float centerY, float size, Color color) { //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_0056: 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) Sprite buttonIconSprite = GetButtonIconSprite(kind); if (!((Object)(object)buttonIconSprite == (Object)null)) { GameObject val = new GameObject("Icon " + kind); val.transform.SetParent(parent, false); Image obj = val.AddComponent(); obj.sprite = buttonIconSprite; obj.type = (Type)0; obj.preserveAspect = true; ((Graphic)obj).color = color; ((Graphic)obj).raycastTarget = false; SetRect(((Graphic)obj).rectTransform, new TabletRect(centerX, centerY, size, size)); } } private static GameObject CreateCanvas(Transform parent, string name, float width, float height, float z) { //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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, 0f, 0f - Mathf.Abs(z)); val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one * 0.001f; Canvas obj = val.AddComponent(); obj.renderMode = (RenderMode)2; obj.sortingOrder = 100; val.GetComponent().sizeDelta = new Vector2(width, height); return val; } private Image CreateImage(Transform parent, string name, TabletRect bounds, Color color) { //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_003b: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); if ((Object)(object)_roundedSprite != (Object)null) { val2.sprite = _roundedSprite; val2.type = (Type)1; } ((Graphic)val2).color = color; ((Graphic)val2).raycastTarget = false; SetRect(((Graphic)val2).rectTransform, bounds); return val2; } private static RawImage CreateRawImage(Transform parent, string name, TabletRect bounds, Texture2D texture, Color color) { //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_0020: 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_0053: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RawImage obj = val.AddComponent(); obj.texture = (Texture)(object)texture; ((Graphic)obj).color = color; ((Graphic)obj).raycastTarget = false; obj.uvRect = new Rect(0f, 0f, 1f, 1f); SetRect(((Graphic)obj).rectTransform, bounds); return obj; } private static TMP_Text CreateText(Transform parent, string value, TabletRect bounds, float fontSize, Color color, TextAlignmentOptions alignment, FontStyles style = (FontStyles)0) { //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_006f: 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_007f: 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) GameObject val = new GameObject("Text - " + value); val.transform.SetParent(parent, false); TextMeshProUGUI val2 = val.AddComponent(); if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null) { ((TMP_Text)val2).font = TMP_Settings.defaultFontAsset; } ((TMP_Text)val2).text = value; ((TMP_Text)val2).fontSize = fontSize; ((TMP_Text)val2).enableAutoSizing = true; ((TMP_Text)val2).fontSizeMax = fontSize; ((TMP_Text)val2).fontSizeMin = Mathf.Max(7f, fontSize * 0.55f); ((TMP_Text)val2).fontStyle = style; ((Graphic)val2).color = color; ((TMP_Text)val2).alignment = alignment; ((TMP_Text)val2).enableWordWrapping = ((TabletRect)(ref bounds)).Height >= fontSize * 1.55f; ((TMP_Text)val2).overflowMode = (TextOverflowModes)3; ((Graphic)val2).raycastTarget = false; SetRect(((TMP_Text)val2).rectTransform, bounds); return (TMP_Text)(object)val2; } private static void SetRect(RectTransform rect, TabletRect bounds) { //IL_000b: 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_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_0067: 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_007d: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = new Vector2(0.5f, 0.5f); rect.anchorMax = new Vector2(0.5f, 0.5f); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchoredPosition = new Vector2(((TabletRect)(ref bounds)).X, ((TabletRect)(ref bounds)).Y); rect.sizeDelta = new Vector2(((TabletRect)(ref bounds)).Width, ((TabletRect)(ref bounds)).Height); ((Transform)rect).localScale = Vector3.one; ((Transform)rect).localRotation = Quaternion.identity; } private static Vector3 PixelCenter(TabletRect rect) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) return new Vector3(((TabletRect)(ref rect)).X / 1000f, ((TabletRect)(ref rect)).Y / 1000f, 0.007f); } private static Vector3 PixelSize(TabletRect rect) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) return new Vector3(((TabletRect)(ref rect)).Width / 1000f, ((TabletRect)(ref rect)).Height / 1000f, 0.014f); } private static Texture2D CreatePlaceholderTexture() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "WristHub Permanent Avatar Placeholder", hideFlags = (HideFlags)32 }; Color[] array = (Color[])(object)new Color[4096]; Color val2 = default(Color); ((Color)(ref val2))..ctor(0.02f, 0.075f, 0.105f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.18f, 0.72f, 0.82f, 1f); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { bool flag = (j - 32) * (j - 32) + (i - 45) * (i - 45) <= 64; bool flag2 = j >= 22 && j <= 42 && i >= 16 && i <= 37; array[i * 64 + j] = ((flag || flag2) ? val3 : val2); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); return val; } private static Texture2D CreateRoundedTexture() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_00fb: 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) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "WristHub Rounded Rectangle", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; Color[] array = (Color[])(object)new Color[4096]; float num = 32f; float num2 = num - 14f; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num3 = Mathf.Abs((float)j + 0.5f - num) - num2; float num4 = Mathf.Abs((float)i + 0.5f - num) - num2; float num5 = Mathf.Sqrt(Mathf.Max(num3, 0f) * Mathf.Max(num3, 0f) + Mathf.Max(num4, 0f) * Mathf.Max(num4, 0f)) + Mathf.Min(Mathf.Max(num3, num4), 0f) - 14f; float num6 = Mathf.Clamp01(0.5f - num5); array[i * 64 + j] = new Color(1f, 1f, 1f, num6); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); return val; } private static Renderer CreatePanel(Transform parent, string name, Vector3 position, Vector3 scale, Color color, PrimitiveType primitive = (PrimitiveType)3) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_005f: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(primitive); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = position; obj.transform.localRotation = Quaternion.identity; obj.transform.localScale = scale; Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); SetColor(component2, color); return component2; } private static void SetColor(Renderer renderer, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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) MaterialPropertyBlock val = new MaterialPropertyBlock(); renderer.GetPropertyBlock(val); val.SetColor("_Color", color); val.SetColor("_BaseColor", color); renderer.SetPropertyBlock(val); } private static void SetTexture(Renderer renderer, Texture2D texture) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown MaterialPropertyBlock val = new MaterialPropertyBlock(); renderer.GetPropertyBlock(val); val.SetTexture("_MainTex", (Texture)(object)texture); val.SetTexture("_BaseMap", (Texture)(object)texture); renderer.SetPropertyBlock(val); } private void SetStatus(string value, Color color) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_statusText == (Object)null)) { _statusText.text = (string.IsNullOrWhiteSpace(value) ? "Ready" : value.Trim()); ((Graphic)_statusText).color = color; } } private void Pulse(Hand hand) { if (!_preferences.HapticsEnabled) { return; } try { BaseController obj = (((Object)(object)hand == (Object)(object)Player.LeftHand) ? Player.LeftController : Player.RightController); if (obj != null) { Haptor haptor = obj.haptor; if (haptor != null) { haptor.Haptic_Tap(); } } } catch (Exception ex) { _log.Msg("Touch haptic skipped: " + ex.Message); } } private static AvatarDownloadState Map(DownloadState state) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected I4, but got Unknown //IL_0029: 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_0031: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) switch ((int)state) { case 0: case 1: return (AvatarDownloadState)1; case 2: case 3: return (AvatarDownloadState)2; case 4: return (AvatarDownloadState)3; case 5: return (AvatarDownloadState)4; case 6: return (AvatarDownloadState)5; case 7: return (AvatarDownloadState)6; default: return (AvatarDownloadState)0; } } private static string CardStatus(AvatarEntry entry) { //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_0007: 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_0027: Expected I4, but got Unknown AvatarDownloadState downloadState = entry.DownloadState; return (downloadState - 1) switch { 0 => "QUEUED", 1 => $"{Math.Round(entry.DownloadProgress * 100.0)}%", 2 => "INSTALLING", 4 => "RETRY", 5 => "CANCELLED", _ => entry.Installed ? "INSTALLED" : "ONLINE", }; } private static bool IsEffectRenderer(Renderer renderer) { return !AvatarPreviewMath.IsVisualRendererType(((object)renderer).GetType().Name); } private static string DownloadStatus(AvatarEntry entry) { //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_0007: 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_0027: Expected I4, but got Unknown AvatarDownloadState downloadState = entry.DownloadState; return (downloadState - 1) switch { 0 => string.Empty, 1 => string.Empty, 2 => string.Empty, 3 => "Preparing installed avatar pack", 4 => Readable(entry.Status ?? "Download failed"), 5 => "Download cancelled", _ => entry.Compatible ? "Available on mod.io" : "Not compatible", }; } private static string Readable(string value) { if (!string.IsNullOrWhiteSpace(value)) { return value.Replace('\r', ' ').Replace('\n', ' ').Trim(); } return "Something went wrong. Try again."; } private static string Short(string value, int length) { string text = (string.IsNullOrWhiteSpace(value) ? "Unknown" : value.Trim()); if (text.Length > length) { return text.Substring(0, Math.Max(1, length - 1)) + "…"; } return text; } private void BuildFusionExperiencePages() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_007c: 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_00c5: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: 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_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: 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_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_0919: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null) && !((Object)(object)_fusionHomePage != (Object)null)) { _fusionHomePage = new GameObject("WristHubOS Fusion App"); _fusionHomePage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_fusionHomePage.transform, "Fusion Glass", new TabletRect(0f, 0f, 304f, 202f), new Color(0.004f, 0.02f, 0.045f, 0.985f)); CreateImage(_fusionHomePage.transform, "Fusion Accent", new TabletRect(0f, 66f, 278f, 45f), new Color(0.055f, 0.13f, 0.29f, 0.96f)); _fusionHomeTitle = CreateText(_fusionHomePage.transform, "FUSION", new TabletRect(-58f, 84f, 112f, 22f), 15f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser, _fusionHomePage.transform, "HOME", new Vector3(-0.131f, 0.084f, 0.008f), new Vector3(0.046f, 0.023f, 0.014f), DimCyan, ShowHub, 7f); CreateButton(_browser, _fusionHomePage.transform, "X", new Vector3(0.136f, 0.084f, 0.008f), new Vector3(0.026f, 0.023f, 0.014f), Red, Close, 14f); _fusionHomeSummary = CreateText(_fusionHomePage.transform, "NOT CONNECTED", new TabletRect(0f, 60f, 258f, 31f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _fusionHomePage.transform, "QUICK JOIN", new Vector3(-0.078f, 0.021f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), Green, QuickJoinFusion, 8f); CreateButton(_browser, _fusionHomePage.transform, "BROWSE", new Vector3(0.078f, 0.021f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), new Color(0.09f, 0.35f, 0.56f, 1f), ShowFusionServersPage, 8f); CreateButton(_browser, _fusionHomePage.transform, "JOIN CODE", new Vector3(-0.078f, -0.018f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), new Color(0.12f, 0.31f, 0.52f, 1f), OpenFusionServerCodeKeyboard, 7.5f); CreateButton(_browser, _fusionHomePage.transform, "PLAYERS", new Vector3(0.078f, -0.018f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), new Color(0.11f, 0.38f, 0.48f, 1f), ShowCurrentFusionPlayers, 8f); CreateButton(_browser, _fusionHomePage.transform, "FULL FUSION", new Vector3(-0.078f, -0.057f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), new Color(0.2f, 0.25f, 0.43f, 1f), OpenAdvancedFusion, 7.5f); _fusionDisconnectButton = CreateButton(_browser, _fusionHomePage.transform, "DISCONNECT", new Vector3(0.078f, -0.057f, 0.008f), new Vector3(0.125f, 0.03f, 0.014f), new Color(0.48f, 0.13f, 0.18f, 1f), DisconnectFusion, 7f); _fusionHomeStatus = CreateText(_fusionHomePage.transform, "Quick Join chooses the best available public room", new TabletRect(0f, -84f, 270f, 14f), 6.5f, new Color(0.67f, 0.82f, 0.9f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _fusionHomePage.SetActive(false); _fusionPlayersPage = new GameObject("WristHubOS Fusion Players"); _fusionPlayersPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_fusionPlayersPage.transform, "Players Glass", new TabletRect(0f, 0f, 304f, 208f), new Color(0.004f, 0.02f, 0.042f, 0.985f)); CreateText(_fusionPlayersPage.transform, "PLAYERS", new TabletRect(-36f, 86f, 120f, 22f), 14f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _fusionPlayersPage.transform, "BACK", new Vector3(-0.132f, 0.086f, 0.008f), new Vector3(0.046f, 0.023f, 0.014f), DimCyan, BackFromFusionPlayers, 7f); CreateButton(_browser, _fusionPlayersPage.transform, "X", new Vector3(0.136f, 0.086f, 0.008f), new Vector3(0.026f, 0.023f, 0.014f), Red, Close, 14f); for (int i = 0; i < 4; i++) { float num = 0.052f - (float)i * 0.038f; TouchButton touchButton = CreateButton(_browser, _fusionPlayersPage.transform, string.Empty, new Vector3(0.012f, num, 0.008f), new Vector3(0.248f, 0.032f, 0.014f), new Color(0.025f, 0.15f, 0.22f, 0.97f), delegate { }, 7.5f); touchButton.Label.alignment = (TextAlignmentOptions)4097; SetRect(touchButton.Label.rectTransform, new TabletRect(22f, 0f, 205f, 27f)); _fusionPlayerRows.Add(touchButton); RawImage val = CreateRawImage(_fusionPlayersPage.transform, $"Player {i + 1} Avatar", new TabletRect(-119f, num * 1000f, 31f, 27f), _placeholderTexture ?? Texture2D.whiteTexture, Color.white); ((Graphic)val).raycastTarget = false; _fusionPlayerImages.Add(val); } CreateButton(_browser, _fusionPlayersPage.transform, "PREV", new Vector3(-0.112f, -0.087f, 0.008f), new Vector3(0.052f, 0.024f, 0.014f), DimCyan, delegate { MoveFusionPlayerPage(-1); }, 7f); CreateButton(_browser, _fusionPlayersPage.transform, "NEXT", new Vector3(0.112f, -0.087f, 0.008f), new Vector3(0.052f, 0.024f, 0.014f), DimCyan, delegate { MoveFusionPlayerPage(1); }, 7f); _fusionPlayerPosition = CreateText(_fusionPlayersPage.transform, "1 / 1", new TabletRect(0f, -87f, 70f, 16f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _fusionPlayerStatus = CreateText(_fusionPlayersPage.transform, string.Empty, new TabletRect(0f, -69f, 260f, 14f), 6.5f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); _fusionPlayersPage.SetActive(false); } } private void ShowFusionHomePage() { ShowWristOsPage(_fusionHomePage, (AvatarBrowserViewState)10); RefreshFusionHome(); } private void RefreshFusionHome() { //IL_00e9: 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) GameObject? fusionHomePage = _fusionHomePage; if (fusionHomePage != null && fusionHomePage.activeSelf) { FusionServerEntry currentServer = FusionPortalBridge.GetCurrentServer(); if (_fusionDisconnectButton != null) { _fusionDisconnectButton.Root.SetActive(currentServer != (FusionServerEntry)null); } if ((Object)(object)_fusionHomeSummary != (Object)null) { _fusionHomeSummary.text = ((currentServer == (FusionServerEntry)null) ? "READY TO CONNECT\nBrowse public rooms or enter a code" : $"{currentServer.Name}\n{currentServer.Level} • {currentServer.PopulationLabel} • {currentServer.Gamemode}"); ((Graphic)_fusionHomeSummary).color = ((currentServer == (FusionServerEntry)null) ? Cyan : Green); } if ((Object)(object)_fusionHomeStatus != (Object)null && currentServer != (FusionServerEntry)null) { _fusionHomeStatus.text = "Connected as " + (FusionPortalBridge.IsHost ? "host" : "player") + " • code " + currentServer.Code; } } } private void QuickJoinFusion() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_fusionHomeStatus != (Object)null) { _fusionHomeStatus.text = "Finding the best public Fusion room…"; ((Graphic)_fusionHomeStatus).color = Cyan; } FusionPortalBridge.RequestPublicServers(++_fusionServerRequestGeneration, delegate(int resultGeneration, IReadOnlyList servers, string error) { _mainThread.Enqueue(delegate { //IL_0114: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && resultGeneration == _fusionServerRequestGeneration) { FusionServerEntry val = (from server in servers where server.IsValid && !server.Full && server.HasLevel orderby server.Players descending select server).ThenBy((FusionServerEntry server) => server.Name, StringComparer.OrdinalIgnoreCase).FirstOrDefault(); if (val != (FusionServerEntry)null && FusionPortalBridge.JoinServer(val.Code, _log)) { BeginClose(immediate: true); } else if ((Object)(object)_fusionHomeStatus != (Object)null) { _fusionHomeStatus.text = (string.IsNullOrWhiteSpace(error) ? "No compatible public rooms found" : error); ((Graphic)_fusionHomeStatus).color = Red; } } }); }); } private void DisconnectFusion() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (FusionPortalBridge.Disconnect(_log)) { if ((Object)(object)_fusionHomeStatus != (Object)null) { _fusionHomeStatus.text = "Disconnected"; ((Graphic)_fusionHomeStatus).color = Cyan; } RefreshFusionHome(); } } private void OpenAdvancedFusion() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (FusionPortalBridge.OpenNativeFusionMenu(_preferences.UseLeftWrist, _log)) { BeginClose(immediate: true); return; } _log.Warning("WristHub could not find Fusion's native menu. Verify Fusion Content is installed."); if ((Object)(object)_fusionHomeSummary != (Object)null) { _fusionHomeSummary.text = "FULL FUSION MENU NOT READY\nOpen BONELAB's menu once, then retry"; ((Graphic)_fusionHomeSummary).color = Red; } } private void ShowCurrentFusionPlayers() { _fusionPlayersSource = FusionPortalBridge.GetCurrentServer(); _fusionPlayerPageIndex = 0; ShowWristOsPage(_fusionPlayersPage, (AvatarBrowserViewState)10); RefreshFusionPlayers(); } private void ShowSelectedFusionPlayers() { _fusionPlayersSource = SelectedFusionServer(); _fusionPlayerPageIndex = 0; ShowWristOsPage(_fusionPlayersPage, (AvatarBrowserViewState)10); RefreshFusionPlayers(); } private void BackFromFusionPlayers() { if (_fusionPlayersSource != (FusionServerEntry)null && _fusionServers.Any((FusionServerEntry server) => server.Code.Equals(_fusionPlayersSource.Code, StringComparison.OrdinalIgnoreCase))) { ShowFusionServerDetailsPage(); } else { ShowFusionHomePage(); } } private void MoveFusionPlayerPage(int direction) { FusionServerEntry? fusionPlayersSource = _fusionPlayersSource; int num = ((fusionPlayersSource != null) ? fusionPlayersSource.DetailedPlayers.Count : 0); int num2 = Math.Max(1, (int)Math.Ceiling((double)num / 4.0)); _fusionPlayerPageIndex = (_fusionPlayerPageIndex + direction + num2) % num2; RefreshFusionPlayers(); } private void RefreshFusionPlayers() { GameObject? fusionPlayersPage = _fusionPlayersPage; if (fusionPlayersPage == null || !fusionPlayersPage.activeSelf) { return; } FusionServerEntry? fusionPlayersSource = _fusionPlayersSource; IReadOnlyList readOnlyList = ((fusionPlayersSource != null) ? fusionPlayersSource.DetailedPlayers : null) ?? Array.Empty(); int num = Math.Max(1, (int)Math.Ceiling((double)readOnlyList.Count / 4.0)); _fusionPlayerPageIndex = Math.Clamp(_fusionPlayerPageIndex, 0, num - 1); if ((Object)(object)_fusionPlayerPosition != (Object)null) { _fusionPlayerPosition.text = $"{_fusionPlayerPageIndex + 1} / {num}"; } if ((Object)(object)_fusionPlayerStatus != (Object)null) { _fusionPlayerStatus.text = ((_fusionPlayersSource == (FusionServerEntry)null) ? "Join a lobby to see its players" : $"{_fusionPlayersSource.Name} • {readOnlyList.Count} player{((readOnlyList.Count == 1) ? "" : "s")}"); } for (int i = 0; i < _fusionPlayerRows.Count; i++) { int num2 = _fusionPlayerPageIndex * 4 + i; TouchButton touchButton = _fusionPlayerRows[i]; if (num2 >= readOnlyList.Count) { touchButton.Root.SetActive(false); ((Component)_fusionPlayerImages[i]).gameObject.SetActive(false); continue; } FusionServerPlayer val = readOnlyList[num2]; touchButton.Root.SetActive(true); touchButton.Label.text = $"{val.Name}\n{val.Role} • {val.AvatarTitle}"; ((Component)_fusionPlayerImages[i]).gameObject.SetActive(true); RefreshFusionPlayerArtwork(i, val); } } private void RefreshFusionPlayerArtwork(int slot, FusionServerPlayer player) { if (slot >= 0 && slot < _fusionPlayerImages.Count && _fusionPlayerImageModIds[slot] != player.AvatarModId) { _fusionPlayerImageModIds[slot] = player.AvatarModId; int generation = ++_fusionPlayerImageGenerations[slot]; _fusionPlayerImages[slot].texture = (Texture)(object)_placeholderTexture; if (player.AvatarModId > 0) { LoadFusionPlayerArtworkAsync(slot, player.AvatarModId, generation); } } } private async Task LoadFusionPlayerArtworkAsync(int slot, long modId, int generation) { try { string url = (await _service.GetModDetailsAsync(modId, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false)).Logo.Thumbnail; _mainThread.Enqueue(delegate { if (!_disposed && slot < _fusionPlayerImages.Count && generation == _fusionPlayerImageGenerations[slot] && _fusionPlayerImageModIds[slot] == modId && !string.IsNullOrWhiteSpace(url)) { _thumbnails.Load(url, delegate(Texture2D texture) { if (!_disposed && slot < _fusionPlayerImages.Count && generation == _fusionPlayerImageGenerations[slot] && _fusionPlayerImageModIds[slot] == modId) { _fusionPlayerImages[slot].texture = (Texture)(object)(texture ?? _placeholderTexture); } }); } }); } catch { } } private Sprite? GetButtonIconSprite(ButtonIconKind kind) { //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_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_01a5: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if (kind == ButtonIconKind.None) { return null; } if (_buttonIconSprites.TryGetValue(kind, out Sprite value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = "WristHub Line Icon " + kind, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; IReadOnlyList source = IconShapes(kind); Color[] array = (Color[])(object)new Color[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = 0f; for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { Vector2 point = new Vector2((((float)j + ((float)l + 0.5f) / 3f) / 64f - 0.5f) * 2f, (((float)i + ((float)k + 0.5f) / 3f) / 64f - 0.5f) * 2f); if (source.Any((IconPrimitive shape) => IconContains(shape, point))) { num += 1f; } } } float num2 = num / 9f; array[i * 64 + j] = new Color(1f, 1f, 1f, num2); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 64f); ((Object)val2).name = "WristHub Icon " + kind; _buttonIconTextures.Add(val); _buttonIconSprites[kind] = val2; return val2; } private static IReadOnlyList IconShapes(ButtonIconKind kind) { return kind switch { ButtonIconKind.Back => new IconPrimitive[2] { Line(0.45f, 0.52f, -0.35f, 0f), Line(-0.35f, 0f, 0.45f, -0.52f) }, ButtonIconKind.Forward => new IconPrimitive[2] { Line(-0.45f, 0.52f, 0.35f, 0f), Line(0.35f, 0f, -0.45f, -0.52f) }, ButtonIconKind.Close => new IconPrimitive[2] { Line(-0.48f, 0.48f, 0.48f, -0.48f), Line(0.48f, 0.48f, -0.48f, -0.48f) }, ButtonIconKind.Search => new IconPrimitive[2] { Ring(-0.12f, 0.12f, 0.44f), Line(0.2f, -0.2f, 0.58f, -0.58f, 0.12f) }, ButtonIconKind.Settings => new IconPrimitive[10] { Ring(0f, 0f, 0.3f, 0.11f), Ring(0f, 0f, 0.58f, 0.1f), Line(0f, 0.48f, 0f, 0.72f), Line(0f, -0.48f, 0f, -0.72f), Line(0.48f, 0f, 0.72f, 0f), Line(-0.48f, 0f, -0.72f, 0f), Line(0.34f, 0.34f, 0.51f, 0.51f), Line(-0.34f, 0.34f, -0.51f, 0.51f), Line(0.34f, -0.34f, 0.51f, -0.51f), Line(-0.34f, -0.34f, -0.51f, -0.51f) }, ButtonIconKind.Download => new IconPrimitive[4] { Line(0f, 0.62f, 0f, -0.24f), Line(-0.34f, 0.08f, 0f, -0.28f), Line(0f, -0.28f, 0.34f, 0.08f), Line(-0.54f, -0.58f, 0.54f, -0.58f) }, ButtonIconKind.Avatar => new IconPrimitive[3] { Disc(0f, 0.34f, 0.24f), Ring(0f, -0.42f, 0.48f, 0.16f), Box(0f, -0.68f, 1f, 0.35f) }, ButtonIconKind.Equip => new IconPrimitive[4] { Disc(-0.28f, 0.34f, 0.2f), Ring(-0.28f, -0.36f, 0.4f, 0.14f), Line(0.1f, -0.1f, 0.32f, -0.34f, 0.12f), Line(0.32f, -0.34f, 0.68f, 0.3f, 0.12f) }, ButtonIconKind.Apps => new IconPrimitive[4] { Box(-0.32f, 0.32f, 0.42f, 0.42f), Box(0.32f, 0.32f, 0.42f, 0.42f), Box(-0.32f, -0.32f, 0.42f, 0.42f), Box(0.32f, -0.32f, 0.42f, 0.42f) }, ButtonIconKind.Map => new IconPrimitive[5] { Line(-0.58f, 0.48f, -0.2f, 0.12f), Line(-0.2f, 0.12f, 0.18f, 0.34f), Line(0.18f, 0.34f, 0.58f, -0.48f), Disc(-0.58f, 0.48f, 0.14f), Disc(0.58f, -0.48f, 0.14f) }, ButtonIconKind.Compass => new IconPrimitive[3] { Ring(0f, 0f, 0.67f), Line(-0.2f, -0.44f, 0.2f, 0.44f, 0.15f), Disc(0.2f, 0.44f, 0.13f) }, ButtonIconKind.Portal => new IconPrimitive[3] { Ring(0f, 0f, 0.65f, 0.11f), Ring(0f, 0f, 0.42f, 0.065f), Line(-0.18f, -0.36f, 0.22f, 0.38f, 0.07f) }, ButtonIconKind.Fusion => new IconPrimitive[3] { Ring(-0.18f, 0f, 0.42f, 0.12f), Ring(0.18f, 0f, 0.42f, 0.12f), Disc(0f, 0f, 0.12f) }, ButtonIconKind.Players => new IconPrimitive[4] { Disc(-0.28f, 0.28f, 0.22f), Disc(0.3f, 0.22f, 0.18f), Ring(-0.28f, -0.42f, 0.4f, 0.14f), Ring(0.3f, -0.42f, 0.32f, 0.13f) }, ButtonIconKind.Gamemode => new IconPrimitive[6] { Ring(0f, 0f, 0.64f, 0.09f), Disc(0f, 0f, 0.18f), Line(-0.56f, 0f, -0.25f, 0f), Line(0.25f, 0f, 0.56f, 0f), Line(0f, 0.25f, 0f, 0.56f), Line(0f, -0.25f, 0f, -0.56f) }, ButtonIconKind.QuickJoin => new IconPrimitive[4] { Line(-0.62f, 0.25f, 0.05f, 0.25f), Line(0.05f, 0.25f, 0.58f, -0.2f), Line(0.58f, -0.2f, 0.18f, -0.2f), Line(0.18f, -0.2f, 0.18f, -0.58f) }, ButtonIconKind.Home => new IconPrimitive[5] { Line(-0.62f, 0.02f, 0f, 0.6f), Line(0f, 0.6f, 0.62f, 0.02f), Line(-0.46f, 0.05f, -0.46f, -0.58f), Line(-0.46f, -0.58f, 0.46f, -0.58f), Line(0.46f, -0.58f, 0.46f, 0.05f) }, ButtonIconKind.Refresh => new IconPrimitive[3] { Ring(0f, 0f, 0.56f, 0.1f), Line(0.26f, 0.5f, 0.62f, 0.52f), Line(0.62f, 0.52f, 0.54f, 0.18f) }, ButtonIconKind.Delete => new IconPrimitive[5] { Line(-0.5f, 0.44f, 0.5f, 0.44f), Line(-0.25f, 0.62f, 0.25f, 0.62f), Line(-0.38f, 0.34f, -0.28f, -0.62f), Line(-0.28f, -0.62f, 0.28f, -0.62f), Line(0.28f, -0.62f, 0.38f, 0.34f) }, ButtonIconKind.Join => new IconPrimitive[3] { Line(-0.6f, 0f, 0.46f, 0f), Line(0.1f, 0.42f, 0.52f, 0f), Line(0.52f, 0f, 0.1f, -0.42f) }, _ => Array.Empty(), }; static IconPrimitive Box(float x, float y, float width, float height) { //IL_0003: 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) return new IconPrimitive(IconPrimitiveType.Box, new Vector2(x, y), new Vector2(width, height), 0f, 0f); } static IconPrimitive Disc(float x, float y, float radius) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new IconPrimitive(IconPrimitiveType.Disc, new Vector2(x, y), default(Vector2), radius, 0f); } static IconPrimitive Line(float ax, float ay, float bx, float by, float stroke = 0.105f) { //IL_0003: 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) return new IconPrimitive(IconPrimitiveType.Line, new Vector2(ax, ay), new Vector2(bx, by), 0f, stroke); } static IconPrimitive Ring(float x, float y, float radius, float stroke = 0.095f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new IconPrimitive(IconPrimitiveType.Ring, new Vector2(x, y), default(Vector2), radius, stroke); } } private static bool IconContains(IconPrimitive shape, Vector2 point) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0072: 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_008e: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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) return shape.Type switch { IconPrimitiveType.Line => DistanceToSegment(point, shape.A, shape.B) <= shape.Stroke, IconPrimitiveType.Ring => Mathf.Abs(Vector2.Distance(point, shape.A) - shape.Radius) <= shape.Stroke, IconPrimitiveType.Disc => Vector2.Distance(point, shape.A) <= shape.Radius, IconPrimitiveType.Box => Mathf.Abs(point.x - shape.A.x) <= shape.B.x * 0.5f && Mathf.Abs(point.y - shape.A.y) <= shape.B.y * 0.5f, _ => false, }; } private static float DistanceToSegment(Vector2 point, Vector2 start, Vector2 end) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0035: 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_0037: 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_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) Vector2 val = end - start; float sqrMagnitude = ((Vector2)(ref val)).sqrMagnitude; if (sqrMagnitude <= 0.0001f) { return Vector2.Distance(point, start); } float num = Mathf.Clamp01(Vector2.Dot(point - start, val) / sqrMagnitude); return Vector2.Distance(point, start + val * num); } private Sprite GetMiniMapRingSprite() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_017c: 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_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) if ((Object)(object)_miniMapRingSprite != (Object)null) { return _miniMapRingSprite; } Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false) { name = "WristHub Tactical Map Ring", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; Color[] array = (Color[])(object)new Color[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = ((float)j + 0.5f) / 128f * 2f - 1f; float num2 = ((float)i + 0.5f) / 128f * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.Clamp01(1f - Mathf.Abs(num3 - 0.93f) / 0.026f); float num5 = Mathf.Repeat(Mathf.Atan2(num2, num) * 57.29578f + 180f, 15f); float num6 = ((num5 > 1.1f && num5 < 13.9f) ? 1f : 0.15f); array[i * 128 + j] = new Color(1f, 1f, 1f, num4 * num6); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); _miniMapRingSprite = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 128f); ((Object)_miniMapRingSprite).name = "WristHub Tactical Ring"; _buttonIconTextures.Add(val); return _miniMapRingSprite; } private Sprite GetMiniMapMaskSprite() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_012e: 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_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) if ((Object)(object)_miniMapMaskSprite != (Object)null) { return _miniMapMaskSprite; } Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false) { name = "WristHub Circular Map Mask", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; Color[] array = (Color[])(object)new Color[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = ((float)j + 0.5f) / 128f * 2f - 1f; float num2 = ((float)i + 0.5f) / 128f * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.Clamp01((1f - num3) * 128f * 0.5f); array[i * 128 + j] = new Color(1f, 1f, 1f, num4); } } val.SetPixels(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); _miniMapMaskSprite = Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f), 128f); ((Object)_miniMapMaskSprite).name = "WristHub Circular Map Mask"; _buttonIconTextures.Add(val); return _miniMapMaskSprite; } private void DisposeButtonIconSprites() { try { if ((Object)(object)_miniMapRingSprite != (Object)null) { Object.Destroy((Object)(object)_miniMapRingSprite); } } catch { } try { if ((Object)(object)_miniMapMaskSprite != (Object)null) { Object.Destroy((Object)(object)_miniMapMaskSprite); } } catch { } foreach (Sprite value in _buttonIconSprites.Values) { try { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } } catch { } } foreach (Texture2D buttonIconTexture in _buttonIconTextures) { try { if ((Object)(object)buttonIconTexture != (Object)null) { Object.Destroy((Object)(object)buttonIconTexture); } } catch { } } _buttonIconSprites.Clear(); _buttonIconTextures.Clear(); _miniMapRingSprite = null; _miniMapMaskSprite = null; } private void BuildPortalsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f6: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: 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_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _portalsPage = new GameObject("WristHubOS Portals App"); _portalsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_portalsPage.transform, "Portal Glass", new TabletRect(0f, 0f, 258f, 174f), new Color(0.004f, 0.025f, 0.04f, 0.96f)); CreateText(_portalsPage.transform, "PORTALS", new TabletRect(0f, 66f, 112f, 24f), 17f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _portalModeText = CreateText(_portalsPage.transform, "POINT WITH CONTROLLER • TRIGGER TO PLACE", new TabletRect(0f, 42f, 230f, 14f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _portalLocalButton = CreateButton(_browser, _portalsPage.transform, "LOCAL LINK", new Vector3(-0.061f, 0.01f, 0.008f), new Vector3(0.098f, 0.036f, 0.014f), DimCyan, BeginLocalPortalPlacement, 10f); _portalWorldButton = CreateButton(_browser, _portalsPage.transform, "WORLD GATE", new Vector3(0.061f, 0.01f, 0.008f), new Vector3(0.098f, 0.036f, 0.014f), new Color(0.08f, 0.35f, 0.45f, 1f), BeginWorldPortalPlacement, 10f); _portalRemoveButton = CreateButton(_browser, _portalsPage.transform, "REMOVE PORTAL", new Vector3(0f, -0.03f, 0.008f), new Vector3(0.112f, 0.027f, 0.014f), Red, RemovePortal, 8f); _portalLevelsButton = CreateButton(_browser, _portalsPage.transform, "MAPS", new Vector3(-0.053f, -0.03f, 0.009f), new Vector3(0.088f, 0.027f, 0.014f), new Color(0.08f, 0.34f, 0.44f, 1f), ShowPortalLevelsPage, 8f); _portalServersButton = CreateButton(_browser, _portalsPage.transform, "FUSION SERVERS", new Vector3(0.053f, -0.03f, 0.009f), new Vector3(0.088f, 0.027f, 0.014f), new Color(0.19f, 0.28f, 0.48f, 1f), ShowFusionServersPage, 6.5f); _portalStatus = CreateText(_portalsPage.transform, "LOCAL LINK: place entrance, then exit\nWORLD GATE: choose LEVELS, then place", new TabletRect(0f, -62f, 230f, 34f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); CreateButton(_browser, _portalsPage.transform, "HOME", new Vector3(-0.102f, 0.068f, 0.008f), new Vector3(0.044f, 0.023f, 0.014f), DimCyan, ShowHub, 8f); CreateButton(_browser, _portalsPage.transform, "X", new Vector3(0.102f, 0.068f, 0.008f), new Vector3(0.026f, 0.023f, 0.014f), Red, Close, 14f); _portalsPage.SetActive(false); BuildPortalLevelsPage(); BuildFusionServersPage(); } } private void BuildFusionServersPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_01c2: 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_01dc: 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_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Expected O, but got Unknown //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e4: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_08a8: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09ee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_browser == (Object)null || (Object)(object)_canvasRoot == (Object)null) { return; } _fusionServersPage = new GameObject("WristHubOS Fusion Server Browser"); _fusionServersPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_fusionServersPage.transform, "Server Glass", new TabletRect(0f, 0f, 320f, 216f), new Color(0.004f, 0.025f, 0.04f, 0.97f)); CreateText(_fusionServersPage.transform, "FUSION SERVERS", new TabletRect(-37f, 88f, 120f, 22f), 14f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _fusionServersPage.transform, "BACK", new Vector3(-0.137f, 0.088f, 0.008f), new Vector3(0.044f, 0.023f, 0.014f), DimCyan, ShowFusionHomePage, 8f); CreateButton(_browser, _fusionServersPage.transform, "JOIN CODE", new Vector3(0.051f, 0.088f, 0.008f), new Vector3(0.052f, 0.023f, 0.014f), new Color(0.08f, 0.4f, 0.55f, 1f), OpenFusionServerCodeKeyboard, 6.5f); CreateButton(_browser, _fusionServersPage.transform, "REFRESH", new Vector3(0.103f, 0.088f, 0.008f), new Vector3(0.048f, 0.023f, 0.014f), DimCyan, RefreshFusionServers, 6.5f); CreateButton(_browser, _fusionServersPage.transform, "X", new Vector3(0.143f, 0.088f, 0.008f), new Vector3(0.024f, 0.023f, 0.014f), Red, Close, 14f); _fusionServerRows.Clear(); _fusionServerRowArtwork.Clear(); for (int i = 0; i < 4; i++) { int capturedSlot = i; float num = 0.052f - (float)i * 0.037f; TouchButton touchButton = CreateButton(_browser, _fusionServersPage.transform, string.Empty, new Vector3(0f, num, 0.008f), new Vector3(0.276f, 0.032f, 0.014f), new Color(0.025f, 0.16f, 0.22f, 0.96f), delegate { SelectFusionServerRow(capturedSlot); }, 7.5f); touchButton.Label.alignment = (TextAlignmentOptions)4097; SetRect(touchButton.Label.rectTransform, new TabletRect(22f, 0f, 218f, 27f)); _fusionServerRows.Add(touchButton); RawImage val = CreateRawImage(_fusionServersPage.transform, $"Fusion Lobby {i + 1} Cover", new TabletRect(-119f, num * 1000f, 34f, 26f), _placeholderTexture ?? Texture2D.whiteTexture, Color.white); ((Graphic)val).raycastTarget = false; _fusionServerRowArtwork.Add(val); } CreateButton(_browser, _fusionServersPage.transform, "PREV", new Vector3(-0.118f, -0.091f, 0.008f), new Vector3(0.052f, 0.024f, 0.014f), DimCyan, delegate { MoveFusionServerPage(-1); }, 7f); CreateButton(_browser, _fusionServersPage.transform, "NEXT", new Vector3(0.118f, -0.091f, 0.008f), new Vector3(0.052f, 0.024f, 0.014f), DimCyan, delegate { MoveFusionServerPage(1); }, 7f); _fusionServerListPosition = CreateText(_fusionServersPage.transform, "1 / 1", new TabletRect(0f, -91f, 68f, 16f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _fusionServerListStatus = CreateText(_fusionServersPage.transform, "Searching public Fusion lobbies…", new TabletRect(0f, -72f, 260f, 15f), 7f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); _fusionServersPage.SetActive(false); _fusionServerDetailsPage = new GameObject("WristHubOS Fusion Server Details"); _fusionServerDetailsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_fusionServerDetailsPage.transform, "Lobby Details Glass", new TabletRect(0f, 0f, 320f, 216f), new Color(0.004f, 0.025f, 0.04f, 0.98f)); CreateButton(_browser, _fusionServerDetailsPage.transform, "SERVERS", new Vector3(-0.13f, 0.088f, 0.008f), new Vector3(0.058f, 0.023f, 0.014f), DimCyan, ShowFusionServersPage, 7f); CreateText(_fusionServerDetailsPage.transform, "LOBBY DETAILS", new TabletRect(0f, 88f, 150f, 22f), 13f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _fusionServerDetailsPage.transform, "X", new Vector3(0.143f, 0.088f, 0.008f), new Vector3(0.024f, 0.023f, 0.014f), Red, Close, 14f); CreateImage(_fusionServerDetailsPage.transform, "Fusion Lobby Cover Well", new TabletRect(-85f, 29f, 112f, 92f), new Color(0.006f, 0.055f, 0.075f, 0.98f)); _fusionServerArtwork = CreateRawImage(_fusionServerDetailsPage.transform, "Fusion Lobby Cover", new TabletRect(-85f, 29f, 104f, 84f), _placeholderTexture ?? Texture2D.whiteTexture, Color.white); ((Graphic)_fusionServerArtwork).raycastTarget = false; _fusionServerName = CreateText(_fusionServerDetailsPage.transform, "Fusion Lobby", new TabletRect(46f, 58f, 132f, 30f), 12f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _fusionServerDetails = CreateText(_fusionServerDetailsPage.transform, string.Empty, new TabletRect(46f, 18f, 132f, 48f), 7.5f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); _fusionServerDescription = CreateText(_fusionServerDetailsPage.transform, "No description", new TabletRect(0f, -31f, 278f, 35f), 7f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); _fusionServerMembers = CreateText(_fusionServerDetailsPage.transform, string.Empty, new TabletRect(0f, -55f, 278f, 18f), 6.5f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); _fusionServerPosition = CreateText(_fusionServerDetailsPage.transform, "0 / 0", new TabletRect(0f, -72f, 80f, 13f), 7f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _fusionServerStatus = CreateText(_fusionServerDetailsPage.transform, "Choose an action", new TabletRect(0f, -87f, 120f, 13f), 6.5f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); _fusionServerJoinButton = CreateButton(_browser, _fusionServerDetailsPage.transform, "JOIN", new Vector3(-0.102f, -0.101f, 0.008f), new Vector3(0.083f, 0.027f, 0.014f), Green, JoinSelectedFusionServer, 8f); _fusionServerActionButton = CreateButton(_browser, _fusionServerDetailsPage.transform, "PORTAL", new Vector3(0f, -0.101f, 0.008f), new Vector3(0.083f, 0.027f, 0.014f), new Color(0.08f, 0.4f, 0.55f, 1f), BeginFusionServerPortalPlacement, 7.5f); CreateButton(_browser, _fusionServerDetailsPage.transform, "PLAYERS", new Vector3(0.102f, -0.101f, 0.008f), new Vector3(0.083f, 0.027f, 0.014f), new Color(0.14f, 0.31f, 0.5f, 1f), ShowSelectedFusionPlayers, 7f); _fusionServerDetailsPage.SetActive(false); } private void BuildPortalLevelsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0392: 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_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _portalLevelsPage = new GameObject("WristHubOS Portal Levels"); _portalLevelsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_portalLevelsPage.transform, "Level Glass", new TabletRect(0f, 0f, 276f, 180f), new Color(0.004f, 0.025f, 0.04f, 0.97f)); CreateText(_portalLevelsPage.transform, "MAP LIBRARY", new TabletRect(-25f, 72f, 120f, 20f), 13f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _portalLevelsPage.transform, "BACK", new Vector3(-0.112f, 0.072f, 0.008f), new Vector3(0.044f, 0.023f, 0.014f), DimCyan, ShowPortalsPage, 8f); CreateButton(_browser, _portalLevelsPage.transform, "SEARCH MAPS", new Vector3(0.075f, 0.072f, 0.008f), new Vector3(0.066f, 0.023f, 0.014f), DimCyan, OpenPortalLevelKeyboard, 7f); CreateButton(_browser, _portalLevelsPage.transform, "X", new Vector3(0.12f, 0.072f, 0.008f), new Vector3(0.024f, 0.023f, 0.014f), Red, Close, 14f); _portalLevelName = CreateText(_portalLevelsPage.transform, "Installed levels", new TabletRect(0f, 36f, 220f, 30f), 14f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _portalLevelDetails = CreateText(_portalLevelsPage.transform, string.Empty, new TabletRect(0f, 2f, 220f, 32f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); _portalLevelPosition = CreateText(_portalLevelsPage.transform, "0 / 0", new TabletRect(0f, -23f, 100f, 16f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _portalLevelStatus = CreateText(_portalLevelsPage.transform, "Choose a level", new TabletRect(0f, -45f, 220f, 18f), 8f, Color.white, (TextAlignmentOptions)514, (FontStyles)0); CreateButton(_browser, _portalLevelsPage.transform, "<", new Vector3(-0.113f, -0.003f, 0.008f), new Vector3(0.033f, 0.04f, 0.014f), DimCyan, delegate { MovePortalLevelResult(-1); }, 17f); CreateButton(_browser, _portalLevelsPage.transform, ">", new Vector3(0.113f, -0.003f, 0.008f), new Vector3(0.033f, 0.04f, 0.014f), DimCyan, delegate { MovePortalLevelResult(1); }, 17f); _portalLevelActionButton = CreateButton(_browser, _portalLevelsPage.transform, "OPEN PORTAL", new Vector3(0f, -0.07f, 0.008f), new Vector3(0.1f, 0.029f, 0.014f), Green, ActivatePortalLevelResult, 9f); _portalLevelsPage.SetActive(false); } } private void ShowPortalsPage() { ShowWristOsPage(_portalsPage, (AvatarBrowserViewState)8); RefreshPortalPage(); _log.Msg("WristHubOS Portals app opened."); } private void ShowPortalLevelsPage() { ShowWristOsPage(_portalLevelsPage, (AvatarBrowserViewState)9); if (_portalLevelQuery.Length == 0) { RefreshInstalledPortalLevels(force: true); } RefreshPortalLevelPage(); } private void ShowFusionServersPage() { ShowWristOsPage(_fusionServersPage, (AvatarBrowserViewState)10); RefreshInstalledPortalLevels(force: true); RefreshFusionServerPage(); if (_fusionServers.Count == 0) { RefreshFusionServers(); } } private void ShowFusionServerDetailsPage() { ShowWristOsPage(_fusionServerDetailsPage, (AvatarBrowserViewState)10); RefreshFusionServerPage(); } private void OpenFusionServerCodeKeyboard() { _wristKeyboardPurpose = WristKeyboardPurpose.FusionServerCode; OpenWristOsKeyboard(_fusionServerCodeInput, "JOIN FUSION SERVER"); } private void SubmitFusionServerCode(string value) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) string text = default(string); if (!FusionServerEntry.TryNormalizeCode(value, ref text)) { _fusionServerCodeInput = value.Trim(); ShowFusionServersPage(); if ((Object)(object)_fusionServerListStatus != (Object)null) { _fusionServerListStatus.text = "Enter a valid Fusion code (letters, numbers, - or _)"; ((Graphic)_fusionServerListStatus).color = Red; } return; } _fusionServerCodeInput = text; if (FusionPortalBridge.JoinServer(text, _log)) { _log.Msg("WristHub handed a typed server code to Fusion's native join flow."); BeginClose(immediate: true); return; } ShowFusionServersPage(); if ((Object)(object)_fusionServerListStatus != (Object)null) { _fusionServerListStatus.text = "Fusion could not join that code - check the code and connection"; ((Graphic)_fusionServerListStatus).color = Red; } } private void RefreshFusionServers() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_fusionServerListStatus != (Object)null) { _fusionServerListStatus.text = "Searching public Fusion lobbies…"; ((Graphic)_fusionServerListStatus).color = Cyan; } FusionPortalBridge.RequestPublicServers(++_fusionServerRequestGeneration, delegate(int resultGeneration, IReadOnlyList servers, string error) { _mainThread.Enqueue(delegate { //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && resultGeneration == _fusionServerRequestGeneration) { _fusionServers.Clear(); _fusionServers.AddRange(servers.Where((FusionServerEntry server) => server.IsValid)); _fusionServerIndex = Math.Clamp(_fusionServerIndex, 0, Math.Max(0, _fusionServers.Count - 1)); _fusionServerPageIndex = Math.Clamp(_fusionServerPageIndex, 0, Math.Max(0, (int)Math.Ceiling((double)_fusionServers.Count / 4.0) - 1)); if (_fusionServers.Count > 0) { _selectedFusionServerCode = _fusionServers[_fusionServerIndex].Code; } RefreshFusionServerPage(); if ((Object)(object)_fusionServerListStatus != (Object)null) { _fusionServerListStatus.text = (string.IsNullOrWhiteSpace(error) ? $"{_fusionServers.Count} public Fusion rooms" : Readable(error)); ((Graphic)_fusionServerListStatus).color = (string.IsNullOrWhiteSpace(error) ? Cyan : Red); } } }); }); } private void MoveFusionServerPage(int direction) { int num = Math.Max(1, (int)Math.Ceiling((double)_fusionServers.Count / 4.0)); _fusionServerPageIndex = (_fusionServerPageIndex + direction + num) % num; RefreshFusionServerPage(); } private void SelectFusionServerRow(int slot) { int num = _fusionServerPageIndex * 4 + slot; if (num >= 0 && num < _fusionServers.Count) { _fusionServerIndex = num; _selectedFusionServerCode = _fusionServers[num].Code; ShowFusionServerDetailsPage(); } } private FusionServerEntry? SelectedFusionServer() { return ((IEnumerable)_fusionServers).FirstOrDefault((Func)((FusionServerEntry server) => server.Code.Equals(_selectedFusionServerCode, StringComparison.OrdinalIgnoreCase))); } private void RefreshFusionServerPage() { RefreshFusionServerListPage(); RefreshFusionServerDetailsPage(); } private void RefreshFusionServerListPage() { //IL_01ec: Unknown result type (might be due to invalid IL or missing references) GameObject? fusionServersPage = _fusionServersPage; if (fusionServersPage == null || !fusionServersPage.activeSelf) { return; } int num = Math.Max(1, (int)Math.Ceiling((double)_fusionServers.Count / 4.0)); _fusionServerPageIndex = Math.Clamp(_fusionServerPageIndex, 0, num - 1); if ((Object)(object)_fusionServerListPosition != (Object)null) { _fusionServerListPosition.text = $"{_fusionServerPageIndex + 1} / {num}"; } for (int i = 0; i < _fusionServerRows.Count; i++) { int num2 = _fusionServerPageIndex * 4 + i; TouchButton touchButton = _fusionServerRows[i]; bool flag = num2 < _fusionServers.Count; touchButton.Root.SetActive(flag); if (i < _fusionServerRowArtwork.Count) { ((Component)_fusionServerRowArtwork[i]).gameObject.SetActive(flag); } if (!flag) { _fusionServerRowArtworkCodes[i] = string.Empty; continue; } FusionServerEntry val = _fusionServers[num2]; touchButton.Label.text = $"{val.Name}\n{val.Level} • {val.PopulationLabel} • {val.Host}"; RefreshFusionServerRowArtwork(i, val); } if (_fusionServers.Count == 0 && (Object)(object)_fusionServerListStatus != (Object)null) { _fusionServerListStatus.text = "No joinable lobbies • refresh after Fusion signs in"; ((Graphic)_fusionServerListStatus).color = Amber; } } private void RefreshFusionServerDetailsPage() { //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) GameObject? fusionServerDetailsPage = _fusionServerDetailsPage; if (fusionServerDetailsPage == null || !fusionServerDetailsPage.activeSelf) { return; } if (_fusionServers.Count == 0) { if ((Object)(object)_fusionServerName != (Object)null) { _fusionServerName.text = "Lobby unavailable"; } if ((Object)(object)_fusionServerDetails != (Object)null) { _fusionServerDetails.text = "Return to the server list and refresh"; } if ((Object)(object)_fusionServerDescription != (Object)null) { _fusionServerDescription.text = string.Empty; } if ((Object)(object)_fusionServerMembers != (Object)null) { _fusionServerMembers.text = string.Empty; } if ((Object)(object)_fusionServerPosition != (Object)null) { _fusionServerPosition.text = "0 / 0"; } if (_fusionServerActionButton != null) { _fusionServerActionButton.Root.SetActive(false); } if (_fusionServerJoinButton != null) { _fusionServerJoinButton.Root.SetActive(false); } if ((Object)(object)_fusionServerArtwork != (Object)null) { _fusionServerArtwork.texture = (Texture)(object)_placeholderTexture; } _fusionServerArtworkCode = string.Empty; return; } _fusionServerIndex = Math.Clamp(_fusionServerIndex, 0, _fusionServers.Count - 1); FusionServerEntry val = _fusionServers[_fusionServerIndex]; _selectedFusionServerCode = val.Code; if ((Object)(object)_fusionServerName != (Object)null) { _fusionServerName.text = val.Name; } if ((Object)(object)_fusionServerDetails != (Object)null) { _fusionServerDetails.text = $"{val.Level}\n{val.Gamemode} • {val.PopulationLabel}\nHost: {val.Host}" + (string.IsNullOrWhiteSpace(val.Version) ? string.Empty : (" • v" + val.Version)); } if ((Object)(object)_fusionServerDescription != (Object)null) { _fusionServerDescription.text = (string.IsNullOrWhiteSpace(val.Description) ? "No server description" : Readable(val.Description)); } if ((Object)(object)_fusionServerMembers != (Object)null) { _fusionServerMembers.text = ((val.Members.Count == 0) ? ("Players: " + val.PopulationLabel) : ("Players: " + string.Join(" • ", val.Members.Take(8)))); } if ((Object)(object)_fusionServerPosition != (Object)null) { _fusionServerPosition.text = $"{_fusionServerIndex + 1} / {_fusionServers.Count}"; } if (_fusionServerActionButton != null) { _fusionServerActionButton.Root.SetActive(!val.Full); } if (_fusionServerJoinButton != null) { _fusionServerJoinButton.Root.SetActive(!val.Full); } if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = (val.Full ? "ROOM FULL" : (val.HasLevel ? "READY" : "MAP DOWNLOAD REQUIRED")); ((Graphic)_fusionServerStatus).color = (val.Full ? Red : (val.HasLevel ? Green : Amber)); } RefreshFusionServerArtwork(val); } private void JoinSelectedFusionServer() { //IL_003c: 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) FusionServerEntry val = SelectedFusionServer(); if (val == (FusionServerEntry)null || !val.IsValid) { if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Lobby is no longer available"; ((Graphic)_fusionServerStatus).color = Red; } } else if (FusionPortalBridge.JoinServer(val.Code, _log)) { BeginClose(immediate: true); } else if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Fusion could not join this lobby"; ((Graphic)_fusionServerStatus).color = Red; } } private void RefreshFusionServerRowArtwork(int slot, FusionServerEntry server) { if (slot >= 0 && slot < _fusionServerRowArtwork.Count && !_fusionServerRowArtworkCodes[slot].Equals(server.Code, StringComparison.OrdinalIgnoreCase)) { _fusionServerRowArtworkCodes[slot] = server.Code; int generation = ++_fusionServerRowArtworkGenerations[slot]; _fusionServerRowArtwork[slot].texture = (Texture)(object)_placeholderTexture; PortalDestinationEntry val = ((IEnumerable)_installedPortalLevels).FirstOrDefault((Func)((PortalDestinationEntry level) => (!string.IsNullOrWhiteSpace(server.LevelBarcode) && level.LevelBarcode.Equals(server.LevelBarcode, StringComparison.OrdinalIgnoreCase)) || level.Name.Equals(server.Level, StringComparison.OrdinalIgnoreCase))); if (val != (PortalDestinationEntry)null && !string.IsNullOrWhiteSpace(val.ArtworkUrl)) { LoadFusionServerRowArtwork(slot, server.Code, val.ArtworkUrl, generation); } else if (server.LevelModId > 0) { LoadFusionServerRowArtworkAsync(slot, server, generation); } } } private async Task LoadFusionServerRowArtworkAsync(int slot, FusionServerEntry server, int generation) { try { ModIoMod mod = await _service.GetModDetailsAsync(server.LevelModId, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { LoadFusionServerRowArtwork(slot, server.Code, mod.Logo.Thumbnail, generation); }); } catch { } } private void LoadFusionServerRowArtwork(int slot, string code, string url, int generation) { if (slot < 0 || slot >= _fusionServerRowArtwork.Count || string.IsNullOrWhiteSpace(url) || generation != _fusionServerRowArtworkGenerations[slot] || !_fusionServerRowArtworkCodes[slot].Equals(code, StringComparison.OrdinalIgnoreCase)) { return; } _thumbnails.Load(url, delegate(Texture2D texture) { if (!_disposed && slot < _fusionServerRowArtwork.Count && generation == _fusionServerRowArtworkGenerations[slot] && _fusionServerRowArtworkCodes[slot].Equals(code, StringComparison.OrdinalIgnoreCase)) { _fusionServerRowArtwork[slot].texture = (Texture)(object)(texture ?? _placeholderTexture); } }); } private void RefreshFusionServerArtwork(FusionServerEntry server) { if (!((Object)(object)_fusionServerArtwork == (Object)null) && !_fusionServerArtworkCode.Equals(server.Code, StringComparison.OrdinalIgnoreCase)) { _fusionServerArtworkCode = server.Code; int generation = ++_fusionServerArtworkGeneration; _fusionServerArtwork.texture = (Texture)(object)_placeholderTexture; PortalDestinationEntry val = ((IEnumerable)_installedPortalLevels).FirstOrDefault((Func)((PortalDestinationEntry level) => (!string.IsNullOrWhiteSpace(server.LevelBarcode) && level.LevelBarcode.Equals(server.LevelBarcode, StringComparison.OrdinalIgnoreCase)) || level.Name.Equals(server.Level, StringComparison.OrdinalIgnoreCase))); if (val != (PortalDestinationEntry)null && !string.IsNullOrWhiteSpace(val.ArtworkUrl)) { LoadFusionServerArtwork(val.ArtworkUrl, generation); } else if (server.LevelModId > 0) { LoadFusionServerArtworkAsync(server.LevelModId, generation); } } } private async Task LoadFusionServerArtworkAsync(long modId, int generation) { try { ModIoMod mod = await _service.GetModDetailsAsync(modId, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { LoadFusionServerArtwork(mod.Logo.Thumbnail, generation); }); } catch { } } private void LoadFusionServerArtwork(string url, int generation) { if (string.IsNullOrWhiteSpace(url) || generation != _fusionServerArtworkGeneration) { return; } _thumbnails.Load(url, delegate(Texture2D texture) { if (!_disposed && generation == _fusionServerArtworkGeneration && !((Object)(object)_fusionServerArtwork == (Object)null)) { _fusionServerArtwork.texture = (Texture)(object)(texture ?? _placeholderTexture); } }); } private void RefreshPortalPage() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0157: Invalid comparison between Unknown and I4 //IL_01f1: 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) bool flag = true; if (_portalLocalButton != null) { _portalLocalButton.Root.SetActive(flag); } if (_portalWorldButton != null) { _portalWorldButton.Root.SetActive(flag); } if (_portalRemoveButton != null) { _portalRemoveButton.Root.SetActive(flag && _activePortal != (PortalLinkState)null); } if (_portalLevelsButton != null) { _portalLevelsButton.Root.SetActive(flag && _activePortal == (PortalLinkState)null); } if (_portalServersButton != null) { _portalServersButton.Root.SetActive(flag && _activePortal == (PortalLinkState)null); } if ((Object)(object)_portalModeText != (Object)null) { _portalModeText.text = ((IsFusionConnected() && !IsFusionHost()) ? "CLIENT PORTAL • WORLD GATES LEAVE LOBBY" : "POINT WITH CONTROLLER • TRIGGER TO PLACE"); } if (!((Object)(object)_portalStatus == (Object)null)) { if (!flag) { _portalStatus.text = "You can use shared portals\nOnly the host can create or remove them"; ((Graphic)_portalStatus).color = Amber; } else if (_portalPlacementStage != PortalPlacementStage.None) { ((Graphic)_portalStatus).color = Amber; } else if (_activePortal != (PortalLinkState)null) { TMP_Text portalStatus = _portalStatus; PortalLinkKind kind = _activePortal.Kind; string text = (((int)kind == 0) ? "Local link open • walk through either side" : (((int)kind != 2) ? ("World Gate open • " + _activePortal.DestinationTitle) : ("Join portal open • " + _activePortal.DestinationTitle))); portalStatus.text = text; ((Graphic)_portalStatus).color = Green; } else { RefreshInstalledPortalLevels(force: false); PortalDestinationEntry val = SelectedPortalLevel(); _portalStatus.text = ((val == (PortalDestinationEntry)null) ? "LOCAL LINK: place entrance, then exit\nWORLD GATE: choose LEVELS, then place" : ("Selected world: " + val.Name + "\nTouch WORLD GATE, point, then trigger")); ((Graphic)_portalStatus).color = Cyan; } } } private void BeginLocalPortalPlacement() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (CanControlPortals()) { ReplacePortalForPlacement(); _portalPlacementStage = PortalPlacementStage.LocalEntrance; _portalTriggerHeld = true; _portalPointerReadyAt = Time.unscaledTime + 0.2f; EnsurePortalPointer(); SetPortalStatus("Point at a wall or floor • trigger sets ENTRANCE", Amber); RequireInputRearm(); } } private void BeginWorldPortalPlacement() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (!CanControlPortals()) { return; } RefreshInstalledPortalLevels(force: true); if (_portalLevels.Count == 0) { SetPortalStatus("No installed BONELAB levels found", Red); return; } if (string.IsNullOrWhiteSpace(_selectedPortalLevelBarcode)) { _selectedPortalLevelBarcode = _portalLevels[0].LevelBarcode; } ReplacePortalForPlacement(); _portalPlacementStage = PortalPlacementStage.WorldEntrance; _portalTriggerHeld = true; _portalPointerReadyAt = Time.unscaledTime + 0.2f; EnsurePortalPointer(); PortalDestinationEntry val = SelectedPortalLevel(); SetPortalStatus((((val != null) ? val.Name : null) ?? "Level") + "\nPoint and pull trigger to place gate", Amber); RequireInputRearm(); } private void BeginFusionServerPortalPlacement() { //IL_003c: 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) FusionServerEntry val = SelectedFusionServer(); if (val == (FusionServerEntry)null || !val.IsValid) { if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Refresh and choose a valid Fusion lobby"; ((Graphic)_fusionServerStatus).color = Red; } return; } ReplacePortalForPlacement(); _portalPlacementStage = PortalPlacementStage.FusionServerEntrance; _portalTriggerHeld = true; _portalPointerReadyAt = Time.unscaledTime + 0.2f; EnsurePortalPointer(); if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Point anywhere and pull trigger to place the join portal"; ((Graphic)_fusionServerStatus).color = Amber; } RequireInputRearm(); } private void RefreshInstalledPortalLevels(bool force) { //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown if (!force && Time.unscaledTime < _nextPortalLevelScan && _installedPortalLevels.Count > 0) { return; } _nextPortalLevelScan = Time.unscaledTime + 5f; _installedPortalLevels.Clear(); _portalLevelCrates.Clear(); try { Enumerator enumerator = AssetWarehouse.Instance.GetPalletManifests().GetEnumerator(); while (enumerator.MoveNext()) { PalletManifest current = enumerator.Current; object obj; if (current == null) { obj = null; } else { Pallet pallet = current.Pallet; obj = ((pallet != null) ? pallet.Crates : null); } if (obj == null) { continue; } Enumerator enumerator2 = current.Pallet.Crates.GetEnumerator(); while (enumerator2.MoveNext()) { Crate current2 = enumerator2.Current; LevelCrate val = ((Il2CppObjectBase)current2).TryCast(); object obj2; if (val == null) { obj2 = null; } else { Barcode barcode = ((Scannable)val).Barcode; obj2 = ((barcode != null) ? barcode.ID : null); } string text = (string)obj2; if ((Object)(object)val == (Object)null || string.IsNullOrWhiteSpace(text)) { continue; } _portalLevelCrates[text] = val; Pallet pallet2 = ((Crate)val).Pallet; object obj3; if (pallet2 == null) { obj3 = null; } else { Barcode barcode2 = ((Scannable)pallet2).Barcode; obj3 = ((barcode2 != null) ? barcode2.ID : null); } if (obj3 == null) { obj3 = string.Empty; } string palletBarcode = (string)obj3; InstalledModRecord val2 = ((IEnumerable)_service.Installed).FirstOrDefault((Func)delegate(InstalledModRecord record) { ModIoSharingMetadata sharing = record.Sharing; return sharing != null && sharing.PalletBarcodes.Any((string value) => value.Equals(palletBarcode, StringComparison.OrdinalIgnoreCase)); }); ModIoSharingMetadata val3 = ((val2 != null) ? val2.Sharing : null); List installedPortalLevels = _installedPortalLevels; long num = ((val2 != null) ? val2.ModId : 0); string obj4 = ((Scannable)val).Title ?? "Unnamed level"; Pallet pallet3 = ((Crate)val).Pallet; string obj5 = ((pallet3 != null) ? ((Scannable)pallet3).Title : null) ?? "Unknown pack"; Pallet pallet4 = ((Crate)val).Pallet; installedPortalLevels.Add(new PortalDestinationEntry(num, text, obj4, obj5, ((pallet4 != null) ? pallet4.Author : null) ?? "Unknown creator", string.Empty, 0L, true, val3 == null || val3.WindowsFileId.HasValue, val3 == null || val3.AndroidFileId.HasValue)); } } _installedPortalLevels.Sort((PortalDestinationEntry left, PortalDestinationEntry right) => string.Compare(left.Name, right.Name, StringComparison.OrdinalIgnoreCase)); if (_portalLevelQuery.Length == 0) { _portalLevels.Clear(); _portalLevels.AddRange(_installedPortalLevels); } if (_portalLevels.Count > 0 && !_portalLevels.Any((PortalDestinationEntry level) => level.LevelBarcode.Equals(_selectedPortalLevelBarcode, StringComparison.OrdinalIgnoreCase))) { _selectedPortalLevelBarcode = _portalLevels[0].LevelBarcode; } } catch (Exception exception) { ThrottledOsError("portal-level-discovery", exception); } } private PortalDestinationEntry? SelectedPortalLevel() { return ((IEnumerable)_portalLevels).FirstOrDefault((Func)((PortalDestinationEntry level) => level.LevelBarcode.Equals(_selectedPortalLevelBarcode, StringComparison.OrdinalIgnoreCase))); } private void MovePortalLevel(int direction) { if (_portalPlacementStage != PortalPlacementStage.None || _activePortal != (PortalLinkState)null) { return; } RefreshInstalledPortalLevels(force: false); if (_portalLevels.Count != 0) { int val = _portalLevels.FindIndex((PortalDestinationEntry level) => level.LevelBarcode.Equals(_selectedPortalLevelBarcode, StringComparison.OrdinalIgnoreCase)); val = (Math.Max(0, val) + direction + _portalLevels.Count) % _portalLevels.Count; _selectedPortalLevelBarcode = _portalLevels[val].LevelBarcode; RefreshPortalPage(); } } private void MovePortalLevelResult(int direction) { if (_portalLevels.Count != 0) { _portalLevelIndex = (_portalLevelIndex + direction + _portalLevels.Count) % _portalLevels.Count; _selectedPortalLevelBarcode = _portalLevels[_portalLevelIndex].LevelBarcode; RefreshPortalLevelPage(); } } private void RefreshPortalLevelPage() { //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) GameObject? portalLevelsPage = _portalLevelsPage; if (portalLevelsPage == null || !portalLevelsPage.activeSelf) { return; } if (_portalLevels.Count == 0) { if ((Object)(object)_portalLevelName != (Object)null) { _portalLevelName.text = ((_portalLevelQuery.Length == 0) ? "No installed levels" : "No matching levels"); } if ((Object)(object)_portalLevelDetails != (Object)null) { _portalLevelDetails.text = string.Empty; } if ((Object)(object)_portalLevelPosition != (Object)null) { _portalLevelPosition.text = "0 / 0"; } if (_portalLevelActionButton != null) { _portalLevelActionButton.Root.SetActive(false); } return; } _portalLevelIndex = Math.Clamp(_portalLevelIndex, 0, _portalLevels.Count - 1); PortalDestinationEntry val = _portalLevels[_portalLevelIndex]; _selectedPortalLevelBarcode = val.LevelBarcode; if ((Object)(object)_portalLevelName != (Object)null) { _portalLevelName.text = val.Name; } if ((Object)(object)_portalLevelDetails != (Object)null) { _portalLevelDetails.text = $"{val.Pack}\nBy {val.Creator} • {val.PlatformLabel}"; } if ((Object)(object)_portalLevelPosition != (Object)null) { _portalLevelPosition.text = $"{_portalLevelIndex + 1} / {_portalLevels.Count}"; } if (_portalLevelActionButton != null) { _portalLevelActionButton.Root.SetActive(true); _portalLevelActionButton.Label.text = (val.Installed ? "OPEN PORTAL" : "DOWNLOAD MAP"); } if ((Object)(object)_portalLevelStatus != (Object)null && _pendingPortalLevelModId == 0L) { _portalLevelStatus.text = (val.Installed ? "Installed • ready for a World Gate" : "BONELAB mod.io map • ready to download"); ((Graphic)_portalLevelStatus).color = (val.Installed ? Green : Amber); } } private void OpenPortalLevelKeyboard() { _wristKeyboardPurpose = WristKeyboardPurpose.PortalLevels; OpenWristOsKeyboard(_portalLevelQuery, "SEARCH BONELAB LEVELS"); } private void SubmitPortalLevelSearch(string query) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) _portalLevelQuery = query.Trim(); _portalLevelIndex = 0; if (_portalLevelQuery.Length == 0) { _portalOnlineMods.Clear(); RefreshInstalledPortalLevels(force: true); ShowPortalLevelsPage(); return; } ShowPortalLevelsPage(); if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = "Searching BONELAB mod.io…"; ((Graphic)_portalLevelStatus).color = Cyan; } int generation = ++_portalLevelSearchGeneration; SearchPortalLevelsAsync(_portalLevelQuery, generation); } private async Task SearchPortalLevelsAsync(string query, int generation) { try { ModIoPage page = await _service.SearchAsync(new ModSearchRequest(query, "Level", (string)null, (ModSort)0, 0, 60), default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected O, but got Unknown if (!_disposed && generation == _portalLevelSearchGeneration) { RefreshInstalledPortalLevels(force: true); _portalOnlineMods.Clear(); List list = _installedPortalLevels.Where((PortalDestinationEntry level) => level.Name.Contains(query, StringComparison.OrdinalIgnoreCase) || level.Pack.Contains(query, StringComparison.OrdinalIgnoreCase)).ToList(); foreach (ModIoMod mod in page.Data) { _portalOnlineMods[mod.Id] = mod; if (!list.Any((PortalDestinationEntry level) => level.ModId == mod.Id)) { ModIoFile modfile = mod.Modfile; string[] array = ((modfile != null) ? modfile.Platforms.Select((ModIoPlatform platform) => platform.Platform).ToArray() : null) ?? Array.Empty(); bool flag = array.Length == 0 || array.Any((string platform) => platform.Contains("windows", StringComparison.OrdinalIgnoreCase)); bool flag2 = array.Any((string platform) => platform.Contains("android", StringComparison.OrdinalIgnoreCase) || platform.Contains("oculus", StringComparison.OrdinalIgnoreCase)); long id = mod.Id; string empty = string.Empty; string name = mod.Name; string name2 = mod.Name; string displayName = mod.Author.DisplayName; string thumbnail = mod.Logo.Thumbnail; ModIoFile modfile2 = mod.Modfile; list.Add(new PortalDestinationEntry(id, empty, name, name2, displayName, thumbnail, (modfile2 != null) ? modfile2.FileSize : 0, false, flag, flag2)); } } _portalLevels.Clear(); _portalLevels.AddRange(list); _portalLevelIndex = 0; RefreshPortalLevelPage(); if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = $"{_portalLevels.Count} level result{((_portalLevels.Count == 1) ? string.Empty : "s")}"; ((Graphic)_portalLevelStatus).color = Cyan; } } }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (!_disposed && generation == _portalLevelSearchGeneration && !((Object)(object)_portalLevelStatus == (Object)null)) { _portalLevelStatus.text = Readable(exception.Message); ((Graphic)_portalLevelStatus).color = Red; } }); } } private void ActivatePortalLevelResult() { //IL_008f: 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) if (_portalLevels.Count == 0 || _pendingPortalLevelModId != 0L) { return; } PortalDestinationEntry val = _portalLevels[_portalLevelIndex]; if (val.Installed && !string.IsNullOrWhiteSpace(val.LevelBarcode)) { _selectedPortalLevelBarcode = val.LevelBarcode; ShowPortalsPage(); BeginWorldPortalPlacement(); return; } if (!_portalOnlineMods.TryGetValue(val.ModId, out ModIoMod value)) { if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = "Level download is unavailable"; ((Graphic)_portalLevelStatus).color = Red; } return; } _pendingPortalLevelModId = value.Id; _pendingPortalLevelDeadline = Time.unscaledTime + 60f; _nextPortalInstallScan = 0f; _portalLevelBarcodesBeforeDownload.Clear(); foreach (PortalDestinationEntry installedPortalLevel in _installedPortalLevels) { _portalLevelBarcodesBeforeDownload.Add(installedPortalLevel.LevelBarcode); } if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = "Preparing level download…"; ((Graphic)_portalLevelStatus).color = Amber; } DownloadPortalLevelAsync(value); } private async Task DownloadPortalLevelAsync(ModIoMod mod) { try { IReadOnlyList jobs = await _service.InstallWithDependenciesAsync(mod, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { foreach (DownloadJob item in jobs) { _jobs[item.Mod.Id] = item; } _downloadBatches[mod.Id] = jobs.Select((DownloadJob job) => job.Id).ToArray(); RefreshPortalLevelPage(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { //IL_005f: Unknown result type (might be due to invalid IL or missing references) _pendingPortalLevelModId = 0L; if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = Readable(exception.Message); ((Graphic)_portalLevelStatus).color = Red; } }); } } private void TickPortalLevelDownload() { //IL_0114: 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_011a: 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_011e: Invalid comparison between Unknown and I4 //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Invalid comparison between Unknown and I4 //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Invalid comparison between Unknown and I4 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Invalid comparison between Unknown and I4 //IL_0109: 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) if (_pendingPortalLevelModId == 0L) { return; } if (!_jobs.TryGetValue(_pendingPortalLevelModId, out DownloadJob value)) { if (!TryBindDownloadedPortalLevel() && Time.unscaledTime >= _pendingPortalLevelDeadline) { _pendingPortalLevelModId = 0L; if ((Object)(object)_portalLevelStatus != (Object)null) { _portalLevelStatus.text = "Level installed, but no LevelCrate was found"; ((Graphic)_portalLevelStatus).color = Red; } } return; } if ((Object)(object)_portalLevelStatus != (Object)null) { int value2 = Math.Clamp((int)Math.Round(value.Progress * 100.0), 0, 100); _portalLevelStatus.text = (((int)value.State == 5) ? "Loading downloaded level pack…" : $"{value.State} • {value2}%"); ((Graphic)_portalLevelStatus).color = (((int)value.State == 6) ? Red : Amber); } DownloadState state = value.State; if (state - 6 <= 1) { _pendingPortalLevelModId = 0L; } else if ((int)value.State == 5) { TryBindDownloadedPortalLevel(); } } private bool TryBindDownloadedPortalLevel() { if (Time.unscaledTime < _nextPortalInstallScan) { return false; } _nextPortalInstallScan = Time.unscaledTime + 1f; _runtime.RefreshLocalLibrary(); _nextPortalLevelScan = 0f; RefreshInstalledPortalLevels(force: true); PortalDestinationEntry added = ((IEnumerable)_installedPortalLevels).FirstOrDefault((Func)((PortalDestinationEntry level) => level.ModId == _pendingPortalLevelModId)) ?? ((IEnumerable)_installedPortalLevels).FirstOrDefault((Func)((PortalDestinationEntry level) => !_portalLevelBarcodesBeforeDownload.Contains(level.LevelBarcode))); if (added == (PortalDestinationEntry)null) { return false; } _pendingPortalLevelModId = 0L; _portalLevelQuery = string.Empty; _portalLevels.Clear(); _portalLevels.AddRange(_installedPortalLevels); _portalLevelIndex = Math.Max(0, _portalLevels.FindIndex((PortalDestinationEntry level) => level.LevelBarcode == added.LevelBarcode)); _selectedPortalLevelBarcode = added.LevelBarcode; RefreshPortalLevelPage(); return true; } private void ReplacePortalForPlacement() { if (_activePortal != (PortalLinkState)null) { RemovePortal(); } CancelPortalPlacement(); _pendingPortalEntrance = null; } private void TickPortals() { //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_0052: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Invalid comparison between Unknown and I4 //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Invalid comparison between Unknown and I4 //IL_0119: 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_0076: 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_0088: 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_019f: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f0: Unknown result type (might be due to invalid IL or missing references) if (_portalPlacementStage != PortalPlacementStage.None) { TickPortalPlacement(); } if (_activePortal == (PortalLinkState)null || (Object)(object)Player.Head == (Object)null) { return; } Vector3 position = Player.Head.position; if (!_hasPreviousPortalHead) { _previousPortalHead = position; _hasPreviousPortalHead = true; return; } if ((int)_activePortal.Kind == 0) { PortalEndpoint? exit = _activePortal.Exit; if (exit.HasValue) { PortalEndpoint valueOrDefault = exit.GetValueOrDefault(); if (_portalEntranceGuard.TryCross(_activePortal.Entrance, _activePortal.Diameter, ToNumerics(position), Time.unscaledTimeAsDouble)) { TeleportThrough(_activePortal.Entrance, valueOrDefault); } else if (_portalExitGuard.TryCross(valueOrDefault, _activePortal.Diameter, ToNumerics(position), Time.unscaledTimeAsDouble)) { TeleportThrough(valueOrDefault, _activePortal.Entrance); } goto IL_019e; } } if ((int)_activePortal.Kind == 1 && _portalEntranceGuard.TryCross(_activePortal.Entrance, _activePortal.Diameter, ToNumerics(position), Time.unscaledTimeAsDouble)) { if (!IsFusionConnected() || IsFusionHost() || _activePortalLocallyCreated) { BeginWorldTravel(); } } else if ((int)_activePortal.Kind == 2 && _portalEntranceGuard.TryCross(_activePortal.Entrance, _activePortal.Diameter, ToNumerics(position), Time.unscaledTimeAsDouble)) { BeginFusionServerJoin(); } goto IL_019e; IL_019e: _previousPortalHead = position; } private void TickPortalPlacement() { //IL_0061: 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_0066: 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_008e: 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_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_01bd: 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_00aa: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00da: 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_014c: 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_010d: 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_0137: Unknown result type (might be due to invalid IL or missing references) BoneHubFingertipProbe boneHubFingertipProbe = _fingertips.GetProbes().FirstOrDefault((BoneHubFingertipProbe value) => value.IsLeft != _preferences.UseLeftWrist); if ((Object)(object)boneHubFingertipProbe.Hand == (Object)null) { boneHubFingertipProbe = _fingertips.GetProbes().FirstOrDefault(); } if ((Object)(object)boneHubFingertipProbe.Hand == (Object)null) { return; } Vector3 val = (boneHubFingertipProbe.AimTracked ? boneHubFingertipProbe.AimOrigin : boneHubFingertipProbe.GripAnchorPosition); Vector3 val2; if (boneHubFingertipProbe.AimTracked) { Vector3 aimDirection = boneHubFingertipProbe.AimDirection; if (((Vector3)(ref aimDirection)).sqrMagnitude > 0.001f) { aimDirection = boneHubFingertipProbe.AimDirection; val2 = ((Vector3)(ref aimDirection)).normalized; goto IL_00aa; } } val2 = boneHubFingertipProbe.GripAnchorRotation * Vector3.forward; goto IL_00aa; IL_00aa: Vector3 direction = val2; Vector3 targetPoint; PortalEndpoint endpoint; bool flag = TryPortalSurface(val, direction, out targetPoint, out endpoint); if ((Object)(object)_portalPointerLine != (Object)null) { _portalPointerLine.SetPosition(0, val); _portalPointerLine.SetPosition(1, targetPoint); } if ((Object)(object)_portalPointerReticle != (Object)null) { _portalPointerReticle.transform.SetPositionAndRotation(targetPoint, flag ? ToUnity(((PortalEndpoint)(ref endpoint)).Rotation) : Quaternion.identity); float num = PortalMath.ResolveDiameter(CurrentPlayerHeight()); _portalPointerReticle.transform.localScale = new Vector3(num, num, 0.025f); } SetPortalPointerColor(flag ? Green : Red); float num2 = 0f; try { num2 = boneHubFingertipProbe.Hand.GetIndexTriggerAxis(); } catch { } if (Time.unscaledTime < _portalPointerReadyAt) { return; } if (_portalTriggerHeld) { if (num2 < 0.25f) { _portalTriggerHeld = false; } } else if (!(num2 < 0.75f)) { _portalTriggerHeld = true; if (!flag) { SetPortalStatus("Point away from your body and try again", Red); } else { CommitPortalEndpoint(endpoint); } } } private bool TryPortalSurface(Vector3 origin, Vector3 direction, out Vector3 targetPoint, out PortalEndpoint endpoint) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_003d: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_00de: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_00fc: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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) targetPoint = origin; endpoint = default(PortalEndpoint); if (!IsFinitePortalVector(origin) || !IsFinitePortalVector(direction) || ((Vector3)(ref direction)).sqrMagnitude < 0.0001f) { return false; } ((Vector3)(ref direction)).Normalize(); float num = float.MaxValue; int num2 = Physics.RaycastNonAlloc(origin + direction * 0.03f, direction, Il2CppStructArray.op_Implicit(_portalRayHits), 12f, -5, (QueryTriggerInteraction)1); for (int i = 0; i < num2; i++) { RaycastHit val = _portalRayHits[i]; if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) && !(((RaycastHit)(ref val)).distance >= num) && !IsPortalSurfaceIgnored(((RaycastHit)(ref val)).collider)) { bool flag = ((RaycastHit)(ref val)).normal.y > 0.55f; num = ((RaycastHit)(ref val)).distance; Vector3 value = (((Object)(object)Player.Head == (Object)null) ? Vector3.forward : Player.Head.forward); float num3 = PortalMath.ResolveDiameter(CurrentPlayerHeight()); endpoint = PortalMath.ResolvePlacement(ToNumerics(((RaycastHit)(ref val)).point), ToNumerics(((RaycastHit)(ref val)).normal), ToNumerics(value), flag, num3); targetPoint = ToUnity(((PortalEndpoint)(ref endpoint)).Position); } } if (num < float.MaxValue) { return ((PortalEndpoint)(ref endpoint)).IsValid; } float num4 = Mathf.Clamp(CurrentPlayerHeight() * 2.25f, 3f, 6f); targetPoint = origin + direction * num4; Vector3 val2 = (((Object)(object)Player.Head == (Object)null) ? direction : Player.Head.forward); Vector3 val3 = -Vector3.ProjectOnPlane(val2, Vector3.up); if (((Vector3)(ref val3)).sqrMagnitude < 0.001f) { val3 = -Vector3.ProjectOnPlane(direction, Vector3.up); } if (((Vector3)(ref val3)).sqrMagnitude < 0.001f) { val3 = Vector3.back; } endpoint = PortalMath.ResolvePlacement(ToNumerics(targetPoint), ToNumerics(((Vector3)(ref val3)).normalized), ToNumerics(val2), false, PortalMath.ResolveDiameter(CurrentPlayerHeight())); targetPoint = ToUnity(((PortalEndpoint)(ref endpoint)).Position); return ((PortalEndpoint)(ref endpoint)).IsValid; } private bool IsPortalSurfaceIgnored(Collider collider) { if ((Object)(object)_root != (Object)null && ((Component)collider).transform.IsChildOf(_root.transform)) { return true; } if ((Object)(object)Player.RigManager != (Object)null && ((Component)collider).transform.IsChildOf(((Component)Player.RigManager).transform)) { return true; } return false; } private static bool IsFinitePortalVector(Vector3 value) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (float.IsFinite(value.x) && float.IsFinite(value.y)) { return float.IsFinite(value.z); } return false; } private void CommitPortalEndpoint(PortalEndpoint endpoint) { //IL_00a4: 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_000a: 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_0059: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Invalid comparison between Unknown and I4 //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Invalid comparison between Unknown and I4 //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Invalid comparison between Unknown and I4 //IL_02a5: Unknown result type (might be due to invalid IL or missing references) if (_portalPlacementStage == PortalPlacementStage.LocalEntrance) { _pendingPortalEntrance = endpoint; _portalPlacementStage = PortalPlacementStage.LocalExit; _portalTriggerHeld = true; if (_portalVisual == null) { _portalVisual = new BoneHubPortalVisual(_constrainedRendering); } _portalVisual.ShowPreview(endpoint, PortalMath.ResolveDiameter(CurrentPlayerHeight()), _preferences.ReducedMotion, Cyan); SetPortalStatus("Entrance set • point and trigger to set EXIT", Amber); _log.Msg("WristHub Local Link entrance placed; waiting for the exit endpoint."); return; } float num = PortalMath.ResolveDiameter(CurrentPlayerHeight()); int num2 = ++_portalGeneration; Scene activeScene = SceneManager.GetActiveScene(); string text = ((Scene)(ref activeScene)).name ?? "unknown"; if (_portalPlacementStage == PortalPlacementStage.LocalExit) { PortalEndpoint? pendingPortalEntrance = _pendingPortalEntrance; if (pendingPortalEntrance.HasValue) { PortalEndpoint valueOrDefault = pendingPortalEntrance.GetValueOrDefault(); _activePortal = new PortalLinkState(num2, (PortalLinkKind)0, text, valueOrDefault, (PortalEndpoint?)endpoint, string.Empty, string.Empty, "Local Link", num, 0uL, (PortalLifecycle)2); goto IL_01b2; } } if (_portalPlacementStage == PortalPlacementStage.WorldEntrance) { PortalDestinationEntry val = SelectedPortalLevel(); if (val != null) { _activePortal = new PortalLinkState(num2, (PortalLinkKind)1, text, endpoint, (PortalEndpoint?)null, val.LevelBarcode, string.Empty, val.Name, num, 0uL, (PortalLifecycle)2); goto IL_01b2; } } if (_portalPlacementStage == PortalPlacementStage.FusionServerEntrance) { FusionServerEntry val2 = SelectedFusionServer(); if (val2 != null) { PortalLinkState val3 = new PortalLinkState(num2, (PortalLinkKind)2, text, endpoint, (PortalEndpoint?)null, string.Empty, string.Empty, val2.Name, num, 0uL, (PortalLifecycle)2); val3.set_DestinationServerCode(val2.Code); val3.set_DestinationServerLobbyId(val2.LobbyId); _activePortal = val3; goto IL_01b2; } return; } return; IL_01b2: _activePortalLocallyCreated = true; CancelPortalPlacement(); if (_portalVisual == null) { _portalVisual = new BoneHubPortalVisual(_constrainedRendering); } _portalVisual.Show(_activePortal, _preferences.ReducedMotion, Cyan); _portalEntranceGuard.Reset(); _portalExitGuard.Reset(); _hasPreviousPortalHead = false; if ((int)_activePortal.Kind != 2) { BroadcastPortalState(_activePortal); } Instance log = _log; PortalLinkKind kind = _activePortal.Kind; string text2 = (((int)kind == 0) ? "WristHub two-way Local Link opened." : (((int)kind != 2) ? "WristHub World Gate opened and is ready for host entry." : "WristHub Fusion server join portal opened.")); log.Msg(text2); if ((int)_activePortal.Kind == 2 && (Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Join portal open • walk through it to switch lobbies"; ((Graphic)_fusionServerStatus).color = Green; } RefreshPortalPage(); } private void TeleportThrough(PortalEndpoint entry, PortalEndpoint exit) { //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_0022: 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_003b: 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_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_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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) if (!((Object)(object)Player.Head == (Object)null) && !((Object)(object)Player.RigManager == (Object)null)) { PortalCrossingResult val = PortalMath.MapBetween(entry, exit, ToNumerics(Player.Head.position), ToNumerics(Player.Head.rotation)); if (((PortalCrossingResult)(ref val)).Crossed) { Vector3 val2 = ToUnity(Vector3.Transform(Vector3.UnitZ, ((PortalCrossingResult)(ref val)).Rotation)); RigManager rigManager = Player.RigManager; Vector3 val3 = ToUnity(((PortalCrossingResult)(ref val)).Position); Vector3 val4 = Vector3.ProjectOnPlane(val2, Vector3.up); rigManager.Teleport(val3, ((Vector3)(ref val4)).normalized, true); _portalEntranceGuard.Reset(); _portalExitGuard.Reset(); _hasPreviousPortalHead = false; } } } private void BeginWorldTravel() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!(_activePortal == (PortalLinkState)null) && (int)_activePortal.Kind == 1) { _portalVisual?.BeginCollapse(); bool flag = IsFusionConnected() && !IsFusionHost(); SetPortalStatus(flag ? "Leaving lobby and opening world…" : "Opening world for the lobby…", Amber); string destinationLevelBarcode = _activePortal.DestinationLevelBarcode; string destinationLoadingScreenBarcode = _activePortal.DestinationLoadingScreenBarcode; RemovePortal(broadcast: false, hideImmediately: false); TryFusionLevelLoad(destinationLevelBarcode, destinationLoadingScreenBarcode, flag); } } private void BeginFusionServerJoin() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (_activePortal == (PortalLinkState)null || (int)_activePortal.Kind != 2) { return; } string destinationServerCode = _activePortal.DestinationServerCode; ulong destinationServerLobbyId = _activePortal.DestinationServerLobbyId; _portalVisual?.BeginCollapse(); RemovePortal(broadcast: false, hideImmediately: false); if (IsFusionConnected()) { if (!FusionPortalBridge.BeginServerSwitch(destinationServerCode, _log, destinationServerLobbyId)) { _latestSdkNotification = "Portal server switch failed — open Fusion and retry"; _log.Warning("WristHub portal could not queue the Fusion lobby handoff."); } BeginClose(immediate: true); } else if (!FusionPortalBridge.JoinServer(destinationServerCode, _log)) { ShowFusionServerDetailsPage(); if ((Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = "Fusion could not join that lobby • refresh and retry"; ((Graphic)_fusionServerStatus).color = Red; } } else { BeginClose(immediate: true); } } private void RemovePortal() { RemovePortal(broadcast: true, hideImmediately: false); } private void RemovePortal(bool broadcast, bool hideImmediately) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 CancelPortalPlacement(); if (!(_activePortal == (PortalLinkState)null)) { if (broadcast && (int)_activePortal.Kind != 2) { BroadcastPortalRemoval(++_portalGeneration); } if (hideImmediately) { _portalVisual?.Hide(); } else { _portalVisual?.BeginCollapse(); } _activePortal = null; _activePortalLocallyCreated = false; _pendingPortalEntrance = null; _portalEntranceGuard.Reset(); _portalExitGuard.Reset(); _hasPreviousPortalHead = false; RefreshPortalPage(); } } private void CancelPortalPlacement() { bool num = _activePortal == (PortalLinkState)null && _portalPlacementStage != PortalPlacementStage.None; _portalPlacementStage = PortalPlacementStage.None; _pendingPortalEntrance = null; if ((Object)(object)_portalPointerLine != (Object)null) { ((Component)_portalPointerLine).gameObject.SetActive(false); } GameObject? portalPointerReticle = _portalPointerReticle; if (portalPointerReticle != null) { portalPointerReticle.SetActive(false); } if (num) { _portalVisual?.Hide(); } } private void EnsurePortalPointer() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown if ((Object)(object)_root == (Object)null) { return; } if (_portalMaterial == null) { _portalMaterial = BoneHubPortalVisual.CreateSharedMaterial(); } if ((Object)(object)_portalPointerLine == (Object)null) { GameObject val = new GameObject("WristHub Portal Placement Ray"); val.transform.SetParent(_root.transform, true); _portalPointerLine = val.AddComponent(); _portalPointerLine.positionCount = 2; _portalPointerLine.useWorldSpace = true; _portalPointerLine.widthMultiplier = 0.007f; _portalPointerLine.numCapVertices = 4; ((Renderer)_portalPointerLine).sharedMaterial = _portalMaterial; } if ((Object)(object)_portalPointerReticle == (Object)null) { _portalPointerReticle = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)_portalPointerReticle).name = "WristHub Portal Placement Outline"; _portalPointerReticle.transform.SetParent(_root.transform, true); Collider component = _portalPointerReticle.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } _portalPointerRenderer = _portalPointerReticle.GetComponent(); if ((Object)(object)_portalPointerRenderer != (Object)null) { _portalPointerRenderer.sharedMaterial = _portalMaterial; } } ((Component)_portalPointerLine).gameObject.SetActive(true); _portalPointerReticle.SetActive(true); } private void SetPortalPointerColor(Color color) { //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) //IL_0022: 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_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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if ((Object)(object)_portalPointerLine != (Object)null) { LineRenderer? portalPointerLine = _portalPointerLine; Color startColor = (_portalPointerLine.endColor = color); portalPointerLine.startColor = startColor; } if (!((Object)(object)_portalPointerRenderer == (Object)null)) { if (_portalPropertyBlock == null) { _portalPropertyBlock = new MaterialPropertyBlock(); } _portalPropertyBlock.SetColor("_Color", new Color(color.r, color.g, color.b, 0.2f)); _portalPointerRenderer.SetPropertyBlock(_portalPropertyBlock); } } private void SetPortalStatus(string text, Color color) { //IL_0050: 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) if (_portalPlacementStage == PortalPlacementStage.FusionServerEntrance && (Object)(object)_fusionServerStatus != (Object)null) { _fusionServerStatus.text = text; ((Graphic)_fusionServerStatus).color = color; } else if ((Object)(object)_portalStatus != (Object)null) { _portalStatus.text = text; ((Graphic)_portalStatus).color = color; } } private bool CanControlPortals() { return true; } private static bool IsFusionConnected() { return FusionPortalBridge.IsConnected; } private static bool IsFusionHost() { return FusionPortalBridge.IsHost; } private void BroadcastPortalState(PortalLinkState state) { FusionPortalBridge.Publish(state, ReceivePortalState); } private void BroadcastPortalRemoval(int generation) { FusionPortalBridge.Remove(generation, ReceivePortalRemoval); } private void TryFusionLevelLoad(string barcode, string loadingBarcode, bool leaveLobby) { FusionPortalBridge.LoadLevel(barcode, loadingBarcode, leaveLobby, _log); } private void ReceivePortalState(PortalLinkState state) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (state.Generation >= _portalGeneration && state.IsValid) { _portalGeneration = state.Generation; _activePortal = state; _activePortalLocallyCreated = false; if (_portalVisual == null) { _portalVisual = new BoneHubPortalVisual(_constrainedRendering); } _portalVisual.Show(state, _preferences.ReducedMotion, Cyan); _portalEntranceGuard.Reset(); _portalExitGuard.Reset(); _hasPreviousPortalHead = false; } } private void ReceivePortalRemoval(int generation) { if (generation >= _portalGeneration) { _portalGeneration = generation; _activePortal = null; _activePortalLocallyCreated = false; _portalVisual?.BeginCollapse(); _portalEntranceGuard.Reset(); _portalExitGuard.Reset(); _hasPreviousPortalHead = false; } } private void ResetPortals(bool destroyOwnedObjects) { CancelPortalPlacement(); _activePortal = null; _activePortalLocallyCreated = false; _pendingPortalEntrance = null; _portalLevels.Clear(); _portalLevelCrates.Clear(); _fusionServers.Clear(); _portalVisual?.Dispose(); _portalVisual = null; if (destroyOwnedObjects) { try { if ((Object)(object)_portalPointerLine != (Object)null) { Object.Destroy((Object)(object)((Component)_portalPointerLine).gameObject); } } catch { } try { if ((Object)(object)_portalPointerReticle != (Object)null) { Object.Destroy((Object)(object)_portalPointerReticle); } } catch { } try { if ((Object)(object)_portalMaterial != (Object)null) { Object.Destroy((Object)(object)_portalMaterial); } } catch { } } _portalPointerLine = null; _portalPointerReticle = null; _portalPointerRenderer = null; _portalMaterial = null; _portalPropertyBlock = null; _portalsPage = null; _portalStatus = null; _portalModeText = null; _portalLocalButton = null; _portalWorldButton = null; _portalRemoveButton = null; _portalLevelsButton = null; _portalServersButton = null; _portalLevelsPage = null; _portalLevelActionButton = null; _portalLevelName = null; _portalLevelDetails = null; _portalLevelPosition = null; _portalLevelStatus = null; _fusionServersPage = null; _fusionServerDetailsPage = null; _fusionServerActionButton = null; _fusionServerJoinButton = null; _fusionServerName = null; _fusionServerArtwork = null; _fusionServerArtworkGeneration++; _fusionServerArtworkCode = string.Empty; _fusionServerRows.Clear(); _fusionServerRowArtwork.Clear(); for (int i = 0; i < _fusionServerRowArtworkCodes.Length; i++) { _fusionServerRowArtworkCodes[i] = string.Empty; _fusionServerRowArtworkGenerations[i]++; } _fusionServerListPosition = null; _fusionServerListStatus = null; _fusionServerDetails = null; _fusionServerPosition = null; _fusionServerStatus = null; _fusionServerDescription = null; _fusionServerMembers = null; _fusionHomePage = null; _fusionPlayersPage = null; _fusionHomeTitle = null; _fusionHomeSummary = null; _fusionHomeStatus = null; _fusionDisconnectButton = null; _fusionPlayerRows.Clear(); _fusionPlayerImages.Clear(); _fusionPlayersSource = null; _fusionPlayerPosition = null; _fusionPlayerStatus = null; for (int j = 0; j < _fusionPlayerImageGenerations.Length; j++) { _fusionPlayerImageGenerations[j]++; _fusionPlayerImageModIds[j] = 0L; } } private static Vector3 ToNumerics(Vector3 value) { //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_000c: Unknown result type (might be due to invalid IL or missing references) return new Vector3(value.x, value.y, value.z); } private static Vector3 ToUnity(Vector3 value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(value.X, value.Y, value.Z); } private static Quaternion ToNumerics(Quaternion value) { //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_000c: 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 new Quaternion(value.x, value.y, value.z, value.w); } private static Quaternion ToUnity(Quaternion value) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Quaternion(value.X, value.Y, value.Z, value.W); } private TouchButton CreateButton(GameObject surfaceRoot, Transform visualParent, string text, Vector3 localPosition, Vector3 size, Color color, Action action, float fontSize) { //IL_0009: 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_000d: Unknown result type (might be due to invalid IL or missing references) return CreateButton(surfaceRoot.transform, visualParent, text, localPosition, size, color, action, fontSize); } private void BuildWristOsHome(Transform parent) { //IL_002b: 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_0069: 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_0095: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0143: 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_0170: 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_01c1: 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_0217: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0318: 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_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: 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_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) if (_sdkHost == null) { _sdkHost = new RuntimeSdkHost(this); } WristHubApi.AttachHost((IWristHubHost)(object)_sdkHost); RegisterWristOsApps(); StyleOsWordmark(CreateText(parent, "WRISTHUB", WristOsHomeHeaderLayout.Wordmark, 13.5f, new Color(0.96f, 0.985f, 1f, 1f), (TextAlignmentOptions)514, (FontStyles)1), 2.4f); StyleOsWordmark(CreateText(parent, "OS", WristOsHomeHeaderLayout.OsMark, 14f, Cyan, (TextAlignmentOptions)514, (FontStyles)3), 1.1f); CreateImage(parent, "WristHubOS Wordmark Light Rail", WristOsHomeHeaderLayout.AccentRail, new Color(Cyan.r, Cyan.g, Cyan.b, 0.62f)); CreateButton(_hub.transform, parent, "AVATARS", new Vector3(-0.087f, 0.023f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), Cyan, delegate { OpenOsApp((WristOsAppId)0); }, 8.5f); CreateButton(_hub.transform, parent, "FUSION", new Vector3(0f, 0.023f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), new Color(0.22f, 0.38f, 0.72f, 1f), delegate { OpenOsApp((WristOsAppId)1); }, 8.5f); CreateButton(_hub.transform, parent, "MOD APPS", new Vector3(0.087f, 0.023f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), new Color(0.1f, 0.43f, 0.55f, 1f), delegate { OpenOsApp((WristOsAppId)2); }, 8f); CreateButton(_hub.transform, parent, "MINI MAP", new Vector3(-0.087f, -0.015f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), new Color(0.05f, 0.35f, 0.28f, 1f), delegate { OpenOsApp((WristOsAppId)3); }, 8f); CreateButton(_hub.transform, parent, "COMPASS", new Vector3(0f, -0.015f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), new Color(0.16f, 0.3f, 0.48f, 1f), delegate { OpenOsApp((WristOsAppId)4); }, 8f); CreateButton(_hub.transform, parent, "PORTALS", new Vector3(0.087f, -0.015f, 0.008f), new Vector3(0.078f, 0.028f, 0.014f), new Color(0.08f, 0.37f, 0.48f, 1f), delegate { OpenOsApp((WristOsAppId)5); }, 8f); CreateButton(_hub.transform, parent, "DL", PixelCenter(WristOsHomeHeaderLayout.Download), PixelSize(WristOsHomeHeaderLayout.Download), new Color(0.35f, 0.22f, 0.04f, 1f), ShowDownloadsPage, 8f); CreateButton(_hub.transform, parent, "SET", PixelCenter(WristOsHomeHeaderLayout.Settings), PixelSize(WristOsHomeHeaderLayout.Settings), DimCyan, ShowOptionsPage, 6f); CreateButton(_hub.transform, parent, "X", PixelCenter(WristOsHomeHeaderLayout.Close), PixelSize(WristOsHomeHeaderLayout.Close), Red, Close, 16f); _osStatusText = CreateButton(_hub.transform, parent, "SYSTEM READY", new Vector3(0f, -0.059f, 0.008f), new Vector3(0.126f, 0.019f, 0.012f), new Color(0.018f, 0.12f, 0.16f, 1f), ShowNotificationCenter, 7f).Label; } private static void StyleOsWordmark(TMP_Text text, float spacing) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) TMP_FontAsset val = ResolveOsWordmarkFont(); if ((Object)(object)val != (Object)null) { text.font = val; } text.enableAutoSizing = false; text.fontWeight = (FontWeight)900; text.characterSpacing = spacing; text.outlineWidth = 0.1f; text.outlineColor = new Color32((byte)0, (byte)12, (byte)22, (byte)220); text.overflowMode = (TextOverflowModes)3; } private static TMP_FontAsset? ResolveOsWordmarkFont() { if (_osWordmarkFontResolved) { return _osWordmarkFont ?? TMP_Settings.defaultFontAsset; } _osWordmarkFontResolved = true; try { int num = 0; foreach (TMP_FontAsset item in Resources.FindObjectsOfTypeAll()) { if (!((Object)(object)item == (Object)null)) { string text = ((Object)item).name?.ToUpperInvariant() ?? string.Empty; int num2 = (text.Contains("DIN", StringComparison.Ordinal) ? 100 : (text.Contains("EUROSTILE", StringComparison.Ordinal) ? 95 : (text.Contains("AGENCY", StringComparison.Ordinal) ? 90 : (text.Contains("ROBOTO CONDENSED", StringComparison.Ordinal) ? 85 : (text.Contains("OSWALD", StringComparison.Ordinal) ? 80 : (text.Contains("BARLOW", StringComparison.Ordinal) ? 75 : 0)))))); if (num2 > num) { num = num2; _osWordmarkFont = item; } } } } catch { } return _osWordmarkFont ?? TMP_Settings.defaultFontAsset; } private void RegisterWristOsApps() { if (_osRouter.Apps.Count == 0) { _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)0, "Avatars", OpenAvatarsFromOs)); _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)1, "Fusion", ShowFusionHomePage)); _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)2, "Mod Apps", ShowCodeModsPage)); _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)3, "Mini Map", ShowMiniMapPage)); _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)4, "Compass", ShowCompassPage)); _osRouter.Register((IWristOsApp)(object)new RuntimeWristOsApp((WristOsAppId)5, "Portals", ShowPortalsPage)); } } private void OpenOsApp(WristOsAppId id) { //IL_0006: 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) if (!_osRouter.OpenApp(id) && (Object)(object)_osStatusText != (Object)null) { _osStatusText.text = "APP UNAVAILABLE"; ((Graphic)_osStatusText).color = Red; } } private void OpenAvatarsFromOs() { //IL_0082: 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_008e: 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 (!((Object)(object)_browser == (Object)null)) { if (_runtime.GetAllAvatars().Count == 0) { _runtime.RefreshLocalLibrary(); } GameObject? launcher = _launcher; if (launcher != null) { launcher.SetActive(false); } GameObject? hub = _hub; if (hub != null) { hub.SetActive(false); } _browser.SetActive(true); StartHologramProjection(); _query = string.Empty; _downloadsOnly = false; _selectedPackId = null; _scope = (AvatarBrowseScope)0; _scopeBeforeSearch = _scope; _viewState = (AvatarBrowserViewState)2; _selectedIdentity = string.Empty; RememberScope(); ShowAllAvatars(); } } private void BuildWristOsPages() { if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { BuildCodeModsPage(); BuildMiniMapPage(); BuildPortalsPage(); BuildFusionExperiencePages(); BuildNotificationCenter(); } } private void BuildCodeModsPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00fc: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0337: 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_0351: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _codeModsPage = new GameObject("WristHubOS Code Mods App"); _codeModsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_codeModsPage.transform, "Code Mods Glass", new TabletRect(0f, 0f, 310f, 184f), new Color(0.005f, 0.026f, 0.04f, 0.96f)); _codeModTitle = CreateText(_codeModsPage.transform, "MOD APPS", new TabletRect(-48f, 79f, 96f, 22f), 16f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser, _codeModsPage.transform, "BACK", new Vector3(-0.132f, 0.079f, 0.008f), new Vector3(0.045f, 0.024f, 0.014f), DimCyan, BackCodeMods, 8f); _codeModCommunityButton = CreateButton(_browser, _codeModsPage.transform, "COMMUNITY", new Vector3(0.033f, 0.079f, 0.008f), new Vector3(0.064f, 0.024f, 0.014f), new Color(0.19f, 0.28f, 0.48f, 1f), ToggleCodeModCommunity, 6.5f); CreateButton(_browser, _codeModsPage.transform, "SEARCH", new Vector3(0.092f, 0.079f, 0.008f), new Vector3(0.05f, 0.024f, 0.014f), DimCyan, OpenCodeModKeyboard, 7f); CreateButton(_browser, _codeModsPage.transform, "X", new Vector3(0.139f, 0.079f, 0.008f), new Vector3(0.026f, 0.024f, 0.014f), Red, Close, 15f); for (int i = 0; i < 4; i++) { BuildCodeModRow(i); } CreateButton(_browser, _codeModsPage.transform, "<", new Vector3(-0.117f, -0.079f, 0.008f), new Vector3(0.047f, 0.024f, 0.014f), DimCyan, delegate { MoveCodeModPage(-1); }, 18f); _codeModPosition = CreateText(_codeModsPage.transform, "1 / 1", new TabletRect(0f, -79f, 96f, 20f), 10f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _codeModsPage.transform, ">", new Vector3(0.117f, -0.079f, 0.008f), new Vector3(0.047f, 0.024f, 0.014f), DimCyan, delegate { MoveCodeModPage(1); }, 18f); _codeModsPage.SetActive(false); } } private void BuildCodeModRow(int index) { //IL_006d: 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_00ca: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0183: 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) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_codeModsPage == (Object)null)) { float num = 48f - (float)index * 32f; TouchButton touchButton = CreateButton(_browser, _codeModsPage.transform, string.Empty, new Vector3(-0.022f, num / 1000f, 0.008f), new Vector3(0.22f, 0.027f, 0.014f), Surface, delegate { ActivateCodeModRow(index); }, 8f); TouchButton minus = CreateButton(_browser, _codeModsPage.transform, "-", new Vector3(0.106f, num / 1000f, 0.009f), new Vector3(0.032f, 0.022f, 0.014f), DimCyan, delegate { AdjustCodeModRow(index, -1); }, 15f); TouchButton plus = CreateButton(_browser, _codeModsPage.transform, "+", new Vector3(0.139f, num / 1000f, 0.009f), new Vector3(0.032f, 0.022f, 0.014f), DimCyan, delegate { AdjustCodeModRow(index, 1); }, 15f); TMP_Text detail = CreateText(touchButton.Root.transform, string.Empty, new TabletRect(0f, -7f, 198f, 9f), 6.5f, new Color(0.62f, 0.78f, 0.84f, 1f), (TextAlignmentOptions)514, (FontStyles)0); _codeModRows.Add(new OsControlRow { Main = touchButton, Minus = minus, Plus = plus, Detail = detail }); } } private void BuildMiniMapPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f6: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_01fd: Expected O, but got Unknown //IL_0238: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0293: 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_02a6: Expected O, but got Unknown //IL_02c1: 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_0315: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Expected O, but got Unknown //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: 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_0420: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected O, but got Unknown //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0912: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _miniMapPage = new GameObject("WristHubOS Mini Map App"); _miniMapPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_miniMapPage.transform, "Tactical Map Glass", new TabletRect(0f, 0f, 304f, 208f), new Color(0.002f, 0.018f, 0.026f, 0.985f)); CreateText(_miniMapPage.transform, "LIVE LEVEL MAP", new TabletRect(-34f, 91f, 132f, 16f), 8.5f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateImage(_miniMapPage.transform, "Map Shadow", new TabletRect(0f, -1f, 174f, 174f), new Color(0.002f, 0.012f, 0.02f, 0.98f)); CreateImage(_miniMapPage.transform, "Map Frame", new TabletRect(0f, -1f, 164f, 164f), new Color(0.004f, 0.025f, 0.032f, 0.98f)); GameObject val = new GameObject("Circular Map Viewport"); val.transform.SetParent(_miniMapPage.transform, false); Image val2 = val.AddComponent(); val2.sprite = GetMiniMapMaskSprite(); val2.type = (Type)0; ((Graphic)val2).color = Color.white; ((Graphic)val2).raycastTarget = false; _miniMapViewport = ((Graphic)val2).rectTransform; SetRect(_miniMapViewport, new TabletRect(0f, -1f, 160f, 160f)); val.AddComponent().showMaskGraphic = false; val.AddComponent(); GameObject val3 = new GameObject("Cached Color Map"); _miniMapGeometryRoot = val3.AddComponent(); ((Transform)_miniMapGeometryRoot).SetParent((Transform)(object)_miniMapViewport, false); RectTransform? miniMapGeometryRoot = _miniMapGeometryRoot; RectTransform? miniMapGeometryRoot2 = _miniMapGeometryRoot; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(0.5f, 0.5f); miniMapGeometryRoot2.anchorMax = val4; miniMapGeometryRoot.anchorMin = val4; _miniMapGeometryRoot.sizeDelta = new Vector2(160f, 160f); _miniMapGeometryRoot.anchoredPosition = Vector2.zero; BuildMiniMapSceneCapture((Transform)(object)_miniMapGeometryRoot); _miniMapLayoutTexture = new Texture2D(32, 32, (TextureFormat)4, false) { name = "WristHub Live Top-Down Map", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; _miniMapLayoutSprite = Sprite.Create(_miniMapLayoutTexture, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 32f); ((Object)_miniMapLayoutSprite).name = "WristHub Live Map Sprite"; _miniMapLayoutImage = CreateImage((Transform)(object)_miniMapGeometryRoot, "Live Color Layout", new TabletRect(0f, 0f, 158f, 158f), new Color(1f, 1f, 1f, 0.5f)); _miniMapLayoutImage.sprite = _miniMapLayoutSprite; _miniMapLayoutImage.preserveAspect = true; ClearMiniMapRaster(); _miniMapPeerOverlay = new MiniMapPeerOverlay(); _miniMapPeerOverlay.Bind((Transform)(object)_miniMapViewport); for (int i = 0; i < 16; i++) { _miniMapPeerVisuals.Add(new MiniMapPeerVisual()); } GameObject val5 = new GameObject("Live Portal Markers"); _miniMapMarkerRoot = val5.AddComponent(); ((Transform)_miniMapMarkerRoot).SetParent(_miniMapPage.transform, false); RectTransform? miniMapMarkerRoot = _miniMapMarkerRoot; RectTransform? miniMapMarkerRoot2 = _miniMapMarkerRoot; ((Vector2)(ref val4))..ctor(0.5f, 0.5f); miniMapMarkerRoot2.anchorMax = val4; miniMapMarkerRoot.anchorMin = val4; _miniMapMarkerRoot.sizeDelta = new Vector2(160f, 160f); _miniMapMarkerRoot.anchoredPosition = new Vector2(0f, -1f); for (int j = 0; j < 2; j++) { GameObject gameObject = ((Component)CreateText((Transform)(object)_miniMapMarkerRoot, "◉", new TabletRect(0f, 0f, 12f, 12f), 9f, new Color(0.94f, 0.32f, 1f, 1f), (TextAlignmentOptions)514, (FontStyles)1)).gameObject; gameObject.SetActive(false); _miniMapPortalDots.Add(gameObject); } ((Transform)_miniMapMarkerRoot).SetAsLastSibling(); GameObject val6 = new GameObject("Rotating Cardinal Ring"); _miniMapBearingRoot = val6.AddComponent(); ((Transform)_miniMapBearingRoot).SetParent(_miniMapPage.transform, false); RectTransform? miniMapBearingRoot = _miniMapBearingRoot; RectTransform? miniMapBearingRoot2 = _miniMapBearingRoot; ((Vector2)(ref val4))..ctor(0.5f, 0.5f); miniMapBearingRoot2.anchorMax = val4; miniMapBearingRoot.anchorMin = val4; _miniMapBearingRoot.sizeDelta = new Vector2(174f, 174f); _miniMapBearingRoot.anchoredPosition = new Vector2(0f, -1f); CreateText((Transform)(object)_miniMapBearingRoot, "N", new TabletRect(0f, 76f, 16f, 12f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateText((Transform)(object)_miniMapBearingRoot, "E", new TabletRect(76f, 0f, 16f, 12f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateText((Transform)(object)_miniMapBearingRoot, "S", new TabletRect(0f, -76f, 16f, 12f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); CreateText((Transform)(object)_miniMapBearingRoot, "W", new TabletRect(-76f, 0f, 16f, 12f), 8f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _miniMapHeading = CreateText(_miniMapPage.transform, "N 000°", new TabletRect(76f, 91f, 64f, 15f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _miniMapRangeText = CreateText(_miniMapPage.transform, "0 SQUAD • SAME LEVEL", new TabletRect(0f, -91f, 142f, 11f), 6.8f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _miniMapScanText = CreateText(_miniMapPage.transform, "LIVE FLOOR SCAN", new TabletRect(0f, -101f, 142f, 9f), 5.3f, new Color(Cyan.r, Cyan.g, Cyan.b, 0.78f), (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _miniMapPage.transform, "HOME", new Vector3(-0.132f, 0.091f, 0.008f), new Vector3(0.04f, 0.021f, 0.014f), DimCyan, ShowHub, 7f); _miniMapModeButton = CreateButton(_browser, _miniMapPage.transform, "TRACK UP", new Vector3(-0.112f, -0.091f, 0.008f), new Vector3(0.066f, 0.021f, 0.014f), DimCyan, ToggleMiniMapMode, 6.5f); CreateButton(_browser, _miniMapPage.transform, "−", new Vector3(0.078f, -0.091f, 0.008f), new Vector3(0.027f, 0.021f, 0.014f), DimCyan, delegate { AdjustMiniMapRange(-1); }, 10f); _miniMapRangeValue = CreateText(_miniMapPage.transform, "25 M", new TabletRect(108f, -91f, 34f, 18f), 7.5f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); CreateButton(_browser, _miniMapPage.transform, "+", new Vector3(0.138f, -0.091f, 0.008f), new Vector3(0.027f, 0.021f, 0.014f), DimCyan, delegate { AdjustMiniMapRange(1); }, 10f); CreateButton(_browser, _miniMapPage.transform, "X", new Vector3(0.137f, 0.091f, 0.008f), new Vector3(0.027f, 0.021f, 0.014f), Red, Close, 13f); ((Transform)_miniMapMarkerRoot).SetAsLastSibling(); int num = LayerMask.NameToLayer("UI"); if (num >= 0) { SetMiniMapLayer(_miniMapPage.transform, num); } _miniMapPage.SetActive(false); } } private void BuildMiniMapSceneCapture(Transform parent) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0072: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) int resolution = (_constrainedRendering ? 128 : 256); _miniMapCaptureTexture = CreateMiniMapRenderTexture(resolution, "WristHub Actual Level Map A"); _miniMapCaptureBackTexture = CreateMiniMapRenderTexture(resolution, "WristHub Actual Level Map B"); GameObject val = new GameObject("Actual Level Colors"); val.transform.SetParent(parent, false); _miniMapSceneImage = val.AddComponent(); _miniMapSceneImage.texture = (Texture)(object)_miniMapCaptureTexture; ((Graphic)_miniMapSceneImage).color = Color.white; ((Graphic)_miniMapSceneImage).raycastTarget = false; SetRect(((Graphic)_miniMapSceneImage).rectTransform, new TabletRect(0f, 0f, 158f, 158f)); _miniMapCaptureObject = new GameObject("WristHub Cached Map Camera"); Object.DontDestroyOnLoad((Object)(object)_miniMapCaptureObject); _miniMapCaptureCamera = _miniMapCaptureObject.AddComponent(); ((Behaviour)_miniMapCaptureCamera).enabled = false; _miniMapCaptureCamera.orthographic = true; _miniMapCaptureCamera.orthographicSize = (float)_preferences.MiniMapRange; _miniMapCaptureCamera.aspect = 1f; _miniMapCaptureCamera.nearClipPlane = 0.05f; _miniMapCaptureCamera.farClipPlane = 12f; _miniMapCaptureCamera.clearFlags = (CameraClearFlags)2; _miniMapCaptureCamera.backgroundColor = new Color(0.004f, 0.012f, 0.022f, 1f); _miniMapCaptureCamera.allowHDR = false; _miniMapCaptureCamera.allowMSAA = false; _miniMapCaptureCamera.useOcclusionCulling = true; _miniMapCaptureCamera.stereoTargetEye = (StereoTargetEyeMask)0; _miniMapCaptureCamera.depth = -100f; _miniMapCaptureCamera.cullingMask = ResolveMiniMapCameraMask(); _miniMapCaptureCamera.targetTexture = _miniMapCaptureBackTexture; } private static RenderTexture CreateMiniMapRenderTexture(int resolution, string name) { //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_0011: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown RenderTexture val = new RenderTexture(resolution, resolution, 16, (RenderTextureFormat)0) { name = name, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, useMipMap = false, autoGenerateMips = false, antiAliasing = 1 }; val.Create(); return val; } private static int ResolveMiniMapCameraMask() { int num = -1; string[] array = new string[6] { "UI", "Ignore Raycast", "Player", "PlayerOnly", "Avatar", "Hand" }; for (int i = 0; i < array.Length; i++) { int num2 = LayerMask.NameToLayer(array[i]); if (num2 >= 0) { num &= ~(1 << num2); } } return num; } private void SuppressMiniMapPlayerRenderers() { RestoreMiniMapPlayerRenderers(); foreach (FusionMiniMapPeer miniMapPeer in _miniMapPeers) { Transform rigRoot = miniMapPeer.RigRoot; if ((Object)(object)rigRoot == (Object)null) { continue; } Renderer[] array; try { array = Il2CppArrayBase.op_Implicit(((Component)rigRoot).GetComponentsInChildren(true)); } catch { continue; } Renderer[] array2 = array; foreach (Renderer val in array2) { if (!((Object)(object)val == (Object)null) && val.enabled && !_miniMapSuppressedRenderers.Contains(val)) { val.enabled = false; _miniMapSuppressedRenderers.Add(val); } } } } private void RestoreMiniMapPlayerRenderers() { foreach (Renderer miniMapSuppressedRenderer in _miniMapSuppressedRenderers) { try { if ((Object)(object)miniMapSuppressedRenderer != (Object)null) { miniMapSuppressedRenderer.enabled = true; } } catch { } } _miniMapSuppressedRenderers.Clear(); } private static void SetMiniMapLayer(Transform root, int layer) { ((Component)root).gameObject.layer = layer; for (int i = 0; i < root.childCount; i++) { SetMiniMapLayer(root.GetChild(i), layer); } } private void BuildSpawnablesPage() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0168: 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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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) //IL_026c: 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_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_0416: 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_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _spawnablesPage = new GameObject("WristHubOS Spawnables App"); _spawnablesPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_spawnablesPage.transform, "Spawnables Glass", new TabletRect(0f, 0f, 300f, 188f), new Color(0.005f, 0.026f, 0.038f, 0.96f)); CreateText(_spawnablesPage.transform, "SPAWNABLES", new TabletRect(-5f, 78f, 86f, 22f), 16f, Color.white, (TextAlignmentOptions)4097, (FontStyles)1); CreateButton(_browser, _spawnablesPage.transform, "HOME", new Vector3(-0.128f, 0.078f, 0.008f), new Vector3(0.044f, 0.024f, 0.014f), DimCyan, ShowHub, 8f); _spawnableModeButton = CreateButton(_browser, _spawnablesPage.transform, "ALL", new Vector3(-0.083f, 0.078f, 0.008f), new Vector3(0.04f, 0.024f, 0.014f), DimCyan, CycleSpawnableMode, 7f); CreateButton(_browser, _spawnablesPage.transform, "SEARCH", new Vector3(0.05f, 0.078f, 0.008f), new Vector3(0.05f, 0.024f, 0.014f), DimCyan, OpenSpawnableKeyboard, 7f); CreateButton(_browser, _spawnablesPage.transform, "X", new Vector3(0.135f, 0.078f, 0.008f), new Vector3(0.026f, 0.024f, 0.014f), Red, Close, 15f); _spawnableFavoriteButton = CreateButton(_browser, _spawnablesPage.transform, "FAV", new Vector3(0.098f, 0.078f, 0.008f), new Vector3(0.03f, 0.024f, 0.014f), new Color(0.34f, 0.25f, 0.05f, 1f), ToggleSpawnableFavorite, 7f); _spawnablePreview = CreateSilhouette(_spawnablesPage.transform); ((Object)_spawnablePreview).name = "Safe Native Spawn Preview"; _spawnablePreview.transform.localPosition = new Vector3(-0.07f, 0.005f, 0.01f); _spawnablePreview.transform.localScale = Vector3.one * 0.7f; _spawnableName = CreateText(_spawnablesPage.transform, "Scanning installed crates…", new TabletRect(54f, 42f, 132f, 32f), 13f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _spawnableDetails = CreateText(_spawnablesPage.transform, string.Empty, new TabletRect(54f, 5f, 132f, 34f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); _spawnablePosition = CreateText(_spawnablesPage.transform, "0 / 0", new TabletRect(54f, -23f, 90f, 16f), 9f, Cyan, (TextAlignmentOptions)514, (FontStyles)1); _spawnableStatus = CreateText(_spawnablesPage.transform, "Safe preview only • confirm to spawn", new TabletRect(0f, -72f, 250f, 13f), 8f, new Color(0.7f, 0.82f, 0.88f, 1f), (TextAlignmentOptions)514, (FontStyles)0); CreateButton(_browser, _spawnablesPage.transform, "<", new Vector3(-0.135f, 0.005f, 0.008f), new Vector3(0.03f, 0.038f, 0.014f), DimCyan, delegate { MoveSpawnable(-1); }, 18f); CreateButton(_browser, _spawnablesPage.transform, ">", new Vector3(0.135f, 0.005f, 0.008f), new Vector3(0.03f, 0.038f, 0.014f), DimCyan, delegate { MoveSpawnable(1); }, 18f); _spawnActionButton = CreateButton(_browser, _spawnablesPage.transform, "POINT", new Vector3(0.025f, -0.048f, 0.008f), new Vector3(0.068f, 0.03f, 0.014f), Green, SpawnSelectedAhead, 10f); CreateButton(_browser, _spawnablesPage.transform, "IN HAND", new Vector3(0.102f, -0.048f, 0.008f), new Vector3(0.048f, 0.03f, 0.014f), new Color(0.35f, 0.24f, 0.06f, 1f), SpawnSelectedInHand, 8f); _spawnDeleteButton = CreateButton(_browser, _spawnablesPage.transform, "DELETE", new Vector3(-0.108f, -0.048f, 0.008f), new Vector3(0.056f, 0.026f, 0.014f), Red, ToggleSpawnDelete, 7f); CreateButton(_browser, _spawnablesPage.transform, "ROT", new Vector3(-0.06f, -0.048f, 0.008f), new Vector3(0.035f, 0.026f, 0.014f), DimCyan, delegate { AdjustSpawnPlacement(15f, 0f); }, 7f); _spawnablesPage.SetActive(false); } } private void BuildNotificationCenter() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00f6: 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_013c: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_0220: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_canvasRoot == (Object)null)) { _notificationsPage = new GameObject("WristHubOS Notification Center"); _notificationsPage.transform.SetParent(_canvasRoot.transform, false); CreateImage(_notificationsPage.transform, "Notification Glass", new TabletRect(0f, 0f, 250f, 160f), new Color(0.005f, 0.026f, 0.04f, 0.97f)); CreateText(_notificationsPage.transform, "NOTIFICATIONS", new TabletRect(0f, 61f, 120f, 22f), 15f, Color.white, (TextAlignmentOptions)514, (FontStyles)1); _notificationText = CreateText(_notificationsPage.transform, "System ready", new TabletRect(0f, 3f, 210f, 80f), 10f, Cyan, (TextAlignmentOptions)514, (FontStyles)0); CreateButton(_browser, _notificationsPage.transform, "HOME", new Vector3(-0.087f, 0.061f, 0.008f), new Vector3(0.044f, 0.023f, 0.014f), DimCyan, ShowHub, 8f); CreateButton(_browser, _notificationsPage.transform, "DOWNLOADS", new Vector3(0f, -0.06f, 0.008f), new Vector3(0.082f, 0.026f, 0.014f), new Color(0.35f, 0.22f, 0.04f, 1f), ShowDownloadsPage, 8f); CreateButton(_browser, _notificationsPage.transform, "X", new Vector3(0.087f, 0.061f, 0.008f), new Vector3(0.026f, 0.023f, 0.014f), Red, Close, 14f); _notificationsPage.SetActive(false); } } private void ShowCodeModsPage() { ShowWristOsPage(_codeModsPage, (AvatarBrowserViewState)6); _nextLoadedCodeModScan = 0f; RefreshCodeMods(force: true); _log.Msg("WristHubOS Mod Apps opened."); } private void ShowMiniMapPage() { ShowWristOsPage(_miniMapPage, (AvatarBrowserViewState)7); _nextMiniMapPeerRefresh = 0f; _nextMiniMapOverlayRender = 0f; _nextMiniMapOverlayRecovery = 0f; _miniMapOverlayDiagnosticLogged = false; _miniMapOverlayRecovering = false; if ((Object)(object)_miniMapViewport != (Object)null) { if (_miniMapPeerOverlay == null) { _miniMapPeerOverlay = new MiniMapPeerOverlay(); } _miniMapPeerOverlay.Bind((Transform)(object)_miniMapViewport); _miniMapPeerOverlay.Clear(); } _lastMiniMapDegree = -1; RefreshMiniMapLabels(); _log.Msg("WristHubOS Mini Map app opened."); } private void ShowSpawnablesPage() { ShowWristOsPage(_spawnablesPage, (AvatarBrowserViewState)11); RefreshSpawnables(force: true); _log.Msg("WristHubOS Spawnables app opened."); } private void ShowNotificationCenter() { _osRouter.OpenDrawer("notifications"); ShowWristOsPage(_notificationsPage, (AvatarBrowserViewState)4); RefreshNotificationCenter(); } private void BackFromOptions() { if (_optionsReturnToHub) { _optionsReturnToHub = false; ShowHub(); } else { ShowScopePage(); } } private void BackCodeMods() { WristHubPage? activeSdkPage = _activeSdkPage; if (((activeSdkPage != null) ? activeSdkPage.Parent : null) != null) { _activeSdkPage = _activeSdkPage.Parent; _codeModPageIndex = 0; RefreshCodeMods(force: true); } else if (_activeSdkApp != null) { _activeSdkApp = null; _activeSdkPage = null; _codeModPageIndex = 0; RefreshCodeMods(force: true); } else if (_activeBoneMenuPage != null) { object member = GetMember(_activeBoneMenuPage, "Parent"); if (member != null && member != Page.Root) { _activeBoneMenuPage = member; } else { _activeBoneMenuPage = null; _showLegacyBoneMenu = false; } _codeModPageIndex = 0; RefreshCodeMods(force: true); } else if (_showLegacyBoneMenu) { _showLegacyBoneMenu = false; _codeModPageIndex = 0; RefreshCodeMods(force: true); } else { ShowHub(); } } private void ToggleCodeModCommunity() { _activeSdkApp = null; _activeSdkPage = null; _activeBoneMenuPage = null; _showLegacyBoneMenu = false; _codeModCatalogMode = _codeModCatalogMode switch { CodeModCatalogMode.All => CodeModCatalogMode.Community, CodeModCatalogMode.Community => CodeModCatalogMode.Managers, CodeModCatalogMode.Managers => CodeModCatalogMode.BoneMenu, CodeModCatalogMode.BoneMenu => CodeModCatalogMode.Loaded, _ => CodeModCatalogMode.All, }; _codeModPageIndex = 0; RefreshCodeMods(force: true); } private void ShowWristOsPage(GameObject? page, AvatarBrowserViewState state) { //IL_006b: 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) if (!((Object)(object)_root == (Object)null) && !((Object)(object)_browser == (Object)null) && !((Object)(object)page == (Object)null)) { _root.SetActive(true); GameObject? hub = _hub; if (hub != null) { hub.SetActive(false); } _browser.SetActive(true); HideStandardPages(); HideWristOsAppPages(page); page.SetActive(true); DeactivateAvatarPreview(); _viewState = state; StartHologramProjection(); UpdatePresentationMode(); RequireInputRearm(); } } private void HideStandardPages() { GameObject? packPage = _packPage; if (packPage != null) { packPage.SetActive(false); } GameObject? detailPage = _detailPage; if (detailPage != null) { detailPage.SetActive(false); } GameObject? optionsPage = _optionsPage; if (optionsPage != null) { optionsPage.SetActive(false); } GameObject? watchPlacementPage = _watchPlacementPage; if (watchPlacementPage != null) { watchPlacementPage.SetActive(false); } GameObject? downloadsPage = _downloadsPage; if (downloadsPage != null) { downloadsPage.SetActive(false); } GameObject? packOptionsPage = _packOptionsPage; if (packOptionsPage != null) { packOptionsPage.SetActive(false); } GameObject? keyboardPage = _keyboardPage; if (keyboardPage != null) { keyboardPage.SetActive(false); } GameObject? deletePage = _deletePage; if (deletePage != null) { deletePage.SetActive(false); } GameObject? compassPage = _compassPage; if (compassPage != null) { compassPage.SetActive(false); } } private void HideWristOsAppPages(GameObject? except = null) { if ((Object)(object)_portalsPage != (Object)null && (Object)(object)_portalsPage != (Object)(object)except && _portalsPage.activeSelf) { CancelPortalPlacement(); } if ((Object)(object)_codeModsPage != (Object)null && (Object)(object)_codeModsPage != (Object)(object)except) { _codeModsPage.SetActive(false); } if ((Object)(object)_miniMapPage != (Object)null && (Object)(object)_miniMapPage != (Object)(object)except) { _miniMapPage.SetActive(false); } if ((Object)(object)_portalsPage != (Object)null && (Object)(object)_portalsPage != (Object)(object)except) { _portalsPage.SetActive(false); } if ((Object)(object)_portalLevelsPage != (Object)null && (Object)(object)_portalLevelsPage != (Object)(object)except) { _portalLevelsPage.SetActive(false); } if ((Object)(object)_fusionServersPage != (Object)null && (Object)(object)_fusionServersPage != (Object)(object)except) { _fusionServersPage.SetActive(false); } if ((Object)(object)_fusionServerDetailsPage != (Object)null && (Object)(object)_fusionServerDetailsPage != (Object)(object)except) { _fusionServerDetailsPage.SetActive(false); } if ((Object)(object)_fusionHomePage != (Object)null && (Object)(object)_fusionHomePage != (Object)(object)except) { _fusionHomePage.SetActive(false); } if ((Object)(object)_fusionPlayersPage != (Object)null && (Object)(object)_fusionPlayersPage != (Object)(object)except) { _fusionPlayersPage.SetActive(false); } if ((Object)(object)_notificationsPage != (Object)null && (Object)(object)_notificationsPage != (Object)(object)except) { _notificationsPage.SetActive(false); } } private GameObject? ActiveWristOsPage() { GameObject? codeModsPage = _codeModsPage; if (codeModsPage != null && codeModsPage.activeSelf) { return _codeModsPage; } GameObject? miniMapPage = _miniMapPage; if (miniMapPage != null && miniMapPage.activeSelf) { return _miniMapPage; } GameObject? portalsPage = _portalsPage; if (portalsPage != null && portalsPage.activeSelf) { return _portalsPage; } GameObject? portalLevelsPage = _portalLevelsPage; if (portalLevelsPage != null && portalLevelsPage.activeSelf) { return _portalLevelsPage; } GameObject? fusionServersPage = _fusionServersPage; if (fusionServersPage != null && fusionServersPage.activeSelf) { return _fusionServersPage; } GameObject? fusionServerDetailsPage = _fusionServerDetailsPage; if (fusionServerDetailsPage != null && fusionServerDetailsPage.activeSelf) { return _fusionServerDetailsPage; } GameObject? fusionHomePage = _fusionHomePage; if (fusionHomePage != null && fusionHomePage.activeSelf) { return _fusionHomePage; } GameObject? fusionPlayersPage = _fusionPlayersPage; if (fusionPlayersPage != null && fusionPlayersPage.activeSelf) { return _fusionPlayersPage; } GameObject? notificationsPage = _notificationsPage; if (notificationsPage != null && notificationsPage.activeSelf) { return _notificationsPage; } return null; } private bool IsWristOsFocusedPageActive() { return (Object)(object)ActiveWristOsPage() != (Object)null; } private bool RefreshVisibleWristOsPage() { GameObject? codeModsPage = _codeModsPage; if (codeModsPage != null && codeModsPage.activeSelf) { RefreshCodeMods(force: false); return true; } GameObject? miniMapPage = _miniMapPage; if (miniMapPage != null && miniMapPage.activeSelf) { RefreshMiniMapLabels(); return true; } GameObject? portalsPage = _portalsPage; if (portalsPage != null && portalsPage.activeSelf) { RefreshPortalPage(); return true; } GameObject? portalLevelsPage = _portalLevelsPage; if (portalLevelsPage != null && portalLevelsPage.activeSelf) { RefreshPortalLevelPage(); return true; } GameObject? fusionServersPage = _fusionServersPage; if (fusionServersPage != null && fusionServersPage.activeSelf) { RefreshFusionServerPage(); return true; } GameObject? fusionServerDetailsPage = _fusionServerDetailsPage; if (fusionServerDetailsPage != null && fusionServerDetailsPage.activeSelf) { RefreshFusionServerPage(); return true; } GameObject? fusionHomePage = _fusionHomePage; if (fusionHomePage != null && fusionHomePage.activeSelf) { RefreshFusionHome(); return true; } GameObject? fusionPlayersPage = _fusionPlayersPage; if (fusionPlayersPage != null && fusionPlayersPage.activeSelf) { RefreshFusionPlayers(); return true; } GameObject? notificationsPage = _notificationsPage; if (notificationsPage != null && notificationsPage.activeSelf) { RefreshNotificationCenter(); return true; } return false; } private void TickWristOs() { //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_00e6: 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_01b6: Invalid comparison between Unknown and I4 //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Invalid comparison between Unknown and I4 //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) FusionPortalBridge.Attach(_portalStateReceiver, _portalRemoveReceiver); _osRouter.Tick(Time.unscaledTimeAsDouble); SdkNotification result; while (_sdkNotifications.TryDequeue(out result)) { _latestSdkNotification = (string.IsNullOrWhiteSpace(result.AppId) ? result.Message : (SafeSdkId(result.AppId) + ": " + result.Message)); if (_runtimeErrorThrottle.ShouldLog("sdk-notification|" + SafeSdkId(result.AppId) + "|" + ((object)result.Kind/*cast due to .constrained prefix*/).ToString(), (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Msg($"WristHub app notification [{result.Kind}] from {SafeSdkId(result.AppId)}."); } } string result2; while (_sdkOpenRequests.TryDequeue(out result2)) { OpenRegisteredSdkApp(result2); } if ((Object)(object)_osStatusText != (Object)null) { GameObject? hub = _hub; if (hub != null && hub.activeSelf) { int num = _jobs.Values.Count(delegate(DownloadJob job) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 DownloadState state = job.State; return (int)state <= 4; }); int registeredAppCount = WristHubApi.RegisteredAppCount; _osStatusText.text = ((num > 0) ? $"{num} ACTIVE DOWNLOAD{((num == 1) ? "" : "S")}" : (((int)_sharingState == 5) ? "FUSION SHARING NEEDS ATTENTION" : ((registeredAppCount > 0) ? $"{registeredAppCount} MOD APP{((registeredAppCount == 1) ? "" : "S")} READY" : "SYSTEM READY"))); ((Graphic)_osStatusText).color = ((num > 0) ? Amber : (((int)_sharingState == 5) ? Red : Cyan)); } } GameObject? codeModsPage = _codeModsPage; if (codeModsPage != null && codeModsPage.activeSelf && Time.unscaledTime >= _nextCodeModRefresh) { RefreshCodeMods(force: true); } GameObject? miniMapPage = _miniMapPage; if (miniMapPage != null && miniMapPage.activeSelf) { TickMiniMap(); } else { Camera? miniMapCaptureCamera = _miniMapCaptureCamera; if (miniMapCaptureCamera != null && ((Behaviour)miniMapCaptureCamera).enabled) { ((Behaviour)_miniMapCaptureCamera).enabled = false; } } if (_portalPlacementStage != PortalPlacementStage.None || _activePortal != (PortalLinkState)null) { TickPortals(); } if (_pendingPortalLevelModId != 0L) { TickPortalLevelDownload(); } GameObject? notificationsPage = _notificationsPage; if (notificationsPage != null && notificationsPage.activeSelf) { RefreshNotificationCenter(); } } private void RefreshNotificationCenter() { //IL_00a0: 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_00a7: 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_00ac: Invalid comparison between Unknown and I4 //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_01a8: 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_0193: Invalid comparison between Unknown and I4 //IL_01a1: 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) if (!((Object)(object)_notificationText == (Object)null)) { int num = _jobs.Values.Count(delegate(DownloadJob job) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 DownloadState state = job.State; return (int)state <= 4; }); int num2 = _jobs.Values.Count((DownloadJob job) => (int)job.State == 6); int value = _jobs.Values.Count((DownloadJob job) => (int)job.State == 5); AvatarSharingState sharingState = _sharingState; string text = ((sharingState - 2 <= 1) ? "Fusion sharing ready" : (((int)sharingState != 5) ? "Fusion sharing idle" : "Fusion sharing needs a rescan")); string value2 = text; _notificationText.text = $"{num} active download{((num == 1) ? "" : "s")}\n{value} completed • {num2} failed\n\n{value2}"; if (!string.IsNullOrWhiteSpace(_latestSdkNotification)) { TMP_Text? notificationText = _notificationText; notificationText.text = notificationText.text + "\n\n" + _latestSdkNotification; } ((Graphic)_notificationText).color = ((num2 > 0 || (int)_sharingState == 5) ? Red : ((num > 0) ? Amber : Cyan)); } } private void RefreshCodeMods(bool force) { //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) GameObject? codeModsPage = _codeModsPage; if (codeModsPage == null || !codeModsPage.activeSelf || (!force && Time.unscaledTime < _nextCodeModRefresh)) { return; } _nextCodeModRefresh = Time.unscaledTime + 1.5f; try { _codeModItems.Clear(); if (_activeSdkApp != null && _activeSdkPage != null) { foreach (WristHubControl control in _activeSdkPage.Controls) { try { if (_codeModQuery.Length <= 0 || control.Label.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || control.Description.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase)) { List codeModItems = _codeModItems; string label = control.Label; string detail = DescribeSdkControl(control); WristHubPageLink val = (WristHubPageLink)(object)((control is WristHubPageLink) ? control : null); codeModItems.Add(new CodeModSnapshot(label, detail, (val != null) ? val.Page : null, control)); } } catch (Exception exception) { ThrottledOsError("sdk-control-" + SafeSdkId(_activeSdkApp.Id) + "-" + SafeSdkId(control.Id), exception); } } } else if (_showLegacyBoneMenu) { object page = _activeBoneMenuPage ?? Page.Root; IReadOnlyList readOnlyList = SnapshotCustomManagerControls(page); if (readOnlyList.Count > 0) { foreach (ReflectedManagerControl item in readOnlyList) { if (_codeModQuery.Length <= 0 || item.Label.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || item.Detail.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase)) { _codeModItems.Add(new CodeModSnapshot(item.Label, item.Detail, null, item)); } } } foreach (object item2 in SnapshotBoneMenuElements(page)) { if (item2 != null) { string stringMember = GetStringMember(item2, "ElementName", "Unnamed control"); if ((_activeBoneMenuPage != null || !stringMember.Contains("WristHub", StringComparison.OrdinalIgnoreCase)) && (_codeModQuery.Length <= 0 || stringMember.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || DescribeBoneMenuElement(item2).Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase))) { object member = GetMember(item2, "LinkedPage"); string detail2 = ((member != null) ? "Open legacy controls" : DescribeBoneMenuElement(item2)); _codeModItems.Add(new CodeModSnapshot(stringMember, detail2, member, item2)); } } } } else { HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); int num = 0; CodeModCatalogMode codeModCatalogMode; bool flag; foreach (WristHubApp registeredApp in WristHubApi.GetRegisteredApps()) { if (!registeredApp.Available) { continue; } hashSet.Add(NormalizeCodeModName(registeredApp.Name)); if (_codeModCatalogMode != CodeModCatalogMode.Community || !(registeredApp.Community == (WristHubCommunityProfile)null)) { codeModCatalogMode = _codeModCatalogMode; flag = (uint)(codeModCatalogMode - 3) <= 1u; if (!flag && (_codeModCatalogMode != CodeModCatalogMode.Managers || IsManagerMod(registeredApp.Name)) && (_codeModQuery.Length <= 0 || registeredApp.Name.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || registeredApp.Author.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase))) { string value = ((registeredApp.Notifications > 0) ? $" • {registeredApp.Notifications} new" : string.Empty); string value2 = ((registeredApp.Community == (WristHubCommunityProfile)null) ? string.Empty : $" • {registeredApp.Community.Category}"); string detail3 = ((_codeModCatalogMode == CodeModCatalogMode.Community && registeredApp.Community != (WristHubCommunityProfile)null) ? $"{registeredApp.Community.Category} • {registeredApp.Community.Summary}" : $"By {registeredApp.Author} • v{registeredApp.Version}{value2}{value}"); _codeModItems.Add(new CodeModSnapshot(registeredApp.Name, detail3, registeredApp)); num++; } } } int num2 = 0; codeModCatalogMode = _codeModCatalogMode; if ((codeModCatalogMode == CodeModCatalogMode.All || (uint)(codeModCatalogMode - 2) <= 1u) ? true : false) { foreach (object item3 in SnapshotBoneMenuElements(Page.Root)) { if (item3 == null) { continue; } string stringMember2 = GetStringMember(item3, "ElementName", "Unnamed mod"); if (!stringMember2.Contains("WristHub", StringComparison.OrdinalIgnoreCase) && (_codeModCatalogMode != CodeModCatalogMode.Managers || IsManagerMod(stringMember2))) { object member2 = GetMember(item3, "LinkedPage"); string text = ((member2 != null) ? "BoneMenu app • open controls" : DescribeBoneMenuElement(item3)); hashSet.Add(NormalizeCodeModName(stringMember2)); if (_codeModQuery.Length <= 0 || stringMember2.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || text.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase)) { _codeModItems.Add(new CodeModSnapshot(stringMember2, text, member2, item3)); num2++; } } } } switch (_codeModCatalogMode) { case CodeModCatalogMode.All: case CodeModCatalogMode.Managers: case CodeModCatalogMode.Loaded: flag = true; break; default: flag = false; break; } if (flag) { RefreshLoadedCodeModCache(); } switch (_codeModCatalogMode) { case CodeModCatalogMode.All: case CodeModCatalogMode.Managers: case CodeModCatalogMode.Loaded: flag = true; break; default: flag = false; break; } if (flag) { foreach (LoadedCodeModSnapshot loadedCodeMod in _loadedCodeMods) { if (!loadedCodeMod.Name.Contains("WristHub", StringComparison.OrdinalIgnoreCase) && (_codeModCatalogMode != CodeModCatalogMode.Managers || IsManagerMod(loadedCodeMod.Name))) { string normalized = NormalizeCodeModName(loadedCodeMod.Name); if (!hashSet.Any((string represented) => CodeModNamesMatch(represented, normalized)) && (_codeModQuery.Length <= 0 || loadedCodeMod.Name.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase) || loadedCodeMod.Author.Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase))) { string text2 = (string.IsNullOrWhiteSpace(loadedCodeMod.Version) ? string.Empty : (" • v" + loadedCodeMod.Version)); _codeModItems.Add(new CodeModSnapshot(loadedCodeMod.Name, "Loaded" + text2 + " • no wrist controls", null)); } } } } codeModCatalogMode = _codeModCatalogMode; flag = ((codeModCatalogMode == CodeModCatalogMode.All || codeModCatalogMode == CodeModCatalogMode.BoneMenu) ? true : false); if (flag && (_codeModQuery.Length == 0 || "OPEN FULL BONEMENU".Contains(_codeModQuery, StringComparison.OrdinalIgnoreCase))) { _codeModItems.Add(new CodeModSnapshot("OPEN FULL BONEMENU", "Fallback for custom controls", Page.Root)); } string text3 = $"{num}|{num2}|{_loadedCodeMods.Count}"; if (!text3.Equals(_lastCodeModCatalogSignature, StringComparison.Ordinal)) { _lastCodeModCatalogSignature = text3; _log.Msg($"WristHub Mod Apps catalog refreshed: {num} native, {num2} BoneMenu, {_loadedCodeMods.Count} loaded code mods."); } } if (_codeModItems.Count == 0) { _codeModItems.Add(new CodeModSnapshot((_activeSdkApp == null) ? ("No " + _codeModCatalogMode.ToString().ToLowerInvariant() + " apps found") : "This page is empty", (_activeSdkApp == null) ? "Developers publish installed apps with WristHub.SDK" : "No controls match this search", null)); } RefreshCodeModRows(); } catch (Exception exception2) { ThrottledOsError("codemods-discovery", exception2); } } private void RefreshCodeModRows() { //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) int num = Math.Max(1, (int)Math.Ceiling((double)_codeModItems.Count / 4.0)); _codeModPageIndex = Math.Clamp(_codeModPageIndex, 0, num - 1); if ((Object)(object)_codeModTitle != (Object)null) { TMP_Text codeModTitle = _codeModTitle; WristHubPage? activeSdkPage = _activeSdkPage; string text = ((activeSdkPage != null) ? activeSdkPage.Title : null); if (text == null) { string text2 = ((!_showLegacyBoneMenu) ? (_codeModCatalogMode switch { CodeModCatalogMode.Community => "COMMUNITY", CodeModCatalogMode.Managers => "MOD MANAGERS", CodeModCatalogMode.BoneMenu => "BONEMENU APPS", CodeModCatalogMode.Loaded => "LOADED MODS", _ => "MOD APPS", }) : ((_activeBoneMenuPage == null) ? "LEGACY BONEMENU" : GetStringMember(_activeBoneMenuPage, "Name", "MOD CONTROLS"))); text = text2; } codeModTitle.text = text; } if (_codeModCommunityButton != null) { bool active = _activeSdkApp == null && !_showLegacyBoneMenu; _codeModCommunityButton.Root.SetActive(active); TMP_Text codeModTitle = _codeModCommunityButton.Label; codeModTitle.text = _codeModCatalogMode switch { CodeModCatalogMode.All => "COMMUNITY", CodeModCatalogMode.Community => "MANAGERS", CodeModCatalogMode.Managers => "BONEMENU", CodeModCatalogMode.BoneMenu => "LOADED", _ => "ALL APPS", }; } if ((Object)(object)_codeModPosition != (Object)null) { _codeModPosition.text = $"{_codeModPageIndex + 1} / {num}"; } for (int i = 0; i < _codeModRows.Count; i++) { OsControlRow osControlRow = _codeModRows[i]; int num2 = _codeModPageIndex * 4 + i; if (num2 >= _codeModItems.Count) { osControlRow.Main.Root.SetActive(false); osControlRow.Minus.Root.SetActive(false); osControlRow.Plus.Root.SetActive(false); osControlRow.Source = null; continue; } CodeModSnapshot codeModSnapshot = (CodeModSnapshot)(osControlRow.Source = _codeModItems[num2]); osControlRow.Main.Root.SetActive(true); osControlRow.Main.Label.text = codeModSnapshot.Name; osControlRow.Detail.text = codeModSnapshot.Detail; Image panel = osControlRow.Main.Panel; object? element = codeModSnapshot.Element; WristHubControl val = (WristHubControl)((element is WristHubControl) ? element : null); ((Graphic)panel).color = ((val != null) ? SdkControlColor(val) : ((codeModSnapshot.Page is WristHubApp) ? DimCyan : Surface)); object element2 = codeModSnapshot.Element; bool flag = ((element2 is WristHubSlider || element2 is WristHubChoice || element2 is WristHubColorInput) ? true : false); bool active2 = flag || codeModSnapshot.Element is ReflectedManagerControl { Adjustable: not false } || IsBoneMenuElement(codeModSnapshot.Element, "IntElement") || IsBoneMenuElement(codeModSnapshot.Element, "FloatElement"); osControlRow.Minus.Root.SetActive(active2); osControlRow.Plus.Root.SetActive(active2); } } private void MoveCodeModPage(int direction) { int num = Math.Max(1, (int)Math.Ceiling((double)_codeModItems.Count / 4.0)); _codeModPageIndex = (_codeModPageIndex + direction + num) % num; RefreshCodeModRows(); } private void ActivateCodeModRow(int slot) { if (slot < 0 || slot >= _codeModRows.Count || !(_codeModRows[slot].Source is CodeModSnapshot codeModSnapshot)) { return; } try { object? page = codeModSnapshot.Page; WristHubApp val = (WristHubApp)((page is WristHubApp) ? page : null); if (val != null) { OpenRegisteredSdkApp(val.Id); return; } object? page2 = codeModSnapshot.Page; WristHubPage val2 = (WristHubPage)((page2 is WristHubPage) ? page2 : null); if (val2 != null) { _activeSdkPage = val2; _codeModPageIndex = 0; RefreshCodeMods(force: true); } else if (!_showLegacyBoneMenu && codeModSnapshot.Page == Page.Root) { OpenNativeBoneMenuPage(Page.Root); } else if (codeModSnapshot.Page != null) { object? page3 = codeModSnapshot.Page; Page val3 = (Page)((page3 is Page) ? page3 : null); if (val3 != null && (IsManagerMod(GetStringMember(val3, "Name", string.Empty)) || SnapshotBoneMenuElements(val3).Count == 0)) { OpenNativeBoneMenuPage(val3); return; } _showLegacyBoneMenu = true; _activeBoneMenuPage = codeModSnapshot.Page; _codeModPageIndex = 0; RefreshCodeMods(force: true); } else { if (codeModSnapshot.Element == null) { return; } object? element = codeModSnapshot.Element; WristHubControl val4 = (WristHubControl)((element is WristHubControl) ? element : null); if (val4 != null) { ActivateSdkControl(val4); RefreshCodeMods(force: true); } else if (codeModSnapshot.Element is ReflectedManagerControl reflectedManagerControl) { reflectedManagerControl.Activate(); RefreshCodeMods(force: true); } else if (!IsBoneMenuElement(codeModSnapshot.Element, "IntElement") && !IsBoneMenuElement(codeModSnapshot.Element, "FloatElement")) { if (IsBoneMenuElement(codeModSnapshot.Element, "EnumElement")) { Invoke(codeModSnapshot.Element, "GetNext"); } else if (IsBoneMenuElement(codeModSnapshot.Element, "StringElement")) { OpenCodeModStringKeyboard(codeModSnapshot.Element); } else if (HasMethod(codeModSnapshot.Element, "OnElementSelected")) { Invoke(codeModSnapshot.Element, "OnElementSelected"); } else { OpenBoneMenuFallback(); } RefreshCodeMods(force: true); } } } catch (Exception exception) { ThrottledOsError("codemods-control", exception); } } private void AdjustCodeModRow(int slot, int direction) { if (slot < 0 || slot >= _codeModRows.Count || !(_codeModRows[slot].Source is CodeModSnapshot { Element: not null } codeModSnapshot)) { return; } try { object? element = codeModSnapshot.Element; WristHubSlider val = (WristHubSlider)((element is WristHubSlider) ? element : null); if (val != null) { val.Adjust(direction); } else { object? element2 = codeModSnapshot.Element; WristHubChoice val2 = (WristHubChoice)((element2 is WristHubChoice) ? element2 : null); if (val2 != null) { val2.Adjust(direction); } else { object? element3 = codeModSnapshot.Element; WristHubColorInput val3 = (WristHubColorInput)((element3 is WristHubColorInput) ? element3 : null); if (val3 != null) { val3.Adjust(direction); } else if (codeModSnapshot.Element is ReflectedManagerControl reflectedManagerControl) { reflectedManagerControl.Adjust(direction); } else { Invoke(codeModSnapshot.Element, (direction < 0) ? "Decrement" : "Increment"); } } } RefreshCodeMods(force: true); } catch (Exception exception) { ThrottledOsError("codemods-adjust", exception); } } private void OpenBoneMenuFallback() { object? activeBoneMenuPage = _activeBoneMenuPage; Page val = (Page)((activeBoneMenuPage is Page) ? activeBoneMenuPage : null); if (val != null) { OpenNativeBoneMenuPage(val); } } private void OpenNativeBoneMenuPage(Page page) { MelonCoroutines.Start(OpenNativeBoneMenuPageRoutine(page)); } private IEnumerator OpenNativeBoneMenuPageRoutine(Page page) { yield return null; if (!NativeMenuHostBridge.TryOpenPreferences(_preferences.UseLeftWrist, out string error)) { _log.Warning("WristHub could not open the custom manager UI: " + error); if ((Object)(object)_codeModTitle != (Object)null) { _codeModTitle.text = "NATIVE MENU NOT READY"; } yield break; } try { Type? type = typeof(Menu).Assembly.GetType("BoneLib.BoneMenu.MenuBootstrap"); BindingFlags bindingAttr = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; object obj = type?.GetField("panelView", bindingAttr)?.GetValue(null); object? obj2 = type?.GetField("background", bindingAttr)?.GetValue(null); GameObject val = (GameObject)((obj2 is GameObject) ? obj2 : null); MethodInfo methodInfo = obj?.GetType().GetMethod("PAGESELECT", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(int) }, null); if (obj == null || methodInfo == null) { throw new InvalidOperationException("BoneMenu visual host is not ready"); } methodInfo.Invoke(obj, new object[1] { 11 }); if ((Object)(object)val != (Object)null) { val.SetActive(false); } Menu.OpenPage(page); MelonCoroutines.Start(NativeMenuHostBridge.RecenterInFrontRoutine()); BeginClose(immediate: true); _log.Msg("WristHub opened a custom mod manager in BoneMenu's supported visual host."); } catch (Exception ex) { _log.Warning("WristHub could not select the custom manager page: " + ex.Message); if ((Object)(object)_codeModTitle != (Object)null) { _codeModTitle.text = "MANAGER PAGE FAILED"; } } } private void TickMiniMap() { //IL_00da: 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_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_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_00b7: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_014b: 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_0165: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: 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_0250: 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_0250: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.Head == (Object)null || !TryGetCompassWorldYaw(out var yaw)) { return; } int num = Mathf.RoundToInt(yaw) % 360; if (num != _lastMiniMapDegree) { _lastMiniMapDegree = num; if ((Object)(object)_miniMapHeading != (Object)null) { _miniMapHeading.text = $"{MiniMapMath.Cardinal(yaw)} • {num:000}°"; } } if (_miniMapScanOriginValid) { Vector3 val = Vector3.ProjectOnPlane(Player.Head.position - _miniMapScanOrigin, Vector3.up); if (!(((Vector3)(ref val)).magnitude > (float)_preferences.MiniMapRange * 0.3f)) { goto IL_00e4; } } ResetMiniMapScan(Player.Head.position); goto IL_00e4; IL_00e4: TickMiniMapSceneCapture(); float num2 = (((int)_preferences.MiniMapOrientation == 0) ? yaw : 0f); if ((Object)(object)_miniMapGeometryRoot != (Object)null) { ((Transform)_miniMapGeometryRoot).localRotation = Quaternion.Euler(0f, 0f, num2); if (_miniMapCaptureValid) { Vector3 val2 = Player.Head.position - _miniMapCaptureCenter; Vector2 vector = MiniMapMath.Project(new Vector2(val2.x, val2.z), yaw, _preferences.MiniMapOrientation, _preferences.MiniMapRange); _miniMapGeometryRoot.anchoredPosition = new Vector2((0f - vector.X) * 74f, (0f - vector.Y) * 74f); } else { _miniMapGeometryRoot.anchoredPosition = Vector2.zero; } } if ((Object)(object)_miniMapBearingRoot != (Object)null) { ((Transform)_miniMapBearingRoot).localRotation = Quaternion.Euler(0f, 0f, num2); } if (Time.unscaledTime >= _nextMiniMapPeerRefresh) { _nextMiniMapPeerRefresh = Time.unscaledTime + (_constrainedRendering ? 0.1f : 0.05f); RefreshMiniMapPeers(yaw); RefreshMiniMapPortalMarkers(yaw); } TickMiniMapPeerVisuals(yaw); bool constrainedRendering = _constrainedRendering; BoneHubForearmProjection? hologramProjection = _hologramProjection; GeometryScanBudget budget = GeometryScanBudget.Resolve(constrainedRendering, (HoloPerformanceTier)((hologramProjection == null) ? (_constrainedRendering ? 1 : 0) : ((int)hologramProjection.PerformanceTier))); RefreshMiniMapGeometry(yaw, budget); } private void TickMiniMapSceneCapture() { //IL_002e: 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_0040: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00dd: 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_00fb: 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_0116: 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) if ((Object)(object)_miniMapCaptureCamera == (Object)null || (Object)(object)Player.Head == (Object)null) { return; } ((Behaviour)_miniMapCaptureCamera).enabled = false; float num = (float)_preferences.MiniMapRange; Vector3 position = Player.Head.position; Vector3 val = Vector3.ProjectOnPlane(position - _miniMapCaptureCenter, Vector3.up); float magnitude = ((Vector3)(ref val)).magnitude; float num2 = Mathf.Max(2f, num * 0.2f); if (_miniMapCaptureValid && magnitude < num2 && Mathf.Abs(_miniMapCaptureCamera.orthographicSize - num) < 0.01f) { return; } float num3 = Mathf.Max(1.5f, num * 0.12f); float num4 = Mathf.Round(position.x / num3) * num3; float num5 = Mathf.Round(position.z / num3) * num3; float num6 = Mathf.Max(_miniMapReferenceFloorY + 0.6f, position.y + 0.12f); _miniMapPendingCaptureCenter = new Vector3(num4, position.y, num5); ((Component)_miniMapCaptureCamera).transform.SetPositionAndRotation(new Vector3(num4, num6, num5), Quaternion.Euler(90f, 0f, 0f)); _miniMapCaptureCamera.orthographicSize = num; _miniMapCaptureCamera.farClipPlane = Mathf.Max(5f, num6 - _miniMapReferenceFloorY + 4f); try { SuppressMiniMapPlayerRenderers(); _miniMapCaptureCamera.Render(); CompleteMiniMapCapture(); } finally { RestoreMiniMapPlayerRenderers(); } } private void CompleteMiniMapCapture() { //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_00b5: 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) if ((Object)(object)_miniMapCaptureCamera == (Object)null) { return; } ((Behaviour)_miniMapCaptureCamera).enabled = false; RenderTexture targetTexture = _miniMapCaptureCamera.targetTexture; if (!((Object)(object)targetTexture == (Object)null) && !((Object)(object)_miniMapSceneImage == (Object)null) && !((Object)(object)_miniMapCaptureTexture == (Object)null)) { RenderTexture miniMapCaptureTexture = _miniMapCaptureTexture; _miniMapCaptureTexture = targetTexture; _miniMapCaptureBackTexture = miniMapCaptureTexture; _miniMapSceneImage.texture = (Texture)(object)_miniMapCaptureTexture; _miniMapCaptureCamera.targetTexture = _miniMapCaptureBackTexture; _miniMapCaptureCenter = _miniMapPendingCaptureCenter; _miniMapCaptureValid = true; if ((Object)(object)Player.Head != (Object)null) { ResetMiniMapScan(new Vector3(_miniMapCaptureCenter.x, Player.Head.position.y, _miniMapCaptureCenter.z)); } } } private void ResetMiniMapScan(Vector3 center) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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) _miniMapReferenceFloorY = ResolveMiniMapFloorY(center); _miniMapScanOrigin = new Vector3(center.x, _miniMapReferenceFloorY, center.z); _miniMapScanOriginValid = true; _miniMapRasterCursor = 0; _miniMapRasterSamplesRemaining = 1024; ClearMiniMapRaster(); } private float ResolveMiniMapFloorY(Vector3 center) { //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_000b: 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_0037: 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) int count = Physics.RaycastNonAlloc(center + Vector3.up, Vector3.down, Il2CppStructArray.op_Implicit(_miniMapHits), 8f, -5, (QueryTriggerInteraction)1); if (TrySelectMiniMapHit(count, requireFloor: true, out var selected) && float.IsFinite(((RaycastHit)(ref selected)).point.y)) { return ((RaycastHit)(ref selected)).point.y; } return center.y - CurrentPlayerHeight() * 0.88f; } private void RefreshMiniMapGeometry(float heading, GeometryScanBudget budget) { //IL_0027: 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: Invalid comparison between Unknown and I4 //IL_00f4: 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_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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0131: 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_0188: 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_0174: Unknown result type (might be due to invalid IL or missing references) if (!((GeometryScanBudget)(ref budget)).Enabled || (Object)(object)_miniMapLayoutTexture == (Object)null || _miniMapRasterSamplesRemaining <= 0) { return; } float num = (float)_preferences.MiniMapRange; int num2; if (!_constrainedRendering) { BoneHubForearmProjection? hologramProjection = _hologramProjection; num2 = ((hologramProjection != null && (int)hologramProjection.PerformanceTier == 0) ? 3 : 2); } else { num2 = 1; } int val = num2; val = Math.Min(val, _miniMapRasterSamplesRemaining); Vector2 val2 = default(Vector2); Vector3 val3 = default(Vector3); for (int i = 0; i < val; i++) { int num3 = (_miniMapRasterCursor++ * 997 + 512) % 1024; int num4 = num3 % 32; int num5 = num3 / 32; ((Vector2)(ref val2))..ctor((float)num4 / 31f * 2f - 1f, (float)num5 / 31f * 2f - 1f); if (((Vector2)(ref val2)).sqrMagnitude > 1.02f) { SetMiniMapRasterCell(num3, 1, 0f, Vector3.up); } else { ((Vector3)(ref val3))..ctor(val2.x * num, 0f, val2.y * num); int count = Physics.RaycastNonAlloc(_miniMapScanOrigin + val3 + Vector3.up * 4.5f, Vector3.down, Il2CppStructArray.op_Implicit(_miniMapHits), 9f, -5, (QueryTriggerInteraction)1); if (TrySelectMiniMapFloorHit(count, out var selected)) { SetMiniMapRasterCell(num3, 2, ((RaycastHit)(ref selected)).point.y - _miniMapReferenceFloorY, ((RaycastHit)(ref selected)).normal); } else { SetMiniMapRasterCell(num3, 1, 0f, Vector3.up); } } _miniMapRasterSamplesRemaining--; } if (_miniMapTextureDirty && Time.unscaledTime >= _nextMiniMapTextureUpload) { _nextMiniMapTextureUpload = Time.unscaledTime + (_constrainedRendering ? 0.22f : 0.12f); _miniMapLayoutTexture.SetPixels(Il2CppStructArray.op_Implicit(_miniMapPixels)); _miniMapLayoutTexture.Apply(false, false); _miniMapTextureDirty = false; RefreshMiniMapLabels(); } } private bool TrySelectMiniMapFloorHit(int count, out RaycastHit selected) { //IL_0001: 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_0049: 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_00df: 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) selected = default(RaycastHit); bool result = false; float num = float.MaxValue; for (int i = 0; i < count && i < _miniMapHits.Length; i++) { RaycastHit val = _miniMapHits[i]; if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) && !((Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null) && !(((RaycastHit)(ref val)).normal.y <= 0.4f) && (!((Object)(object)_root != (Object)null) || !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(_root.transform)) && (!((Object)(object)Player.RigManager != (Object)null) || !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(((Component)Player.RigManager).transform))) { float num2 = Mathf.Abs(((RaycastHit)(ref val)).point.y - _miniMapReferenceFloorY); if (!(num2 >= num) && !(num2 > 4.25f)) { num = num2; selected = val; result = true; } } } return result; } private void ClearMiniMapRaster() { //IL_0026: 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) Color val = default(Color); ((Color)(ref val))..ctor(0f, 0f, 0f, 0f); for (int i = 0; i < _miniMapPixels.Length; i++) { _miniMapPixels[i] = val; _miniMapHeights[i] = 0f; _miniMapCellState[i] = 0; } _miniMapTextureDirty = true; _nextMiniMapTextureUpload = 0f; if (!((Object)(object)_miniMapLayoutTexture == (Object)null)) { _miniMapLayoutTexture.SetPixels(Il2CppStructArray.op_Implicit(_miniMapPixels)); _miniMapLayoutTexture.Apply(false, false); _miniMapTextureDirty = false; } } private void SetMiniMapRasterCell(int index, byte state, float heightDelta, Vector3 normal) { //IL_0024: 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_0050: 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_0079: Unknown result type (might be due to invalid IL or missing references) if (index >= 0 && index < _miniMapPixels.Length) { _miniMapCellState[index] = state; _miniMapHeights[index] = heightDelta; RefreshMiniMapRasterColor(index, normal); int num = index % 32; int num2 = index / 32; if (num > 0) { RefreshMiniMapRasterColor(index - 1, Vector3.up); } if (num + 1 < 32) { RefreshMiniMapRasterColor(index + 1, Vector3.up); } if (num2 > 0) { RefreshMiniMapRasterColor(index - 32, Vector3.up); } if (num2 + 1 < 32) { RefreshMiniMapRasterColor(index + 32, Vector3.up); } _miniMapTextureDirty = true; } } private void RefreshMiniMapRasterColor(int index, Vector3 normal) { //IL_0027: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00e3: 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_0142: 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_0149: 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_0197: 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_0150: Invalid comparison between Unknown and I4 //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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) switch (_miniMapCellState[index]) { case 0: _miniMapPixels[index] = new Color(0f, 0f, 0f, 0f); return; case 1: _miniMapPixels[index] = new Color(0.006f, 0.022f, 0.04f, 0.06f); return; } float num = _miniMapHeights[index]; int num2 = index % 32; int num3 = index / 32; if ((num2 > 0 && _miniMapCellState[index - 1] == 1) || (num2 + 1 < 32 && _miniMapCellState[index + 1] == 1) || (num3 > 0 && _miniMapCellState[index - 32] == 1) || (num3 + 1 < 32 && _miniMapCellState[index + 32] == 1)) { _miniMapPixels[index] = new Color(0.12f, 0.82f, 1f, 0.92f); return; } if (normal.y < 0.78f) { _miniMapPixels[index] = new Color(1f, 0.48f, 0.1f, 0.46f); return; } float num4 = ((((num2 + num3) & 1) == 0) ? 1f : 0.88f); Color[] miniMapPixels = _miniMapPixels; MiniMapAltitudeBand val = MiniMapMath.AltitudeBand(num, 0.75f); Color val2 = (((int)val == 0) ? new Color(0.04f, 0.24f * num4, 0.56f * num4, 0.28f) : (((int)val != 2) ? new Color(0.035f, 0.48f * num4, 0.5f * num4, 0.1f) : new Color(0.56f * num4, 0.2f * num4, 0.92f * num4, 0.32f))); miniMapPixels[index] = val2; } private bool TrySelectMiniMapHit(int count, bool requireFloor, out RaycastHit selected) { //IL_0001: 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_00a2: 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_00c7: Unknown result type (might be due to invalid IL or missing references) selected = default(RaycastHit); bool result = false; float num = float.MaxValue; for (int i = 0; i < count && i < _miniMapHits.Length; i++) { RaycastHit val = _miniMapHits[i]; if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) && !((Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null) && (!((Object)(object)_root != (Object)null) || !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(_root.transform)) && (!((Object)(object)Player.RigManager != (Object)null) || !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(((Component)Player.RigManager).transform)) && (!requireFloor || !(((RaycastHit)(ref val)).normal.y <= 0.4f)) && !(((RaycastHit)(ref val)).distance >= num)) { num = ((RaycastHit)(ref val)).distance; selected = val; result = true; } } return result; } private void RefreshMiniMapPeers(float heading) { //IL_0108: 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_0155: Unknown result type (might be due to invalid IL or missing references) _miniMapFusion.Collect(_miniMapPeers); if (_miniMapPeers.Count != _lastMiniMapPeerCount) { _lastMiniMapPeerCount = _miniMapPeers.Count; _miniMapCaptureValid = false; _log.Msg($"WristHub Mini Map is tracking {_lastMiniMapPeerCount} valid remote Fusion pose{((_lastMiniMapPeerCount == 1) ? string.Empty : "s")}."); } int num = Math.Min(_miniMapPeers.Count, _miniMapPeerVisuals.Count); for (int i = 0; i < num; i++) { FusionMiniMapPeer fusionMiniMapPeer = _miniMapPeers[i]; MiniMapPeerVisual miniMapPeerVisual = FindMiniMapPeerVisual(fusionMiniMapPeer.Id); if (miniMapPeerVisual != null) { miniMapPeerVisual.PeerId = fusionMiniMapPeer.Id; miniMapPeerVisual.Active = true; miniMapPeerVisual.TargetWorldPosition = fusionMiniMapPeer.Position; miniMapPeerVisual.TargetHeadingDegrees = fusionMiniMapPeer.HeadingDegrees; miniMapPeerVisual.Role = fusionMiniMapPeer.Role; miniMapPeerVisual.TrackingTransform = fusionMiniMapPeer.TrackingTransform; miniMapPeerVisual.LastSeenAt = Time.unscaledTime; if (!miniMapPeerVisual.HasDisplayPose) { miniMapPeerVisual.WorldPosition = fusionMiniMapPeer.Position; miniMapPeerVisual.HeadingDegrees = fusionMiniMapPeer.HeadingDegrees; miniMapPeerVisual.HasDisplayPose = true; } } } foreach (MiniMapPeerVisual miniMapPeerVisual2 in _miniMapPeerVisuals) { if (miniMapPeerVisual2.Active && !(Time.unscaledTime - miniMapPeerVisual2.LastSeenAt < 0.75f)) { ResetMiniMapPeer(miniMapPeerVisual2); } } RefreshMiniMapLabels(); } private MiniMapPeerVisual? FindMiniMapPeerVisual(int peerId) { MiniMapPeerVisual miniMapPeerVisual = null; foreach (MiniMapPeerVisual miniMapPeerVisual2 in _miniMapPeerVisuals) { if (miniMapPeerVisual2.Active && miniMapPeerVisual2.PeerId == peerId) { return miniMapPeerVisual2; } if (miniMapPeerVisual == null && !miniMapPeerVisual2.Active) { miniMapPeerVisual = miniMapPeerVisual2; } } if (miniMapPeerVisual != null) { return miniMapPeerVisual; } foreach (MiniMapPeerVisual miniMapPeerVisual3 in _miniMapPeerVisuals) { bool flag = false; foreach (FusionMiniMapPeer miniMapPeer in _miniMapPeers) { if (miniMapPeer.Id == miniMapPeerVisual3.PeerId) { flag = true; break; } } if (!flag) { return miniMapPeerVisual3; } } return null; } private void TickMiniMapPeerVisuals(float heading) { //IL_00d4: 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_00e4: 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_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) if ((Object)(object)Player.Head == (Object)null) { return; } float num = 1f - Mathf.Exp(-18f * Mathf.Min(Time.unscaledDeltaTime, 0.05f)); float num2 = 1f - Mathf.Exp(-22f * Mathf.Min(Time.unscaledDeltaTime, 0.05f)); foreach (MiniMapPeerVisual miniMapPeerVisual in _miniMapPeerVisuals) { if (!miniMapPeerVisual.Active) { continue; } Transform trackingTransform = miniMapPeerVisual.TrackingTransform; if ((Object)(object)trackingTransform != (Object)null) { miniMapPeerVisual.TargetWorldPosition = trackingTransform.position; Vector3 val = Vector3.ProjectOnPlane(trackingTransform.forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude >= 0.001f) { miniMapPeerVisual.TargetHeadingDegrees = Mathf.Atan2(val.x, val.z) * 57.29578f; } } Vector3 val2 = miniMapPeerVisual.WorldPosition - miniMapPeerVisual.TargetWorldPosition; if (((Vector3)(ref val2)).sqrMagnitude > 16f) { miniMapPeerVisual.WorldPosition = miniMapPeerVisual.TargetWorldPosition; } else { miniMapPeerVisual.WorldPosition = Vector3.Lerp(miniMapPeerVisual.WorldPosition, miniMapPeerVisual.TargetWorldPosition, num); } miniMapPeerVisual.HeadingDegrees = Mathf.LerpAngle(miniMapPeerVisual.HeadingDegrees, miniMapPeerVisual.TargetHeadingDegrees, num2); } if (!(Time.unscaledTime < _nextMiniMapOverlayRender)) { _nextMiniMapOverlayRender = Time.unscaledTime + (_constrainedRendering ? (1f / 15f) : (1f / 30f)); RenderMiniMapPeerOverlay(heading); } } private void RenderMiniMapPeerOverlay(float heading) { //IL_0066: 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) //IL_00d4: 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_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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_011b: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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: Invalid comparison between Unknown and I4 //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Invalid comparison between Unknown and I4 if ((Object)(object)Player.Head == (Object)null || (Object)(object)_miniMapViewport == (Object)null) { return; } if (_miniMapPeerOverlay == null || !_miniMapPeerOverlay.IsReady) { _miniMapPeerOverlay?.Dispose(); _miniMapPeerOverlay = new MiniMapPeerOverlay(); _miniMapPeerOverlay.Bind((Transform)(object)_miniMapViewport); } int num = 0; float rotationDegrees = (((int)_preferences.MiniMapOrientation == 0) ? 0f : (0f - heading)); _miniMapPeerOverlay.UpdatePose(num++, Vector2.Zero, rotationDegrees, ToMiniMapOverlayColor(Green), 1.05f); int num2 = 0; foreach (MiniMapPeerVisual miniMapPeerVisual in _miniMapPeerVisuals) { if (miniMapPeerVisual.Active && miniMapPeerVisual.HasDisplayPose) { Vector3 val = miniMapPeerVisual.WorldPosition - Player.Head.position; Vector2 normalizedPosition = MiniMapMath.Project(new Vector2(val.x, val.z), heading, _preferences.MiniMapOrientation, _preferences.MiniMapRange); MiniMapAltitudeBand val2 = MiniMapMath.AltitudeBand(val.y, 1.5f); MiniMapOverlayColor color = MiniMapPeerColors.Resolve(miniMapPeerVisual.Role, val2); float rotationDegrees2 = MiniMapMath.MarkerRotation(miniMapPeerVisual.HeadingDegrees, heading, _preferences.MiniMapOrientation); if (_miniMapPeerOverlay.UpdatePose(num, normalizedPosition, rotationDegrees2, color, ((int)miniMapPeerVisual.Role == 2) ? 0.7f : (((int)miniMapPeerVisual.Role == 1) ? 0.66f : 0.62f))) { num++; num2++; } } } int num3 = _miniMapPeerOverlay.Render(num); _miniMapOverlayRecovering = num2 > 0 && num3 <= 0; if (_miniMapOverlayRecovering && Time.unscaledTime >= _nextMiniMapOverlayRecovery) { _nextMiniMapOverlayRecovery = Time.unscaledTime + 1f; _miniMapPeerOverlay.Dispose(); _miniMapPeerOverlay.Bind((Transform)(object)_miniMapViewport); } if (!_miniMapOverlayDiagnosticLogged) { _miniMapOverlayDiagnosticLogged = true; _log.Msg($"WristHub Mini Map overlay: {_miniMapFusion.LastDetectedCount} peers detected, {_miniMapFusion.LastValidPoseCount} valid poses, {num2} remote markers rendered; overlay ready={_miniMapPeerOverlay.IsReady}."); } RefreshMiniMapLabels(); } private static MiniMapOverlayColor ToMiniMapOverlayColor(Color color) { //IL_0000: 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_003a: 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_0074: Unknown result type (might be due to invalid IL or missing references) return new MiniMapOverlayColor((byte)Mathf.Clamp(Mathf.RoundToInt(color.r * 255f), 0, 255), (byte)Mathf.Clamp(Mathf.RoundToInt(color.g * 255f), 0, 255), (byte)Mathf.Clamp(Mathf.RoundToInt(color.b * 255f), 0, 255), (byte)Mathf.Clamp(Mathf.RoundToInt(color.a * 255f), 0, 255)); } private static void ResetMiniMapPeer(MiniMapPeerVisual visual) { //IL_001d: 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) visual.Active = false; visual.PeerId = -1; visual.TrackingTransform = null; visual.HasDisplayPose = false; visual.TargetWorldPosition = Vector3.zero; visual.WorldPosition = Vector3.zero; visual.TargetHeadingDegrees = 0f; visual.HeadingDegrees = 0f; visual.Role = (MiniMapPeerRole)0; } private void RefreshMiniMapPortalMarkers(float heading) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject miniMapPortalDot in _miniMapPortalDots) { miniMapPortalDot.SetActive(false); } if (!(_activePortal == (PortalLinkState)null) && !((Object)(object)Player.Head == (Object)null)) { PortalEndpoint entrance = _activePortal.Entrance; ShowMiniMapPortalMarker(0, ((PortalEndpoint)(ref entrance)).Position, heading); PortalEndpoint? exit = _activePortal.Exit; if (exit.HasValue) { PortalEndpoint valueOrDefault = exit.GetValueOrDefault(); ShowMiniMapPortalMarker(1, ((PortalEndpoint)(ref valueOrDefault)).Position, heading); } } } private void ShowMiniMapPortalMarker(int index, Vector3 position, float heading) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_005f: 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_00a9: Unknown result type (might be due to invalid IL or missing references) if (index >= 0 && index < _miniMapPortalDots.Count && !((Object)(object)Player.Head == (Object)null)) { Vector3 val = new Vector3(position.X, position.Y, position.Z) - Player.Head.position; Vector2 vector = MiniMapMath.Project(new Vector2(val.x, val.z), heading, _preferences.MiniMapOrientation, _preferences.MiniMapRange); Transform transform = _miniMapPortalDots[index].transform; RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val2 != null) { val2.anchoredPosition = new Vector2(vector.X * 74f, vector.Y * 74f); _miniMapPortalDots[index].SetActive(true); } } } private void ToggleMiniMapMode() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) _preferences.MiniMapOrientation = (MiniMapOrientation)((int)_preferences.MiniMapOrientation == 0); SavePreferences(); RefreshMiniMapLabels(); } private void AdjustMiniMapRange(int direction) { //IL_000c: 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) _preferences.MiniMapRange = MiniMapMath.StepRange(_preferences.MiniMapRange, direction); SavePreferences(); _miniMapCaptureValid = false; _miniMapScanOriginValid = false; RefreshMiniMapLabels(); } private void RefreshMiniMapLabels() { //IL_0019: 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: Expected I4, but got Unknown //IL_0122: 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_0139: Unknown result type (might be due to invalid IL or missing references) if (_miniMapModeButton != null) { _miniMapModeButton.Label.text = (((int)_preferences.MiniMapOrientation == 0) ? "TRACK UP" : "NORTH UP"); } if ((Object)(object)_miniMapRangeValue != (Object)null) { _miniMapRangeValue.text = $"{(int)_preferences.MiniMapRange} M"; } if ((Object)(object)_miniMapRangeText != (Object)null) { _miniMapRangeText.text = $"{_miniMapPeers.Count} SQUAD • {((_activePortal == (PortalLinkState)null) ? "AREA LIVE" : "PORTAL MARKED")}"; } if (!((Object)(object)_miniMapScanText != (Object)null)) { return; } if (_miniMapOverlayRecovering) { _miniMapScanText.text = "PLAYER OVERLAY RECOVERING"; ((Graphic)_miniMapScanText).color = Amber; return; } ((Graphic)_miniMapScanText).color = Cyan; BoneHubForearmProjection? hologramProjection = _hologramProjection; if (((hologramProjection != null) ? ((int)hologramProjection.PerformanceTier) : 0) == 2) { _miniMapScanText.text = "PERFORMANCE MODE • PLAYERS LIVE"; } else if (_miniMapRasterSamplesRemaining > 0) { int num = 1024; int value = Mathf.Clamp(Mathf.RoundToInt((float)(num - _miniMapRasterSamplesRemaining) * 100f / (float)num), 0, 99); _miniMapScanText.text = $"MAPPING AREA {value}% • PLAYERS LIVE"; } else { _miniMapScanText.text = "COLOR MAP READY • PLAYERS LIVE"; } } private void RefreshSpawnables(bool force) { //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown GameObject? spawnablesPage = _spawnablesPage; if (spawnablesPage == null || !spawnablesPage.activeSelf || (!force && Time.unscaledTime < _nextSpawnableRefresh)) { return; } _nextSpawnableRefresh = Time.unscaledTime + 0.25f; try { List palletManifests = AssetWarehouse.Instance.GetPalletManifests(); if (_spawnableCatalog.Count == 0 || palletManifests.Count != _spawnableManifestCount) { _spawnableCatalog.Clear(); _spawnableCrates.Clear(); Enumerator enumerator = palletManifests.GetEnumerator(); while (enumerator.MoveNext()) { PalletManifest current = enumerator.Current; object obj; if (current == null) { obj = null; } else { Pallet pallet = current.Pallet; obj = ((pallet != null) ? pallet.Crates : null); } if (obj == null) { continue; } Enumerator enumerator2 = current.Pallet.Crates.GetEnumerator(); while (enumerator2.MoveNext()) { SpawnableCrate val = ((Il2CppObjectBase)enumerator2.Current).TryCast(); object obj2; if (val == null) { obj2 = null; } else { Barcode barcode = ((Scannable)val).Barcode; obj2 = ((barcode != null) ? barcode.ID : null); } string text = (string)obj2; if (!((Object)(object)val == (Object)null) && !string.IsNullOrWhiteSpace(text)) { string obj3 = ((Scannable)val).Title ?? "Unnamed spawnable"; Pallet pallet2 = ((Crate)val).Pallet; string obj4 = ((pallet2 != null) ? ((Scannable)pallet2).Title : null) ?? "Unknown pack"; Pallet pallet3 = ((Crate)val).Pallet; SpawnableEntry item = new SpawnableEntry(text, obj3, obj4, ((pallet3 != null) ? pallet3.Author : null) ?? "Unknown creator", ((Scannable)val).Description ?? string.Empty, true); _spawnableCatalog.Add(item); _spawnableCrates[text] = val; } } } _spawnableManifestCount = palletManifests.Count; } IEnumerable spawnableCatalog = _spawnableCatalog; List list = SpawnPlacementMath.Filter(_spawnableMode switch { SpawnableBrowseMode.Favorites => spawnableCatalog.Where((SpawnableEntry val2) => _preferences.FavoriteSpawnableBarcodes.Contains(val2.Barcode, StringComparer.OrdinalIgnoreCase)), SpawnableBrowseMode.Recent => spawnableCatalog.OrderBy((SpawnableEntry val2) => RecentSpawnableIndex(val2.Barcode)), SpawnableBrowseMode.Groups => spawnableCatalog.OrderBy((SpawnableEntry val2) => val2.Pack, StringComparer.OrdinalIgnoreCase).ThenBy((SpawnableEntry val2) => val2.Name, StringComparer.OrdinalIgnoreCase), _ => spawnableCatalog, }, _spawnableQuery).ToList(); if (_spawnableMode == SpawnableBrowseMode.Recent) { list = list.OrderBy((SpawnableEntry val2) => RecentSpawnableIndex(val2.Barcode)).ToList(); } else if (_spawnableMode == SpawnableBrowseMode.Groups) { list = list.OrderBy((SpawnableEntry val2) => val2.Pack, StringComparer.OrdinalIgnoreCase).ThenBy((SpawnableEntry val2) => val2.Name, StringComparer.OrdinalIgnoreCase).ToList(); } _spawnableEntries.Clear(); _spawnableEntries.AddRange(list); _spawnableIndex = ((_spawnableEntries.Count != 0) ? Math.Clamp(_spawnableIndex, 0, _spawnableEntries.Count - 1) : 0); RefreshSpawnableSelection(); } catch (Exception exception) { ThrottledOsError("spawnables-discovery", exception); } } private void MoveSpawnable(int direction) { if (_spawnableEntries.Count != 0) { _spawnableIndex = (_spawnableIndex + direction + _spawnableEntries.Count) % _spawnableEntries.Count; RefreshSpawnableSelection(); } } private void RefreshSpawnableSelection() { //IL_0157: Unknown result type (might be due to invalid IL or missing references) if (_spawnableEntries.Count == 0) { if ((Object)(object)_spawnableName != (Object)null) { _spawnableName.text = ((_spawnableQuery.Length == 0) ? "No spawnables found" : "No matching spawnables"); } if ((Object)(object)_spawnableDetails != (Object)null) { _spawnableDetails.text = string.Empty; } if ((Object)(object)_spawnablePosition != (Object)null) { _spawnablePosition.text = "0 / 0"; } return; } SpawnableEntry val = _spawnableEntries[_spawnableIndex]; if ((Object)(object)_spawnableName != (Object)null) { _spawnableName.text = val.Name; } if ((Object)(object)_spawnableDetails != (Object)null) { _spawnableDetails.text = val.Pack + "\nBy " + val.Creator; } if ((Object)(object)_spawnablePosition != (Object)null) { _spawnablePosition.text = $"{_spawnableIndex + 1} / {_spawnableEntries.Count}"; } if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Safe hologram preview • choose a spawn action"; ((Graphic)_spawnableStatus).color = Cyan; } if (_spawnableFavoriteButton != null) { _spawnableFavoriteButton.Label.text = (_preferences.FavoriteSpawnableBarcodes.Contains(val.Barcode, StringComparer.OrdinalIgnoreCase) ? "★" : "FAV"); } LoadSpawnableNativePreview(val); } private int RecentSpawnableIndex(string barcode) { int num = _preferences.RecentSpawnableBarcodes.FindIndex((string value) => value.Equals(barcode, StringComparison.OrdinalIgnoreCase)); if (num >= 0) { return num; } return int.MaxValue; } private void CycleSpawnableMode() { _spawnableMode = (SpawnableBrowseMode)((int)(_spawnableMode + 1) % 4); _spawnableIndex = 0; if (_spawnableModeButton != null) { TMP_Text label = _spawnableModeButton.Label; label.text = _spawnableMode switch { SpawnableBrowseMode.Groups => "GROUP", SpawnableBrowseMode.Recent => "RECENT", SpawnableBrowseMode.Favorites => "FAVS", _ => "ALL", }; } RefreshSpawnables(force: true); } private void ToggleSpawnableFavorite() { if (_spawnableEntries.Count != 0) { string barcode = _spawnableEntries[_spawnableIndex].Barcode; int num = _preferences.FavoriteSpawnableBarcodes.FindIndex((string value) => value.Equals(barcode, StringComparison.OrdinalIgnoreCase)); if (num >= 0) { _preferences.FavoriteSpawnableBarcodes.RemoveAt(num); } else { _preferences.FavoriteSpawnableBarcodes.Insert(0, barcode); } SavePreferences(); RefreshSpawnableSelection(); } } private void SpawnSelectedAhead() { //IL_0035: 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_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_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_0065: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Player.Head == (Object)null) && _spawnableEntries.Count != 0) { if (_spawnPlacementActive) { CancelSpawnPlacement(); return; } CancelSpawnDelete(); Vector3 position = Player.Head.position; Vector3 val = Vector3.ProjectOnPlane(Player.Head.forward, Vector3.up); Vector3 position2 = position + ((Vector3)(ref val)).normalized * 1.5f; BeginSpawnPlacement(position2, Quaternion.Euler(0f, Player.Head.eulerAngles.y + 180f, 0f)); } } private void SpawnSelectedInHand() { //IL_00f9: 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_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_00e7: 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_0072: 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_012e: 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_014e: 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_0151: Unknown result type (might be due to invalid IL or missing references) if (_spawnableEntries.Count == 0) { return; } Hand hand = (_preferences.UseLeftWrist ? Player.RightHand : Player.LeftHand); if ((Object)(object)hand != (Object)null) { try { if (hand.HasAttachedObject()) { if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Free your other hand first"; ((Graphic)_spawnableStatus).color = Amber; } return; } } catch { } } BoneHubFingertipProbe boneHubFingertipProbe = _fingertips.GetProbes().FirstOrDefault((BoneHubFingertipProbe value) => (Object)(object)value.Hand == (Object)(object)hand); Vector3 position = (((Object)(object)boneHubFingertipProbe.Hand != (Object)null && boneHubFingertipProbe.GripAnchorTracked) ? boneHubFingertipProbe.GripAnchorPosition : (((Object)(object)hand != (Object)null) ? ((Component)hand).transform.position : (Player.Head.position + Player.Head.forward * 0.8f))); Quaternion rotation = (((Object)(object)boneHubFingertipProbe.Hand != (Object)null && boneHubFingertipProbe.GripAnchorTracked) ? boneHubFingertipProbe.GripAnchorRotation : (((Object)(object)hand != (Object)null) ? ((Component)hand).transform.rotation : Quaternion.identity)); SpawnSelected(position, rotation, hand); } private void SpawnSelected(Vector3 position, Quaternion rotation, Hand? autoGrab = null) { //IL_00a5: 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_0072: 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_0074: Unknown result type (might be due to invalid IL or missing references) if (_spawnableEntries.Count == 0 || (Object)(object)_spawnableStatus == (Object)null) { return; } SpawnableEntry item = _spawnableEntries[_spawnableIndex]; _spawnableStatus.text = "Spawning through BONELAB…"; ((Graphic)_spawnableStatus).color = Amber; try { HelperMethods.SpawnCrate(item.Barcode, position, rotation, Vector3.one, false, (Action)delegate(GameObject spawned) { _mainThread.Enqueue(delegate { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Spawned • Fusion handles eligible peer sync"; ((Graphic)_spawnableStatus).color = Green; } RememberSpawnable(item.Barcode); if ((Object)(object)spawned != (Object)null) { _spawnedObjects.RemoveAll((GameObject value) => (Object)(object)value == (Object)null); _spawnedObjects.Add(spawned); if ((Object)(object)autoGrab != (Object)null) { _pendingGrabObject = spawned; _pendingGrabHand = autoGrab; _pendingGrabDeadline = Time.unscaledTime + 1.25f; _nextPendingGrabAttempt = Time.unscaledTime + 0.05f; } } }); }, (Action)null); } catch (Exception exception) { _spawnableStatus.text = "Spawn failed • crate may be incompatible"; ((Graphic)_spawnableStatus).color = Red; ThrottledOsError("spawnables-spawn", exception); } } private void LoadSpawnableNativePreview(SpawnableEntry item) { int generation = ++_spawnablePreviewGeneration; if ((Object)(object)_spawnableNativePreview != (Object)null) { Object.Destroy((Object)(object)_spawnableNativePreview); } _spawnableNativePreview = null; _spawnablePreviewMesh = null; if ((Object)(object)_spawnablePreview == (Object)null || !_spawnableCrates.TryGetValue(item.Barcode, out SpawnableCrate value)) { return; } foreach (Renderer componentsInChild in _spawnablePreview.GetComponentsInChildren(true)) { componentsInChild.enabled = true; } try { MarrowAssetT previewMesh = ((GameObjectCrate)value).PreviewMesh; Renderer componentInChildren = _spawnablePreview.GetComponentInChildren(true); Material material = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null); if ((MarrowAsset)(object)previewMesh == (MarrowAsset)null || (Object)(object)material == (Object)null) { return; } previewMesh.LoadAsset(Action.op_Implicit((Action)delegate(Mesh mesh) { _mainThread.Enqueue(delegate { if (!_disposed && generation == _spawnablePreviewGeneration && !((Object)(object)mesh == (Object)null) && !((Object)(object)_spawnablePreview == (Object)null)) { RenderOnlyPreviewResult renderOnlyPreviewResult = BoneHubRenderOnlyPreviewBuilder.BuildNativePreview(mesh, material, _spawnablePreview.transform, _constrainedRendering, 0f, (AvatarPreviewHeightSource)0, 0, null); if (renderOnlyPreviewResult.Valid && !((Object)(object)renderOnlyPreviewResult.Root == (Object)null)) { _spawnableNativePreview = renderOnlyPreviewResult.Root; _spawnablePreviewMesh = mesh; foreach (Renderer componentsInChild2 in _spawnablePreview.GetComponentsInChildren(true)) { if (!((Component)componentsInChild2).transform.IsChildOf(renderOnlyPreviewResult.Root.transform)) { componentsInChild2.enabled = false; } } } } }); })); } catch (Exception exception) { ThrottledOsError("spawnables-preview", exception); } } private void BeginSpawnPlacement(Vector3 position, Quaternion rotation) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0144: Unknown result type (might be due to invalid IL or missing references) CancelSpawnPlacement(); if (!((Object)(object)_root == (Object)null)) { GameObject? spawnablePreview = _spawnablePreview; object obj; if (spawnablePreview == null) { obj = null; } else { Renderer componentInChildren = spawnablePreview.GetComponentInChildren(true); obj = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null); } Material val = (Material)obj; if ((Object)(object)_spawnablePreviewMesh != (Object)null && (Object)(object)val != (Object)null) { _spawnPlacementPreview = BoneHubRenderOnlyPreviewBuilder.BuildNativePreview(_spawnablePreviewMesh, val, _root.transform, _constrainedRendering, 0f, (AvatarPreviewHeightSource)0, 0, null).Root; } if (_spawnPlacementPreview == null) { _spawnPlacementPreview = CreateSilhouette(_root.transform); } ((Object)_spawnPlacementPreview).name = "Spawn Placement Hologram"; _spawnPlacementPreview.transform.SetPositionAndRotation(position, rotation); _spawnPlacementActive = true; _spawnDeleteActive = false; _spawnTriggerHeld = true; _spawnPointerReadyAt = Time.unscaledTime + 0.18f; _spawnPlacementYaw = ((Quaternion)(ref rotation)).eulerAngles.y; EnsureSpawnPointerVisuals(Green); if (_spawnActionButton != null) { _spawnActionButton.Label.text = "CANCEL"; } if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Point with your finger • pull trigger to spawn • CANCEL exits"; ((Graphic)_spawnableStatus).color = Amber; } } } private void ToggleSpawnDelete() { //IL_0035: 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) if (_spawnDeleteActive) { CancelSpawnDelete(); return; } CancelSpawnPlacement(); _spawnDeleteActive = true; _spawnTriggerHeld = true; _spawnPointerReadyAt = Time.unscaledTime + 0.18f; EnsureSpawnPointerVisuals(Red); if (_spawnDeleteButton != null) { _spawnDeleteButton.Label.text = "CANCEL"; } if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Point at an item spawned by WristHub • pull trigger to delete"; ((Graphic)_spawnableStatus).color = Red; } } private void TickSpawnPointer() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ec: 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_00f1: 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_00f4: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_0187: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0295: 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_0265: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.Head == (Object)null) { CancelSpawnPlacement(); CancelSpawnDelete(); return; } IReadOnlyList probes = _fingertips.GetProbes(); bool preferredLeft = !_preferences.UseLeftWrist; BoneHubFingertipProbe boneHubFingertipProbe = (((Object)(object)_spawnPlacementHand == (Object)null) ? probes.FirstOrDefault((BoneHubFingertipProbe value) => value.IsLeft == preferredLeft) : probes.FirstOrDefault((BoneHubFingertipProbe value) => (Object)(object)value.Hand == (Object)(object)_spawnPlacementHand)); if ((Object)(object)boneHubFingertipProbe.Hand == (Object)null) { boneHubFingertipProbe = probes.FirstOrDefault(); } if ((Object)(object)boneHubFingertipProbe.Hand == (Object)null) { return; } _spawnPlacementHand = boneHubFingertipProbe.Hand; Vector3 position = boneHubFingertipProbe.Position; Vector3 pointingDirection = boneHubFingertipProbe.PointingDirection; Vector3 val; if (!(((Vector3)(ref pointingDirection)).sqrMagnitude > 0.001f)) { val = ((Component)boneHubFingertipProbe.Hand).transform.forward; } else { pointingDirection = boneHubFingertipProbe.PointingDirection; val = ((Vector3)(ref pointingDirection)).normalized; } Vector3 val2 = val; Vector3 val3 = position + val2 * 12f; Collider val4 = null; float num = float.MaxValue; int num2 = Physics.RaycastNonAlloc(position + val2 * 0.025f, val2, Il2CppStructArray.op_Implicit(_spawnPointerHits), 12f, -5, (QueryTriggerInteraction)1); for (int num3 = 0; num3 < num2; num3++) { RaycastHit val5 = _spawnPointerHits[num3]; if (!((Object)(object)((RaycastHit)(ref val5)).collider == (Object)null) && !(((RaycastHit)(ref val5)).distance >= num) && !IsSpawnPointerIgnored(((RaycastHit)(ref val5)).collider)) { num = ((RaycastHit)(ref val5)).distance; val3 = ((RaycastHit)(ref val5)).point; val4 = ((RaycastHit)(ref val5)).collider; } } if ((Object)(object)_spawnPointerLine != (Object)null) { _spawnPointerLine.SetPosition(0, position); _spawnPointerLine.SetPosition(1, val3); } if ((Object)(object)_spawnPointerReticle != (Object)null) { _spawnPointerReticle.transform.position = val3; } if (_spawnPlacementActive && (Object)(object)_spawnPlacementPreview != (Object)null) { _spawnPlacementPreview.transform.position = val3; _spawnPlacementPreview.transform.rotation = Quaternion.Euler(0f, _spawnPlacementYaw, 0f); } _spawnDeleteTarget = (_spawnDeleteActive ? FindSpawnedRoot(val4) : null); SetSpawnPointerColor((Color)((!_spawnDeleteActive) ? (((Object)(object)val4 != (Object)null) ? Green : Amber) : (((Object)(object)_spawnDeleteTarget != (Object)null) ? Red : new Color(0.45f, 0.18f, 0.18f, 1f)))); float num4 = 0f; try { num4 = boneHubFingertipProbe.Hand.GetIndexTriggerAxis(); } catch { } if (Time.unscaledTime < _spawnPointerReadyAt) { return; } if (_spawnTriggerHeld) { if (!SpawnPlacementMath.TriggerHeld(num4, true)) { _spawnTriggerHeld = false; } } else { if (!SpawnPlacementMath.TriggerHeld(num4, false)) { return; } _spawnTriggerHeld = true; if (_spawnDeleteActive) { if ((Object)(object)_spawnDeleteTarget != (Object)null) { DeletePointedSpawn(_spawnDeleteTarget); } else if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Aim at something you spawned with WristHub"; } } else if (_spawnPlacementActive && (Object)(object)_spawnPlacementPreview != (Object)null) { Vector3 position2 = _spawnPlacementPreview.transform.position; Quaternion rotation = _spawnPlacementPreview.transform.rotation; SpawnSelected(position2, rotation); CancelSpawnPlacement(); } } } private bool IsSpawnPointerIgnored(Collider collider) { if ((Object)(object)_root != (Object)null && ((Component)collider).transform.IsChildOf(_root.transform)) { return true; } if ((Object)(object)Player.RigManager != (Object)null && ((Component)collider).transform.IsChildOf(((Component)Player.RigManager).transform)) { return true; } return false; } private GameObject? FindSpawnedRoot(Collider? collider) { if ((Object)(object)collider == (Object)null) { return null; } _spawnedObjects.RemoveAll((GameObject value) => (Object)(object)value == (Object)null); foreach (GameObject spawnedObject in _spawnedObjects) { if ((Object)(object)((Component)collider).transform == (Object)(object)spawnedObject.transform || ((Component)collider).transform.IsChildOf(spawnedObject.transform)) { return spawnedObject; } } return null; } private void DeletePointedSpawn(GameObject target) { //IL_008b: 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) try { Poolee val = target.GetComponentInParent() ?? target.GetComponentInChildren(true); if ((Object)(object)val != (Object)null) { val.Despawn(); } else { Object.Destroy((Object)(object)target); } _spawnedObjects.Remove(target); if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Deleted"; ((Graphic)_spawnableStatus).color = Green; } } catch (Exception exception) { if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Delete failed • object is protected"; ((Graphic)_spawnableStatus).color = Red; } ThrottledOsError("spawnables-delete", exception); } } private void TickPendingAutoGrab() { //IL_005c: 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) if ((Object)(object)_pendingGrabObject == (Object)null || (Object)(object)_pendingGrabHand == (Object)null) { return; } if (Time.unscaledTime > _pendingGrabDeadline) { _pendingGrabObject = null; _pendingGrabHand = null; if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Spawned at hand • this item has no usable grip"; ((Graphic)_spawnableStatus).color = Amber; } } else { if (Time.unscaledTime < _nextPendingGrabAttempt) { return; } _nextPendingGrabAttempt = Time.unscaledTime + 0.12f; try { if (_pendingGrabHand.HasAttachedObject()) { _pendingGrabObject = null; _pendingGrabHand = null; return; } Grip componentInChildren = _pendingGrabObject.GetComponentInChildren(true); if ((Object)(object)componentInChildren == (Object)null || !((Component)componentInChildren).gameObject.activeInHierarchy) { return; } _pendingGrabHand.AttachObject(((Component)componentInChildren).gameObject); if (_pendingGrabHand.HasAttachedObject()) { if ((Object)(object)_spawnableStatus != (Object)null) { _spawnableStatus.text = "Spawned and grabbed"; ((Graphic)_spawnableStatus).color = Green; } _pendingGrabObject = null; _pendingGrabHand = null; } } catch (Exception exception) { _pendingGrabObject = null; _pendingGrabHand = null; ThrottledOsError("spawnables-auto-grab", exception); } } } private void AdjustSpawnPlacement(float yawDelta, float distanceDelta) { //IL_00cf: 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_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) //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_009a: 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) if (!_spawnPlacementActive || (Object)(object)_spawnPlacementPreview == (Object)null || (Object)(object)Player.Head == (Object)null) { return; } _spawnPlacementYaw = SpawnPlacementMath.Rotate(_spawnPlacementYaw, yawDelta); if (Math.Abs(distanceDelta) > 0.001f) { _spawnPlacementDistance = SpawnPlacementMath.ClampDistance(_spawnPlacementDistance + distanceDelta); if (_spawnPlacementDistance >= 5.99f) { _spawnPlacementDistance = 0.75f; } Transform transform = _spawnPlacementPreview.transform; Vector3 position = Player.Head.position; Vector3 val = Vector3.ProjectOnPlane(Player.Head.forward, Vector3.up); transform.position = position + ((Vector3)(ref val)).normalized * _spawnPlacementDistance; } _spawnPlacementPreview.transform.rotation = Quaternion.Euler(0f, _spawnPlacementYaw, 0f); } private void CancelSpawnPlacement() { if ((Object)(object)_spawnPlacementPreview != (Object)null) { Object.Destroy((Object)(object)_spawnPlacementPreview); } _spawnPlacementPreview = null; _spawnPlacementActive = false; _spawnPlacementHand = null; if (_spawnActionButton != null) { _spawnActionButton.Label.text = "POINT"; } HideSpawnPointerIfIdle(); } private void CancelSpawnDelete() { _spawnDeleteActive = false; _spawnDeleteTarget = null; _spawnPlacementHand = null; if (_spawnDeleteButton != null) { _spawnDeleteButton.Label.text = "DELETE"; } HideSpawnPointerIfIdle(); } private void EnsureSpawnPointerVisuals(Color color) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0200: 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) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_0072: Expected O, but got Unknown if ((Object)(object)_root == (Object)null) { return; } if ((Object)(object)_spawnPointerMaterial == (Object)null) { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Transparent") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Standard"); if ((Object)(object)val != (Object)null) { _spawnPointerMaterial = new Material(val) { name = "WristHub Spawn Pointer" }; } } if ((Object)(object)_spawnPointerLine == (Object)null) { GameObject val2 = new GameObject("WristHub Finger Spawn Ray"); val2.transform.SetParent(_root.transform, true); _spawnPointerLine = val2.AddComponent(); _spawnPointerLine.positionCount = 2; _spawnPointerLine.useWorldSpace = true; float num = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()) * _preferences.WatchScale; _spawnPointerLine.widthMultiplier = 0.006f * num; _spawnPointerLine.numCapVertices = 4; ((Renderer)_spawnPointerLine).sharedMaterial = _spawnPointerMaterial; } if ((Object)(object)_spawnPointerReticle == (Object)null) { _spawnPointerReticle = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)_spawnPointerReticle).name = "WristHub Spawn Pointer Target"; _spawnPointerReticle.transform.SetParent(_root.transform, true); float num2 = AvatarUiScaleMath.ResolveMenuScale(CurrentPlayerHeight()) * _preferences.WatchScale; _spawnPointerReticle.transform.localScale = Vector3.one * 0.025f * num2; Collider component = _spawnPointerReticle.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } _spawnPointerRenderer = _spawnPointerReticle.GetComponent(); if ((Object)(object)_spawnPointerRenderer != (Object)null) { _spawnPointerRenderer.sharedMaterial = _spawnPointerMaterial; } } ((Component)_spawnPointerLine).gameObject.SetActive(true); _spawnPointerReticle.SetActive(true); SetSpawnPointerColor(color); } private void SetSpawnPointerColor(Color color) { //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) //IL_0022: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown if ((Object)(object)_spawnPointerLine != (Object)null) { LineRenderer? spawnPointerLine = _spawnPointerLine; Color startColor = (_spawnPointerLine.endColor = color); spawnPointerLine.startColor = startColor; } if ((Object)(object)_spawnPointerRenderer != (Object)null) { if (_spawnPointerBlock == null) { _spawnPointerBlock = new MaterialPropertyBlock(); } _spawnPointerRenderer.GetPropertyBlock(_spawnPointerBlock); _spawnPointerBlock.SetColor("_Color", color); _spawnPointerRenderer.SetPropertyBlock(_spawnPointerBlock); } } private void HideSpawnPointerIfIdle() { if (!_spawnPlacementActive && !_spawnDeleteActive) { if ((Object)(object)_spawnPointerLine != (Object)null) { ((Component)_spawnPointerLine).gameObject.SetActive(false); } GameObject? spawnPointerReticle = _spawnPointerReticle; if (spawnPointerReticle != null) { spawnPointerReticle.SetActive(false); } } } private void RememberSpawnable(string barcode) { _preferences.RecentSpawnableBarcodes.RemoveAll((string value) => value.Equals(barcode, StringComparison.OrdinalIgnoreCase)); _preferences.RecentSpawnableBarcodes.Insert(0, barcode); if (_preferences.RecentSpawnableBarcodes.Count > 64) { _preferences.RecentSpawnableBarcodes.RemoveRange(64, _preferences.RecentSpawnableBarcodes.Count - 64); } SavePreferences(); } private void OpenCodeModKeyboard() { _wristKeyboardPurpose = WristKeyboardPurpose.CodeMods; OpenWristOsKeyboard(_codeModQuery, "SEARCH CODE MODS"); } private void OpenSpawnableKeyboard() { _wristKeyboardPurpose = WristKeyboardPurpose.Spawnables; OpenWristOsKeyboard(_spawnableQuery, "SEARCH SPAWNABLES"); } private void OpenCodeModStringKeyboard(object element) { _activeCodeModStringElement = element; _wristKeyboardPurpose = WristKeyboardPurpose.CodeModString; OpenWristOsKeyboard(GetStringMember(element, "Value", string.Empty), "EDIT MOD SETTING"); } private void OpenSdkTextKeyboard(WristHubTextInput control) { _activeSdkText = control; _wristKeyboardPurpose = WristKeyboardPurpose.SdkText; OpenWristOsKeyboard(control.Value, "EDIT APP SETTING"); } private void ApplyCodeModString(string value) { object activeCodeModStringElement = _activeCodeModStringElement; _activeCodeModStringElement = null; if (activeCodeModStringElement == null) { return; } try { PropertyInfo property = activeCodeModStringElement.GetType().GetProperty("Value", BindingFlags.Instance | BindingFlags.Public); if ((object)property != null && property.CanWrite) { property.SetValue(activeCodeModStringElement, value); } if (HasMethod(activeCodeModStringElement, "OnElementSelected")) { Invoke(activeCodeModStringElement, "OnElementSelected"); } } catch (Exception exception) { ThrottledOsError("codemods-string", exception); } } private void ApplySdkText(string value) { WristHubTextInput activeSdkText = _activeSdkText; _activeSdkText = null; if (activeSdkText == null) { return; } try { activeSdkText.Set(value); } catch (Exception exception) { WristHubApp? activeSdkApp = _activeSdkApp; ThrottledOsError("sdk-text-" + SafeSdkId((activeSdkApp != null) ? activeSdkApp.Id : null), exception); } } private void OpenWristOsKeyboard(string value, string title) { //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_006b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_browser == (Object)null) && !((Object)(object)_keyboardPage == (Object)null)) { _viewStateBeforeKeyboard = _viewState; _keyboard.Set(value); HideStandardPages(); HideWristOsAppPages(); _keyboardPage.SetActive(true); if ((Object)(object)_keyboardTitle != (Object)null) { _keyboardTitle.text = title; } _viewState = (AvatarBrowserViewState)14; UpdatePresentationMode(); RefreshKeyboardText(); RequireInputRearm(); } } private static IEnumerable GetEnumerableMember(object source, string name) { if (!(GetMember(source, name) is IEnumerable source2)) { return Array.Empty(); } return source2.Cast(); } private static object? GetMember(object source, string name) { Type type = source.GetType(); object obj = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(source); if (obj == null) { FieldInfo? field = type.GetField(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if ((object)field == null) { return null; } obj = field.GetValue(source); } return obj; } private static string GetStringMember(object source, string name, string fallback) { string text = GetMember(source, name)?.ToString(); if (text == null || text.Length <= 0) { return fallback; } return text; } private static IReadOnlyList SnapshotBoneMenuElements(object page) { List list = new List(); Queue queue = new Queue(); HashSet hashSet = new HashSet(ReferenceEqualityComparer.Instance); HashSet hashSet2 = new HashSet(ReferenceEqualityComparer.Instance); queue.Enqueue(page); while (queue.Count > 0 && hashSet.Count < 128 && list.Count < 1024) { object obj = queue.Dequeue(); if (!hashSet.Add(obj)) { continue; } foreach (object item in GetEnumerableMember(obj, "Elements")) { if (item != null && hashSet2.Add(item)) { list.Add(item); if (list.Count >= 1024) { break; } } } foreach (object item2 in GetEnumerableMember(obj, "IndexPages")) { if (item2 != null && !hashSet.Contains(item2)) { queue.Enqueue(item2); } } } return list; } private IReadOnlyList SnapshotCustomManagerControls(object page) { if (page == _managerControlCachePage && Time.unscaledTime < _managerControlCacheUntil) { return _managerControlCache; } string stringMember = GetStringMember(page, "Name", string.Empty); List result = new List(); MethodInfo populateSubscriptions; MethodInfo receiveMod; HashSet seenMods; if (stringMember.Contains("ModIo Mod Networker", StringComparison.OrdinalIgnoreCase)) { try { Assembly? assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly candidate) => candidate.GetName().Name?.Equals("ModioModNetworker", StringComparison.OrdinalIgnoreCase) ?? false); Type type = assembly?.GetType("ModIoModNetworker.Ui.NetworkerMenuController"); Type type2 = assembly?.GetType("ModioModNetworker.MainClass"); Type type3 = assembly?.GetType("ModioModNetworker.ModFileManager"); populateSubscriptions = type2?.GetMethod("PopulateSubscriptions", BindingFlags.Static | BindingFlags.Public); receiveMod = type2?.GetMethod("ReceiveSubModInfo", BindingFlags.Static | BindingFlags.Public); MethodInfo queueTrending = type3?.GetMethod("QueueTrending", BindingFlags.Static | BindingFlags.Public, null, new Type[2] { typeof(int), typeof(string) }, null); result.Add(new ReflectedManagerControl("REFRESH MOD.IO", () => "Refresh subscriptions and discover mods", delegate { populateSubscriptions?.Invoke(null, null); queueTrending?.Invoke(null, new object[2] { 0, string.Empty }); _managerControlCacheUntil = 0f; })); if (type?.GetField("settings", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) is IEnumerable enumerable) { foreach (object setting in enumerable) { if (setting == null) { continue; } string stringMember2 = GetStringMember(setting, "title", "Networker setting"); FieldInfo valueField = setting.GetType().GetField("value", BindingFlags.Instance | BindingFlags.Public); if (valueField?.FieldType == typeof(bool)) { Delegate callback = GetMember(setting, "onChecked") as Delegate; result.Add(new ReflectedManagerControl(stringMember2, () => (!(bool)(valueField.GetValue(setting) ?? ((object)false))) ? "OFF" : "ON", delegate { bool flag = !(bool)(valueField.GetValue(setting) ?? ((object)false)); valueField.SetValue(setting, flag); callback?.DynamicInvoke(flag); })); } else if (valueField?.FieldType == typeof(int)) { int minimum = Convert.ToInt32(GetMember(setting, "minValue") ?? ((object)0)); int maximum = Convert.ToInt32(GetMember(setting, "maxValue") ?? ((object)100)); int increment = Math.Max(1, Convert.ToInt32(GetMember(setting, "increment") ?? ((object)1))); Delegate callback2 = GetMember(setting, "onModified") as Delegate; result.Add(new ReflectedManagerControl(stringMember2, () => Convert.ToInt32(valueField.GetValue(setting) ?? ((object)0)).ToString(), delegate { }, delegate(int direction) { int num = Math.Clamp(Convert.ToInt32(valueField.GetValue(setting) ?? ((object)0)) + Math.Sign(direction) * increment, minimum, maximum); valueField.SetValue(setting, num); callback2?.DynamicInvoke(num); })); } } } seenMods = new HashSet(StringComparer.OrdinalIgnoreCase); AddModCollection(type?.GetField("totalInstalled", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as IEnumerable, "INSTALLED LIBRARY"); AddModCollection(type?.GetField("modIoRetrieved", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as IEnumerable, "MOD.IO"); } catch (Exception exception) { ThrottledOsError("networker-controls", exception); } } else if (stringMember.Contains("Thunderstore Mod Assistant", StringComparison.OrdinalIgnoreCase)) { try { Assembly? assembly2 = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly candidate) => candidate.GetName().Name?.Equals("ThunderstoreModAssistant", StringComparison.OrdinalIgnoreCase) ?? false); IDictionary dictionary = (assembly2?.GetType("ThunderstoreModAssistant.ThunderstoreParser"))?.GetField("codeMods", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) as IDictionary; MethodInfo install = (assembly2?.GetType("ThunderstoreModAssistant.Install.InstallManager"))?.GetMethods(BindingFlags.Static | BindingFlags.Public).FirstOrDefault((MethodInfo method) => method.Name == "InstallMod" && method.GetParameters().Length == 2); if (dictionary != null && install != null) { foreach (DictionaryEntry item in dictionary.Cast().Take(512)) { object info = item.Value; if (info == null) { continue; } string stringMember3 = GetStringMember(info, "name", item.Key?.ToString() ?? "Thunderstore mod"); string author = GetStringMember(info, "author", "Unknown author"); string version = GetStringMember(info, "version", string.Empty); MethodInfo installedMethod = info.GetType().GetMethod("IsInstalled", BindingFlags.Instance | BindingFlags.Public); MethodInfo updateMethod = info.GetType().GetMethod("HasUpdate", BindingFlags.Instance | BindingFlags.Public); result.Add(new ReflectedManagerControl(stringMember3, delegate { if (!Installed()) { return "AVAILABLE • " + author + " • v" + version; } return (!HasUpdate()) ? ("INSTALLED • " + author + " • v" + version) : ("UPDATE READY • " + author + " • v" + version); }, delegate { if (!Installed() || HasUpdate()) { install.Invoke(null, new object[2] { info, true }); } })); bool HasUpdate() { return Convert.ToBoolean(updateMethod?.Invoke(info, null) ?? ((object)false)); } bool Installed() { return Convert.ToBoolean(installedMethod?.Invoke(info, null) ?? ((object)false)); } } } } catch (Exception exception2) { ThrottledOsError("thunderstore-controls", exception2); } } _managerControlCachePage = page; _managerControlCache = result; _managerControlCacheUntil = Time.unscaledTime + 8f; return result; void AddModCollection(IEnumerable? source, string section) { if (source == null) { return; } foreach (object item2 in (from object value in source where value != null select value).Take(512)) { object info2 = item2; string stringMember4 = GetStringMember(info2, "numericalId", string.Empty); string stringMember5 = GetStringMember(info2, "modId", string.Empty); string text = ((stringMember4.Length > 0) ? stringMember4 : stringMember5); MethodInfo installedMethod2; MethodInfo subscribedMethod; if (text.Length != 0 && seenMods.Add(text)) { string stringMember6 = GetStringMember(info2, "modName", (stringMember5.Length > 0) ? stringMember5 : "mod.io item"); string author2 = GetStringMember(info2, "author", "Unknown author"); string version2 = GetStringMember(info2, "version", "0.0.0"); installedMethod2 = info2.GetType().GetMethod("IsInstalled", BindingFlags.Instance | BindingFlags.Public); subscribedMethod = info2.GetType().GetMethod("IsSubscribed", BindingFlags.Instance | BindingFlags.Public); result.Add(new ReflectedManagerControl(stringMember6, delegate { if (Downloading()) { return $"DOWNLOADING • {Convert.ToDouble(GetMember(info2, "modDownloadPercentage") ?? ((object)0.0)):0}%"; } return (!Installed2()) ? ((!Subscribed()) ? (section + " • " + author2 + " • touch to download") : ("SUBSCRIBED • refresh to install • " + author2)) : ("INSTALLED • " + author2 + " • v" + version2); }, delegate { if (!Installed2() && !Downloading()) { if (Subscribed()) { populateSubscriptions?.Invoke(null, null); } else { receiveMod?.Invoke(null, new object[2] { info2, true }); } } })); } bool Downloading() { return Convert.ToBoolean(GetMember(info2, "downloading") ?? ((object)false)); } bool Installed2() { return Convert.ToBoolean(installedMethod2?.Invoke(info2, null) ?? ((object)false)); } bool Subscribed() { return Convert.ToBoolean(subscribedMethod?.Invoke(info2, null) ?? ((object)false)); } } } } private void RefreshLoadedCodeModCache() { if (Time.unscaledTime < _nextLoadedCodeModScan) { return; } _nextLoadedCodeModScan = Time.unscaledTime + 10f; _loadedCodeMods.Clear(); try { if (!(typeof(MelonBase).GetProperty("RegisteredMelons", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) is IEnumerable enumerable)) { return; } HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (object item in enumerable) { try { if (item == null || !typeof(MelonMod).IsAssignableFrom(item.GetType())) { continue; } object member = GetMember(item, "Info"); if (member != null) { string text = GetStringMember(member, "Name", string.Empty).Trim(); if (text.Length != 0 && hashSet.Add(text)) { _loadedCodeMods.Add(new LoadedCodeModSnapshot(text, GetStringMember(member, "Author", "Unknown author"), GetStringMember(member, "Version", string.Empty))); } } } catch (Exception exception) { ThrottledOsError("codemod-entry", exception); } } _loadedCodeMods.Sort((LoadedCodeModSnapshot left, LoadedCodeModSnapshot right) => string.Compare(left.Name, right.Name, StringComparison.OrdinalIgnoreCase)); } catch (Exception exception2) { ThrottledOsError("codemod-catalog", exception2); } } private static string NormalizeCodeModName(string value) { return new string(value.Where(char.IsLetterOrDigit).Select(char.ToLowerInvariant).Take(96) .ToArray()); } private static bool IsManagerMod(string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } if (!value.Contains("mod.io", StringComparison.OrdinalIgnoreCase) && !value.Contains("modio", StringComparison.OrdinalIgnoreCase) && !value.Contains("thunderstore", StringComparison.OrdinalIgnoreCase) && !value.Contains("manager", StringComparison.OrdinalIgnoreCase) && !value.Contains("networker", StringComparison.OrdinalIgnoreCase) && !value.Contains("updater", StringComparison.OrdinalIgnoreCase)) { return value.Contains("downloader", StringComparison.OrdinalIgnoreCase); } return true; } private static bool CodeModNamesMatch(string left, string right) { if (!left.Equals(right, StringComparison.OrdinalIgnoreCase)) { if (left.Length >= 3 && right.Length >= 3) { if (!left.Contains(right, StringComparison.OrdinalIgnoreCase)) { return right.Contains(left, StringComparison.OrdinalIgnoreCase); } return true; } return false; } return true; } private static bool IsBoneMenuElement(object? source, string typeName) { Type type = source?.GetType(); while (type != null) { if (type.Name.Equals(typeName, StringComparison.Ordinal)) { return true; } type = type.BaseType; } return false; } private static bool HasMethod(object source, string name) { return source.GetType().GetMethod(name, BindingFlags.Instance | BindingFlags.Public) != null; } private static object? Invoke(object source, string method) { return source.GetType().GetMethod(method, BindingFlags.Instance | BindingFlags.Public)?.Invoke(source, null); } private static string DescribeBoneMenuElement(object element) { string text = GetMember(element, "Value")?.ToString(); if (IsBoneMenuElement(element, "PageLinkElement")) { return "Open controls"; } if (IsBoneMenuElement(element, "FunctionElement")) { return "Run action"; } if (IsBoneMenuElement(element, "BoolElement")) { return text ?? "Toggle"; } if (IsBoneMenuElement(element, "IntElement")) { return text ?? "Number"; } if (IsBoneMenuElement(element, "FloatElement")) { return text ?? "Decimal"; } if (IsBoneMenuElement(element, "EnumElement")) { return text ?? "Choice"; } if (IsBoneMenuElement(element, "StringElement")) { return text ?? "Text"; } return "Open in BoneMenu"; } private static string DescribeSdkControl(WristHubControl control) { //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) if (!control.Enabled) { if (!string.IsNullOrWhiteSpace(control.Description)) { return "Unavailable • " + control.Description; } return "Unavailable"; } string text; if (!(control is WristHubPageLink)) { if (!(control is WristHubAction)) { WristHubToggle val = (WristHubToggle)(object)((control is WristHubToggle) ? control : null); if (val == null) { WristHubSlider val2 = (WristHubSlider)(object)((control is WristHubSlider) ? control : null); if (val2 == null) { WristHubChoice val3 = (WristHubChoice)(object)((control is WristHubChoice) ? control : null); if (val3 == null) { WristHubTextInput val4 = (WristHubTextInput)(object)((control is WristHubTextInput) ? control : null); if (val4 == null) { WristHubColorInput val5 = (WristHubColorInput)(object)((control is WristHubColorInput) ? control : null); if (val5 == null) { WristHubLabel val6 = (WristHubLabel)(object)((control is WristHubLabel) ? control : null); text = ((val6 == null) ? control.Description : val6.Value); } else { WristHubColorValue value = val5.Value; text = ((WristHubColorValue)(ref value)).Hex; } } else { text = (string.IsNullOrEmpty(val4.Value) ? "Tap to type" : val4.Value); } } else { text = val3.Value; } } else { text = $"{val2.Value:0.##}"; } } else { text = (val.Value ? "On" : "Off"); } } else { text = "Run action"; } } else { text = "Open page"; } string text2 = text; if (!string.IsNullOrWhiteSpace(control.Description)) { return text2 + " • " + control.Description; } return text2; } private Color SdkControlColor(WristHubControl control) { //IL_0023: 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_0029: 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_0041: Expected I4, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //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_010f: 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_010e: Unknown result type (might be due to invalid IL or missing references) if (!control.Enabled) { return new Color(0.08f, 0.09f, 0.1f, 0.92f); } WristHubAccent accent = control.Accent; return (Color)((accent - 1) switch { 1 => new Color(Green.r * 0.48f, Green.g * 0.48f, Green.b * 0.48f, 0.96f), 2 => new Color(Amber.r * 0.48f, Amber.g * 0.48f, Amber.b * 0.48f, 0.96f), 3 => new Color(Red.r * 0.48f, Red.g * 0.48f, Red.b * 0.48f, 0.96f), 0 => Surface, _ => DimCyan, }); } private void ActivateSdkControl(WristHubControl control) { if (!control.Enabled) { return; } WristHubPageLink val = (WristHubPageLink)(object)((control is WristHubPageLink) ? control : null); if (val == null) { WristHubAction val2 = (WristHubAction)(object)((control is WristHubAction) ? control : null); if (val2 == null) { WristHubToggle val3 = (WristHubToggle)(object)((control is WristHubToggle) ? control : null); if (val3 == null) { WristHubChoice val4 = (WristHubChoice)(object)((control is WristHubChoice) ? control : null); if (val4 == null) { WristHubTextInput val5 = (WristHubTextInput)(object)((control is WristHubTextInput) ? control : null); if (val5 != null) { OpenSdkTextKeyboard(val5); } } else { val4.Adjust(1); } } else { val3.Toggle(); } } else { val2.Invoke(); } } else { _activeSdkPage = val.Page; _codeModPageIndex = 0; } } private void OpenRegisteredSdkApp(string appId) { WristHubApp val = ((IEnumerable)WristHubApi.GetRegisteredApps()).FirstOrDefault((Func)((WristHubApp candidate) => candidate.Id.Equals(appId, StringComparison.OrdinalIgnoreCase))); if (val != null && val.Available) { _activeSdkApp = val; _activeSdkPage = val.Root; _activeBoneMenuPage = null; _showLegacyBoneMenu = false; _optionsReturnToHub = false; _codeModPageIndex = 0; ShowCodeModsPage(); } } private static string SafeSdkId(string? value) { if (string.IsNullOrWhiteSpace(value)) { return "unknown"; } return new string(value.Where(delegate(char character) { bool flag = char.IsLetterOrDigit(character); if (!flag) { bool flag2 = ((character == '-' || character == '.' || character == '_') ? true : false); flag = flag2; } return flag; }).Take(64).ToArray()); } private void ThrottledOsError(string subsystem, Exception exception) { string text = "os-" + subsystem + "|" + exception.GetType().FullName; if (_runtimeErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { _log.Error("WristHubOS " + subsystem + " recovered (repeats suppressed): " + exception.Message); } } private void OnWristOsSceneChanged() { RemovePortal(IsFusionHost(), hideImmediately: true); _miniMapFusion.Invalidate(); _miniMapPeers.Clear(); foreach (MiniMapPeerVisual miniMapPeerVisual in _miniMapPeerVisuals) { ResetMiniMapPeer(miniMapPeerVisual); } _miniMapPeerOverlay?.Clear(); _nextMiniMapPeerRefresh = 0f; _nextMiniMapOverlayRender = 0f; _nextMiniMapOverlayRecovery = 0f; _miniMapOverlayDiagnosticLogged = false; _miniMapOverlayRecovering = false; _lastMiniMapPeerCount = -1; _miniMapScanOriginValid = false; _miniMapCaptureValid = false; if ((Object)(object)_miniMapCaptureCamera != (Object)null) { ((Behaviour)_miniMapCaptureCamera).enabled = false; } _nextSpawnableRefresh = 0f; CancelSpawnPlacement(); CancelSpawnDelete(); _spawnedObjects.Clear(); _pendingGrabObject = null; _pendingGrabHand = null; } private void ResetWristOsReferences(bool destroyOwnedObjects) { //IL_03b5: 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_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) if (_sdkHost != null) { WristHubApi.DetachHost((IWristHubHost)(object)_sdkHost); } ResetPortals(destroyOwnedObjects); RestoreMiniMapPlayerRenderers(); _spawnablePreviewGeneration++; try { if ((Object)(object)_miniMapLayoutSprite != (Object)null) { Object.Destroy((Object)(object)_miniMapLayoutSprite); } } catch { } try { if ((Object)(object)_miniMapLayoutTexture != (Object)null) { Object.Destroy((Object)(object)_miniMapLayoutTexture); } } catch { } try { if ((Object)(object)_miniMapCaptureTexture != (Object)null) { _miniMapCaptureTexture.Release(); Object.Destroy((Object)(object)_miniMapCaptureTexture); } } catch { } try { if ((Object)(object)_miniMapCaptureBackTexture != (Object)null && (Object)(object)_miniMapCaptureBackTexture != (Object)(object)_miniMapCaptureTexture) { _miniMapCaptureBackTexture.Release(); Object.Destroy((Object)(object)_miniMapCaptureBackTexture); } } catch { } try { if ((Object)(object)_miniMapCaptureObject != (Object)null) { Object.Destroy((Object)(object)_miniMapCaptureObject); } } catch { } try { _miniMapPeerOverlay?.Dispose(); } catch { } if (destroyOwnedObjects) { try { if ((Object)(object)_spawnPlacementPreview != (Object)null) { Object.Destroy((Object)(object)_spawnPlacementPreview); } } catch { } try { if ((Object)(object)_spawnableNativePreview != (Object)null) { Object.Destroy((Object)(object)_spawnableNativePreview); } } catch { } try { if ((Object)(object)_spawnPointerLine != (Object)null) { Object.Destroy((Object)(object)((Component)_spawnPointerLine).gameObject); } } catch { } try { if ((Object)(object)_spawnPointerReticle != (Object)null) { Object.Destroy((Object)(object)_spawnPointerReticle); } } catch { } try { if ((Object)(object)_spawnPointerMaterial != (Object)null) { Object.Destroy((Object)(object)_spawnPointerMaterial); } } catch { } } _codeModRows.Clear(); _codeModItems.Clear(); _loadedCodeMods.Clear(); _nextLoadedCodeModScan = 0f; _lastCodeModCatalogSignature = string.Empty; _miniMapPeerVisuals.Clear(); _miniMapPortalDots.Clear(); _spawnableEntries.Clear(); _spawnableCatalog.Clear(); _spawnedObjects.Clear(); _miniMapPeers.Clear(); _spawnableCrates.Clear(); _codeModsPage = null; _miniMapPage = null; _spawnablesPage = null; _notificationsPage = null; _osStatusText = null; _codeModTitle = null; _codeModPosition = null; _miniMapHeading = null; _miniMapRangeText = null; _miniMapScanText = null; _miniMapModeButton = null; _miniMapRangeValue = null; _spawnableName = null; _spawnableDetails = null; _spawnablePosition = null; _spawnableStatus = null; _notificationText = null; _spawnablePreview = null; _spawnableNativePreview = null; _spawnPlacementPreview = null; _spawnPointerLine = null; _spawnPointerReticle = null; _spawnPointerMaterial = null; _spawnPointerBlock = null; _spawnPointerRenderer = null; _spawnActionButton = null; _spawnableModeButton = null; _spawnableFavoriteButton = null; _spawnDeleteButton = null; _spawnablePreviewMesh = null; _miniMapPeerOverlay = null; _miniMapViewport = null; _miniMapGeometryRoot = null; _miniMapLayoutImage = null; _miniMapLayoutSprite = null; _miniMapLayoutTexture = null; _miniMapSceneImage = null; _miniMapCaptureCamera = null; _miniMapCaptureTexture = null; _miniMapCaptureBackTexture = null; _miniMapCaptureObject = null; _miniMapMarkerRoot = null; _miniMapBearingRoot = null; _nextMiniMapPeerRefresh = 0f; _nextMiniMapOverlayRender = 0f; _nextMiniMapOverlayRecovery = 0f; _miniMapOverlayDiagnosticLogged = false; _miniMapOverlayRecovering = false; _miniMapRasterCursor = 0; _miniMapRasterSamplesRemaining = 0; _miniMapTextureDirty = false; _nextMiniMapTextureUpload = 0f; _miniMapCaptureValid = false; _miniMapCaptureCenter = Vector3.zero; _miniMapPendingCaptureCenter = Vector3.zero; _pendingGrabObject = null; _pendingGrabHand = null; _activeBoneMenuPage = null; _managerControlCachePage = null; _managerControlCache = Array.Empty(); _managerControlCacheUntil = 0f; _activeCodeModStringElement = null; _activeSdkApp = null; _activeSdkPage = null; _activeSdkText = null; _sdkHost = null; _showLegacyBoneMenu = false; _latestSdkNotification = string.Empty; string result; while (_sdkOpenRequests.TryDequeue(out result)) { } SdkNotification result2; while (_sdkNotifications.TryDequeue(out result2)) { } } private void DisposeWristOs() { ResetWristOsReferences(destroyOwnedObjects: false); } } internal sealed class BoneHubPortalVisual : IDisposable { private readonly bool _constrained; private GameObject? _root; private readonly List _rotors = new List(6); private readonly List _energyLayers = new List(4); private readonly List _endpoints = new List(2); private readonly List _endpointDiameters = new List(2); private readonly List _collapseScales = new List(2); private readonly List _renderers = new List(12); private readonly List _baseColors = new List(12); private readonly List _blocks = new List(4); private readonly List _ownedMeshes = new List(8); private Material? _sharedMaterial; private Material? _surfaceMaterial; private Texture2D? _liquidTexture; private Color _accent = new Color(0.05f, 0.78f, 1f, 1f); private float _openedAt; private float _collapseAt = -1f; private float _nextStableEnergyUpdateAt; public BoneHubPortalVisual(bool constrained) { //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) _constrained = constrained; } public static Material? CreateSharedMaterial() { //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_0052: Expected O, but got Unknown Shader val = Shader.Find("Legacy Shaders/Particles/Additive") ?? Shader.Find("Particles/Additive") ?? Shader.Find("Unlit/Transparent") ?? Shader.Find("Sprites/Default"); if ((Object)(object)val == (Object)null) { return null; } Material val2 = new Material(val) { name = "WristHub Portal Energy" }; if (val2.HasProperty("_MainTex")) { val2.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); } if (val2.HasProperty("_Cull")) { val2.SetInt("_Cull", 0); } if (val2.HasProperty("_ZWrite")) { val2.SetInt("_ZWrite", 0); } return val2; } public void Show(PortalLinkState state, bool reducedMotion, Color accent) { //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_0015: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) _accent = accent; EnsureVisualRoot("[WristHub] Shared Portal Link"); ConfigureEndpoint(0, state.Entrance, state.Diameter, "Entrance"); int num = 1; PortalEndpoint? exit = state.Exit; if (exit.HasValue) { PortalEndpoint valueOrDefault = exit.GetValueOrDefault(); ConfigureEndpoint(1, valueOrDefault, state.Diameter, "Exit"); num = 2; } SetEndpointCount(num); if ((Object)(object)_root != (Object)null) { _root.SetActive(true); } _openedAt = Time.unscaledTime; _collapseAt = -1f; _nextStableEnergyUpdateAt = 0f; for (int i = 0; i < num; i++) { _endpoints[i].localScale = Vector3.one * (reducedMotion ? _endpointDiameters[i] : 0.015f); } } public void ShowPreview(PortalEndpoint endpoint, float diameter, bool reducedMotion, Color accent) { //IL_0001: 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_0015: 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_007f: Unknown result type (might be due to invalid IL or missing references) _accent = accent; EnsureVisualRoot("[WristHub] Portal Entrance Preview"); ConfigureEndpoint(0, endpoint, diameter, "Pending Entrance"); SetEndpointCount(1); if ((Object)(object)_root != (Object)null) { _root.SetActive(true); } _openedAt = Time.unscaledTime; _collapseAt = -1f; _nextStableEnergyUpdateAt = 0f; _endpoints[0].localScale = Vector3.one * (reducedMotion ? diameter : 0.015f); } private void EnsureVisualRoot(string name) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)_root != (Object)null) { ((Object)_root).name = name; return; } _root = new GameObject(name); Object.DontDestroyOnLoad((Object)(object)_root); _sharedMaterial = CreateSharedMaterial(); PrepareLiquidMaterial(); } private void ConfigureEndpoint(int index, PortalEndpoint endpoint, float diameter, string name) { //IL_0003: 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_0088: Unknown result type (might be due to invalid IL or missing references) while (_endpoints.Count <= index) { BuildEndpoint(endpoint, diameter, name); } Transform obj = _endpoints[index]; ((Object)obj).name = name; obj.SetPositionAndRotation(new Vector3(((PortalEndpoint)(ref endpoint)).Position.X, ((PortalEndpoint)(ref endpoint)).Position.Y, ((PortalEndpoint)(ref endpoint)).Position.Z), new Quaternion(((PortalEndpoint)(ref endpoint)).Rotation.X, ((PortalEndpoint)(ref endpoint)).Rotation.Y, ((PortalEndpoint)(ref endpoint)).Rotation.Z, ((PortalEndpoint)(ref endpoint)).Rotation.W)); _endpointDiameters[index] = diameter; ((Component)obj).gameObject.SetActive(true); } private void SetEndpointCount(int activeCount) { for (int i = 0; i < _endpoints.Count; i++) { if ((Object)(object)_endpoints[i] != (Object)null) { ((Component)_endpoints[i]).gameObject.SetActive(i < activeCount); } } } private void BuildEndpoint(PortalEndpoint endpoint, float diameter, string name) { //IL_0010: 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_0087: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root == (Object)null)) { Transform transform = new GameObject(name).transform; transform.SetParent(_root.transform, false); transform.SetPositionAndRotation(new Vector3(((PortalEndpoint)(ref endpoint)).Position.X, ((PortalEndpoint)(ref endpoint)).Position.Y, ((PortalEndpoint)(ref endpoint)).Position.Z), new Quaternion(((PortalEndpoint)(ref endpoint)).Rotation.X, ((PortalEndpoint)(ref endpoint)).Rotation.Y, ((PortalEndpoint)(ref endpoint)).Rotation.Z, ((PortalEndpoint)(ref endpoint)).Rotation.W)); _endpoints.Add(transform); _endpointDiameters.Add(diameter); AddEnergyLayer(transform, "Turbulent Rounded Rim", BuildTubeRing(_constrained ? 28 : 44, _constrained ? 4 : 6, 0.445f, 0.045f), new Color(_accent.r, _accent.g, 1f, 0.93f), 0f, rotates: true, _sharedMaterial); AddEnergyLayer(transform, "Soft Outer Halo", BuildRing(_constrained ? 24 : 36, 0.505f, 0.012f), new Color(_accent.r, _accent.g, 1f, 0.38f), -0.008f, rotates: false, _sharedMaterial); AddEnergyLayer(transform, "Recessed Liquid Vortex", BuildVortexFunnel(_constrained ? 28 : 44, _constrained ? 3 : 5, 0.405f, 0.055f, 0.065f), new Color(0.05f, 0.38f + _accent.g * 0.28f, 0.78f, 0.7f), 0.008f, rotates: true, _surfaceMaterial); AddEnergyLayer(transform, "Liquid Surface Highlights", BuildDisc(_constrained ? 32 : 48, 0.39f), new Color(0.24f + _accent.r * 0.35f, 0.82f, 1f, 0.24f), 0.058f, rotates: true, _sharedMaterial); transform.localScale = Vector3.one * 0.015f; } } private void PrepareLiquidMaterial() { //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_008a: Expected O, but got Unknown if ((Object)(object)_sharedMaterial == (Object)null) { return; } _liquidTexture = BuildLiquidTexture(_constrained ? 64 : 96); if (_sharedMaterial.HasProperty("_MainTex")) { _sharedMaterial.SetTexture("_MainTex", (Texture)(object)_liquidTexture); } Shader val = Shader.Find("Unlit/Transparent") ?? Shader.Find("Sprites/Default"); if (!((Object)(object)val == (Object)null)) { _surfaceMaterial = new Material(val) { name = "WristHub Portal Liquid Depth" }; if (_surfaceMaterial.HasProperty("_MainTex")) { _surfaceMaterial.SetTexture("_MainTex", (Texture)(object)_liquidTexture); } if (_surfaceMaterial.HasProperty("_Cull")) { _surfaceMaterial.SetInt("_Cull", 0); } if (_surfaceMaterial.HasProperty("_ZWrite")) { _surfaceMaterial.SetInt("_ZWrite", 0); } } } private void AddEnergyLayer(Transform parent, string name, Mesh mesh, Color color, float depth, bool rotates, Material? material) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0026: 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_008e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, 0f, depth); val.AddComponent().sharedMesh = mesh; _ownedMeshes.Add(mesh); MeshRenderer val2 = val.AddComponent(); ((Renderer)val2).sharedMaterial = material ?? _sharedMaterial; MaterialPropertyBlock val3 = CreateBlock(color); ((Renderer)val2).SetPropertyBlock(val3); _blocks.Add(val3); _renderers.Add((Renderer)(object)val2); _baseColors.Add(color); _energyLayers.Add(val.transform); if (rotates) { _rotors.Add(val.transform); } } private static MaterialPropertyBlock CreateBlock(Color color) { //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_000b: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown MaterialPropertyBlock val = new MaterialPropertyBlock(); val.SetColor("_Color", color); val.SetColor("_TintColor", color); return val; } public void Tick(float now, bool reducedMotion) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00d6: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null || !_root.activeSelf) { return; } if (_collapseAt >= 0f) { float num = Mathf.Clamp01((now - _collapseAt) / 0.48f); float num2 = 1f - Mathf.SmoothStep(0f, 1f, num); for (int i = 0; i < _endpoints.Count; i++) { Vector3 val = ((i < _collapseScales.Count) ? _collapseScales[i] : (Vector3.one * _endpointDiameters[i])); if ((Object)(object)_endpoints[i] != (Object)null && ((Component)_endpoints[i]).gameObject.activeSelf) { _endpoints[i].localScale = val * num2; } } UpdateEnergy(Mathf.Max(0f, num2), now, reducedMotion); if (num >= 1f) { Hide(); } return; } float num3 = (reducedMotion ? 1f : Mathf.Clamp01((now - _openedAt) / 0.82f)); float num4 = Mathf.SmoothStep(0.01f, 1f, num3); if (!reducedMotion) { num4 += Mathf.Sin(num3 * (float)Math.PI) * 0.075f; } for (int j = 0; j < _endpoints.Count; j++) { if ((Object)(object)_endpoints[j] != (Object)null && ((Component)_endpoints[j]).gameObject.activeSelf) { _endpoints[j].localScale = Vector3.one * (_endpointDiameters[j] * num4); } } UpdateEnergy(num3, now, reducedMotion); if (reducedMotion) { return; } for (int k = 0; k < _rotors.Count; k++) { if ((Object)(object)_rotors[k] != (Object)null) { _rotors[k].localRotation = Quaternion.Euler(0f, 0f, now * ((k % 2 == 0) ? 18f : (-12f)) + (float)k * 17f); } } float num5 = 0.985f + Mathf.Sin(now * 2.8f) * 0.015f; for (int l = 0; l < _energyLayers.Count; l++) { if ((Object)(object)_energyLayers[l] != (Object)null) { _energyLayers[l].localScale = Vector3.one * num5; } } } private void UpdateEnergy(float visibility, float now, bool reducedMotion) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00d9: Unknown result type (might be due to invalid IL or missing references) if (visibility >= 0.999f && _collapseAt < 0f && now < _nextStableEnergyUpdateAt) { return; } _nextStableEnergyUpdateAt = now + (_constrained ? (1f / 18f) : (1f / 30f)); float num = (reducedMotion ? 1f : (0.88f + Mathf.Sin(now * 5.5f) * 0.12f)); for (int i = 0; i < _renderers.Count && i < _blocks.Count && i < _baseColors.Count; i++) { if (!((Object)(object)_renderers[i] == (Object)null) && ((Component)_renderers[i]).gameObject.activeInHierarchy) { Color val = _baseColors[i]; val.a *= visibility * num; _blocks[i].SetColor("_Color", val); _blocks[i].SetColor("_TintColor", val); _renderers[i].SetPropertyBlock(_blocks[i]); } } } public void BeginCollapse() { //IL_0054: 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) if ((Object)(object)_root == (Object)null || _collapseAt >= 0f) { return; } _collapseScales.Clear(); foreach (Transform endpoint in _endpoints) { _collapseScales.Add(((Object)(object)endpoint == (Object)null) ? Vector3.zero : endpoint.localScale); } _collapseAt = Time.unscaledTime; } public void Hide() { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _collapseAt = -1f; } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; foreach (Mesh ownedMesh in _ownedMeshes) { if ((Object)(object)ownedMesh != (Object)null) { Object.Destroy((Object)(object)ownedMesh); } } _ownedMeshes.Clear(); if ((Object)(object)_liquidTexture != (Object)null) { Object.Destroy((Object)(object)_liquidTexture); } _liquidTexture = null; if ((Object)(object)_surfaceMaterial != (Object)null) { Object.Destroy((Object)(object)_surfaceMaterial); } _surfaceMaterial = null; if ((Object)(object)_sharedMaterial != (Object)null) { Object.Destroy((Object)(object)_sharedMaterial); } _sharedMaterial = null; _rotors.Clear(); _energyLayers.Clear(); _endpoints.Clear(); _endpointDiameters.Clear(); _collapseScales.Clear(); _renderers.Clear(); _baseColors.Clear(); _blocks.Clear(); } private static Mesh BuildRing(int segments, float radius, float width) { //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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_013a: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[segments * 4]; int[] array2 = new int[segments * 6]; for (int i = 0; i < segments; i++) { float num = (float)i * (float)Math.PI * 2f / (float)segments; float num2 = ((float)i + 0.72f) * (float)Math.PI * 2f / (float)segments; float num3 = radius - width; int num4 = i * 4; array[num4] = new Vector3(Mathf.Cos(num) * num3, Mathf.Sin(num) * num3, 0f); array[num4 + 1] = new Vector3(Mathf.Cos(num) * radius, Mathf.Sin(num) * radius, 0f); array[num4 + 2] = new Vector3(Mathf.Cos(num2) * radius, Mathf.Sin(num2) * radius, 0f); array[num4 + 3] = new Vector3(Mathf.Cos(num2) * num3, Mathf.Sin(num2) * num3, 0f); int num5 = i * 6; array2[num5] = num4; array2[num5 + 1] = num4 + 1; array2[num5 + 2] = num4 + 2; array2[num5 + 3] = num4; array2[num5 + 4] = num4 + 2; array2[num5 + 5] = num4 + 3; } Mesh val = new Mesh { name = "WristHub Segmented Portal Ring", vertices = Il2CppStructArray.op_Implicit(array), triangles = Il2CppStructArray.op_Implicit(array2) }; val.RecalculateBounds(); return val; } private static Mesh BuildRadialTicks(int count, float innerRadius, float outerRadius, float halfWidth) { //IL_0043: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006f: 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_0076: 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_0085: 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) //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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_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_0121: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[count * 4]; int[] array2 = new int[count * 6]; Vector3 val = default(Vector3); for (int i = 0; i < count; i++) { float num = (float)i * (float)Math.PI * 2f / (float)count; ((Vector3)(ref val))..ctor(Mathf.Cos(num), Mathf.Sin(num), 0f); Vector3 val2 = new Vector3(0f - val.y, val.x, 0f) * halfWidth; int num2 = i * 4; array[num2] = val * innerRadius - val2; array[num2 + 1] = val * outerRadius - val2; array[num2 + 2] = val * outerRadius + val2; array[num2 + 3] = val * innerRadius + val2; int num3 = i * 6; array2[num3] = num2; array2[num3 + 1] = num2 + 1; array2[num3 + 2] = num2 + 2; array2[num3 + 3] = num2; array2[num3 + 4] = num2 + 2; array2[num3 + 5] = num2 + 3; } Mesh val3 = new Mesh { name = "WristHub Portal Radial Ticks", vertices = Il2CppStructArray.op_Implicit(array), triangles = Il2CppStructArray.op_Implicit(array2) }; val3.RecalculateBounds(); return val3; } private static Mesh BuildTubeRing(int segments, int sides, float radius, float tubeRadius) { //IL_0082: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00ac: 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_00c7: 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_0164: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown int num = sides + 1; Vector3[] array = (Vector3[])(object)new Vector3[(segments + 1) * num]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[segments * sides * 6]; Vector3 val = default(Vector3); for (int i = 0; i <= segments; i++) { float num2 = (float)i / (float)segments; float num3 = num2 * (float)Math.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num3), Mathf.Sin(num3), 0f); for (int j = 0; j <= sides; j++) { float num4 = (float)j / (float)sides * (float)Math.PI * 2f; int num5 = i * num + j; array[num5] = val * (radius + Mathf.Cos(num4) * tubeRadius) + Vector3.forward * (Mathf.Sin(num4) * tubeRadius); array2[num5] = new Vector2(num2 * 2f, (float)j / (float)sides); } } int num6 = 0; for (int k = 0; k < segments; k++) { for (int l = 0; l < sides; l++) { int num7 = k * num + l; int num8 = num7 + num; array3[num6++] = num7; array3[num6++] = num8; array3[num6++] = num8 + 1; array3[num6++] = num7; array3[num6++] = num8 + 1; array3[num6++] = num7 + 1; } } Mesh val2 = new Mesh { name = "WristHub Rounded Portal Rim", vertices = Il2CppStructArray.op_Implicit(array), uv = Il2CppStructArray.op_Implicit(array2), triangles = Il2CppStructArray.op_Implicit(array3) }; val2.RecalculateBounds(); return val2; } private static Mesh BuildVortexFunnel(int segments, int depthRings, float outerRadius, float innerRadius, float depth) { //IL_00aa: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown int num = segments + 1; Vector3[] array = (Vector3[])(object)new Vector3[(depthRings + 1) * num]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[depthRings * segments * 6]; for (int i = 0; i <= depthRings; i++) { float num2 = (float)i / (float)depthRings; float num3 = Mathf.Lerp(outerRadius, innerRadius, Mathf.SmoothStep(0f, 1f, num2)); float num4 = depth * Mathf.SmoothStep(0f, 1f, num2); for (int j = 0; j <= segments; j++) { float num5 = (float)j / (float)segments * (float)Math.PI * 2f + num2 * 0.85f; int num6 = i * num + j; array[num6] = new Vector3(Mathf.Cos(num5) * num3, Mathf.Sin(num5) * num3, num4); array2[num6] = new Vector2(Mathf.Cos(num5) * num3 / (outerRadius * 2f) + 0.5f, Mathf.Sin(num5) * num3 / (outerRadius * 2f) + 0.5f); } } int num7 = 0; for (int k = 0; k < depthRings; k++) { for (int l = 0; l < segments; l++) { int num8 = k * num + l; int num9 = num8 + num; array3[num7++] = num8; array3[num7++] = num9; array3[num7++] = num9 + 1; array3[num7++] = num8; array3[num7++] = num9 + 1; array3[num7++] = num8 + 1; } } Mesh val = new Mesh { name = "WristHub Recessed Liquid Portal", vertices = Il2CppStructArray.op_Implicit(array), uv = Il2CppStructArray.op_Implicit(array2), triangles = Il2CppStructArray.op_Implicit(array3) }; val.RecalculateBounds(); return val; } private static Mesh BuildDisc(int segments, float radius) { //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_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_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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0103: 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_0116: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[segments + 1]; Vector2[] array2 = (Vector2[])(object)new Vector2[segments + 1]; int[] array3 = new int[segments * 3]; array[0] = Vector3.zero; array2[0] = new Vector2(0.5f, 0.5f); for (int i = 0; i < segments; i++) { float num = (float)i * (float)Math.PI * 2f / (float)segments; array[i + 1] = new Vector3(Mathf.Cos(num) * radius, Mathf.Sin(num) * radius, 0f); array2[i + 1] = new Vector2(Mathf.Cos(num) * 0.5f + 0.5f, Mathf.Sin(num) * 0.5f + 0.5f); int num2 = i * 3; array3[num2] = 0; array3[num2 + 1] = i + 1; array3[num2 + 2] = (i + 1) % segments + 1; } Mesh val = new Mesh { name = "WristHub Circular Portal Veil", vertices = Il2CppStructArray.op_Implicit(array), uv = Il2CppStructArray.op_Implicit(array2), triangles = Il2CppStructArray.op_Implicit(array3) }; val.RecalculateBounds(); return val; } private static Texture2D BuildLiquidTexture(int size) { //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_0014: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { name = "WristHub Smooth Liquid Portal", wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1, anisoLevel = 1 }; Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num = ((float)j + 0.5f) / (float)size * 2f - 1f; float num2 = ((float)i + 0.5f) / (float)size * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = 0f; if (num3 <= 1f) { float num5 = Mathf.Atan2(num2, num); float num6 = Mathf.Sin(num5 * 5f - num3 * 19f) * 0.5f + 0.5f; float num7 = Mathf.Sin(num5 * 9f + num3 * 31f + Mathf.Sin(num5 * 3f) * 1.4f) * 0.5f + 0.5f; float num8 = Mathf.Pow(Mathf.Clamp01(1f - num3), 0.3f); float num9 = Mathf.Exp((0f - num3) * num3 * 3.2f); float num10 = Mathf.Clamp01(1f - Mathf.Abs(num3 - 0.91f) / 0.075f); num4 = Mathf.Clamp01((0.16f + num6 * 0.28f + num7 * 0.16f) * num8 + num9 * 0.18f + num10 * 0.38f); } byte b = (byte)Mathf.RoundToInt(Mathf.Lerp(180f, 255f, num4)); array[i * size + j] = new Color32(b, (byte)245, byte.MaxValue, (byte)Mathf.RoundToInt(num4 * 255f)); } } val.SetPixels32(Il2CppStructArray.op_Implicit(array)); val.Apply(false, true); return val; } } internal static class BoneHubAvatarRigValidator { private static readonly string[] EssentialArtTransforms = new string[17] { "artHips", "artSpine", "artChest", "artNeck", "artHead", "artUpperArmLf", "artLowerArmLf", "artHandLf", "artUpperArmRt", "artLowerArmRt", "artHandRt", "artUpperLegLf", "artLowerLegLf", "artFootLf", "artUpperLegRt", "artLowerLegRt", "artFootRt" }; public static AvatarRigValidationResult Validate(GameObject prefab) { //IL_0216: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)prefab == (Object)null) { return AvatarRigValidationResult.Reject("The avatar asset did not load."); } Avatar val = prefab.GetComponent() ?? ((IEnumerable)prefab.GetComponentsInChildren(true)).FirstOrDefault((Func)((Avatar candidate) => (Object)(object)candidate != (Object)null)); if ((Object)(object)val == (Object)null) { return AvatarRigValidationResult.Reject("A BONELAB Avatar definition is missing."); } List list = new List(4); if (!float.IsFinite(val.height) || !AvatarPreviewMath.IsUsableHeight(val.height)) { list.Add("Height metadata is unavailable"); } bool? flag = ReadBoolean(val, "PreComputed", "preComputed", "precomputed", "_preComputed"); if (flag.HasValue && !flag.Value) { list.Add("Runtime precompute flag is false"); } if (CountValid((IEnumerable?)val.bodyMeshes) + CountValid((IEnumerable?)val.headMeshes) + CountValid((IEnumerable?)val.hairMeshes) == 0) { list.Add("Declared preview renderers are unavailable"); } int num = 0; bool flag2 = true; string[] essentialArtTransforms = EssentialArtTransforms; foreach (string name in essentialArtTransforms) { object obj = ReadMember(val, name); if (obj != null) { num++; Transform val2 = (Transform)((obj is Transform) ? obj : null); if (val2 == null || (Object)(object)val2 == (Object)null || !IsInside(val2, prefab.transform)) { flag2 = false; } } } if (!flag2) { list.Add("Some reflected ArtTransforms could not be verified"); } if (num < EssentialArtTransforms.Length) { Animator val3 = ((IEnumerable)prefab.GetComponentsInChildren(true)).FirstOrDefault((Func)((Animator candidate) => (Object)(object)candidate != (Object)null && candidate.isHuman)); if ((Object)(object)val3 == (Object)null || !HasEssentialHumanoidBones(val3, prefab.transform)) { list.Add("The complete humanoid rig could not be verified through IL2CPP"); } } return (list.Count == 0) ? AvatarRigValidationResult.Ready() : AvatarRigValidationResult.Allow(string.Join("; ", list)); } catch (Exception ex) { return AvatarRigValidationResult.Allow("Rig preflight was unavailable: " + ex.GetType().Name); } } private static int CountValid(IEnumerable? renderers) { return renderers?.Count((SkinnedMeshRenderer renderer) => (Object)(object)renderer != (Object)null && (Object)(object)renderer.sharedMesh != (Object)null) ?? 0; } private static bool HasEssentialHumanoidBones(Animator animator, Transform root) { //IL_001a: 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) HumanBodyBones[] array = new HumanBodyBones[17]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); HumanBodyBones[] array2 = (HumanBodyBones[])(object)array; foreach (HumanBodyBones val in array2) { Transform boneTransform = animator.GetBoneTransform(val); if ((Object)(object)boneTransform == (Object)null || !IsInside(boneTransform, root)) { return false; } } return true; } private static bool IsInside(Transform candidate, Transform root) { Transform val = candidate; while ((Object)(object)val != (Object)null) { if ((Object)(object)val == (Object)(object)root) { return true; } val = val.parent; } return false; } private static bool? ReadBoolean(object value, params string[] names) { foreach (string name in names) { object obj = ReadMember(value, name); if (obj is bool) { return (bool)obj; } } return null; } private static object? ReadMember(object value, string name) { Type type = value.GetType(); object obj = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(value); if (obj == null) { PropertyInfo? property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if ((object)property == null) { return null; } obj = property.GetValue(value); } return obj; } } internal sealed class BoneHubChestEquipGuide : IDisposable { private const int DashCount = 14; private const int PulseCount = 3; private const float RevealSeconds = 0.2f; private const float CollapseSeconds = 0.16f; private static readonly Color Cyan = new Color(0.08f, 0.82f, 1f, 1f); private static readonly Color Green = new Color(0.28f, 1f, 0.62f, 1f); private static readonly int ColorId = Shader.PropertyToID("_Color"); private static readonly int BaseColorId = Shader.PropertyToID("_BaseColor"); private static readonly int TintColorId = Shader.PropertyToID("_TintColor"); private readonly Instance _log; private readonly MaterialPropertyBlock _block = new MaterialPropertyBlock(); private readonly Renderer[] _rings = (Renderer[])(object)new Renderer[3]; private readonly Renderer[] _dashes = (Renderer[])(object)new Renderer[14]; private readonly Renderer[] _pulses = (Renderer[])(object)new Renderer[3]; private readonly List _ownedMeshes = new List(4); private GameObject? _root; private Renderer? _core; private Renderer? _halo; private Renderer? _crosshair; private Material? _material; private float _shownAt; private float _collapseAt = -1f; private float _lastAlpha = 1f; private bool _inside; private bool _loggedFailure; public BoneHubChestEquipGuide(Instance log) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _log = log; } public void Show() { EnsureBuilt(); if (!((Object)(object)_root == (Object)null)) { _shownAt = Time.unscaledTime; _collapseAt = -1f; _lastAlpha = 1f; _inside = false; _root.SetActive(true); } } public void UpdatePose(Vector3 previewPosition, Vector3 chestPosition, Vector3 viewerPosition, float interactionRadius, bool inside, bool reducedMotion, float heightScale) { //IL_0080: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00ac: 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_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_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_00a7: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00e0: 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_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_0163: 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_015c: 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_01ac: 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_01b3: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: 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_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: 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_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: 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_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0410: 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_042c: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_042e: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); if (!((Object)(object)_root == (Object)null) && !((Object)(object)_core == (Object)null) && !((Object)(object)_halo == (Object)null) && !((Object)(object)_crosshair == (Object)null)) { if (!_root.activeSelf || _collapseAt >= 0f) { Show(); } float num = Mathf.Clamp(heightScale, 0.2f, 8f); float num2 = Mathf.Max(0.035f * num, interactionRadius); Vector3 value = viewerPosition - chestPosition; Vector3 val = ((IsFinite(value) && ((Vector3)(ref value)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref value)).normalized : Vector3.back); Vector3 val2 = Vector3.ProjectOnPlane(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.001f) { val2 = Vector3.ProjectOnPlane(Vector3.forward, val); normalized = ((Vector3)(ref val2)).normalized; } Quaternion val3 = Quaternion.LookRotation(val, normalized); float num3 = Mathf.Max(0f, Time.unscaledTime - _shownAt); float num4 = (reducedMotion ? 1f : Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num3 / 0.2f))); float num5 = ChestEquipGuideMath.Proximity(Vector3.Distance(previewPosition, chestPosition), num2, 2.75f); Color color = (inside ? Green : Color.Lerp(Cyan, Green, num5 * 0.45f)); float num6 = (reducedMotion ? 0f : (Mathf.Sin(num3 * (inside ? 12f : 6f)) * 0.035f)); float num7 = num2 * (0.58f + num6); ((Component)_core).transform.SetPositionAndRotation(chestPosition + val * 0.004f * num, val3); ((Component)_core).transform.localScale = Vector3.one * num7 * (inside ? 0.3f : 0.23f) * num4; SetColor(_core, color, (inside ? 0.82f : 0.52f) * num4); ((Component)_halo).transform.SetPositionAndRotation(chestPosition + val * 0.002f * num, val3); ((Component)_halo).transform.localScale = Vector3.one * num7 * (inside ? 1.38f : 1.12f) * num4; SetColor(_halo, color, (inside ? 0.28f : 0.15f) * num4); for (int i = 0; i < _rings.Length; i++) { float num8 = ((i % 2 == 0) ? 1f : (-1f)); float num9 = (reducedMotion ? ((float)i * 17f) : (num3 * (22f + (float)i * 9f) * num8 + (float)i * 17f)); float num10 = num7 * (0.56f + (float)i * 0.23f) * num4; ((Component)_rings[i]).transform.SetPositionAndRotation(chestPosition + val * (0.003f + (float)i * 0.001f) * num, val3 * Quaternion.AngleAxis(num9, Vector3.forward)); ((Component)_rings[i]).transform.localScale = new Vector3(num10, num10, 1f); SetColor(_rings[i], color, (inside ? (0.7f - (float)i * 0.12f) : (0.44f - (float)i * 0.09f)) * num4); } ((Component)_crosshair).transform.SetPositionAndRotation(chestPosition + val * 0.006f * num, val3); ((Component)_crosshair).transform.localScale = Vector3.one * num7 * num4; SetColor(_crosshair, color, (inside ? 0.72f : 0.38f) * num4); UpdateTether(previewPosition, chestPosition, viewerPosition, val, color, num5, num4, reducedMotion, num, num3); _inside = inside; _lastAlpha = num4; } } public void Hide(bool immediate = false) { if (!((Object)(object)_root == (Object)null)) { if (immediate || !_root.activeSelf) { _root.SetActive(false); _collapseAt = -1f; _inside = false; } else if (_collapseAt < 0f) { _collapseAt = Time.unscaledTime; } } } public void Tick(bool reducedMotion) { if (!((Object)(object)_root == (Object)null) && _root.activeSelf && !(_collapseAt < 0f)) { float num = (reducedMotion ? 1f : Mathf.Clamp01((Time.unscaledTime - _collapseAt) / 0.16f)); float allAlpha = (1f - Mathf.SmoothStep(0f, 1f, num)) * _lastAlpha; SetAllAlpha(allAlpha); if (num >= 1f) { Hide(immediate: true); } } } public void Dispose() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } foreach (Mesh ownedMesh in _ownedMeshes) { if ((Object)(object)ownedMesh != (Object)null) { Object.Destroy((Object)(object)ownedMesh); } } if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } _ownedMeshes.Clear(); _root = null; _material = null; } private void UpdateTether(Vector3 start, Vector3 end, Vector3 viewer, Vector3 targetNormal, Color color, float proximity, float reveal, bool reducedMotion, float scale, float elapsed) { //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_0079: 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_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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_00a2: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_015c: 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_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_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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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) //IL_017f: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: 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_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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_02d7: 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_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_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_030a: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_032e: 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_0342: Unknown result type (might be due to invalid IL or missing references) Vector3 val = end - start; float magnitude = ((Vector3)(ref val)).magnitude; if (!float.IsFinite(magnitude) || magnitude < 0.025f) { Renderer[] dashes = _dashes; for (int i = 0; i < dashes.Length; i++) { ((Component)dashes[i]).gameObject.SetActive(false); } dashes = _pulses; for (int i = 0; i < dashes.Length; i++) { ((Component)dashes[i]).gameObject.SetActive(false); } return; } Vector3 val2 = Vector3.Cross(((Vector3)(ref val)).normalized, targetNormal); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.001f) { val3 = Vector3.right; } Vector3 b = (start + end) * 0.5f + Vector3.up * Mathf.Min(0.12f * scale, magnitude * 0.18f) + val3 * Mathf.Min(0.035f * scale, magnitude * 0.06f); int num = Mathf.Clamp(Mathf.CeilToInt(14f * reveal), 1, 14); for (int j = 0; j < _dashes.Length; j++) { Renderer val4 = _dashes[j]; bool flag = j < num; ((Component)val4).gameObject.SetActive(flag); if (flag) { float num2 = ((float)j + 0.5f) / 14f; Vector3 val5 = Bezier(start, b, end, num2); val2 = BezierTangent(start, b, end, num2); Vector3 normalized = ((Vector3)(ref val2)).normalized; val2 = Vector3.ProjectOnPlane(viewer - val5, normalized); Vector3 val6 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val6)).sqrMagnitude < 0.001f) { val6 = targetNormal; } ((Component)val4).transform.SetPositionAndRotation(val5, Quaternion.LookRotation(val6, normalized)); float num3 = Mathf.Clamp(magnitude / 14f * 0.56f, 0.005f * scale, 0.022f * scale); ((Component)val4).transform.localScale = new Vector3((insideOrNear(proximity) ? 0.0022f : 0.0017f) * scale, num3, 1f); float num4 = (reducedMotion ? 1f : (0.72f + 0.28f * Mathf.Sin(elapsed * 9f - num2 * 13f))); SetColor(val4, color, (0.22f + proximity * 0.3f) * num4 * reveal); } } for (int k = 0; k < _pulses.Length; k++) { Renderer val7 = _pulses[k]; bool flag2 = !reducedMotion && reveal > 0.65f; ((Component)val7).gameObject.SetActive(flag2); if (flag2) { float num5 = Mathf.Repeat(elapsed * (0.85f + proximity * 0.55f) + (float)k / 3f, 1f); Vector3 val8 = Bezier(start, b, end, num5); Vector3 val9 = viewer - val8; ((Component)val7).transform.SetPositionAndRotation(val8, (((Vector3)(ref val9)).sqrMagnitude > 0.001f) ? Quaternion.LookRotation(((Vector3)(ref val9)).normalized, Vector3.up) : Quaternion.identity); ((Component)val7).transform.localScale = Vector3.one * (0.01f + proximity * 0.004f) * scale; SetColor(val7, color, Mathf.Sin(num5 * (float)Math.PI) * 0.72f * reveal); } } } private static bool insideOrNear(float proximity) { return proximity >= 0.82f; } private void EnsureBuilt() { //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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown if ((Object)(object)_root != (Object)null) { return; } try { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Transparent") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Standard"); if ((Object)(object)val == (Object)null) { throw new InvalidOperationException("No compatible guidance shader was available."); } _material = new Material(val) { name = "WristHub Shared Chest Guide", renderQueue = 3110 }; if (_material.HasProperty("_Cull")) { _material.SetInt("_Cull", 0); } _root = new GameObject("[WristHub] Chest Equip Guide"); Object.DontDestroyOnLoad((Object)(object)_root); _root.SetActive(false); Mesh mesh = Own(CreateSoftDiscMesh(32)); Mesh mesh2 = Own(CreateOrbMesh(9, 18)); Mesh mesh3 = Own(CreateSegmentedRingMesh(32, 0.91f, 0.32f)); Mesh mesh4 = Own(CreateCrosshairMesh()); Mesh mesh5 = Own(CreateDashMesh()); _halo = CreateRenderer("Target Halo", mesh); _core = CreateRenderer("Target Orb", mesh2); for (int i = 0; i < _rings.Length; i++) { _rings[i] = CreateRenderer("Lock Ring " + i, mesh3); } _crosshair = CreateRenderer("Chest Brackets", mesh4); for (int j = 0; j < _dashes.Length; j++) { _dashes[j] = CreateRenderer("Guidance Dash " + j, mesh5); } for (int k = 0; k < _pulses.Length; k++) { _pulses[k] = CreateRenderer("Guidance Pulse " + k, mesh); } } catch (Exception ex) { if (!_loggedFailure) { _loggedFailure = true; _log.Warning("Chest equip guidance disabled: " + ex.Message); } Dispose(); } } private Mesh Own(Mesh mesh) { _ownedMeshes.Add(mesh); return mesh; } private Renderer CreateRenderer(string name, Mesh mesh) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null || (Object)(object)_material == (Object)null) { throw new InvalidOperationException("Chest guide pool is unavailable."); } GameObject val = new GameObject(name); val.transform.SetParent(_root.transform, false); val.AddComponent().sharedMesh = mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = _material; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return (Renderer)(object)obj; } private void SetAllAlpha(float multiplier) { //IL_000f: 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_0014: 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_004c: 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_0095: 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_00fd: Unknown result type (might be due to invalid IL or missing references) Color color = (_inside ? Green : Cyan); if ((Object)(object)_core != (Object)null) { SetColor(_core, color, 0.82f * multiplier); } if ((Object)(object)_halo != (Object)null) { SetColor(_halo, color, 0.22f * multiplier); } if ((Object)(object)_crosshair != (Object)null) { SetColor(_crosshair, color, 0.6f * multiplier); } Renderer[] rings = _rings; foreach (Renderer val in rings) { if ((Object)(object)val != (Object)null) { SetColor(val, color, 0.55f * multiplier); } } rings = _dashes; foreach (Renderer val2 in rings) { if ((Object)(object)val2 != (Object)null) { SetColor(val2, color, 0.35f * multiplier); } } rings = _pulses; foreach (Renderer val3 in rings) { if ((Object)(object)val3 != (Object)null) { SetColor(val3, color, 0.55f * multiplier); } } } private void SetColor(Renderer renderer, Color color, float alpha) { //IL_0002: 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_000e: 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_0046: 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) Color val = default(Color); ((Color)(ref val))..ctor(color.r, color.g, color.b, Mathf.Clamp01(alpha)); _block.Clear(); _block.SetColor(ColorId, val); _block.SetColor(BaseColorId, val); _block.SetColor(TintColorId, val); renderer.SetPropertyBlock(_block); } private static Vector3 Bezier(Vector3 a, Vector3 b, Vector3 c, float t) { //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) //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = 1f - t; return num * num * a + 2f * num * t * b + t * t * c; } private static Vector3 BezierTangent(Vector3 a, Vector3 b, Vector3 c, float t) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) return 2f * (1f - t) * (b - a) + 2f * t * (c - b); } private static bool IsFinite(Vector3 value) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (float.IsFinite(value.x) && float.IsFinite(value.y)) { return float.IsFinite(value.z); } return false; } private static Mesh CreateSoftDiscMesh(int segments) { //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //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) Vector3[] array = (Vector3[])(object)new Vector3[segments + 1]; Color[] array2 = (Color[])(object)new Color[segments + 1]; int[] array3 = new int[segments * 3]; array2[0] = Color.white; for (int i = 0; i < segments; i++) { float num = (float)i / (float)segments * (float)Math.PI * 2f; array[i + 1] = new Vector3(Mathf.Cos(num), Mathf.Sin(num)); array2[i + 1] = new Color(1f, 1f, 1f, 0f); array3[i * 3] = 0; array3[i * 3 + 1] = i + 1; array3[i * 3 + 2] = (i + 1) % segments + 1; } Mesh obj = FinalizeMesh("WristHub Chest Glow", array, array3); obj.colors = Il2CppStructArray.op_Implicit(array2); return obj; } private static Mesh CreateOrbMesh(int latitudeSegments, int longitudeSegments) { //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) Vector3[] array = (Vector3[])(object)new Vector3[(latitudeSegments + 1) * (longitudeSegments + 1)]; int[] array2 = new int[latitudeSegments * longitudeSegments * 6]; for (int i = 0; i <= latitudeSegments; i++) { float num = (float)i / (float)latitudeSegments * (float)Math.PI; float num2 = Mathf.Cos(num); float num3 = Mathf.Sin(num); for (int j = 0; j <= longitudeSegments; j++) { float num4 = (float)j / (float)longitudeSegments * (float)Math.PI * 2f; array[i * (longitudeSegments + 1) + j] = new Vector3(num3 * Mathf.Cos(num4), num2, num3 * Mathf.Sin(num4)); } } int num5 = 0; for (int k = 0; k < latitudeSegments; k++) { for (int l = 0; l < longitudeSegments; l++) { int num6 = k * (longitudeSegments + 1) + l; int num7 = num6 + longitudeSegments + 1; array2[num5++] = num6; array2[num5++] = num7; array2[num5++] = num6 + 1; array2[num5++] = num6 + 1; array2[num5++] = num7; array2[num5++] = num7 + 1; } } return FinalizeMesh("WristHub Chest Orb", array, array2); } private static Mesh CreateSegmentedRingMesh(int segments, float innerRatio, float gapRatio) { //IL_0084: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[segments * 4]; int[] array2 = new int[segments * 6]; Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 0; i < segments; i++) { float num = ((float)i + gapRatio * 0.5f) / (float)segments * (float)Math.PI * 2f; float num2 = ((float)i + 1f - gapRatio * 0.5f) / (float)segments * (float)Math.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), Mathf.Sin(num)); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2), Mathf.Sin(num2)); int num3 = i * 4; array[num3] = val; array[num3 + 1] = val2; array[num3 + 2] = val2 * innerRatio; array[num3 + 3] = val * innerRatio; int num4 = i * 6; array2[num4] = num3; array2[num4 + 1] = num3 + 1; array2[num4 + 2] = num3 + 2; array2[num4 + 3] = num3; array2[num4 + 4] = num3 + 2; array2[num4 + 5] = num3 + 3; } return FinalizeMesh("WristHub Chest Segmented Ring", array, array2); } private static Mesh CreateCrosshairMesh() { //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) //IL_0026: 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_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_003e: 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_005a: 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_006f: 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) List list = new List(32); List list2 = new List(48); for (int i = 0; i < 4; i++) { Quaternion val = Quaternion.AngleAxis((float)i * 90f, Vector3.forward); AddQuad(list, list2, val * new Vector3(0.82f, 0.67f), val * new Vector3(0.1f, 0.025f)); AddQuad(list, list2, val * new Vector3(0.67f, 0.82f), val * new Vector3(0.025f, 0.1f)); } return FinalizeMesh("WristHub Chest Brackets", list.ToArray(), list2.ToArray()); } private static void AddQuad(List vertices, List triangles, Vector3 center, Vector3 half) { //IL_0008: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_003d: 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_0059: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) int count = vertices.Count; vertices.Add(center + new Vector3(0f - Mathf.Abs(half.x), 0f - Mathf.Abs(half.y))); vertices.Add(center + new Vector3(Mathf.Abs(half.x), 0f - Mathf.Abs(half.y))); vertices.Add(center + new Vector3(Mathf.Abs(half.x), Mathf.Abs(half.y))); vertices.Add(center + new Vector3(0f - Mathf.Abs(half.x), Mathf.Abs(half.y))); triangles.Add(count); triangles.Add(count + 1); triangles.Add(count + 2); triangles.Add(count); triangles.Add(count + 2); triangles.Add(count + 3); } private static Mesh CreateDashMesh() { //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_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_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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) return FinalizeMesh("WristHub Guidance Dash", (Vector3[])(object)new Vector3[4] { new Vector3(-0.5f, 0f), new Vector3(0.5f, 0f), new Vector3(0.5f, 1f), new Vector3(-0.5f, 1f) }, new int[6] { 0, 1, 2, 0, 2, 3 }); } private static Mesh FinalizeMesh(string name, Vector3[] vertices, int[] triangles) { //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_004f: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown int[] array = new int[triangles.Length * 2]; Array.Copy(triangles, array, triangles.Length); for (int i = 0; i < triangles.Length; i += 3) { int num = triangles.Length + i; array[num] = triangles[i]; array[num + 1] = triangles[i + 2]; array[num + 2] = triangles[i + 1]; } Mesh val = new Mesh { name = name, vertices = Il2CppStructArray.op_Implicit(vertices), triangles = Il2CppStructArray.op_Implicit(array) }; val.RecalculateBounds(); return val; } } internal readonly record struct BoneHubFingertipProbe(Hand Hand, Vector3 Position, Vector3 ThumbPosition, bool HasTrackedFingers, bool IsLeft, Vector3 GripAnchorPosition, Quaternion GripAnchorRotation, bool GripAnchorTracked, Vector3 PinchPosition, Quaternion PinchRotation, Vector3 PointingDirection, Vector3 AimOrigin, Vector3 AimDirection, bool AimTracked) { public float PinchDistance => Vector3.Distance(Position, ThumbPosition); public bool TryGetDragAnchor(bool pinch, out Vector3 position, out Quaternion rotation) { //IL_000d: 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_0012: 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_001c: 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_0042: 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) position = (pinch ? PinchPosition : GripAnchorPosition); rotation = (pinch ? PinchRotation : GripAnchorRotation); if ((pinch ? HasTrackedFingers : GripAnchorTracked) && IsFinite(position)) { return IsFinite(rotation); } return false; } private static bool IsFinite(Vector3 value) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (float.IsFinite(value.x) && float.IsFinite(value.y)) { return float.IsFinite(value.z); } return false; } private static bool IsFinite(Quaternion value) { //IL_0000: 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_001a: 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) if (float.IsFinite(value.x) && float.IsFinite(value.y) && float.IsFinite(value.z)) { return float.IsFinite(value.w); } return false; } } internal sealed class BoneHubFingertipProbeProvider { private readonly List _probes = new List(2); private Transform? _leftIntermediate; private Transform? _leftDistal; private Transform? _leftThumbIntermediate; private Transform? _leftThumbDistal; private Transform? _rightIntermediate; private Transform? _rightDistal; private Transform? _rightThumbIntermediate; private Transform? _rightThumbDistal; private float _nextResolveTime; private int _rigInstanceId; private int _leftHandInstanceId; private int _rightHandInstanceId; private int _lastProbeFrame = -1; public static BoneHubFingertipProbeProvider Shared { get; } = new BoneHubFingertipProbeProvider(); public IReadOnlyList GetProbes() { if (_lastProbeFrame == Time.frameCount) { return _probes; } _lastProbeFrame = Time.frameCount; RefreshRigIdentity(); if (Time.unscaledTime >= _nextResolveTime || ((Object)(object)_leftDistal == (Object)null && (Object)(object)_rightDistal == (Object)null)) { ResolveBones(); } _probes.Clear(); AddProbe(Player.LeftHand, isLeft: true, _leftIntermediate, _leftDistal, _leftThumbIntermediate, _leftThumbDistal, _probes); AddProbe(Player.RightHand, isLeft: false, _rightIntermediate, _rightDistal, _rightThumbIntermediate, _rightThumbDistal, _probes); return _probes; } public void Invalidate() { ClearBones(); _rigInstanceId = 0; _leftHandInstanceId = 0; _rightHandInstanceId = 0; _lastProbeFrame = -1; } private void ClearBones() { _leftIntermediate = null; _leftDistal = null; _leftThumbIntermediate = null; _leftThumbDistal = null; _rightIntermediate = null; _rightDistal = null; _rightThumbIntermediate = null; _rightThumbDistal = null; _nextResolveTime = 0f; } private void RefreshRigIdentity() { int num = SafeInstanceId((Object?)(object)Player.RigManager); int num2 = SafeInstanceId((Object?)(object)Player.LeftHand); int num3 = SafeInstanceId((Object?)(object)Player.RightHand); if (num != _rigInstanceId || num2 != _leftHandInstanceId || num3 != _rightHandInstanceId) { ClearBones(); _rigInstanceId = num; _leftHandInstanceId = num2; _rightHandInstanceId = num3; } } private static int SafeInstanceId(Object? value) { try { return (!(value == (Object)null)) ? value.GetInstanceID() : 0; } catch { return 0; } } private void ResolveBones() { _nextResolveTime = Time.unscaledTime + 1f; try { RigManager rigManager = Player.RigManager; Animator val = ((rigManager != null) ? ((IEnumerable)((Component)rigManager).GetComponentsInChildren(true)).FirstOrDefault((Func)((Animator candidate) => (Object)(object)candidate != (Object)null && candidate.isHuman && (Object)(object)candidate.GetBoneTransform((HumanBodyBones)29) != (Object)null)) : null); if (!((Object)(object)val == (Object)null)) { _leftIntermediate = val.GetBoneTransform((HumanBodyBones)28); _leftDistal = val.GetBoneTransform((HumanBodyBones)29); _leftThumbIntermediate = val.GetBoneTransform((HumanBodyBones)25); _leftThumbDistal = val.GetBoneTransform((HumanBodyBones)26); _rightIntermediate = val.GetBoneTransform((HumanBodyBones)43); _rightDistal = val.GetBoneTransform((HumanBodyBones)44); _rightThumbIntermediate = val.GetBoneTransform((HumanBodyBones)40); _rightThumbDistal = val.GetBoneTransform((HumanBodyBones)41); } } catch { Invalidate(); _nextResolveTime = Time.unscaledTime + 1f; } } private static void AddProbe(Hand? hand, bool isLeft, Transform? intermediate, Transform? distal, Transform? thumbIntermediate, Transform? thumbDistal, ICollection probes) { //IL_009d: 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_00b5: 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_00d2: 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_0118: 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_0125: 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_0132: 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_0142: 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_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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: 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) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hand == (Object)null) { return; } Transform transform = ((Component)hand).transform; bool flag = false; try { if ((Object)(object)hand.Controller != (Object)null && (Object)(object)((Component)hand.Controller).transform != (Object)null) { transform = ((Component)hand.Controller).transform; flag = true; } } catch { } Transform val = ((Component)hand).transform; bool flag2 = (Object)(object)val != (Object)null; try { if ((Object)(object)hand.palmPositionTransform != (Object)null) { val = hand.palmPositionTransform; flag2 = true; } else if (flag) { val = transform; flag2 = true; } } catch { val = transform; flag2 = flag; } Vector3 forward; if ((Object)(object)distal == (Object)null || !((Component)distal).gameObject.activeInHierarchy) { Transform val2 = transform; Vector3 vector = FingertipProbeMath.ControllerTip(new Vector3(val2.position.x, val2.position.y, val2.position.z), new Vector3(val2.forward.x, val2.forward.y, val2.forward.z), 0.075f); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(vector.X, vector.Y, vector.Z); Vector3 position = val3; Vector3 thumbPosition = val3; Vector3 position2 = val.position; Quaternion rotation = val.rotation; bool gripAnchorTracked = flag2; Vector3 position3 = val.position; Quaternion rotation2 = val.rotation; forward = val2.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; Vector3 aimOrigin = val2.position + val2.forward * 0.035f; forward = val2.forward; probes.Add(new BoneHubFingertipProbe(hand, position, thumbPosition, HasTrackedFingers: false, isLeft, position2, rotation, gripAnchorTracked, position3, rotation2, normalized, aimOrigin, ((Vector3)(ref forward)).normalized, flag)); } else { Vector3 val4 = Extrapolate(intermediate, distal, ((Component)hand).transform.forward); Vector3 val5 = (((Object)(object)thumbDistal != (Object)null && ((Component)thumbDistal).gameObject.activeInHierarchy) ? Extrapolate(thumbIntermediate, thumbDistal, ((Component)hand).transform.forward) : ((thumbDistal != null) ? thumbDistal.position : (val4 + ((Component)hand).transform.right * 0.05f))); Vector3 pinchPosition = Vector3.Lerp(val4, val5, 0.5f); bool hasTrackedFingers = (Object)(object)thumbDistal != (Object)null; Vector3 position4 = val.position; Quaternion rotation3 = val.rotation; bool gripAnchorTracked2 = flag2; Quaternion rotation4 = ((Component)hand).transform.rotation; Vector3 pointingDirection = ResolveFingerDirection(intermediate, distal, ((Component)hand).transform.forward); Vector3 aimOrigin2 = transform.position + transform.forward * 0.035f; forward = transform.forward; probes.Add(new BoneHubFingertipProbe(hand, val4, val5, hasTrackedFingers, isLeft, position4, rotation3, gripAnchorTracked2, pinchPosition, rotation4, pointingDirection, aimOrigin2, ((Vector3)(ref forward)).normalized, flag)); } } private static Vector3 ResolveFingerDirection(Transform? intermediate, Transform distal, Vector3 fallback) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0036: 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) Vector3 val = (((Object)(object)intermediate == (Object)null) ? fallback : (distal.position - intermediate.position)); if (!(((Vector3)(ref val)).sqrMagnitude > 1E-06f)) { return ((Vector3)(ref fallback)).normalized; } return ((Vector3)(ref val)).normalized; } private static Vector3 Extrapolate(Transform? intermediate, Transform distal, Vector3 fallbackForward) { //IL_0021: 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_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_0052: 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_0089: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)intermediate == (Object)null) { return distal.position + fallbackForward * 0.015f; } Vector3 vector = FingertipProbeMath.Extrapolate(new Vector3(intermediate.position.x, intermediate.position.y, intermediate.position.z), new Vector3(distal.position.x, distal.position.y, distal.position.z), 0.65f); return new Vector3(vector.X, vector.Y, vector.Z); } } internal enum BoneHubProjectionState { Charging, RingExpansion, SideAvatarAssembly, CenterAvatarAssembly, Stable, CarouselTransition, PanelTransition, Collapsing, TrackingGrace, Hidden } internal sealed class BoneHubForearmProjection : IDisposable { private const float CollapseSeconds = 0.35f; private const float TrackingHoldSeconds = 0.2f; private const float TrackingFadeSeconds = 0.24f; private Color _accent = new Color(0.04f, 0.72f, 1f, 1f); private readonly Instance _log; private readonly MaterialPropertyBlock _block = new MaterialPropertyBlock(); private readonly Renderer[] _rings = (Renderer[])(object)new Renderer[3]; private readonly Renderer[] _stageRings = (Renderer[])(object)new Renderer[3]; private readonly Renderer[] _stageArcs = (Renderer[])(object)new Renderer[2]; private readonly List _ownedMeshes = new List(10); private readonly HoloPerformanceGovernor _performance; private GameObject? _root; private Renderer? _emitterGlow; private Renderer? _emitterCore; private Renderer? _emitterLens; private Renderer? _projectorCone; private Renderer? _projectorPulse; private Renderer? _ticks; private Renderer? _revealEdge; private Renderer? _scanGrid; private Renderer? _centerHalo; private Material? _material; private float _shownAt; private float _selectionChangedAt = -1f; private float _panelChangedAt = -1f; private float _collapseStartedAt; private float _trackingLostAt = -1f; private float _lastBrightness = 1f; private Vector3 _smoothedEmitter; private Vector3 _smoothedNormal = Vector3.up; private bool _hasSmoothedAnchor; private bool _loggedFailure; private bool _disposing; private bool _panelVisible; private bool _selectedDetached; public BoneHubProjectionState State { get; private set; } = BoneHubProjectionState.Hidden; public float RevealProgress { get; private set; } = 1f; public float SideAvatarProgress { get; private set; } = 1f; public float CenterAvatarProgress { get; private set; } = 1f; public float PanelProgress { get; private set; } public HoloPerformanceTier PerformanceTier => _performance.Tier; public BoneHubForearmProjection(Instance log, bool constrained) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //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) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown _log = log; _performance = new HoloPerformanceGovernor(constrained); } public void SetAccent(Color accent) { //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) _accent = accent; } public void Show() { EnsureBuilt(); if (!((Object)(object)_root == (Object)null)) { _shownAt = Time.unscaledTime; _trackingLostAt = -1f; _collapseStartedAt = -1f; RevealProgress = 0f; State = BoneHubProjectionState.Charging; _root.SetActive(true); } } public void SetSelection(string identity) { if (State != BoneHubProjectionState.Hidden) { _selectionChangedAt = Time.unscaledTime; State = BoneHubProjectionState.CarouselTransition; } } public void SetPanelVisible(bool visible) { if (_panelVisible != visible) { _panelVisible = visible; _panelChangedAt = Time.unscaledTime; if (State != BoneHubProjectionState.Hidden) { State = BoneHubProjectionState.PanelTransition; } } } public void SetSelectedDetached(bool detached) { _selectedDetached = detached; } public void UpdatePose(BoneHubForearmProjectionAnchor anchor, Transform tablet, bool reducedMotion, float brightness, bool finalPoseOnly = false) { //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_00ba: 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_00ca: 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_008d: 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_009c: 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_00dc: 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_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_00f9: 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_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) EnsureBuilt(); if ((Object)(object)_root == (Object)null || (Object)(object)_emitterCore == (Object)null || (Object)(object)tablet == (Object)null || State == BoneHubProjectionState.Collapsing) { return; } if (!_root.activeSelf || State == BoneHubProjectionState.Hidden) { Show(); } _trackingLostAt = -1f; _lastBrightness = Mathf.Clamp(brightness, 0.25f, 2f); if (!_hasSmoothedAnchor) { _smoothedEmitter = anchor.EmitterPosition; _smoothedNormal = SafeNormal(anchor.SurfaceNormal, Vector3.up); _hasSmoothedAnchor = true; } else { _smoothedEmitter = anchor.EmitterPosition; _smoothedNormal = SafeNormal(anchor.SurfaceNormal, _smoothedNormal); } float num = MaxAxis(tablet.lossyScale); float num2 = Vector3.Distance(tablet.position - tablet.forward * (0.008f * num), _smoothedEmitter); float num3 = Mathf.Max(0.24f, 0.82f * num); if (!float.IsFinite(num2) || num2 < 0.025f || num2 > num3) { BeginTrackingGrace(); UpdateTrackingLost(); return; } float num4 = Mathf.Max(0f, Time.unscaledTime - _shownAt); CinematicProjectionProgress timeline = CinematicProjectionTimeline.Resolve(num4, reducedMotion); if (!finalPoseOnly) { PanelProgress = ((!reducedMotion) ? Mathf.MoveTowards(PanelProgress, _panelVisible ? 1f : 0f, Mathf.Max(0f, Time.unscaledDeltaTime) / 0.25f) : (_panelVisible ? 1f : 0f)); RevealProgress = ((CinematicProjectionProgress)(ref timeline)).Controls; SideAvatarProgress = ((CinematicProjectionProgress)(ref timeline)).SideAvatars; bool flag = !reducedMotion && _selectionChangedAt >= 0f && Time.unscaledTime - _selectionChangedAt < 0.32f; bool flag2 = !reducedMotion && _panelChangedAt >= 0f && Time.unscaledTime - _panelChangedAt < 0.25f; State = (flag ? BoneHubProjectionState.CarouselTransition : (flag2 ? BoneHubProjectionState.PanelTransition : MapPhase(((CinematicProjectionProgress)(ref timeline)).Phase))); float num5 = (flag ? Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((Time.unscaledTime - _selectionChangedAt) / 0.32f)) : 1f); CenterAvatarProgress = ((CinematicProjectionProgress)(ref timeline)).CenterAvatar * num5; } ApplyGeometry(_smoothedEmitter, _smoothedNormal, tablet, num, num4, reducedMotion, _lastBrightness, timeline); } public void BeginTrackingGrace() { if (State != BoneHubProjectionState.Hidden) { if (_trackingLostAt < 0f) { _trackingLostAt = Time.unscaledTime; } State = BoneHubProjectionState.TrackingGrace; } } public void UpdateTrackingLost() { if ((Object)(object)_root == (Object)null || !_root.activeSelf) { return; } BeginTrackingGrace(); float num = Time.unscaledTime - _trackingLostAt; if (!(num <= 0.2f)) { float num2 = 1f - Mathf.Clamp01((num - 0.2f) / 0.24f); SetAllAlpha(num2 * _lastBrightness); if (num2 <= 0f) { Hide(immediate: true); } } } public void Hide(bool immediate = false) { if (!((Object)(object)_root == (Object)null)) { if (immediate || !_root.activeSelf) { _root.SetActive(false); _hasSmoothedAnchor = false; _trackingLostAt = -1f; State = BoneHubProjectionState.Hidden; RevealProgress = 1f; SideAvatarProgress = 1f; CenterAvatarProgress = 1f; PanelProgress = 0f; } else if (State != BoneHubProjectionState.Collapsing) { _collapseStartedAt = Time.unscaledTime; State = BoneHubProjectionState.Collapsing; } } } public void Tick(bool reducedMotion) { float num = Mathf.Max(0f, Time.unscaledDeltaTime) * 1000f; _performance.Sample((double)num); if (State == BoneHubProjectionState.Collapsing && !((Object)(object)_root == (Object)null)) { float num2 = (reducedMotion ? 1f : Mathf.Clamp01((Time.unscaledTime - _collapseStartedAt) / 0.35f)); SetAllAlpha((1f - Mathf.SmoothStep(0f, 1f, num2)) * _lastBrightness); if (num2 >= 1f) { Hide(immediate: true); } } } public void Dispose() { _disposing = true; if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } foreach (Mesh ownedMesh in _ownedMeshes) { if ((Object)(object)ownedMesh != (Object)null) { Object.Destroy((Object)(object)ownedMesh); } } if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } _ownedMeshes.Clear(); _root = null; _material = null; State = BoneHubProjectionState.Hidden; RevealProgress = 1f; SideAvatarProgress = 1f; CenterAvatarProgress = 1f; PanelProgress = 0f; _disposing = false; } private static BoneHubProjectionState MapPhase(CinematicProjectionPhase phase) { //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_0018: Expected I4, but got Unknown return (phase - 1) switch { 0 => BoneHubProjectionState.Charging, 1 => BoneHubProjectionState.RingExpansion, 2 => BoneHubProjectionState.SideAvatarAssembly, 3 => BoneHubProjectionState.CenterAvatarAssembly, _ => BoneHubProjectionState.Stable, }; } private void ApplyGeometry(Vector3 emitterPosition, Vector3 surfaceNormal, Transform tablet, float tabletScale, float elapsed, bool reducedMotion, float brightness, CinematicProjectionProgress timeline) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0126: 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_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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_0115: 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_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_01ae: 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_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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_0226: 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_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Invalid comparison between Unknown and I4 //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_03f3: 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_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0493: 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_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: 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_034d: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_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_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Invalid comparison between Unknown and I4 //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08d1: Invalid comparison between Unknown and I4 //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09c4: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_0848: Unknown result type (might be due to invalid IL or missing references) //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0924: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_0977: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_emitterGlow == (Object)null || (Object)(object)_emitterCore == (Object)null || (Object)(object)_emitterLens == (Object)null || (Object)(object)_projectorCone == (Object)null || (Object)(object)_projectorPulse == (Object)null || (Object)(object)_ticks == (Object)null || (Object)(object)_revealEdge == (Object)null || (Object)(object)_scanGrid == (Object)null || (Object)(object)_centerHalo == (Object)null) { return; } float emitter = ((CinematicProjectionProgress)(ref timeline)).Emitter; float rings = ((CinematicProjectionProgress)(ref timeline)).Rings; float sideAvatars = ((CinematicProjectionProgress)(ref timeline)).SideAvatars; BoneHubProjectionState state = State; bool flag = ((state == BoneHubProjectionState.Stable || state == BoneHubProjectionState.PanelTransition) ? true : false); bool flag2 = flag; float num = ((reducedMotion || flag2) ? 0f : (Mathf.Sin(elapsed * 16f) * 0.035f)); float num2 = Mathf.Max(0.007f, 0.013f * tabletScale); Vector3 val = Vector3.ProjectOnPlane(tablet.up, surfaceNormal); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.01f) { val = Vector3.ProjectOnPlane(tablet.right, surfaceNormal); normalized = ((Vector3)(ref val)).normalized; } Quaternion val2 = Quaternion.LookRotation(surfaceNormal, normalized); Vector3 val3 = emitterPosition + surfaceNormal * (0.0008f * tabletScale); ((Component)_emitterGlow).transform.SetPositionAndRotation(val3, val2); ((Component)_emitterGlow).transform.localScale = Vector3.one * num2 * (1.6f + num); SetAlpha(_emitterGlow, (flag2 ? 0.16f : 0.32f) * emitter * brightness); ((Component)_emitterCore).transform.SetPositionAndRotation(val3 + surfaceNormal * (0.0004f * tabletScale), val2); ((Component)_emitterCore).transform.localScale = Vector3.one * num2 * (0.5f + emitter * 0.24f + num); SetAlpha(_emitterCore, (flag2 ? 0.48f : 0.82f) * emitter * brightness); ((Component)_emitterLens).transform.SetPositionAndRotation(val3 + surfaceNormal * (0.0009f * tabletScale), val2); ((Component)_emitterLens).transform.localScale = Vector3.one * num2 * (0.18f + emitter * 0.13f + num * 0.35f); SetTint(_emitterLens, Color.Lerp(_accent, Color.white, 0.76f), (flag2 ? 0.82f : 1f) * emitter * brightness); for (int i = 0; i < _rings.Length; i++) { Renderer val4 = _rings[i]; bool flag3 = (int)_performance.Tier != 2 || i == 0; ((Component)val4).gameObject.SetActive(flag3); if (flag3) { float num3 = ((i == 0) ? 1f : (-1f)); float num4 = (reducedMotion ? 0f : (elapsed * (13f + (float)i * 8f) * num3)); float num5 = num2 * (1.25f + (float)i * 0.54f) * (0.72f + rings * 0.28f); ((Component)val4).transform.SetPositionAndRotation(val3 + surfaceNormal * (0.0006f * (float)(i + 1) * tabletScale), val2 * Quaternion.AngleAxis(num4, Vector3.forward)); ((Component)val4).transform.localScale = new Vector3(num5, num5, 1f); SetAlpha(val4, (flag2 ? (0.15f - (float)i * 0.025f) : (0.34f - (float)i * 0.05f)) * rings * brightness); } } ((Component)_ticks).transform.SetPositionAndRotation(val3 + surfaceNormal * (0.001f * tabletScale), val2); ((Component)_ticks).transform.localScale = Vector3.one * num2 * 2f * (0.75f + rings * 0.25f); SetAlpha(_ticks, (flag2 ? 0.1f : 0.24f) * rings * brightness); Vector3 val5 = tablet.position - tablet.forward * (0.009f * tabletScale); float num6 = 0.3f * tabletScale; float num7 = 0.19f * tabletScale; Vector3 val6 = val5 - tablet.up * (0.46f * num7); PlaceProjectorCone(_projectorCone, val3, val6, tablet, tabletScale, sideAvatars, (flag2 ? 0.038f : 0.13f) * brightness, 0.24f); bool flag4 = !reducedMotion && !flag2 && sideAvatars > 0.05f && _performance.EffectsAllowed; ((Component)_projectorPulse).gameObject.SetActive(flag4); if (flag4) { float num8 = Mathf.Repeat(elapsed * 1.85f, 1f); ((Component)_projectorPulse).transform.SetPositionAndRotation(Vector3.Lerp(val3, val6, num8), tablet.rotation); ((Component)_projectorPulse).transform.localScale = Vector3.one * (0.0032f * tabletScale); SetAlpha(_projectorPulse, Mathf.Sin(num8 * (float)Math.PI) * 0.42f * brightness); } bool flag5 = !reducedMotion && State == BoneHubProjectionState.CenterAvatarAssembly; ((Component)_revealEdge).gameObject.SetActive(flag5); if (flag5) { ((Component)_revealEdge).transform.SetPositionAndRotation(val5 + tablet.right * Mathf.Lerp((0f - num6) * 0.49f, num6 * 0.49f, RevealProgress), tablet.rotation); ((Component)_revealEdge).transform.localScale = new Vector3(0.0012f * tabletScale, num7 * 0.9f, 1f); SetAlpha(_revealEdge, Mathf.Sin(RevealProgress * (float)Math.PI) * 0.78f * brightness); } Vector3 val7 = val5 - tablet.up * (0.071f * tabletScale); Quaternion val8 = Quaternion.LookRotation(tablet.up, -tablet.forward); float num9 = 0.146f * tabletScale * (0.68f + 0.32f * rings); for (int j = 0; j < _stageRings.Length; j++) { Renderer val9 = _stageRings[j]; bool flag6 = (int)_performance.Tier != 2 || j == 0; ((Component)val9).gameObject.SetActive(flag6); if (flag6) { float num10 = ((j % 2 == 0) ? 1f : (-1f)); float num11 = (reducedMotion ? 0f : (elapsed * (9f + (float)j * 5f) * num10)); float num12 = num9 * (0.74f + (float)j * 0.13f); ((Component)val9).transform.SetPositionAndRotation(val7 + tablet.up * ((float)j * 0.0007f * tabletScale), val8 * Quaternion.AngleAxis(num11, Vector3.forward)); ((Component)val9).transform.localScale = new Vector3(num12, num12, 1f); SetAlpha(val9, (flag2 ? 0.1f : (0.22f - (float)j * 0.035f)) * rings * brightness); } } bool flag7 = _performance.EffectsAllowed && !reducedMotion; for (int k = 0; k < _stageArcs.Length; k++) { Renderer val10 = _stageArcs[k]; ((Component)val10).gameObject.SetActive(flag7); if (flag7) { float num13 = elapsed * (22f + (float)k * 9f) * ((k == 0) ? 1f : (-1f)); ((Component)val10).transform.SetPositionAndRotation(val7 + tablet.up * (0.0022f + (float)k * 0.0008f) * tabletScale, val8 * Quaternion.AngleAxis(num13, Vector3.forward)); ((Component)val10).transform.localScale = Vector3.one * num9 * (0.82f + (float)k * 0.17f); SetAlpha(val10, (flag2 ? 0.16f : 0.34f) * ((CinematicProjectionProgress)(ref timeline)).Controls * brightness); } } ((Component)_scanGrid).gameObject.SetActive((int)_performance.Tier != 2); if (((Component)_scanGrid).gameObject.activeSelf) { float num14 = (reducedMotion ? 0.55f : (0.48f + Mathf.Sin(elapsed * 3.2f) * 0.1f)); ((Component)_scanGrid).transform.SetPositionAndRotation(val5 - tablet.forward * (0.0015f * tabletScale), tablet.rotation); ((Component)_scanGrid).transform.localScale = new Vector3(0.145f * tabletScale, 0.172f * tabletScale * Mathf.Max(0.08f, CenterAvatarProgress), 1f); SetAlpha(_scanGrid, num14 * CenterAvatarProgress * brightness * 0.34f); } ((Component)_centerHalo).transform.SetPositionAndRotation(val7 + tablet.up * (0.0015f * tabletScale), val8); ((Component)_centerHalo).transform.localScale = Vector3.one * num9 * (_selectedDetached ? 0.72f : (0.52f + CenterAvatarProgress * 0.2f)); SetAlpha(_centerHalo, (_selectedDetached ? 0.42f : (flag2 ? 0.16f : 0.34f)) * CenterAvatarProgress * brightness); } private void PlaceProjectorCone(Renderer cone, Vector3 start, Vector3 target, Transform tablet, float tabletScale, float reveal, float alpha, float width) { //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_0042: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0091: 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_0093: 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_00d7: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 val = target - start; float magnitude = ((Vector3)(ref val)).magnitude; if (!float.IsFinite(magnitude) || magnitude < 0.02f || reveal <= 0.01f) { ((Component)cone).gameObject.SetActive(false); return; } ((Component)cone).gameObject.SetActive(true); Vector3 val2 = val / magnitude; Vector3 val3 = Vector3.ProjectOnPlane(-tablet.forward, val2); Vector3 normalized = ((Vector3)(ref val3)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.01f) { val3 = Vector3.Cross(val2, tablet.right); normalized = ((Vector3)(ref val3)).normalized; } ((Component)cone).transform.SetPositionAndRotation(start, Quaternion.LookRotation(normalized, val2)); float num = 0.18f + 0.82f * Mathf.SmoothStep(0f, 1f, reveal); ((Component)cone).transform.localScale = new Vector3(width * tabletScale * num, magnitude * reveal, width * tabletScale * num); SetAlpha(cone, alpha * reveal); } private void SetAllAlpha(float multiplier) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_emitterGlow != (Object)null) { SetAlpha(_emitterGlow, 0.16f * multiplier); } if ((Object)(object)_emitterCore != (Object)null) { SetAlpha(_emitterCore, 0.48f * multiplier); } if ((Object)(object)_emitterLens != (Object)null) { SetTint(_emitterLens, Color.Lerp(_accent, Color.white, 0.76f), 0.72f * multiplier); } if ((Object)(object)_ticks != (Object)null) { SetAlpha(_ticks, 0.1f * multiplier); } Renderer[] rings = _rings; foreach (Renderer val in rings) { if ((Object)(object)val != (Object)null) { SetAlpha(val, 0.13f * multiplier); } } rings = _stageRings; foreach (Renderer val2 in rings) { if ((Object)(object)val2 != (Object)null) { SetAlpha(val2, 0.1f * multiplier); } } rings = _stageArcs; foreach (Renderer val3 in rings) { if ((Object)(object)val3 != (Object)null) { SetAlpha(val3, 0.12f * multiplier); } } if ((Object)(object)_projectorCone != (Object)null) { SetAlpha(_projectorCone, 0.018f * multiplier); } if ((Object)(object)_projectorPulse != (Object)null) { ((Component)_projectorPulse).gameObject.SetActive(false); } if ((Object)(object)_scanGrid != (Object)null) { SetAlpha(_scanGrid, 0.1f * multiplier); } if ((Object)(object)_centerHalo != (Object)null) { SetAlpha(_centerHalo, 0.14f * multiplier); } if ((Object)(object)_revealEdge != (Object)null) { ((Component)_revealEdge).gameObject.SetActive(false); } } private void EnsureBuilt() { //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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown if ((Object)(object)_root != (Object)null || _disposing) { return; } try { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Transparent") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Standard"); if ((Object)(object)val == (Object)null) { throw new InvalidOperationException("No compatible hologram shader was available."); } _material = new Material(val) { name = "WristHub Shared Cinematic Projection", renderQueue = 3100 }; Color val2 = default(Color); ((Color)(ref val2))..ctor(_accent.r, _accent.g, _accent.b, 0.25f); if (_material.HasProperty("_Color")) { _material.SetColor("_Color", val2); } if (_material.HasProperty("_TintColor")) { _material.SetColor("_TintColor", val2); } if (_material.HasProperty("_Cull")) { _material.SetInt("_Cull", 0); } _root = new GameObject("[WristHub] Cinematic Projection"); Object.DontDestroyOnLoad((Object)(object)_root); _root.SetActive(false); Mesh mesh = Own(CreateSoftDiscMesh(40)); Mesh mesh2 = Own(CreateDiscMesh(32)); Mesh mesh3 = Own(CreateSegmentedRingMesh(36, 0.91f, 0.28f)); Mesh mesh4 = Own(CreateSegmentedRingMesh(64, 0.972f, 0.18f)); Mesh mesh5 = Own(CreateArcMesh(48, 0.91f, 0.62f)); Mesh mesh6 = Own(CreateTickMesh(28)); Mesh mesh7 = Own(CreateScanGridMesh(13, 17)); Mesh mesh8 = Own(CreateProjectorConeMesh(24)); Mesh mesh9 = Own(CreateQuadMesh()); _emitterGlow = CreateRenderer("Soft Wrist Glow", mesh); _emitterCore = CreateRenderer("Emitter Core", mesh2); _emitterLens = CreateRenderer("Bright Hologram Lens", mesh); _projectorCone = CreateRenderer("Smooth Volumetric Projector Cone", mesh8); _projectorPulse = CreateRenderer("Projector Scan Pulse", mesh); ((Component)_projectorPulse).gameObject.SetActive(false); for (int i = 0; i < _rings.Length; i++) { _rings[i] = CreateRenderer("Energy Ring " + i, mesh3); } for (int j = 0; j < _stageRings.Length; j++) { _stageRings[j] = CreateRenderer("Avatar Stage Ring " + j, mesh4); } for (int k = 0; k < _stageArcs.Length; k++) { _stageArcs[k] = CreateRenderer("Rotating Stage Arc " + k, mesh5); } _ticks = CreateRenderer("Emitter Ticks", mesh6); _scanGrid = CreateRenderer("Avatar Assembly Scan Dots", mesh7); _centerHalo = CreateRenderer("Selected Avatar Stage Halo", mesh); _revealEdge = CreateRenderer("Tablet Reveal Edge", mesh9); ((Component)_revealEdge).gameObject.SetActive(false); } catch (Exception ex) { if (!_loggedFailure) { _loggedFailure = true; _log.Warning("Cinematic wrist projection disabled: " + ex.Message); } Dispose(); } } private Mesh Own(Mesh mesh) { _ownedMeshes.Add(mesh); return mesh; } private Renderer CreateRenderer(string name, Mesh mesh) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null || (Object)(object)_material == (Object)null) { throw new InvalidOperationException("Projection pool is unavailable."); } GameObject val = new GameObject(name); val.transform.SetParent(_root.transform, false); val.AddComponent().sharedMesh = mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = _material; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return (Renderer)(object)obj; } private void SetAlpha(Renderer renderer, float alpha) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) SetTint(renderer, _accent, alpha); } private void SetTint(Renderer renderer, Color tint, float alpha) { //IL_0002: 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_000e: 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_0046: 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) Color val = default(Color); ((Color)(ref val))..ctor(tint.r, tint.g, tint.b, Mathf.Clamp01(alpha)); _block.Clear(); _block.SetColor("_Color", val); _block.SetColor("_BaseColor", val); _block.SetColor("_TintColor", val); renderer.SetPropertyBlock(_block); } private static Vector3 SafeNormal(Vector3 value, Vector3 fallback) { //IL_0000: 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_000d: 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_0039: Unknown result type (might be due to invalid IL or missing references) if (!float.IsFinite(value.x) || !float.IsFinite(value.y) || !float.IsFinite(value.z) || !(((Vector3)(ref value)).sqrMagnitude > 0.001f)) { return fallback; } return ((Vector3)(ref value)).normalized; } private static float MaxAxis(Vector3 value) { //IL_0008: 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_0024: Unknown result type (might be due to invalid IL or missing references) return Mathf.Max(new float[3] { Mathf.Abs(value.x), Mathf.Abs(value.y), Mathf.Abs(value.z) }); } private static Mesh CreateSoftDiscMesh(int segments) { //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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[segments + 1]; Color[] array2 = (Color[])(object)new Color[segments + 1]; int[] array3 = new int[segments * 3]; array2[0] = Color.white; for (int i = 0; i < segments; i++) { float num = (float)i / (float)segments * (float)Math.PI * 2f; array[i + 1] = new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f); array2[i + 1] = new Color(1f, 1f, 1f, 0f); array3[i * 3] = 0; array3[i * 3 + 1] = i + 1; array3[i * 3 + 2] = (i + 1) % segments + 1; } Mesh obj = FinalizeMesh("WristHub Soft Glow", array, array3); obj.colors = Il2CppStructArray.op_Implicit(array2); return obj; } private static Mesh CreateDiscMesh(int segments) { //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_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) Vector3[] array = (Vector3[])(object)new Vector3[segments + 1]; int[] array2 = new int[segments * 3]; array[0] = Vector3.zero; for (int i = 0; i < segments; i++) { float num = (float)i / (float)segments * (float)Math.PI * 2f; array[i + 1] = new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f); array2[i * 3] = 0; array2[i * 3 + 1] = i + 1; array2[i * 3 + 2] = (i + 1) % segments + 1; } return FinalizeMesh("WristHub Emitter Core", array, array2); } private static Mesh CreateSegmentedRingMesh(int segments, float innerRatio, float gapRatio) { //IL_0084: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[segments * 4]; int[] array2 = new int[segments * 6]; Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 0; i < segments; i++) { float num = ((float)i + gapRatio * 0.5f) / (float)segments * (float)Math.PI * 2f; float num2 = ((float)i + 1f - gapRatio * 0.5f) / (float)segments * (float)Math.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), Mathf.Sin(num)); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2), Mathf.Sin(num2)); int num3 = i * 4; array[num3] = val; array[num3 + 1] = val2; array[num3 + 2] = val2 * innerRatio; array[num3 + 3] = val * innerRatio; int num4 = i * 6; array2[num4] = num3; array2[num4 + 1] = num3 + 1; array2[num4 + 2] = num3 + 2; array2[num4 + 3] = num3; array2[num4 + 4] = num3 + 2; array2[num4 + 5] = num3 + 3; } return FinalizeMesh("WristHub Thin Segmented Ring", array, array2); } private static Mesh CreateTickMesh(int ticks) { //IL_0040: 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_0095: 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_00a2: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f8: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[ticks * 4]; int[] array2 = new int[ticks * 6]; Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 0; i < ticks; i++) { float num = (float)i / (float)ticks * (float)Math.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), Mathf.Sin(num)); ((Vector3)(ref val2))..ctor(0f - val.y, val.x); float num2 = ((i % 4 == 0) ? 1.08f : 1.03f); float num3 = ((i % 4 == 0) ? 0.9f : 0.95f); float num4 = ((i % 4 == 0) ? 0.01f : 0.006f); int num5 = i * 4; array[num5] = val * num2 + val2 * num4; array[num5 + 1] = val * num2 - val2 * num4; array[num5 + 2] = val * num3 - val2 * num4; array[num5 + 3] = val * num3 + val2 * num4; int num6 = i * 6; array2[num6] = num5; array2[num6 + 1] = num5 + 1; array2[num6 + 2] = num5 + 2; array2[num6 + 3] = num5; array2[num6 + 4] = num5 + 2; array2[num6 + 5] = num5 + 3; } return FinalizeMesh("WristHub Restrained Ticks", array, array2); } private static Mesh CreateArcMesh(int segments, float innerRatio, float arcFraction) { //IL_0076: 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_0082: 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_008e: 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_00a0: 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) Vector3[] array = (Vector3[])(object)new Vector3[segments * 4]; int[] array2 = new int[segments * 6]; float num = Mathf.Clamp01(arcFraction) * (float)Math.PI * 2f; Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 0; i < segments; i++) { float num2 = (float)i / (float)segments * num; float num3 = ((float)i + 0.82f) / (float)segments * num; ((Vector3)(ref val))..ctor(Mathf.Cos(num2), Mathf.Sin(num2)); ((Vector3)(ref val2))..ctor(Mathf.Cos(num3), Mathf.Sin(num3)); int num4 = i * 4; array[num4] = val; array[num4 + 1] = val2; array[num4 + 2] = val2 * innerRatio; array[num4 + 3] = val * innerRatio; int num5 = i * 6; array2[num5] = num4; array2[num5 + 1] = num4 + 1; array2[num5 + 2] = num4 + 2; array2[num5 + 3] = num4; array2[num5 + 4] = num4 + 2; array2[num5 + 5] = num4 + 3; } return FinalizeMesh("WristHub Rotating Energy Arc", array, array2); } private static Mesh CreateScanGridMesh(int columns, int rows) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) int num = columns * rows; Vector3[] array = (Vector3[])(object)new Vector3[num * 4]; int[] array2 = new int[num * 6]; int num2 = 0; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { float num3 = ((columns <= 1) ? 0f : ((float)j / (float)(columns - 1) - 0.5f)); float num4 = ((rows <= 1) ? 0f : ((float)i / (float)(rows - 1) - 0.5f)); float num5 = 0.008f * (0.72f + (float)((j + i) % 3) * 0.14f); int num6 = num2 * 4; array[num6] = new Vector3(num3 - num5, num4 - num5); array[num6 + 1] = new Vector3(num3 + num5, num4 - num5); array[num6 + 2] = new Vector3(num3 + num5, num4 + num5); array[num6 + 3] = new Vector3(num3 - num5, num4 + num5); int num7 = num2 * 6; array2[num7] = num6; array2[num7 + 1] = num6 + 1; array2[num7 + 2] = num6 + 2; array2[num7 + 3] = num6; array2[num7 + 4] = num6 + 2; array2[num7 + 5] = num6 + 3; num2++; } } return FinalizeMesh("WristHub Avatar Scan Dot Grid", array, array2); } private static Mesh CreateProjectorConeMesh(int segments) { //IL_00ab: 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_00cb: 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_0189: 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_0199: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown segments = Mathf.Clamp(segments, 12, 32); Vector3[] array = (Vector3[])(object)new Vector3[segments * 4]; Color[] array2 = (Color[])(object)new Color[array.Length]; int[] array3 = new int[segments * 3 * 6]; float[] array4 = new float[4] { 0.82f, 0.46f, 0.2f, 0.035f }; for (int i = 0; i < 4; i++) { float num = (float)i / 3f; float num2 = Mathf.Lerp(0.075f, 0.5f, Mathf.SmoothStep(0f, 1f, num)); for (int j = 0; j < segments; j++) { float num3 = (float)j / (float)segments * (float)Math.PI * 2f; int num4 = i * segments + j; array[num4] = new Vector3(Mathf.Cos(num3) * num2, num, Mathf.Sin(num3) * num2); array2[num4] = new Color(1f, 1f, 1f, array4[i]); } } int num5 = 0; for (int k = 0; k < 3; k++) { for (int l = 0; l < segments; l++) { int num6 = (l + 1) % segments; int num7 = k * segments + l; int num8 = k * segments + num6; int num9 = (k + 1) * segments + l; int num10 = (k + 1) * segments + num6; array3[num5++] = num7; array3[num5++] = num10; array3[num5++] = num8; array3[num5++] = num7; array3[num5++] = num9; array3[num5++] = num10; } } Mesh val = new Mesh { name = "WristHub Smooth Volumetric Projector Cone", vertices = Il2CppStructArray.op_Implicit(array), colors = Il2CppStructArray.op_Implicit(array2), triangles = Il2CppStructArray.op_Implicit(array3) }; val.RecalculateBounds(); return val; } private static Mesh CreateQuadMesh() { //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_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_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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) return FinalizeMesh("WristHub Reveal Edge", (Vector3[])(object)new Vector3[4] { new Vector3(-0.5f, -0.5f), new Vector3(0.5f, -0.5f), new Vector3(0.5f, 0.5f), new Vector3(-0.5f, 0.5f) }, new int[6] { 0, 1, 2, 0, 2, 3 }); } private static Mesh FinalizeMesh(string name, Vector3[] vertices, int[] triangles) { //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_004f: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown int[] array = new int[triangles.Length * 2]; Array.Copy(triangles, array, triangles.Length); for (int i = 0; i < triangles.Length; i += 3) { int num = triangles.Length + i; array[num] = triangles[i]; array[num + 1] = triangles[i + 2]; array[num + 2] = triangles[i + 1]; } Mesh val = new Mesh { name = name, vertices = Il2CppStructArray.op_Implicit(vertices), triangles = Il2CppStructArray.op_Implicit(array) }; val.RecalculateBounds(); return val; } } internal readonly record struct BoneHubForearmProjectionAnchor(bool IsLeft, Transform Source, Vector3 EmitterPosition, Vector3 SurfaceNormal, Vector3 ArmDirection, bool UsesForearm); internal sealed class BoneHubForearmProjectionAnchorProvider { private Transform? _leftForearm; private Transform? _leftHandBone; private Transform? _rightForearm; private Transform? _rightHandBone; private int _rigId; private int _leftHandId; private int _rightHandId; private int _animatorId; private Animator? _animator; private float _nextResolveAt; public bool TryGet(bool left, float heightRatio, out BoneHubForearmProjectionAnchor anchor) { //IL_00e1: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_010b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_011d: 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_014c: 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_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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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) //IL_017f: 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_0188: 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_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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_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_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_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) anchor = default(BoneHubForearmProjectionAnchor); RefreshIdentity(); if (Time.unscaledTime >= _nextResolveAt || (Object)(object)_animator == (Object)null || (left ? ((Object)(object)_leftForearm == (Object)null) : ((Object)(object)_rightForearm == (Object)null))) { ResolveBones(); } Transform val = (left ? _leftForearm : _rightForearm); Transform val2 = (left ? _leftHandBone : _rightHandBone); Hand obj = (left ? Player.LeftHand : Player.RightHand); Transform val3 = ((obj != null) ? ((Component)obj).transform : null); Transform val4 = (((Object)(object)val2 != (Object)null) ? val2 : (((Object)(object)val != (Object)null) ? val : val3)); if ((Object)(object)val4 == (Object)null) { return false; } float num = Mathf.Max(0.05f, heightRatio); bool flag = (Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null; Vector3 val5; Vector3 val6; if (!flag) { val5 = val4.forward; } else { val6 = val2.position - val.position; val5 = ((Vector3)(ref val6)).normalized; } Vector3 val7 = val5; if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val7 = val4.forward; } Vector3 val8 = (flag ? Vector3.Lerp(val.position, val2.position, 0.9f) : (val4.position - val4.forward * (0.025f * num))); Vector3 val9 = (((Object)(object)Player.Head == (Object)null) ? val4.up : (Player.Head.position - val8)); val6 = Vector3.ProjectOnPlane(val9, val7); Vector3 val10 = ((Vector3)(ref val6)).normalized; if (((Vector3)(ref val10)).sqrMagnitude < 0.01f) { val6 = Vector3.ProjectOnPlane(val4.up, val7); val10 = ((Vector3)(ref val6)).normalized; } if (((Vector3)(ref val10)).sqrMagnitude < 0.01f) { val10 = val4.up; } if (Vector3.Dot(val10, val9) < 0f) { val10 = -val10; } Vector3 emitterPosition = val8 + val10 * (0.028f * num); anchor = new BoneHubForearmProjectionAnchor(left, val4, emitterPosition, val10, val7, flag); return true; } public void Invalidate() { _leftForearm = null; _leftHandBone = null; _rightForearm = null; _rightHandBone = null; _rigId = 0; _leftHandId = 0; _rightHandId = 0; _animatorId = 0; _animator = null; _nextResolveAt = 0f; } private void RefreshIdentity() { int num = SafeId((Object?)(object)Player.RigManager); int num2 = SafeId((Object?)(object)Player.LeftHand); int num3 = SafeId((Object?)(object)Player.RightHand); if (num != _rigId || num2 != _leftHandId || num3 != _rightHandId) { Invalidate(); _rigId = num; _leftHandId = num2; _rightHandId = num3; } } private void ResolveBones() { _nextResolveAt = Time.unscaledTime + 1f; try { Animator val = FindAnimator(); if (!((Object)(object)val == (Object)null)) { _animator = val; _animatorId = SafeId((Object?)(object)val); _leftForearm = val.GetBoneTransform((HumanBodyBones)15); _leftHandBone = val.GetBoneTransform((HumanBodyBones)17); _rightForearm = val.GetBoneTransform((HumanBodyBones)16); _rightHandBone = val.GetBoneTransform((HumanBodyBones)18); } } catch { _leftForearm = null; _leftHandBone = null; _rightForearm = null; _rightHandBone = null; _nextResolveAt = Time.unscaledTime + 1f; } } private static int SafeId(Object? value) { try { return (!(value == (Object)null)) ? value.GetInstanceID() : 0; } catch { return 0; } } private static Animator? FindAnimator() { try { RigManager rigManager = Player.RigManager; return (rigManager != null) ? ((IEnumerable)((Component)rigManager).GetComponentsInChildren(true)).FirstOrDefault((Func)((Animator candidate) => (Object)(object)candidate != (Object)null && candidate.isHuman && (Object)(object)candidate.GetBoneTransform((HumanBodyBones)15) != (Object)null)) : null; } catch { return null; } } } internal sealed class BoneHubHologramCarousel : IDisposable { private sealed class SideSlot { public GameObject Root { get; init; } public GameObject Fallback { get; init; } public string Barcode { get; set; } = string.Empty; public int Generation { get; set; } public GameObject? Model { get; set; } public Renderer[] Renderers { get; set; } = Array.Empty(); public bool DesiredVisible { get; set; } } private static readonly Color HologramBlue = new Color(0.03f, 0.74f, 1f, 1f); private readonly ConcurrentQueue _mainThread; private readonly Instance _log; private readonly bool _constrained; private readonly MaterialPropertyBlock _block = new MaterialPropertyBlock(); private readonly SideSlot[] _slots = new SideSlot[2]; private GameObject? _root; private Material? _material; private float _transitionStartedAt; private bool _visible; private bool _loggedFailure; public BoneHubHologramCarousel(Transform parent, ConcurrentQueue mainThread, bool constrained, Instance log) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown _mainThread = mainThread; _constrained = constrained; _log = log; Build(parent); } public void SetVisible(bool visible) { _visible = visible; if ((Object)(object)_root != (Object)null) { _root.SetActive(visible); } } public void SetSelection(BoneHubAvatar? previous, BoneHubAvatar? next, HoloPerformanceTier tier, bool showPrevious = true, bool showNext = true) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Invalid comparison between Unknown and I4 //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (_slots[0] != null && _slots[1] != null) { _transitionStartedAt = Time.unscaledTime; _slots[0].DesiredVisible = showPrevious; _slots[1].DesiredVisible = showNext; _slots[0].Root.SetActive(showPrevious && (int)tier != 2); _slots[1].Root.SetActive(showNext && (int)tier != 2); Bind(_slots[0], previous, tier); Bind(_slots[1], next, tier); } } public void Tick(float assemblyProgress, bool reducedMotion, HoloPerformanceTier tier) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //IL_00ec: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Invalid comparison between Unknown and I4 //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Invalid comparison between Unknown and I4 if (!_visible || (Object)(object)_root == (Object)null) { return; } float num = (reducedMotion ? 1f : Mathf.Clamp01(assemblyProgress)); float num2 = (reducedMotion ? 1f : Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((Time.unscaledTime - _transitionStartedAt) / 0.3f))); Vector3 val = default(Vector3); for (int i = 0; i < _slots.Length; i++) { SideSlot sideSlot = _slots[i]; if (sideSlot == null || (Object)(object)sideSlot.Root == (Object)null) { continue; } bool flag = sideSlot.DesiredVisible && (int)tier != 2; if (sideSlot.Root.activeSelf != flag) { sideSlot.Root.SetActive(flag); } if (flag) { float num3 = ((i == 0) ? (-1f) : 1f); ((Vector3)(ref val))..ctor(num3 * 0.105f, -0.018f, -0.018f); sideSlot.Root.transform.localPosition = new Vector3(val.x * num2, val.y, val.z); float num4 = 0.62f * num * num2; if (!reducedMotion && (int)tier != 2) { num4 *= 1f + Mathf.Sin(Time.unscaledTime * 2.1f + (float)i * 2.4f) * 0.012f; } sideSlot.Root.transform.localScale = Vector3.one * Mathf.Max(0.001f, num4); SetSlotAlpha(sideSlot, ((int)tier == 2) ? 0.18f : (0.38f * num)); } } } public void Dispose() { for (int i = 0; i < _slots.Length; i++) { if (_slots[i] != null) { Clear(_slots[i]); } } if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } _root = null; _material = null; } private void Build(Transform parent) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown try { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Transparent") ?? Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Standard"); if ((Object)(object)val == (Object)null) { throw new InvalidOperationException("No safe hologram shader is available."); } _material = new Material(val) { name = "WristHub Side Avatar Hologram", renderQueue = 3090 }; if (_material.HasProperty("_Cull")) { _material.SetInt("_Cull", 0); } _root = new GameObject("[WristHub] Three Avatar Carousel"); _root.transform.SetParent(parent, false); for (int i = 0; i < _slots.Length; i++) { GameObject val2 = new GameObject((i == 0) ? "Previous Hologram Avatar" : "Next Hologram Avatar"); val2.transform.SetParent(_root.transform, false); GameObject fallback = CreateFallback(val2.transform); _slots[i] = new SideSlot { Root = val2, Fallback = fallback }; } _root.SetActive(false); } catch (Exception ex) { if (!_loggedFailure) { _loggedFailure = true; _log.Warning("Side avatar holograms disabled: " + ex.Message); } } } private void Bind(SideSlot slot, BoneHubAvatar? avatar, HoloPerformanceTier tier) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Invalid comparison between Unknown and I4 //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown string text = avatar?.Barcode ?? string.Empty; if (string.Equals(slot.Barcode, text, StringComparison.OrdinalIgnoreCase) && ((Object)(object)slot.Model != (Object)null || text.Length == 0)) { return; } slot.Generation++; ClearVisual(slot); slot.Barcode = text; slot.Fallback.SetActive(true); if (avatar == null || (int)tier == 2 || (Object)(object)_material == (Object)null) { return; } int generation = slot.Generation; try { AvatarCrate crate = ((CrateReferenceT)new AvatarCrateReference(avatar.Barcode)).Crate; MarrowAssetT val = ((crate != null) ? ((GameObjectCrate)crate).PreviewMesh : null); if ((MarrowAsset)(object)val == (MarrowAsset)null) { return; } val.LoadAsset(Action.op_Implicit((Action)delegate(Mesh mesh) { _mainThread.Enqueue(delegate { if (!((Object)(object)mesh == (Object)null) && generation == slot.Generation && !((Object)(object)_material == (Object)null) && string.Equals(slot.Barcode, avatar.Barcode, StringComparison.OrdinalIgnoreCase)) { RenderOnlyPreviewResult renderOnlyPreviewResult = BoneHubRenderOnlyPreviewBuilder.BuildNativePreview(mesh, _material, slot.Root.transform, _constrained, 0f, (AvatarPreviewHeightSource)0, 0, null); if (renderOnlyPreviewResult.Valid && !((Object)(object)renderOnlyPreviewResult.Root == (Object)null)) { ClearVisual(slot); slot.Model = renderOnlyPreviewResult.Root; slot.Renderers = ((IEnumerable)renderOnlyPreviewResult.Root.GetComponentsInChildren(true)).Where((Renderer renderer) => (Object)(object)renderer != (Object)null).ToArray(); slot.Fallback.SetActive(false); } } }); })); } catch { } } private void SetSlotAlpha(SideSlot slot, float alpha) { //IL_0057: 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_0079: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(HologramBlue.r, HologramBlue.g, HologramBlue.b, Mathf.Clamp01(alpha)); for (int i = 0; i < slot.Renderers.Length; i++) { Renderer val2 = slot.Renderers[i]; if (!((Object)(object)val2 == (Object)null)) { _block.Clear(); _block.SetColor("_Color", val); _block.SetColor("_BaseColor", val); _block.SetColor("_TintColor", val); val2.SetPropertyBlock(_block); } } } private GameObject CreateFallback(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0033: 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_005e: 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_0098: 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_00d2: 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) GameObject val = new GameObject("Blue Hologram Silhouette"); val.transform.SetParent(parent, false); CreateFallbackPart(val.transform, "Head", new Vector3(0f, 0.06f, 0f), new Vector3(0.036f, 0.036f, 0.02f), (PrimitiveType)0); CreateFallbackPart(val.transform, "Body", Vector3.zero, new Vector3(0.052f, 0.074f, 0.018f), (PrimitiveType)3); CreateFallbackPart(val.transform, "Leg L", new Vector3(-0.015f, -0.061f, 0f), new Vector3(0.016f, 0.052f, 0.014f), (PrimitiveType)3); CreateFallbackPart(val.transform, "Leg R", new Vector3(0.015f, -0.061f, 0f), new Vector3(0.016f, 0.052f, 0.014f), (PrimitiveType)3); return val; } private void CreateFallbackPart(Transform parent, string name, Vector3 position, Vector3 scale, PrimitiveType primitive) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(primitive); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = position; obj.transform.localScale = scale; Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)_material != (Object)null) { component2.sharedMaterial = _material; component2.shadowCastingMode = (ShadowCastingMode)0; component2.receiveShadows = false; } } private static void ClearVisual(SideSlot slot) { if ((Object)(object)slot.Model != (Object)null) { Object.Destroy((Object)(object)slot.Model); } slot.Model = null; slot.Renderers = Array.Empty(); } private static void Clear(SideSlot slot) { slot.Generation++; ClearVisual(slot); slot.Barcode = string.Empty; } } public sealed class BoneHubMod : MelonMod { private sealed class PendingFusionAnnouncement { public BoneHubAvatar Avatar { get; } public ModIoSharingMetadata Sharing { get; } public double NextPollAt { get; set; } public double NextRefreshAt { get; set; } public double NextSendAt { get; set; } public double AvatarMismatchSince { get; set; } = -1.0; public double WaitingSince { get; } public int SuccessfulSends { get; set; } public int FailedSends { get; set; } public bool WaitingReported { get; set; } public bool NetworkerMissingReported { get; set; } public PendingFusionAnnouncement(BoneHubAvatar avatar, ModIoSharingMetadata sharing, double waitingSince) { Avatar = avatar; Sharing = sharing; WaitingSince = waitingSince; } } private readonly ConcurrentQueue _mainThread = new ConcurrentQueue(); private readonly ErrorLogThrottle _uiErrorThrottle = new ErrorLogThrottle(); private BoneHubService? _service; private BoneHubMenu? _menu; private BoneHubWristWatch? _watch; private BoneHubRuntime? _runtime; private BoneHubAvatarBrowser? _browser; private BoneHubThumbnailCache? _thumbnails; private LobbyAvatarSharingBridge? _sharing; private PendingFusionAnnouncement? _pendingFusionAnnouncement; private object? _beforeRenderCallback; private MethodInfo? _beforeRenderUnregister; public override void OnInitializeMelon() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown try { if ((int)Application.platform != 11) { ((MelonBase)this).LoggerInstance.Error("This is the standalone Quest build of WristHub. Install the PCVR WristHub package on Windows."); return; } BoneHubOptions val = CreateOptions(); ModIoClient val2 = new ModIoClient(val, (HttpClient)null); DownloadManager val3 = new DownloadManager((IModIoClient)(object)val2, new SafeModInstaller(val), val); _service = new BoneHubService((IModIoClient)(object)val2, val3, val); _service.DownloadChanged += delegate(DownloadJob job) { _mainThread.Enqueue(delegate { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 _menu?.OnDownloadChanged(job); _watch?.OnDownloadChanged(job); _browser?.OnDownloadChanged(job); if ((int)job.State == 5 && job.Result != null) { _runtime?.LoadInstallation(job.Result); _sharing?.RequestRefresh(immediate: true); ModIoSharingMetadata sharing = job.Result.Sharing; if (!string.IsNullOrWhiteSpace((sharing != null) ? sharing.Warning : null)) { ((MelonBase)this).LoggerInstance.Msg("Warning: " + job.Result.Sharing.Warning); } } }); }; _service.InstalledChanged += delegate { _mainThread.Enqueue(delegate { _runtime?.SetPendingDeletions(_service.PendingDeletionModIds); _runtime?.RegisterInstalled(_service.Installed); _browser?.Refresh(); _menu?.OnInstalledChanged(); }); }; _service.InitializeAsync(default(CancellationToken)).GetAwaiter().GetResult(); PendingDeletionProcessResult result = _service.ProcessPendingDeletionsAsync(default(CancellationToken)).GetAwaiter().GetResult(); if (result.Completed > 0) { ((MelonBase)this).LoggerInstance.Msg($"Finished {result.Completed} queued avatar-pack deletion{((result.Completed == 1) ? string.Empty : "s")} before Asset Warehouse startup."); } if (result.Remaining > 0) { ((MelonBase)this).LoggerInstance.Warning($"{result.Remaining} queued avatar-pack deletion{((result.Remaining == 1) ? string.Empty : "s")} could not finish yet: " + string.Join("; ", result.Problems.Take(3))); } BoneHubTheme.Initialize(((MelonBase)this).LoggerInstance); _sharing = new LobbyAvatarSharingBridge(((MelonBase)this).LoggerInstance); _runtime = new BoneHubRuntime(_mainThread, val.ModsDirectory, ((MelonBase)this).LoggerInstance); _runtime.RequestAvatarRestore(_service.LastEquippedAvatarBarcode); _thumbnails = new BoneHubThumbnailCache(Path.Combine(val.DataDirectory, "cache", "thumbnails"), _mainThread, ((MelonBase)this).LoggerInstance); _browser = new BoneHubAvatarBrowser(_service, _runtime, _thumbnails, _mainThread, _service.Preferences, val.ConstrainedRendering, ((MelonBase)this).LoggerInstance, _sharing); _watch = new BoneHubWristWatch(_browser.OpenLauncher, _browser.Close, () => _browser.IsLauncherOpen, () => _browser.IsClosing, _service.Preferences, ((MelonBase)this).LoggerInstance); _browser.Closed += _watch.RequireLookAway; _runtime.SetPendingDeletions(_service.PendingDeletionModIds); _runtime.RegisterInstalled(_service.Installed); _runtime.AvatarsChanged += delegate(long modId, IReadOnlyList avatars) { _browser?.OnAvatarsChanged(modId, avatars); _menu?.OnAvatarsChanged(modId, avatars); }; _runtime.EquipFinished += delegate(BoneHubAvatar avatar, bool success, string? error) { _menu?.OnEquipFinished(avatar, success, error); _browser?.OnEquipFinished(avatar, success); if (!success) { if (_pendingFusionAnnouncement != null && string.Equals(_pendingFusionAnnouncement.Avatar.Barcode, avatar.Barcode, StringComparison.OrdinalIgnoreCase)) { _pendingFusionAnnouncement = null; } } else { InstalledModRecord? obj = ((IEnumerable)_service.Installed).FirstOrDefault((Func)((InstalledModRecord item) => item.ModId == avatar.ModId)); ModIoSharingMetadata sharing = ((obj != null) ? obj.Sharing : null); BeginFusionAnnouncement(avatar, sharing); Task.Run(async delegate { await _service.MarkAvatarEquippedAsync(avatar.Barcode, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _browser?.Refresh(); }); }); } }; _runtime.StatusChanged += delegate(string status) { _watch?.SetStatus(status); _menu?.OnRuntimeStatusChanged(status); _browser?.OnRuntimeStatusChanged(status); }; _menu = new BoneHubMenu(_service, _mainThread, _watch, _runtime, _browser, _thumbnails, val.PlatformDisplayName, ((MelonBase)this).LoggerInstance, _sharing); _menu.Create(); HookFinalWristPose(); _sharing.RequestRefresh(immediate: true); Task.Run(async delegate { int repaired = await _service.RepairSharingRegistrationsAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); if (repaired > 0) { _mainThread.Enqueue(delegate { _sharing?.RequestRefresh(immediate: true); ((MelonBase)this).LoggerInstance.Msg($"Repaired Fusion sharing registration for {repaired} WristHub download{((repaired == 1) ? string.Empty : "s")}."); }); } }); ((MelonBase)this).LoggerInstance.Msg("WristHubV4 4.0.1 BETA — now running on WristHubOS for " + val.PlatformDisplayName + ". Native mod apps, legacy BoneMenu compatibility, themes, shared portals, and guarded performance systems are ready."); } catch (Exception value) { ((MelonBase)this).LoggerInstance.Error($"WristHub could not initialize: {value}"); } } public override void OnUpdate() { for (int i = 0; i < 32; i++) { if (!_mainThread.TryDequeue(out Action result)) { break; } try { result(); } catch (Exception ex) { string text = ex.GetType().FullName + "|" + ex.StackTrace?.Split('\n').FirstOrDefault(); if (_uiErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { ((MelonBase)this).LoggerInstance.Error($"WristHub UI action failed (repeated copies are suppressed): {ex}"); } } } _watch?.Tick(); _menu?.Tick(); FusionPortalBridge.TickServerSwitch(((MelonBase)this).LoggerInstance); bool isServerSwitchPending = FusionPortalBridge.IsServerSwitchPending; _runtime?.Tick(isServerSwitchPending); if (!isServerSwitchPending && _sharing != null && _runtime != null) { _sharing.TickPeerAvatarRecovery(_runtime.IsAvatarAssetReadyForFusionRecovery); } if (!isServerSwitchPending) { TickFusionAnnouncement(); } if (!isServerSwitchPending) { _browser?.Tick(); } NativeMenuHostBridge.TickSelectorLine(); } public override void OnLateUpdate() { _watch?.LateTick(); _browser?.LateTick(); } private void ApplyFinalWristPose() { try { _watch?.LateTick(); _browser?.LateTick(); NativeMenuHostBridge.TickSelectorLine(); } catch (Exception ex) { string text = "before-render|" + ex.GetType().FullName; if (_uiErrorThrottle.ShouldLog(text, (double)Environment.TickCount64 / 1000.0, 5.0)) { ((MelonBase)this).LoggerInstance.Error("WristHub final wrist pose recovered: " + ex.Message); } } } private void HookFinalWristPose() { UnhookFinalWristPose(); try { EventInfo eventInfo = typeof(Application).GetEvent("onBeforeRender", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo methodInfo = eventInfo?.GetAddMethod(nonPublic: true); MethodInfo beforeRenderUnregister = eventInfo?.GetRemoveMethod(nonPublic: true); if (eventInfo?.EventHandlerType != null && methodInfo != null) { _beforeRenderCallback = CreateFinalPoseCallback(eventInfo.EventHandlerType); methodInfo.Invoke(null, new object[1] { _beforeRenderCallback }); _beforeRenderUnregister = beforeRenderUnregister; return; } Type? type = typeof(Application).Assembly.GetType("UnityEngine.BeforeRenderHelper"); MethodInfo methodInfo2 = type?.GetMethod("RegisterCallback", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo beforeRenderUnregister2 = type?.GetMethod("UnregisterCallback", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); Type type2 = methodInfo2?.GetParameters().FirstOrDefault()?.ParameterType; if (!(methodInfo2 == null) && !(type2 == null)) { _beforeRenderCallback = CreateFinalPoseCallback(type2); methodInfo2.Invoke(null, new object[1] { _beforeRenderCallback }); _beforeRenderUnregister = beforeRenderUnregister2; } } catch (Exception ex) { _beforeRenderCallback = null; _beforeRenderUnregister = null; ((MelonBase)this).LoggerInstance.Warning("WristHub will use its LateUpdate wrist lock because the final XR pose callback was unavailable: " + ex.GetBaseException().Message); } } private object CreateFinalPoseCallback(Type callbackType) { if (typeof(Delegate).IsAssignableFrom(callbackType)) { return Delegate.CreateDelegate(callbackType, this, "ApplyFinalWristPose"); } Action action = ApplyFinalWristPose; object obj = callbackType.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(delegate(MethodInfo method) { if (method.Name != "op_Implicit" || method.ReturnType != callbackType) { return false; } ParameterInfo[] parameters = method.GetParameters(); return parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(typeof(Action)); })?.Invoke(null, new object[1] { action }); if (obj != null) { return obj; } throw new InvalidOperationException("No managed callback conversion exists for " + callbackType.FullName + "."); } private void UnhookFinalWristPose() { if (_beforeRenderCallback != null) { try { _beforeRenderUnregister?.Invoke(null, new object[1] { _beforeRenderCallback }); } catch { } _beforeRenderCallback = null; _beforeRenderUnregister = null; } } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { _runtime?.OnSceneChanged(); _browser?.OnSceneChanged(sceneName); _watch?.Recenter(); if (_pendingFusionAnnouncement != null) { _pendingFusionAnnouncement.NextPollAt = 0.0; _pendingFusionAnnouncement.NextRefreshAt = 0.0; _pendingFusionAnnouncement.NextSendAt = 0.0; _pendingFusionAnnouncement.AvatarMismatchSince = -1.0; } } public override void OnDeinitializeMelon() { UnhookFinalWristPose(); _pendingFusionAnnouncement = null; _browser?.Dispose(); _watch?.Dispose(); _menu?.Dispose(); _runtime?.Dispose(); BoneHubService? service = _service; if (service != null) { service.Dispose(); } NativeMenuHostBridge.DisposeSelectorLine(); } private void BeginFusionAnnouncement(BoneHubAvatar avatar, ModIoSharingMetadata? sharing) { _pendingFusionAnnouncement = null; if (sharing != null && sharing.PalletBarcodes.Count > 0 && sharing.ModId > 0 && _sharing != null && _runtime != null) { double num = (double)Environment.TickCount64 / 1000.0; _pendingFusionAnnouncement = new PendingFusionAnnouncement(avatar, sharing, num) { NextPollAt = 0.0, NextRefreshAt = num + 5.0, NextSendAt = num + FusionAvatarAnnouncementPlan.InitialDelaySeconds }; if (!_sharing.IsRegistered(sharing.PalletBarcodes, sharing.ModId) && !_sharing.RegistrationRefreshBusy) { _sharing.RequestRefresh(immediate: true); } if (_runtime.FusionSessionActive) { _runtime.ReportSharingStatus("Equipped " + avatar.Title + " - multiplayer sharing preparing."); } } } private void TickFusionAnnouncement() { PendingFusionAnnouncement pendingFusionAnnouncement = _pendingFusionAnnouncement; if (pendingFusionAnnouncement == null || _sharing == null || _runtime == null) { return; } double num = (double)Environment.TickCount64 / 1000.0; if (!_runtime.IsCurrentAvatar(pendingFusionAnnouncement.Avatar.Barcode)) { if (pendingFusionAnnouncement.AvatarMismatchSince < 0.0) { pendingFusionAnnouncement.AvatarMismatchSince = num; } if (num - pendingFusionAnnouncement.AvatarMismatchSince >= 12.0) { _pendingFusionAnnouncement = null; } return; } pendingFusionAnnouncement.AvatarMismatchSince = -1.0; if (!_runtime.FusionSessionActive || num < pendingFusionAnnouncement.NextPollAt) { return; } pendingFusionAnnouncement.NextPollAt = num + 0.5; if (!_sharing.Available) { if (!pendingFusionAnnouncement.NetworkerMissingReported) { pendingFusionAnnouncement.NetworkerMissingReported = true; _runtime.ReportSharingStatus("Equipped locally - ModioModNetworker is required for peer downloads."); } } else if (!_sharing.IsRegistered(pendingFusionAnnouncement.Sharing.PalletBarcodes, pendingFusionAnnouncement.Sharing.ModId)) { if (num >= pendingFusionAnnouncement.NextRefreshAt && !_sharing.RegistrationRefreshBusy) { _sharing.RequestRefresh(immediate: true); pendingFusionAnnouncement.NextRefreshAt = num + 5.0; } if (!pendingFusionAnnouncement.WaitingReported && num - pendingFusionAnnouncement.WaitingSince >= 30.0) { pendingFusionAnnouncement.WaitingReported = true; _runtime.ReportSharingStatus("Equipped locally - multiplayer sharing is still preparing."); ((MelonBase)this).LoggerInstance.Msg("WristHub is still waiting for Fusion and ModioModNetworker registration; background retry remains active."); } } else { if (!_sharing.LobbyReadyToAnnounce || num < pendingFusionAnnouncement.NextSendAt) { return; } if (_runtime.ResendCurrentAvatarToFusion(pendingFusionAnnouncement.Avatar.Barcode, out string error)) { pendingFusionAnnouncement.SuccessfulSends++; pendingFusionAnnouncement.FailedSends = 0; if (pendingFusionAnnouncement.SuccessfulSends == 1) { _runtime.ReportSharingStatus("Equipped " + pendingFusionAnnouncement.Avatar.Title + " - shared with the Fusion lobby."); ((MelonBase)this).LoggerInstance.Msg("WristHub announced the registered avatar through Fusion's official sender; bounded peer-load recovery is active."); } double num2 = default(double); if (FusionAvatarAnnouncementPlan.TryGetDelayAfterSuccessfulSend(pendingFusionAnnouncement.SuccessfulSends, ref num2)) { pendingFusionAnnouncement.NextSendAt = num + num2; return; } _runtime.ReportSharingStatus("Equipped " + pendingFusionAnnouncement.Avatar.Title + " - multiplayer sharing ready."); ((MelonBase)this).LoggerInstance.Msg("WristHub completed the bounded Fusion peer-load recovery announcements."); _pendingFusionAnnouncement = null; } else { pendingFusionAnnouncement.FailedSends++; pendingFusionAnnouncement.NextSendAt = num + Math.Min(5.0, 0.75 * (double)pendingFusionAnnouncement.FailedSends); if (pendingFusionAnnouncement.FailedSends == 1 || pendingFusionAnnouncement.FailedSends % 8 == 0) { _runtime.ReportSharingStatus("Equipped locally - multiplayer sharing is retrying: " + error); ((MelonBase)this).LoggerInstance.Msg("Warning: Fusion avatar re-announcement is retrying: " + error); } } } } private static BoneHubOptions CreateOptions() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //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_00bf: 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_00e9: 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_0101: 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_0119: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown BoneHubPlatformProfile val = BoneHubPlatformProfile.Detect((int)Application.platform == 11); string text = Application.persistentDataPath; if (string.IsNullOrWhiteSpace(text)) { string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); text = Path.Combine(folderPath, "AppData", "LocalLow", "Stress Level Zero", "BONELAB"); } string text2 = Path.Combine(MelonEnvironment.UserDataDirectory, "WristHub"); string text3 = Path.Combine(MelonEnvironment.UserDataDirectory, "BoneHub"); if (!TryMigrateLegacyData(text3, text2)) { text2 = text3; } Directory.CreateDirectory(text2); string text4 = Environment.GetEnvironmentVariable("WRISTHUB_MODIO_API_KEY") ?? Environment.GetEnvironmentVariable("BONEHUB_MODIO_API_KEY") ?? ReadApiKeyFile(text2); BoneHubOptions val2 = new BoneHubOptions { ApiKey = text4.Trim() }; val2.set_ApiKeyFilePath(Path.Combine(text2, "modio-api-key.txt")); val2.set_HostedServiceBaseUrl(Environment.GetEnvironmentVariable("WRISTHUB_SERVICE_URL") ?? "https://wristhub-api.wristhub.workers.dev/v1"); val2.set_ModsDirectory(Path.Combine(text, "Mods")); val2.set_DataDirectory(text2); val2.set_TargetPlatform(val.ModIoHeader); val2.set_CompatiblePlatforms(val.CompatibleModIoPlatforms); val2.set_PlatformDisplayName(val.DisplayName); val2.set_MaximumDownloadBytes(val.MaximumDownloadBytes); val2.set_MaximumExtractedBytes(val.MaximumExtractedBytes); val2.set_ConstrainedRendering(val.ConstrainedRendering); return val2; } private static string ReadApiKeyFile(string dataDirectory) { string path = Path.Combine(dataDirectory, "modio-api-key.txt"); if (File.Exists(path)) { string text = File.ReadAllText(path).Trim(); if (!BoneHubOptions.IsValidApiKey(text)) { return string.Empty; } return text; } File.WriteAllText(path, "PASTE_YOUR_32_CHARACTER_MOD_IO_API_KEY_HERE"); return string.Empty; } private static bool TryMigrateLegacyData(string legacyDirectory, string targetDirectory) { if (!Directory.Exists(legacyDirectory)) { return true; } try { Directory.CreateDirectory(targetDirectory); foreach (string item in Directory.EnumerateFiles(legacyDirectory, "*", SearchOption.AllDirectories)) { string relativePath = Path.GetRelativePath(legacyDirectory, item); string text = Path.Combine(targetDirectory, relativePath); string directoryName = Path.GetDirectoryName(text); if (!string.IsNullOrWhiteSpace(directoryName)) { Directory.CreateDirectory(directoryName); } if (!File.Exists(text)) { File.Copy(item, text, overwrite: false); } } return !File.Exists(Path.Combine(legacyDirectory, "state.json")) || File.Exists(Path.Combine(targetDirectory, "state.json")); } catch { return false; } } } internal sealed class BoneHubMenu : IDisposable { private readonly BoneHubService _service; private readonly ConcurrentQueue _mainThread; private readonly BoneHubWristWatch _watch; private readonly BoneHubRuntime _runtime; private readonly BoneHubAvatarBrowser _browser; private readonly string _platformName; private readonly Instance _log; private readonly BoneHubThumbnailCache _thumbnails; private readonly LobbyAvatarSharingBridge _sharing; private Page? _root; private Page? _home; private Page? _discover; private Page? _setup; private Page? _results; private Page? _downloads; private Page? _installed; private Page? _favorites; private Page? _updates; private readonly Dictionary _jobs = new Dictionary(); private readonly List _jobOrder = new List(); private readonly List _installedDetailPages = new List(); private readonly Dictionary _maintenanceStatus = new Dictionary(); private readonly HashSet _projectAfterInstall = new HashSet(); private IReadOnlyList _availableUpdates = Array.Empty(); private string _runtimeStatus = "Asset Warehouse initializing"; private string _query = string.Empty; private string _creator = string.Empty; private bool _avatarsOnly = true; private ModSort _sort; private ModSearchRequest? _lastSearch; public BoneHubMenu(BoneHubService service, ConcurrentQueue mainThread, BoneHubWristWatch watch, BoneHubRuntime runtime, BoneHubAvatarBrowser browser, BoneHubThumbnailCache thumbnails, string platformName, Instance log, LobbyAvatarSharingBridge? sharing = null) { _service = service; _mainThread = mainThread; _watch = watch; _runtime = runtime; _browser = browser; _platformName = platformName; _log = log; _thumbnails = thumbnails; _sharing = sharing ?? new LobbyAvatarSharingBridge(log); } public void Open() { if (!_service.ModIoReady && _setup != null) { Menu.OpenPage(_setup); } else if (_home != null) { Menu.OpenPage(_home); } else if (_root != null) { Menu.OpenPage(_root); } } public void OpenDiscover() { _browser.OpenSearch(); } public void OpenInstalled() { _browser.Open(); } public void OpenDownloads() { RebuildDownloads(); if (_downloads != null) { Menu.OpenPage(_downloads); } } public void Create() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0374: 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_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Unknown result type (might be due to invalid IL or missing references) //IL_07ea: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) CreateSimpleMenu(); if (_root != null) { return; } _root = BoneHubTheme.Style(Page.Root.CreatePage(BoneHubTheme.Brand("WristHub // Holo Link"), BoneHubTheme.Cyan, 0, true), showLogo: true, 0.91f); _home = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("◈", "Home"), BoneHubTheme.Cyan, 0, true), showLogo: true); Page val = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("⚙", "Settings"), BoneHubTheme.Violet, 0, true)); _setup = BoneHubTheme.Style(val.CreatePage(BoneHubTheme.PageTitle("◇", "mod.io Setup"), BoneHubTheme.Amber, 0, true)); RebuildSetup(); _discover = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("⌕", "Search"), BoneHubTheme.Cyan, 0, true)); _discover.CreateFunction(BoneHubTheme.Brand("Find a BONELAB avatar"), Color.white, (Action)delegate { }); _discover.CreateString(BoneHubTheme.Label("Name", "Type an avatar name"), BoneHubTheme.Cyan, _query, (Action)delegate(string value) { _query = value?.Trim() ?? string.Empty; }); _discover.CreateString(BoneHubTheme.Label("Creator", "Optional"), BoneHubTheme.Blue, _creator, (Action)delegate(string value) { _creator = value?.Trim() ?? string.Empty; }); _discover.CreateBool(BoneHubTheme.Label("Avatars only", "Recommended"), BoneHubTheme.Blue, _avatarsOnly, (Action)delegate(bool value) { _avatarsOnly = value; }); _discover.CreateEnum(BoneHubTheme.Label("Sort", "Choose order"), BoneHubTheme.Violet, (Enum)(object)_sort, (Action)delegate(Enum value) { //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) _sort = (ModSort)(object)value; }); _discover.CreateFunction(BoneHubTheme.PrimaryAction("Search avatars"), BoneHubTheme.Cyan, (Action)RunSearch); _discover.CreateFunction(BoneHubTheme.SecondaryAction("View trending"), BoneHubTheme.Blue, (Action)delegate { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _query = string.Empty; _sort = (ModSort)0; RunSearch(); }); _discover.CreateFunction(BoneHubTheme.SecondaryAction("Browse new releases"), BoneHubTheme.Violet, (Action)delegate { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _query = string.Empty; _sort = (ModSort)1; RunSearch(); }); _results = BoneHubTheme.Style(_discover.CreatePage(BoneHubTheme.PageTitle("◫", "Results"), BoneHubTheme.Blue, 0, true)); _results.CreateFunction(BoneHubTheme.Status("Ready to search", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); _downloads = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("↓", "Downloads"), BoneHubTheme.Cyan, 0, true)); RebuildDownloads(); _installed = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("✓", "My Avatars"), BoneHubTheme.Green, 0, true)); RebuildInstalled(); _updates = BoneHubTheme.Style(_installed.CreatePage(BoneHubTheme.PageTitle("↻", "Updates"), BoneHubTheme.Blue, 0, true)); RebuildUpdateCenter(); _favorites = BoneHubTheme.Style(_discover.CreatePage(BoneHubTheme.PageTitle("★", "Saved"), BoneHubTheme.Amber, 0, true)); RebuildFavoritesLoading(); LoadFavorites(); val.CreateFunction(BoneHubTheme.Brand("Simple controls"), Color.white, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Status(_service.ModIoReady ? "mod.io connected" : "mod.io setup required", _service.ModIoReady ? "59E6A7" : "FFC970"), _service.ModIoReady ? BoneHubTheme.Green : BoneHubTheme.Amber, (Action)delegate { if (_setup != null) { Menu.OpenPage(_setup); } }); val.CreateFunction(BoneHubTheme.Label("Platform", _platformName), BoneHubTheme.Blue, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Label("Cache", "30 min · offline fallback"), BoneHubTheme.Cyan, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Label("Installer", "Verified safe mode"), BoneHubTheme.Green, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Label("Fusion", _runtime.FusionStatus), BoneHubTheme.Green, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Label("Performance", "Tablet previews use no Marrow grips"), BoneHubTheme.Blue, (Action)delegate { }); val.CreateEnum(BoneHubTheme.Label("Comfort preset", "Apply a complete layout preset"), BoneHubTheme.Violet, (Enum)(object)_service.Preferences.ComfortPreset, (Action)delegate(Enum value) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ApplyComfortPreset((BoneHubComfortPreset)(object)value); }); val.CreateBool(BoneHubTheme.Label("Wrist watch", "Enabled"), BoneHubTheme.Cyan, _watch.Enabled, (Action)delegate(bool value) { _watch.Enabled = value; SavePreferences(); }); val.CreateBool(BoneHubTheme.Label("Clock wake", "Look to show time"), BoneHubTheme.Blue, _watch.RaiseToOpen, (Action)delegate(bool value) { _watch.RaiseToOpen = value; SavePreferences(); }); val.CreateBool(BoneHubTheme.Label("Wrist", "Use left hand"), BoneHubTheme.Cyan, _watch.UseLeftWrist, (Action)delegate(bool value) { _watch.UseLeftWrist = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Watch size", "Scale"), BoneHubTheme.Blue, _watch.WatchScale, 0.05f, 0.65f, 1.6f, (Action)delegate(float value) { _watch.WatchScale = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Watch wake", "1 second"), BoneHubTheme.Violet, _watch.DwellSeconds, 0.25f, 1f, 1f, (Action)delegate(float value) { _watch.DwellSeconds = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Wrist height", "Outward offset"), BoneHubTheme.Cyan, _watch.OutwardOffset, 0.002f, 0.015f, 0.06f, (Action)delegate(float value) { _watch.OutwardOffset = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Wrist position", "Finger offset"), BoneHubTheme.Blue, _watch.FingerOffset, 0.002f, -0.055f, 0.025f, (Action)delegate(float value) { _watch.FingerOffset = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Watch along arm", "Elbow to hand"), BoneHubTheme.Cyan, _watch.ForearmOffset, 0.005f, -0.08f, 0.03f, (Action)delegate(float value) { _watch.ForearmOffset = value; SavePreferences(); }); val.CreateBool(BoneHubTheme.Label("Motion", "Reduced"), BoneHubTheme.Violet, _watch.ReducedMotion, (Action)delegate(bool value) { _watch.ReducedMotion = value; _browser.Refresh(); SavePreferences(); }); val.CreateFunction(BoneHubTheme.SecondaryAction("Recenter wrist watch"), BoneHubTheme.Cyan, (Action)_watch.Recenter); val.CreateFunction(BoneHubTheme.Label("Instant equip", "Patch 6 guarded runtime"), BoneHubTheme.Green, (Action)delegate { }); val.CreateFunction(BoneHubTheme.Label("Avatar Browser", "Safe grip or pinch controls"), BoneHubTheme.Cyan, (Action)_browser.Open); val.CreateBool(BoneHubTheme.Label("Hologram effects", "Scan lines and energy rings"), BoneHubTheme.Cyan, _service.Preferences.HologramEffects, (Action)delegate(bool value) { _service.Preferences.HologramEffects = value; _browser.Refresh(); SavePreferences(); }); val.CreateBool(BoneHubTheme.Label("Controller feedback", "Haptics"), BoneHubTheme.Blue, _service.Preferences.HapticsEnabled, (Action)delegate(bool value) { _service.Preferences.HapticsEnabled = value; SavePreferences(); }); val.CreateBool(BoneHubTheme.Label("Wardrobe audio", "Spatial UI sounds"), BoneHubTheme.Violet, _service.Preferences.SoundsEnabled, (Action)delegate(bool value) { _service.Preferences.SoundsEnabled = value; SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Projection distance", "Meters from headset"), BoneHubTheme.Cyan, _service.Preferences.CarouselDistance, 0.05f, 0.45f, 0.95f, (Action)delegate(float value) { _service.Preferences.CarouselDistance = value; _browser.Refresh(); SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Projection size", "Avatar and rack scale"), BoneHubTheme.Blue, _service.Preferences.HologramScale, 0.05f, 0.7f, 1.4f, (Action)delegate(float value) { _service.Preferences.HologramScale = value; _browser.Refresh(); SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Equip zone", "Chest target size"), BoneHubTheme.Violet, _service.Preferences.EquipZoneScale, 0.05f, 0.7f, 1.6f, (Action)delegate(float value) { _service.Preferences.EquipZoneScale = value; _browser.Refresh(); SavePreferences(); }); val.CreateFloat(BoneHubTheme.Label("Hologram glow", "Brightness"), BoneHubTheme.Cyan, _service.Preferences.HologramBrightness, 0.05f, 0.35f, 1.5f, (Action)delegate(float value) { _service.Preferences.HologramBrightness = value; _browser.Refresh(); SavePreferences(); }); val.CreateFunction(BoneHubTheme.SecondaryAction("Reset hologram comfort settings"), BoneHubTheme.Muted, (Action)ResetHologramPreferences); RebuildHome(); } private void CreateSimpleMenu() { //IL_0010: 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_0069: 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_00c7: 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_012b: 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_019e: 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_0220: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_030a: 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_036c: Unknown result type (might be due to invalid IL or missing references) _root = BoneHubTheme.Style(Page.Root.CreatePage(BoneHubTheme.Brand("WristHub // Avatar Browser"), BoneHubTheme.Cyan, 0, true), showLogo: true, 0.91f); _root.CreateFunction(BoneHubTheme.PrimaryAction("Open Avatar Browser"), BoneHubTheme.Cyan, (Action)delegate { _browser.Open(); }); _downloads = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("↓", "Downloads"), BoneHubTheme.Blue, 0, true)); RebuildDownloads(); Page obj = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("⚙", "Settings"), BoneHubTheme.Violet, 0, true)); obj.CreateBool(BoneHubTheme.Label("Wrist launcher", "Enabled"), BoneHubTheme.Cyan, _watch.Enabled, (Action)delegate(bool value) { _watch.Enabled = value; SavePreferences(); }); obj.CreateBool(BoneHubTheme.Label("Clock wake", "Look at wrist for 1 second"), BoneHubTheme.Blue, _watch.RaiseToOpen, (Action)delegate(bool value) { _watch.RaiseToOpen = value; SavePreferences(); }); obj.CreateBool(BoneHubTheme.Label("Wrist side", "Use left wrist"), BoneHubTheme.Cyan, _watch.UseLeftWrist, (Action)delegate(bool value) { _watch.UseLeftWrist = value; SavePreferences(); }); obj.CreateFloat(BoneHubTheme.Label("UI scale", "Wrist and browser"), BoneHubTheme.Blue, _watch.WatchScale, 0.05f, 0.65f, 1.6f, (Action)delegate(float value) { _watch.WatchScale = value; SavePreferences(); }); obj.CreateFloat(BoneHubTheme.Label("Wrist height", "Outward offset"), BoneHubTheme.Cyan, _watch.OutwardOffset, 0.002f, 0.015f, 0.06f, (Action)delegate(float value) { _watch.OutwardOffset = value; SavePreferences(); }); obj.CreateFloat(BoneHubTheme.Label("Wrist position", "Finger offset"), BoneHubTheme.Blue, _watch.FingerOffset, 0.002f, -0.055f, 0.025f, (Action)delegate(float value) { _watch.FingerOffset = value; SavePreferences(); }); obj.CreateFloat(BoneHubTheme.Label("Watch along arm", "Elbow to hand"), BoneHubTheme.Cyan, _watch.ForearmOffset, 0.005f, -0.08f, 0.03f, (Action)delegate(float value) { _watch.ForearmOffset = value; SavePreferences(); }); obj.CreateBool(BoneHubTheme.Label("Reduced motion", "Simpler transitions"), BoneHubTheme.Violet, _watch.ReducedMotion, (Action)delegate(bool value) { _watch.ReducedMotion = value; SavePreferences(); }); obj.CreateBool(BoneHubTheme.Label("Touch haptics", "One pulse per press"), BoneHubTheme.Blue, _service.Preferences.HapticsEnabled, (Action)delegate(bool value) { _service.Preferences.HapticsEnabled = value; SavePreferences(); }); obj.CreateFloat(BoneHubTheme.Label("Equip zone", "Chest target size"), BoneHubTheme.Cyan, _service.Preferences.EquipZoneScale, 0.05f, 0.7f, 1.6f, (Action)delegate(float value) { _service.Preferences.EquipZoneScale = value; SavePreferences(); }); obj.CreateFunction(BoneHubTheme.SecondaryAction("Reattach wrist UI"), BoneHubTheme.Cyan, (Action)_watch.Recenter); _setup = BoneHubTheme.Style(_root.CreatePage(BoneHubTheme.PageTitle("◇", "mod.io Setup"), BoneHubTheme.Amber, 0, true)); RebuildSetup(); _discover = BoneHubTheme.Style(_root.CreatePage("Avatar Search Keyboard", BoneHubTheme.Cyan, 0, false)); } private void RebuildHome() { //IL_0035: 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_00a9: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) if (_home == null) { return; } _home.RemoveAll(); int count = _runtime.GetAllAvatars().Count; _home.CreateFunction(BoneHubTheme.Brand("Suit up without leaving VR"), Color.white, (Action)delegate { }); _home.CreateFunction(BoneHubTheme.Status(_service.ModIoReady ? "Ready" : "Finish mod.io setup", _service.ModIoReady ? "59E6A7" : "FFC970"), _service.ModIoReady ? BoneHubTheme.Green : BoneHubTheme.Amber, (Action)delegate { if (_setup != null) { Menu.OpenPage(_setup); } }); _home.CreateFunction(BoneHubTheme.Label("Wrist link", "Look 1 sec for time - tap watch to open"), BoneHubTheme.Cyan, (Action)delegate { }); _home.CreateFunction(BoneHubTheme.Label("Avatar library", $"{count} ready"), BoneHubTheme.Blue, (Action)delegate { }); _home.CreateFunction(BoneHubTheme.Label("Multiplayer", _runtime.FusionStatus), BoneHubTheme.Green, (Action)delegate { }); _home.CreateFunction(BoneHubTheme.Hint("WristHubV4 — running on WristHubOS"), BoneHubTheme.Muted, (Action)delegate { }); _home.CreateFunction(BoneHubTheme.PrimaryAction("My avatars"), BoneHubTheme.Green, (Action)OpenInstalled); _home.CreateFunction(BoneHubTheme.PrimaryAction("Search mod.io"), BoneHubTheme.Cyan, (Action)OpenDiscover); _home.CreateFunction(BoneHubTheme.SecondaryAction("Downloads"), BoneHubTheme.Blue, (Action)OpenDownloads); } private void RebuildSetup(string? status = null, bool error = false) { //IL_0024: 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_0098: 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_0118: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) if (_setup == null) { return; } _setup.RemoveAll(); _setup.CreateFunction(BoneHubTheme.Brand("mod.io connection"), Color.white, (Action)delegate { }); _setup.CreateFunction(BoneHubTheme.Status(_service.ModIoReady ? "Connected" : "One-time setup", _service.ModIoReady ? "59E6A7" : "FFC970"), _service.ModIoReady ? BoneHubTheme.Green : BoneHubTheme.Amber, (Action)delegate { }); _setup.CreateFunction(BoneHubTheme.Body("Online search works automatically. A personal read-only mod.io key can be saved locally as an optional backup."), Color.white, (Action)delegate { }); _setup.CreateString(BoneHubTheme.Label("API key", "Input is saved locally"), BoneHubTheme.Cyan, string.Empty, (Action)SaveApiKey); _setup.CreateFunction(BoneHubTheme.Hint("File · " + Truncate(_service.ApiKeyFilePath, 52)), BoneHubTheme.Muted, (Action)delegate { }); if (!string.IsNullOrWhiteSpace(status)) { _setup.CreateFunction(BoneHubTheme.Status(status, error ? "FF6B82" : "59E6A7"), error ? BoneHubTheme.Danger : BoneHubTheme.Green, (Action)delegate { }); } if (_service.ModIoReady && _discover != null) { _setup.CreateFunction(BoneHubTheme.PrimaryAction("Continue to Discover"), BoneHubTheme.Cyan, (Action)delegate { Menu.OpenPage(_discover); }); } } private void SaveApiKey(string value) { RebuildSetup("Saving securely…"); Task.Run(async delegate { try { await _service.ConfigureApiKeyAsync(value, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _watch.SetStatus("MOD.IO CONNECTED", error: false, success: true); RebuildSetup("API key saved · restart not required"); RebuildHome(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { RebuildSetup(Truncate(exception.Message, 48), error: true); }); } }); } private void RunSearch() { RunSearch(0); } private void RunSearch(int offset) { //IL_005e: 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_00dd: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown if (!_service.ModIoReady) { RebuildSetup("Add an API key before searching", error: true); if (_setup != null) { Menu.OpenPage(_setup); } } else { if (_results == null) { return; } _results.RemoveAll(); _results.CreateFunction(BoneHubTheme.Brand("Searching mod.io"), Color.white, (Action)delegate { }); _results.CreateFunction(BoneHubTheme.Status("Finding the best matches", "FFC970"), BoneHubTheme.Amber, (Action)delegate { }); _results.CreateFunction(BoneHubTheme.ProgressBar(0.35), BoneHubTheme.Cyan, (Action)delegate { }); Menu.OpenPage(_results); ModSearchRequest request = new ModSearchRequest(_query, _avatarsOnly ? "Avatar" : null, string.IsNullOrWhiteSpace(_creator) ? null : _creator, _sort, Math.Max(0, offset), 20); _lastSearch = request; _log.Msg($"Searching the BONELAB mod.io catalog (query length {request.Query?.Length ?? 0}, offset {request.Offset})."); Task.Run(async delegate { try { ModIoPage page = await _service.SearchAsync(request, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { ShowResults(page); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { ShowError(exception.Message); }); } }); } } private void ShowResults(ModIoPage page) { //IL_0178: 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_01b2: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: 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_0487: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) if (_results == null) { return; } _log.Msg($"WristHub search returned {page.Data.Count} visible results out of {page.ResultTotal} matches."); _results.RemoveAll(); if (page.Data.Count == 0) { _results.CreateFunction(BoneHubTheme.Brand("Search complete"), Color.white, (Action)delegate { }); _results.CreateFunction(BoneHubTheme.Status("No matches found", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); _results.CreateFunction(BoneHubTheme.Hint("Try a shorter name or a different creator."), BoneHubTheme.Muted, (Action)delegate { }); return; } _results.CreateFunction(BoneHubTheme.Brand($"{page.ResultTotal} matches"), Color.white, (Action)delegate { }); _results.CreateFunction(BoneHubTheme.PrimaryAction("Open results on wrist tablet"), BoneHubTheme.Cyan, (Action)delegate { _browser.Open(); _browser.SetQuery(_query); }); int num; if (page.ResultOffset < 0) { ModSearchRequest? lastSearch = _lastSearch; num = ((lastSearch != null) ? lastSearch.Offset : 0); } else { num = page.ResultOffset; } int currentOffset = num; int num2; if (page.ResultLimit <= 0) { ModSearchRequest? lastSearch2 = _lastSearch; num2 = ((lastSearch2 != null) ? lastSearch2.Limit : 20); } else { num2 = page.ResultLimit; } int pageSize = num2; int value = currentOffset / Math.Max(1, pageSize) + 1; int value2 = Math.Max(1, (int)Math.Ceiling((double)page.ResultTotal / (double)Math.Max(1, pageSize))); _results.CreateFunction(BoneHubTheme.Hint($"Page {value} of {value2}"), BoneHubTheme.Muted, (Action)delegate { }); foreach (ModIoMod mod in page.Data) { bool flag = _service.IsInstalled(mod.Id); string text = (flag ? "" : ""); string text2 = BoneHubTheme.Escape(Truncate(mod.Name, 25)); Page details = BoneHubTheme.Style(_results.CreatePage(text + " " + text2 + "", flag ? BoneHubTheme.Green : BoneHubTheme.Cyan, 0, true)); _thumbnails.Load(mod.Logo.Thumbnail, delegate(Texture2D texture) { details.Logo = texture; }); details.CreateFunction(BoneHubTheme.Brand(flag ? "Installed" : "mod.io"), Color.white, (Action)delegate { }); details.CreateFunction(BoneHubTheme.Label("TITLE", Truncate(mod.Name, 34)), Color.white, (Action)delegate { }); details.CreateFunction(BoneHubTheme.Label("CREATOR", Truncate(mod.Author.DisplayName, 30)), BoneHubTheme.Blue, (Action)delegate { }); details.CreateFunction(BoneHubTheme.Label("DOWNLOADS", BoneHubTheme.CompactNumber(mod.Stats.DownloadsTotal)), BoneHubTheme.Cyan, (Action)delegate { }); details.CreateFunction(BoneHubTheme.Stars(mod.Stats.Rating), BoneHubTheme.Amber, (Action)delegate { }); if (mod.Tags.Count > 0) { details.CreateFunction(BoneHubTheme.Label("TAGS", string.Join(" / ", from tag in mod.Tags.Take(3) select tag.Name)), BoneHubTheme.Violet, (Action)delegate { }); } details.CreateFunction(BoneHubTheme.Body(Truncate(mod.Summary, 52)), Color.white, (Action)delegate { }); bool favorite = _service.IsFavorite(mod.Id); details.CreateFunction(BoneHubTheme.SecondaryAction(favorite ? "Remove from favorites" : "Save to favorites"), BoneHubTheme.Amber, (Action)delegate { ToggleFavorite(mod.Id, !favorite); }); if (flag) { IReadOnlyList avatars = _runtime.GetAvatars(mod.Id); if (avatars.Count > 0) { BoneHubAvatar firstAvatar = avatars[0]; details.CreateFunction(BoneHubTheme.PrimaryAction("Open installed avatars"), BoneHubTheme.Cyan, (Action)delegate { OpenAvatar(firstAvatar); }); } details.CreateFunction(BoneHubTheme.SecondaryAction("Check for update"), BoneHubTheme.Blue, (Action)delegate { CheckForUpdate(mod.Id); }); } else { details.CreateFunction(BoneHubTheme.PrimaryAction("Download + project"), BoneHubTheme.Green, (Action)delegate { QueueInstall(mod, projectAfterInstall: true); }); details.CreateFunction(BoneHubTheme.SecondaryAction("Download only"), BoneHubTheme.Blue, (Action)delegate { QueueInstall(mod, projectAfterInstall: false); }); } } if (currentOffset > 0) { _results.CreateFunction(BoneHubTheme.SecondaryAction("Previous page"), BoneHubTheme.Blue, (Action)delegate { RunSearch(Math.Max(0, currentOffset - pageSize)); }); } if (currentOffset + pageSize < page.ResultTotal) { _results.CreateFunction(BoneHubTheme.PrimaryAction("Next page"), BoneHubTheme.Cyan, (Action)delegate { RunSearch(currentOffset + pageSize); }); } } private void ShowError(string message) { //IL_0027: 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_00be: Unknown result type (might be due to invalid IL or missing references) Page? results = _results; if (results != null) { results.RemoveAll(); } Page? results2 = _results; if (results2 != null) { results2.CreateFunction(BoneHubTheme.Brand("Connection issue"), Color.white, (Action)delegate { }); } Page? results3 = _results; if (results3 != null) { results3.CreateFunction(BoneHubTheme.Status("Search failed", "FF6B82"), BoneHubTheme.Danger, (Action)delegate { }); } Page? results4 = _results; if (results4 != null) { results4.CreateFunction("" + BoneHubTheme.Escape(Truncate(message, 58)) + "", BoneHubTheme.Danger, (Action)delegate { }); } _log.Error(message); } private void ToggleFavorite(long modId, bool favorite) { Task.Run(async delegate { try { await _service.SetFavoriteAsync(modId, favorite, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(LoadFavorites); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { _log.Error("Could not update favorites: " + exception.Message); }); } }); } private void RebuildFavoritesLoading() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (_favorites != null) { _favorites.RemoveAll(); _favorites.CreateFunction(BoneHubTheme.Brand("Your collection"), Color.white, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.Status("Loading saved mods", "FFC970"), BoneHubTheme.Amber, (Action)delegate { }); } } private void LoadFavorites() { if (_favorites == null) { return; } RebuildFavoritesLoading(); Task.Run(async delegate { try { IReadOnlyList favorites = await _service.GetFavoriteModsAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { ShowFavorites(favorites); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { //IL_0033: 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_00c3: 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) if (_favorites != null) { _favorites.RemoveAll(); _favorites.CreateFunction(BoneHubTheme.Brand("Your collection"), Color.white, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.Status("Could not refresh favorites", "FF6B82"), BoneHubTheme.Danger, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.Hint(Truncate(exception.Message, 48)), BoneHubTheme.Danger, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.SecondaryAction("Try again"), BoneHubTheme.Cyan, (Action)LoadFavorites); } }); } }); } private void ShowFavorites(IReadOnlyList favorites) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) if (_favorites == null) { return; } _favorites.RemoveAll(); _favorites.CreateFunction(BoneHubTheme.Brand("Your collection"), Color.white, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.Label("Saved", $"{favorites.Count} mods"), BoneHubTheme.Amber, (Action)delegate { }); if (favorites.Count == 0) { _favorites.CreateFunction(BoneHubTheme.Status("Nothing saved yet", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); _favorites.CreateFunction(BoneHubTheme.Hint("Save a mod from any result page."), BoneHubTheme.Muted, (Action)delegate { }); return; } foreach (ModIoMod item in favorites.Take(10)) { ModIoMod selectedMod = item; string value = (_service.IsInstalled(item.Id) ? "Update" : "Download"); _favorites.CreateFunction($" {BoneHubTheme.Escape(Truncate(item.Name, 25))} {value}", BoneHubTheme.Amber, (Action)delegate { QueueInstall(selectedMod, projectAfterInstall: true); }); _favorites.CreateFunction(BoneHubTheme.SecondaryAction("Remove " + Truncate(item.Name, 22)), BoneHubTheme.Muted, (Action)delegate { ToggleFavorite(selectedMod.Id, favorite: false); }); } if (favorites.Count > 10) { _favorites.CreateFunction(BoneHubTheme.Hint($"Showing 10 of {favorites.Count} saved mods."), BoneHubTheme.Muted, (Action)delegate { }); } } public void OnDownloadChanged(DownloadJob job) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 if (!_jobs.ContainsKey(job.Id)) { _jobOrder.Add(job.Id); } _jobs[job.Id] = job; RebuildDownloads(); if ((int)job.State == 5) { RebuildInstalled(); } } public void OnInstalledChanged() { _runtime.RegisterInstalled(_service.Installed); RebuildInstalled(); } public void OnAvatarsChanged(long modId, IReadOnlyList avatars) { int count = _runtime.GetAllAvatars().Count; _runtimeStatus = ((count == 0) ? "No downloaded avatar crates found" : $"{count} downloaded avatar{((count == 1) ? string.Empty : "s")} ready"); if (_projectAfterInstall.Remove(modId)) { if (avatars.Count > 0) { _runtimeStatus = "Projecting " + avatars[0].Title; _watch.SetStatus("HOLOGRAM READY", error: false, success: true); OpenAvatar(avatars[0]); } else { _runtimeStatus = "Installed, but no avatar crate was found"; _watch.SetStatus("NO AVATAR FOUND", error: true); } } RebuildInstalled(); RebuildHome(); } private void QueueInstall(ModIoMod mod, bool projectAfterInstall) { if (!_service.ModIoReady) { RebuildSetup("Add an API key before downloading", error: true); if (_setup != null) { Menu.OpenPage(_setup); } return; } if (projectAfterInstall) { _projectAfterInstall.Add(mod.Id); } _watch.SetStatus("RESOLVING DEPENDENCIES"); Task.Run(async delegate { try { IReadOnlyList jobs = await _service.InstallWithDependenciesAsync(mod, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _watch.SetStatus((jobs.Count > 1) ? $"QUEUED {jobs.Count} MODS" : "DOWNLOAD QUEUED"); _log.Msg($"Queued {mod.Name} with {Math.Max(0, jobs.Count - 1)} dependencies."); RebuildDownloads(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { _projectAfterInstall.Remove(mod.Id); _watch.SetStatus("INSTALL PLAN FAILED", error: true); ShowError(exception.Message); }); } }); } private void RebuildUpdateCenter(string? status = null) { //IL_0024: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if (_updates == null) { return; } _updates.RemoveAll(); _updates.CreateFunction(BoneHubTheme.Brand("Verified updates"), Color.white, (Action)delegate { }); _updates.CreateFunction(BoneHubTheme.Status(status ?? "Ready to scan", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); foreach (ModUpdateInfo item in _availableUpdates.Where((ModUpdateInfo item) => item.UpdateAvailable)) { _updates.CreateFunction(BoneHubTheme.Label(Truncate(item.Mod.Name, 28), $"file {item.InstalledFileId} → {item.LatestFileId}"), BoneHubTheme.Blue, (Action)delegate { }); } int num = _availableUpdates.Count((ModUpdateInfo item) => item.UpdateAvailable); if (num > 0) { _updates.CreateFunction(BoneHubTheme.PrimaryAction($"Install {num} reviewed update{((num == 1) ? string.Empty : "s")}"), BoneHubTheme.Green, (Action)InstallReviewedUpdates); } _updates.CreateFunction(BoneHubTheme.SecondaryAction("Scan installed library"), BoneHubTheme.Cyan, (Action)ScanForUpdates); } private void ScanForUpdates() { if (!_service.ModIoReady) { RebuildSetup("Add an API key before checking updates", error: true); if (_setup != null) { Menu.OpenPage(_setup); } return; } RebuildUpdateCenter("Scanning platform-compatible files…"); Task.Run(async delegate { try { IReadOnlyList updates = await _service.CheckAllUpdatesAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _availableUpdates = updates; int num = updates.Count((ModUpdateInfo item) => item.UpdateAvailable); RebuildUpdateCenter((num == 0) ? "Everything is current" : $"{num} update{((num == 1) ? string.Empty : "s")} ready for review"); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { RebuildUpdateCenter("Scan failed · " + Truncate(exception.Message, 40)); }); } }); } private void InstallReviewedUpdates() { ModUpdateInfo[] updates = _availableUpdates.Where((ModUpdateInfo item) => item.UpdateAvailable).ToArray(); RebuildUpdateCenter($"Queueing {updates.Length} reviewed updates…"); Task.Run(async delegate { try { ModUpdateInfo[] array = updates; foreach (ModUpdateInfo val in array) { await _service.InstallWithDependenciesAsync(val.Mod, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); } _mainThread.Enqueue(delegate { RebuildUpdateCenter("Reviewed updates queued"); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { RebuildUpdateCenter("Queue failed · " + Truncate(exception.Message, 40)); }); } }); } public void OnEquipFinished(BoneHubAvatar avatar, bool success, string? error) { _runtimeStatus = (success ? ("Equipped " + avatar.Title) : (error ?? ("Could not equip " + avatar.Title))); _watch.SetStatus(_runtimeStatus, !success, success); RebuildInstalled(); } public void OnRuntimeStatusChanged(string status) { _runtimeStatus = status; RebuildInstalled(); } private void RebuildDownloads() { //IL_0024: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected I4, but got Unknown //IL_0140: 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_0149: 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_0152: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_016c: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected I4, but got Unknown //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_0209: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02db: 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_02e0: Invalid comparison between Unknown and I4 //IL_031a: 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) if (_downloads == null) { return; } _downloads.RemoveAll(); _downloads.CreateFunction(BoneHubTheme.Brand("Transfer queue"), Color.white, (Action)delegate { }); if (_jobOrder.Count == 0) { _downloads.CreateFunction(BoneHubTheme.Status("Queue is empty", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); _downloads.CreateFunction(BoneHubTheme.Hint("Downloads continue quietly while you play."), BoneHubTheme.Muted, (Action)delegate { }); return; } foreach (Guid item in _jobOrder.AsEnumerable().Reverse().Take(6)) { DownloadJob val = _jobs[item]; int value = (int)Math.Round(val.Progress * 100.0); DownloadState state = val.State; Color val2 = (Color)((state - 5) switch { 0 => BoneHubTheme.Green, 1 => BoneHubTheme.Danger, 2 => BoneHubTheme.Muted, _ => BoneHubTheme.Cyan, }); state = val.State; string value2 = (state - 5) switch { 0 => "59E6A7", 1 => "FF6B82", 2 => "7891A7", _ => "57E9FF", }; _downloads.CreateFunction($"{BoneHubTheme.Escape(Truncate(val.Mod.Name, 26))} {val.State} · {value}%", val2, (Action)delegate { }); _downloads.CreateFunction($"{BoneHubTheme.ProgressBar(val.Progress)} {value}%", val2, (Action)delegate { }); state = val.State; if (state - 5 > 2) { Guid jobId = val.Id; _downloads.CreateFunction(BoneHubTheme.SecondaryAction("Cancel transfer"), BoneHubTheme.Muted, (Action)delegate { _service.CancelDownload(jobId); }); } if (!string.IsNullOrWhiteSpace(val.Error)) { _downloads.CreateFunction("" + BoneHubTheme.Escape(Truncate(val.Error, 50)) + "", BoneHubTheme.Danger, (Action)delegate { }); } } } private void RebuildInstalled() { //IL_0091: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_084e: 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_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Unknown result type (might be due to invalid IL or missing references) if (_installed == null) { return; } Page[] array = _installedDetailPages.ToArray(); foreach (Page val in array) { try { _installed.RemovePage(val); } catch { } } _installedDetailPages.Clear(); _installed.RemoveAll(); IReadOnlyList allAvatars = _runtime.GetAllAvatars(); _installed.CreateFunction(BoneHubTheme.Brand($"{allAvatars.Count} avatars ready"), Color.white, (Action)delegate { }); _installed.CreateFunction(BoneHubTheme.Status(_runtimeStatus, _runtime.WarehouseReady ? "59E6A7" : "FFC970"), _runtime.WarehouseReady ? BoneHubTheme.Green : BoneHubTheme.Amber, (Action)delegate { }); if (allAvatars.Count > 0) { _installed.CreateFunction(BoneHubTheme.PrimaryAction("Open Avatar Browser"), BoneHubTheme.Cyan, (Action)_browser.Open); foreach (BoneHubAvatar item2 in allAvatars.Take(18)) { BoneHubAvatar selectedAvatar = item2; _installed.CreateFunction(BoneHubTheme.SecondaryAction(Truncate(item2.Title, 29)), BoneHubTheme.Blue, (Action)delegate { OpenAvatar(selectedAvatar); }); } if (allAvatars.Count > 18) { _installed.CreateFunction(BoneHubTheme.Hint($"Open Avatar Browser to browse all {allAvatars.Count} avatars."), BoneHubTheme.Muted, (Action)delegate { }); } } TrashedModRecord lastTrashed = _service.LastTrashed; if (lastTrashed != null) { _installed.CreateFunction(BoneHubTheme.SecondaryAction("Undo uninstall · " + Truncate(lastTrashed.Mod.Name, 24)), BoneHubTheme.Amber, (Action)UndoLastUninstall); } foreach (InstalledModRecord item in _service.Installed.OrderBy((InstalledModRecord record) => record.Name).Take(20)) { InstalledModHealth val2 = _service.VerifyInstalled(item.ModId); string text = (val2.Healthy ? "●" : "●"); Page val3 = BoneHubTheme.Style(_installed.CreatePage(text + " " + BoneHubTheme.Escape(Truncate(item.Name, 27)) + "", val2.Healthy ? BoneHubTheme.Green : BoneHubTheme.Danger, 0, true)); _installedDetailPages.Add(val3); val3.CreateFunction(BoneHubTheme.Brand("Installed content"), Color.white, (Action)delegate { }); val3.CreateFunction(BoneHubTheme.Label("Version", string.IsNullOrWhiteSpace(item.Version) ? "Unknown" : item.Version), BoneHubTheme.Blue, (Action)delegate { }); val3.CreateFunction(BoneHubTheme.Status(val2.Healthy ? "Installation verified" : "Repair recommended", val2.Healthy ? "59E6A7" : "FF6B82"), val2.Healthy ? BoneHubTheme.Green : BoneHubTheme.Danger, (Action)delegate { }); foreach (string item3 in val2.Problems.Take(3)) { val3.CreateFunction(BoneHubTheme.Hint(item3), BoneHubTheme.Danger, (Action)delegate { }); } if (_maintenanceStatus.TryGetValue(item.ModId, out string value)) { val3.CreateFunction(BoneHubTheme.Hint(value), BoneHubTheme.Amber, (Action)delegate { }); } IReadOnlyList avatars = _runtime.GetAvatars(item.ModId); if (avatars.Count > 0) { val3.CreateFunction(BoneHubTheme.Section($"Avatars · {avatars.Count}"), BoneHubTheme.Cyan, (Action)delegate { }); foreach (BoneHubAvatar item4 in avatars.Take(12)) { BoneHubAvatar selectedAvatar2 = item4; val3.CreateFunction(BoneHubTheme.PrimaryAction("Open " + Truncate(item4.Title, 23)), BoneHubTheme.Cyan, (Action)delegate { OpenAvatar(selectedAvatar2); }); } } else { val3.CreateFunction(BoneHubTheme.Hint("No loaded avatar crates are associated with this pallet yet."), BoneHubTheme.Muted, (Action)delegate { }); } val3.CreateFunction(BoneHubTheme.SecondaryAction("Check for update"), BoneHubTheme.Blue, (Action)delegate { CheckForUpdate(item.ModId); }); val3.CreateFunction(BoneHubTheme.SecondaryAction(val2.Healthy ? "Reinstall or update" : "Repair installation"), BoneHubTheme.Green, (Action)delegate { RepairOrUpdate(item.ModId); }); Page obj2 = BoneHubTheme.Style(val3.CreatePage(BoneHubTheme.PageTitle("!", "Move to WristHub Trash"), BoneHubTheme.Danger, 0, true)); obj2.CreateFunction(BoneHubTheme.Brand("Recoverable uninstall"), Color.white, (Action)delegate { }); obj2.CreateFunction(BoneHubTheme.Body(item.Name + " will be moved out of BONELAB's active Mods folder."), Color.white, (Action)delegate { }); obj2.CreateFunction(BoneHubTheme.Hint("You can restore the most recent uninstall from Installed."), BoneHubTheme.Muted, (Action)delegate { }); obj2.CreateFunction(BoneHubTheme.PrimaryAction("Confirm uninstall"), BoneHubTheme.Danger, (Action)delegate { Uninstall(item.ModId); }); } if (_service.Installed.Count == 0 && allAvatars.Count == 0) { _installed.CreateFunction(BoneHubTheme.Status("Library is empty", "7891A7"), BoneHubTheme.Muted, (Action)delegate { }); _installed.CreateFunction(BoneHubTheme.SecondaryAction("Discover your first avatar"), BoneHubTheme.Cyan, (Action)OpenDiscover); } else if (_service.Installed.Count == 0) { _installed.CreateFunction(BoneHubTheme.Hint("Existing BONELAB avatars are ready above. WristHub management actions appear for new WristHub downloads."), BoneHubTheme.Muted, (Action)delegate { }); } } private void CheckForUpdate(long modId) { _maintenanceStatus[modId] = "Checking mod.io for an update…"; RebuildInstalled(); Task.Run(async delegate { try { ModUpdateInfo result = await _service.CheckForUpdateAsync(modId, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _maintenanceStatus[modId] = (result.UpdateAvailable ? "Update available · choose Reinstall or update" : "You have the latest live file"); RebuildInstalled(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { _maintenanceStatus[modId] = "Update check failed · " + Truncate(exception.Message, 42); RebuildInstalled(); }); } }); } private void RepairOrUpdate(long modId) { _maintenanceStatus[modId] = "Preparing a verified replacement…"; RebuildInstalled(); Task.Run(async delegate { try { await _service.RepairOrUpdateAsync(modId, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _mainThread.Enqueue(delegate { _maintenanceStatus[modId] = "Repair or update queued"; RebuildInstalled(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { _maintenanceStatus[modId] = "Could not queue repair · " + Truncate(exception.Message, 40); RebuildInstalled(); }); } }); } private void Uninstall(long modId) { _maintenanceStatus[modId] = "Moving content to WristHub Trash…"; Task.Run(async delegate { bool subscribed = _sharing.IsSubscribed(modId); try { if (subscribed && !_sharing.Unsubscribe(modId)) { throw new InvalidOperationException("Could not unsubscribe this mod. Nothing was deleted."); } InstalledModRecord val = ((IEnumerable)_service.Installed).FirstOrDefault((Func)((InstalledModRecord item) => item.ModId == modId)); await _service.UninstallSubscribedAsync(modId, (val != null) ? val.Name : null, (IReadOnlyList)((val != null) ? val.InstalledDirectories : null), subscribed, default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); _sharing.RequestRefresh(immediate: true); _mainThread.Enqueue(delegate { _maintenanceStatus.Remove(modId); _runtimeStatus = "Mod moved to WristHub Trash"; RebuildInstalled(); if (_installed != null) { Menu.OpenPage(_installed); } }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; if (subscribed) { _sharing.Subscribe(modId); } _mainThread.Enqueue(delegate { _maintenanceStatus[modId] = "Uninstall failed · " + Truncate(exception.Message, 42); RebuildInstalled(); }); } }); } private void UndoLastUninstall() { _runtimeStatus = "Restoring the last uninstalled mod…"; RebuildInstalled(); Task.Run(async delegate { TrashedModRecord lastTrashed = _service.LastTrashed; bool wasSubscribed = lastTrashed != null && lastTrashed.WasSubscribed; try { InstalledModRecord restored = await _service.UndoLastUninstallAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); if (wasSubscribed) { _sharing.Subscribe(restored.ModId); } _sharing.RequestRefresh(immediate: true); _mainThread.Enqueue(delegate { _runtimeStatus = "Restored " + restored.Name; RebuildInstalled(); }); } catch (Exception ex) { Exception ex2 = ex; Exception exception = ex2; _mainThread.Enqueue(delegate { _runtimeStatus = "Restore failed · " + Truncate(exception.Message, 44); RebuildInstalled(); }); } }); } private void ResetHologramPreferences() { _service.Preferences.HologramEffects = true; _service.Preferences.HapticsEnabled = true; _service.Preferences.SoundsEnabled = true; _service.Preferences.CarouselDistance = 0.62f; _service.Preferences.HologramScale = 1f; _service.Preferences.EquipZoneScale = 1f; _service.Preferences.HologramBrightness = 1f; _browser.Refresh(); SavePreferences(); } private void ApplyComfortPreset(BoneHubComfortPreset preset) { //IL_000b: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected I4, but got Unknown _service.Preferences.ComfortPreset = preset; switch (preset - 1) { case 0: _watch.WatchScale = 1.15f; _watch.DwellSeconds = 3f; _service.Preferences.CarouselDistance = 0.54f; _service.Preferences.HologramScale = 1.12f; _service.Preferences.EquipZoneScale = 1.35f; break; case 1: _watch.WatchScale = 1.28f; _watch.DwellSeconds = 3f; _service.Preferences.CarouselDistance = 0.58f; _service.Preferences.HologramScale = 1.25f; _service.Preferences.EquipZoneScale = 1.55f; _service.Preferences.HologramBrightness = 1.2f; break; case 2: _watch.ReducedMotion = true; _service.Preferences.HologramEffects = false; _service.Preferences.CarouselDistance = 0.58f; _service.Preferences.EquipZoneScale = 1.3f; break; default: _watch.WatchScale = 1f; _watch.DwellSeconds = 3f; _watch.ReducedMotion = false; _service.Preferences.HologramEffects = true; _service.Preferences.CarouselDistance = 0.62f; _service.Preferences.HologramScale = 1f; _service.Preferences.EquipZoneScale = 1f; _service.Preferences.HologramBrightness = 1f; break; } _browser.Refresh(); _watch.Recenter(); SavePreferences(); } private void SavePreferences() { SavePreferencesGuardedAsync(); } private async Task SavePreferencesGuardedAsync() { try { await _service.SavePreferencesAsync(default(CancellationToken)).ConfigureAwait(continueOnCapturedContext: false); } catch (Exception ex) { _log.Error("Could not save WristHub preferences: " + ex.Message); } } private static string Truncate(string value, int length) { if (!string.IsNullOrWhiteSpace(value)) { if (value.Length > length) { return value.Substring(0, length - 1) + "…"; } return value; } return "(none)"; } private void OpenAvatar(BoneHubAvatar avatar) { _browser.Open(); _browser.Select(avatar.ToEntry().Identity); } public void Tick() { } public void Dispose() { _thumbnails.Dispose(); } } internal readonly record struct RenderOnlyPreviewResult(GameObject? Root, Bounds Bounds, float GameplayHeightMeters, AvatarPreviewVisualSource VisualSource, AvatarPreviewHeightSource HeightSource, int DeclaredRendererCount, int RendererCount, int VertexCount, IReadOnlyList OwnedMeshes, string? Error) { public bool Valid { get { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Root != (Object)null && (int)VisualSource != 0) { return string.IsNullOrWhiteSpace(Error); } return false; } } public bool InteractionReady { get { if (Valid) { return RendererCount > 0; } return false; } } [CompilerGenerated] public void Deconstruct(out GameObject? Root, out Bounds Bounds, out float GameplayHeightMeters, out AvatarPreviewVisualSource VisualSource, out AvatarPreviewHeightSource HeightSource, out int DeclaredRendererCount, out int RendererCount, out int VertexCount, out IReadOnlyList OwnedMeshes, out string? Error) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected I4, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected I4, but got Unknown Root = this.Root; Bounds = this.Bounds; GameplayHeightMeters = this.GameplayHeightMeters; VisualSource = (AvatarPreviewVisualSource)(int)this.VisualSource; HeightSource = (AvatarPreviewHeightSource)(int)this.HeightSource; DeclaredRendererCount = this.DeclaredRendererCount; RendererCount = this.RendererCount; VertexCount = this.VertexCount; OwnedMeshes = this.OwnedMeshes; Error = this.Error; } } internal static class BoneHubRenderOnlyPreviewBuilder { public static RenderOnlyPreviewResult Build(GameObject prefab, Transform parent, bool constrained) { //IL_00ae: 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_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_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) int num = (constrained ? 24 : 64); int num2 = (constrained ? 350000 : 1250000); int num3 = (constrained ? 512 : 2048); int num4 = (constrained ? 48 : 128); GameObject val = null; int declaredRendererCount = 0; int num5 = 0; int num6 = 0; float gameplayHeightMeters = 0f; AvatarPreviewHeightSource heightSource = (AvatarPreviewHeightSource)0; List list = new List(); try { Avatar component = prefab.GetComponent(); if ((Object)(object)component == (Object)null) { throw new InvalidOperationException("The crate did not expose a BONELAB avatar definition."); } float num7 = 0f; float num8 = 0f; try { num7 = component.height; } catch { } try { component.RefreshBodyMeasurements(); num8 = component.height; } catch { } AvatarResolvedHeight val2 = AvatarPreviewMath.ResolveGameplayHeight(num8, num7); gameplayHeightMeters = ((AvatarResolvedHeight)(ref val2)).Meters; heightSource = ((AvatarResolvedHeight)(ref val2)).Source; List bodyRenderers; List list2 = CollectDeclaredRenderers(component, prefab.transform, out declaredRendererCount, out bodyRenderers); num5 = list2.Count; if (num5 == 0) { throw new InvalidOperationException("The avatar definition did not expose usable body, head, or hair renderers."); } if (num5 > num) { throw new InvalidOperationException("The avatar is too complex for a wrist preview."); } int length = prefab.GetComponentsInChildren(true).Length; if (length == 0 || length > num3) { throw new InvalidOperationException("The avatar transform hierarchy exceeds the safe preview budget."); } int num9 = 0; foreach (Renderer item in list2) { Mesh val3 = RendererMesh(item); if (!((Object)(object)val3 == (Object)null)) { num6 += Math.Max(0, val3.vertexCount); num9 += ((IEnumerable)item.sharedMaterials).Count((Material material) => (Object)(object)material != (Object)null); if (num6 > num2) { throw new InvalidOperationException("The avatar exceeds the safe preview vertex budget."); } if (num9 > num4) { throw new InvalidOperationException("The avatar exceeds the safe preview material budget."); } } } if (num6 == 0 || num9 == 0) { throw new InvalidOperationException("The avatar has no usable mesh and material data."); } val = new GameObject("Sanitized Full-Color Avatar Preview"); val.transform.SetParent(parent, false); val.SetActive(false); Dictionary transforms = new Dictionary(); CloneTransform(prefab.transform, val.transform, transforms, copyLocalTransform: false); Dictionary copied = CopyRenderers(list2, transforms); Renderer[] array = ((IEnumerable)val.GetComponentsInChildren(true)).Where((Renderer renderer) => (Object)(object)renderer != (Object)null && renderer.enabled).ToArray(); if (array.Length == 0) { throw new InvalidOperationException("The sanitized preview did not contain a visible mesh."); } val.SetActive(true); Renderer value; Renderer[] array2 = (from renderer in bodyRenderers select (!copied.TryGetValue(((Object)renderer).GetInstanceID(), out value)) ? null : value into renderer where (Object)(object)renderer != (Object)null select renderer).Cast().ToArray(); if (array2.Length == 0) { array2 = array; } Bounds bounds = ApplyNormalizedLayout(val.transform, array2, parent); if (!AvatarPreviewMath.IsSafePreview(((Bounds)(ref bounds)).size.y, num5, num6, constrained)) { throw new InvalidOperationException("The avatar reported invalid or unbounded preview dimensions."); } return new RenderOnlyPreviewResult(val, bounds, gameplayHeightMeters, (AvatarPreviewVisualSource)1, heightSource, declaredRendererCount, array.Length, num6, list, null); } catch (Exception ex) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } foreach (Mesh item2 in list) { if ((Object)(object)item2 != (Object)null) { Object.Destroy((Object)(object)item2); } } return new RenderOnlyPreviewResult(null, default(Bounds), gameplayHeightMeters, (AvatarPreviewVisualSource)0, heightSource, declaredRendererCount, num5, num6, Array.Empty(), ex.Message); } } public static RenderOnlyPreviewResult BuildNativePreview(Mesh mesh, Material material, Transform parent, bool constrained, float preferredHeightMeters, AvatarPreviewHeightSource preferredHeightSource, int declaredRendererCount, string? fullColorError) { //IL_017d: 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_0188: 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_0041: 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_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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 //IL_0096: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0125: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; try { int num = (constrained ? 350000 : 1250000); if ((Object)(object)mesh == (Object)null || mesh.vertexCount <= 0 || mesh.vertexCount > num) { throw new InvalidOperationException("The native preview mesh is missing or exceeds the safe preview budget."); } Bounds bounds = mesh.bounds; if (IsFinite(((Bounds)(ref bounds)).center) && IsFinite(((Bounds)(ref bounds)).size)) { Vector3 size = ((Bounds)(ref bounds)).size; if (!(((Vector3)(ref size)).sqrMagnitude < 1E-06f)) { AvatarResolvedHeight val2 = (AvatarResolvedHeight)(((int)preferredHeightSource == 1) ? AvatarPreviewMath.ResolveGameplayHeight(preferredHeightMeters, 0f) : new AvatarResolvedHeight(0f, (AvatarPreviewHeightSource)0)); val = new GameObject("BONELAB Native Avatar Preview Mesh"); val.transform.SetParent(parent, false); val.SetActive(false); GameObject val3 = new GameObject("Native Preview Visual"); val3.transform.SetParent(val.transform, false); val3.AddComponent().sharedMesh = mesh; MeshRenderer val4 = val3.AddComponent(); ((Renderer)val4).sharedMaterial = material; ((Renderer)val4).enabled = true; val.SetActive(true); ApplyNormalizedLayout(val.transform, (IReadOnlyList)(object)new Renderer[1] { (Renderer)val4 }, parent); return new RenderOnlyPreviewResult(val, bounds, ((AvatarResolvedHeight)(ref val2)).Meters, (AvatarPreviewVisualSource)2, ((AvatarResolvedHeight)(ref val2)).Source, declaredRendererCount, 1, mesh.vertexCount, Array.Empty(), null); } } throw new InvalidOperationException("The native preview mesh did not report usable bounds."); } catch (Exception ex) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } string error = (string.IsNullOrWhiteSpace(fullColorError) ? ex.Message : (fullColorError + " Native fallback: " + ex.Message)); return new RenderOnlyPreviewResult(null, default(Bounds), preferredHeightMeters, (AvatarPreviewVisualSource)0, preferredHeightSource, declaredRendererCount, 0, (!((Object)(object)mesh == (Object)null)) ? mesh.vertexCount : 0, Array.Empty(), error); } } private static List CollectDeclaredRenderers(Avatar avatar, Transform prefabRoot, out int declaredRendererCount, out List bodyRenderers) { List result = new List(); bodyRenderers = new List(); HashSet instanceIds = new HashSet(); declaredRendererCount = 0; AddDeclared((IEnumerable?)avatar.bodyMeshes, prefabRoot, result, instanceIds, ref declaredRendererCount, bodyRenderers); AddDeclared((IEnumerable?)avatar.headMeshes, prefabRoot, result, instanceIds, ref declaredRendererCount, bodyRenderers); AddDeclared((IEnumerable?)avatar.hairMeshes, prefabRoot, result, instanceIds, ref declaredRendererCount); return result; } private static void AddDeclared(IEnumerable? declared, Transform prefabRoot, ICollection result, ISet instanceIds, ref int declaredRendererCount, ICollection? category = null) { if (declared == null) { return; } foreach (SkinnedMeshRenderer item in declared) { if (!((Object)(object)item == (Object)null)) { declaredRendererCount++; if (!((Object)(object)item.sharedMesh == (Object)null) && IsInside(((Component)item).transform, prefabRoot) && HasValidBones(item, prefabRoot) && instanceIds.Add(((Object)item).GetInstanceID())) { result.Add((Renderer)(object)item); category?.Add((Renderer)(object)item); } } } } private static bool HasValidBones(SkinnedMeshRenderer renderer, Transform prefabRoot) { if ((Object)(object)renderer.rootBone != (Object)null && !IsInside(renderer.rootBone, prefabRoot)) { return false; } Il2CppReferenceArray bones = renderer.bones; for (int i = 0; i < ((Il2CppArrayBase)(object)bones).Length; i++) { if ((Object)(object)((Il2CppArrayBase)(object)bones)[i] == (Object)null || !IsInside(((Il2CppArrayBase)(object)bones)[i], prefabRoot)) { return false; } } return true; } private static bool IsInside(Transform candidate, Transform root) { Transform val = candidate; while ((Object)(object)val != (Object)null) { if ((Object)(object)val == (Object)(object)root) { return true; } val = val.parent; } return false; } private static Mesh? RendererMesh(Renderer renderer) { SkinnedMeshRenderer val = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null); if (val == null) { MeshFilter component = ((Component)renderer).GetComponent(); if (component == null) { return null; } return component.sharedMesh; } return val.sharedMesh; } private static bool IsFinite(Vector3 value) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (float.IsFinite(value.x) && float.IsFinite(value.y)) { return float.IsFinite(value.z); } return false; } private static Transform CloneTransform(Transform source, Transform parent, IDictionary transforms, bool copyLocalTransform = true) { //IL_0010: 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_0027: 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_003d: 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_0053: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("Preview Mesh - " + ((Object)source).name).transform; transform.SetParent(parent, false); transform.localPosition = (copyLocalTransform ? source.localPosition : Vector3.zero); transform.localRotation = (copyLocalTransform ? source.localRotation : Quaternion.identity); transform.localScale = (copyLocalTransform ? source.localScale : Vector3.one); transforms[source] = transform; for (int i = 0; i < source.childCount; i++) { CloneTransform(source.GetChild(i), transform, transforms); } return transform; } private static Bounds ApplyNormalizedLayout(Transform previewRoot, IReadOnlyList renderers, Transform previewSpace) { //IL_0001: 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_0026: 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_0048: 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_006c: 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_009d: 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_00b5: 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_00d2: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_0130: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) previewRoot.localPosition = Vector3.zero; previewRoot.localRotation = Quaternion.Euler(0f, 180f, 0f); previewRoot.localScale = Vector3.one; Bounds result = MeasureRenderedBounds(renderers, previewSpace); if (IsFinite(((Bounds)(ref result)).center) && IsFinite(((Bounds)(ref result)).size)) { Vector3 size = ((Bounds)(ref result)).size; if (!(((Vector3)(ref size)).sqrMagnitude <= 1E-06f) && !(((Bounds)(ref result)).size.y <= 0.0001f) && !(((Bounds)(ref result)).size.y > 10000f)) { AvatarPreviewPlacement val = AvatarPreviewMath.FitBounds(new Vector3(((Bounds)(ref result)).center.x, ((Bounds)(ref result)).center.y, ((Bounds)(ref result)).center.z), new Vector3(((Bounds)(ref result)).size.x, ((Bounds)(ref result)).size.y, ((Bounds)(ref result)).size.z)); if (!((AvatarPreviewPlacement)(ref val)).Valid) { throw new InvalidOperationException("The copied avatar could not be normalized."); } previewRoot.localScale = Vector3.one * ((AvatarPreviewPlacement)(ref val)).UniformScale; for (int i = 0; i < 3; i++) { Bounds val2 = MeasureRenderedBounds(renderers, previewSpace); if (!IsFinite(((Bounds)(ref val2)).center) || !IsFinite(((Bounds)(ref val2)).size) || ((Bounds)(ref val2)).size.y <= 0.0001f) { throw new InvalidOperationException("The normalized avatar bounds became invalid."); } float num = 0.16f / ((Bounds)(ref val2)).size.y; if (!float.IsFinite(num) || num <= 0f || num > 1000f) { throw new InvalidOperationException("The avatar required an unsafe preview correction."); } previewRoot.localScale *= num; val2 = MeasureRenderedBounds(renderers, previewSpace); previewRoot.localPosition -= ((Bounds)(ref val2)).center; } return result; } } throw new InvalidOperationException("The copied avatar did not report usable rendered bounds."); } private static Bounds MeasureRenderedBounds(IEnumerable renderers, Transform space) { //IL_0004: 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_003e: 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_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_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_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_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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00c4: 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_00d0: Unknown result type (might be due to invalid IL or missing references) bool flag = false; Bounds result = default(Bounds); foreach (Renderer renderer in renderers) { if ((Object)(object)renderer == (Object)null || !renderer.enabled) { continue; } Bounds bounds = renderer.bounds; if (!IsFinite(((Bounds)(ref bounds)).center) || !IsFinite(((Bounds)(ref bounds)).size)) { continue; } Vector3 size = ((Bounds)(ref bounds)).size; if (((Vector3)(ref size)).sqrMagnitude < 1E-06f) { continue; } Vector3 center = ((Bounds)(ref bounds)).center; Vector3 extents = ((Bounds)(ref bounds)).extents; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { for (int k = -1; k <= 1; k += 2) { Vector3 val = center + Vector3.Scale(extents, new Vector3((float)i, (float)j, (float)k)); Vector3 val2 = space.InverseTransformPoint(val); if (!flag) { result = new Bounds(val2, Vector3.zero); flag = true; } else { ((Bounds)(ref result)).Encapsulate(val2); } } } } } if (!flag) { throw new InvalidOperationException("The copied avatar has no visible rendered bounds."); } return result; } private static Dictionary CopyRenderers(IEnumerable sourceRenderers, IReadOnlyDictionary transforms) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); foreach (Renderer sourceRenderer in sourceRenderers) { if (!transforms.TryGetValue(((Component)sourceRenderer).transform, out Transform value)) { continue; } MeshRenderer val = (MeshRenderer)(object)((sourceRenderer is MeshRenderer) ? sourceRenderer : null); if (val != null) { MeshFilter component = ((Component)val).GetComponent(); if (!((Object)(object)((component != null) ? component.sharedMesh : null) == (Object)null)) { ((Component)value).gameObject.AddComponent().sharedMesh = component.sharedMesh; MeshRenderer val2 = ((Component)value).gameObject.AddComponent(); ((Renderer)val2).sharedMaterials = ((Renderer)val).sharedMaterials; ((Renderer)val2).enabled = true; dictionary[((Object)sourceRenderer).GetInstanceID()] = (Renderer)(object)val2; } continue; } SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)(object)((sourceRenderer is SkinnedMeshRenderer) ? sourceRenderer : null); if (val3 != null && !((Object)(object)val3.sharedMesh == (Object)null)) { SkinnedMeshRenderer val4 = ((Component)value).gameObject.AddComponent(); val4.sharedMesh = val3.sharedMesh; ((Renderer)val4).sharedMaterials = ((Renderer)val3).sharedMaterials; ((Renderer)val4).localBounds = ((Renderer)val3).localBounds; val4.updateWhenOffscreen = true; ((Renderer)val4).enabled = true; Il2CppReferenceArray bones = val3.bones; Il2CppReferenceArray val5 = new Il2CppReferenceArray((IntPtr)((Il2CppArrayBase)(object)bones).Length); for (int i = 0; i < ((Il2CppArrayBase)(object)bones).Length; i++) { ((Il2CppArrayBase)(object)val5)[i] = (((Object)(object)((Il2CppArrayBase)(object)bones)[i] != (Object)null && transforms.TryGetValue(((Il2CppArrayBase)(object)bones)[i], out Transform value2)) ? value2 : value); } val4.bones = val5; if ((Object)(object)val3.rootBone != (Object)null && transforms.TryGetValue(val3.rootBone, out Transform value3)) { val4.rootBone = value3; } for (int j = 0; j < val3.sharedMesh.blendShapeCount; j++) { val4.SetBlendShapeWeight(j, val3.GetBlendShapeWeight(j)); } dictionary[((Object)sourceRenderer).GetInstanceID()] = (Renderer)(object)val4; } } return dictionary; } } internal sealed record BoneHubAvatar(long ModId, string Barcode, string Title, string ModName, string Author, string Description, string ThumbnailUrl) { public AvatarEntry ToEntry() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown return new AvatarEntry(ModId, Barcode, Title, ModName, Author, Description, ThumbnailUrl, true, true, (AvatarDownloadState)4, 0.0, (string)null); } } internal sealed class BoneHubRuntime : IDisposable { private sealed record PendingLoad(long ModId, IReadOnlyList Directories); private sealed record PendingEquip(BoneHubAvatar Avatar, string? PreviousBarcode, float Deadline); private sealed record PendingPackExit(long ModId, float Deadline, Action Completed); private const string SafeDeletionAvatarBarcode = "c3534c5a-94b2-40a4-912a-24a8506f6c79"; private readonly ConcurrentQueue _mainThread; private readonly string _modsRoot; private readonly Instance _log; private readonly Queue _loads = new Queue(); private readonly Dictionary> _installedDirectories = new Dictionary>(); private readonly Dictionary> _discoveredDirectories = new Dictionary>(); private readonly Dictionary _nativeModListings = new Dictionary(); private readonly Dictionary> _avatars = new Dictionary>(); private readonly HashSet _quarantinedAvatars = new HashSet(StringComparer.OrdinalIgnoreCase); private readonly HashSet _remoteAvatarAssetsLoading = new HashSet(StringComparer.OrdinalIgnoreCase); private readonly HashSet _remoteAvatarAssetsReady = new HashSet(StringComparer.OrdinalIgnoreCase); private readonly Dictionary _remoteAvatarAssetRetryAt = new Dictionary(StringComparer.OrdinalIgnoreCase); private readonly HashSet _suppressedModIds = new HashSet(); private readonly LibraryRefreshGate _libraryRefresh = new LibraryRefreshGate(false); private readonly FusionCompatibilityBridge _fusion = new FusionCompatibilityBridge((Func>)null); private PendingLoad? _activeLoad; private List _activePallets = new List(); private int _activePalletIndex; private bool _initialScanComplete; private bool _equipping; private PendingEquip? _pendingEquip; private PendingPackExit? _pendingPackExit; private string? _lastFusionStatus; private string _restoreBarcode = string.Empty; private bool _restoreAttempted; private float _restoreNotBefore; private float _nativeSaveWaitDeadline; private bool _nativePersistenceActive; private int _rigInstanceId; private float _nextFusionStatusCheck; private float _nextRigIdentityCheck; private float _nextEquipVerification; private PullCordDevice? _bodyLogEffectSource; private int _bodyLogEffectRigId; private bool _bodyLogEffectMissingLogged; private string _uiScaleRefreshBarcode = string.Empty; private float _uiScaleRefreshUntil; private float _nextUiScaleRefresh; public bool WarehouseReady => AssetWarehouse.ready; public bool FusionSessionActive => _fusion.SessionActive; public string FusionStatus => _fusion.Status; public event Action>? AvatarsChanged; public event Action? EquipFinished; public event Action? StatusChanged; public BoneHubRuntime(ConcurrentQueue mainThread, string modsDirectory, Instance log) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown _mainThread = mainThread; _modsRoot = NormalizeDirectory(modsDirectory); _log = log; } public void RegisterInstalled(IEnumerable installed) { InstalledModRecord[] array = installed.ToArray(); HashSet activeIds = array.Select((InstalledModRecord mod) => mod.ModId).ToHashSet(); long[] array2 = _installedDirectories.Keys.Where((long id) => !activeIds.Contains(id)).ToArray(); foreach (long num2 in array2) { _installedDirectories.Remove(num2); _nativeModListings.Remove(num2); if (_avatars.TryGetValue(num2, out List value)) { foreach (BoneHubAvatar item in value) { _quarantinedAvatars.Remove(item.Barcode); } } _avatars.Remove(num2); this.AvatarsChanged?.Invoke(num2, Array.Empty()); } InstalledModRecord[] array3 = array; foreach (InstalledModRecord val in array3) { string[] array4 = val.InstalledDirectories.Where((string path) => !string.IsNullOrWhiteSpace(path)).Distinct(StringComparer.OrdinalIgnoreCase).ToArray(); IReadOnlyList value2; bool flag = !_installedDirectories.TryGetValue(val.ModId, out value2) || !SameDirectories(value2, array4); _installedDirectories[val.ModId] = array4; ModListing val2 = BuildNativeModListing(val.ModId, val.Name, val.Version, val.Sharing); if (val2 != null) { _nativeModListings[val.ModId] = val2; } else { _nativeModListings.Remove(val.ModId); } _suppressedModIds.Remove(val.ModId); if (_initialScanComplete && flag) { QueuePackLoad(val.ModId, array4); } } } public void SetPendingDeletions(IEnumerable modIds) { _suppressedModIds.Clear(); foreach (long modId in modIds) { _suppressedModIds.Add(modId); } foreach (long suppressedModId in _suppressedModIds) { _installedDirectories.Remove(suppressedModId); _discoveredDirectories.Remove(suppressedModId); _nativeModListings.Remove(suppressedModId); if (_avatars.Remove(suppressedModId)) { this.AvatarsChanged?.Invoke(suppressedModId, Array.Empty()); } } } public void LoadInstallation(InstalledModRecord installed) { string[] array = installed.InstalledDirectories.ToArray(); _installedDirectories[installed.ModId] = array; ModListing val = BuildNativeModListing(installed.ModId, installed.Name, installed.Version, installed.Sharing); if (val != null) { _nativeModListings[installed.ModId] = val; } else { _nativeModListings.Remove(installed.ModId); } _suppressedModIds.Remove(installed.ModId); QueuePackLoad(installed.ModId, array); this.StatusChanged?.Invoke("Preparing " + installed.Name + " for live use…"); } public bool RetryInstallation(long modId) { if (!_installedDirectories.TryGetValue(modId, out IReadOnlyList value) || value.Count == 0) { return false; } PendingLoad? activeLoad = _activeLoad; if (((object)activeLoad != null && activeLoad.ModId == modId) || _loads.Any((PendingLoad load) => load.ModId == modId)) { return true; } QueuePackLoad(modId, value); this.StatusChanged?.Invoke("Preparing the installed avatar pack again..."); return true; } public IReadOnlyList GetAvatars(long modId) { if (!_avatars.TryGetValue(modId, out List value)) { return Array.Empty(); } return value.ToArray(); } public IReadOnlyList GetAllAvatars() { return (from @group in _avatars.Values.SelectMany((List avatars) => avatars).GroupBy((BoneHubAvatar avatar) => avatar.Barcode, StringComparer.OrdinalIgnoreCase) select @group.First()).OrderBy((BoneHubAvatar avatar) => avatar.Title, StringComparer.OrdinalIgnoreCase).ToArray(); } public bool IsModInstalled(long modId) { if (_avatars.TryGetValue(modId, out List value)) { return value.Count > 0; } return false; } public bool IsWearingPack(long modId) { RigManager rigManager = Player.RigManager; object obj; if (rigManager == null) { obj = null; } else { AvatarCrateReference avatarCrate = rigManager.AvatarCrate; if (avatarCrate == null) { obj = null; } else { Barcode barcode = ((ScannableReference)avatarCrate).Barcode; obj = ((barcode != null) ? barcode.ID : null); } } string barcode2 = (string)obj; if (string.IsNullOrWhiteSpace(barcode2) && (!TryReadNativeSavedAvatar(out barcode2) || string.IsNullOrWhiteSpace(barcode2))) { return false; } return GetAvatars(modId).Any((BoneHubAvatar avatar) => string.Equals(avatar.Barcode, barcode2, StringComparison.OrdinalIgnoreCase)); } public void LeavePackForDeletion(long modId, Action completed) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown if (!IsWearingPack(modId)) { completed(arg1: true, null); return; } if (_equipping || _pendingPackExit != null) { completed(arg1: false, "Another avatar change is already running."); return; } if (!AssetWarehouse.ready || (Object)(object)Player.RigManager == (Object)null) { completed(arg1: false, "The player rig is not ready to switch away from this pack."); return; } try { AvatarCrateReference val = new AvatarCrateReference("c3534c5a-94b2-40a4-912a-24a8506f6c79"); if ((Object)(object)((CrateReferenceT)(object)val).Crate == (Object)null) { completed(arg1: false, "BONELAB's safe PolyBlank avatar is unavailable."); return; } _equipping = true; _pendingPackExit = new PendingPackExit(modId, Time.unscaledTime + 4f, completed); this.StatusChanged?.Invoke("Switching to PolyBlank before deleting the active pack..."); string text = null; if (_fusion.SessionActive && _fusion.TrySwapAvatar("c3534c5a-94b2-40a4-912a-24a8506f6c79", ref text)) { return; } if (_fusion.SessionActive && !string.IsNullOrWhiteSpace(text)) { _log.Msg("Fusion safe-avatar switch fell back to BONELAB: " + text); } Player.RigManager.SwapAvatarCrate(((ScannableReference)val).Barcode, true, Action.op_Implicit((Action)delegate(bool success) { _mainThread.Enqueue(delegate { if (!success && !(_pendingPackExit == null)) { FinishPackExit(success: false, "BONELAB could not switch to PolyBlank. Nothing was deleted."); } }); })); } catch (Exception ex) { _equipping = false; _pendingPackExit = null; completed(arg1: false, "Could not switch avatars safely: " + ex.Message); } } public bool IsCurrentAvatar(string barcode) { if (string.IsNullOrWhiteSpace(barcode)) { return false; } try { RigManager rigManager = Player.RigManager; object a; if (rigManager == null) { a = null; } else { AvatarCrateReference avatarCrate = rigManager.AvatarCrate; if (avatarCrate == null) { a = null; } else { Barcode barcode2 = ((ScannableReference)avatarCrate).Barcode; a = ((barcode2 != null) ? barcode2.ID : null); } } return string.Equals((string?)a, barcode, StringComparison.OrdinalIgnoreCase) && _fusion.IsAvatarSynchronized(barcode); } catch { return false; } } public bool IsAvatarAssetReadyForFusionRecovery(string barcode) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(barcode) || AssetWarehouse.Instance == null) { return false; } if (_remoteAvatarAssetsReady.Contains(barcode)) { return true; } long tickCount = Environment.TickCount64; if (_remoteAvatarAssetsLoading.Contains(barcode) || (_remoteAvatarAssetRetryAt.TryGetValue(barcode, out var value) && tickCount < value)) { return false; } try { AvatarCrate val = default(AvatarCrate); if (!AssetWarehouse.Instance.TryGetCrate(new Barcode(barcode), ref val) || (Object)(object)val == (Object)null) { return false; } _remoteAvatarAssetsLoading.Add(barcode); ((CrateT)(object)val).LoadAsset(Action.op_Implicit((Action)delegate(GameObject prefab) { _mainThread.Enqueue(delegate { _remoteAvatarAssetsLoading.Remove(barcode); if ((Object)(object)prefab != (Object)null) { _remoteAvatarAssetsReady.Add(barcode); _remoteAvatarAssetRetryAt.Remove(barcode); } else { _remoteAvatarAssetRetryAt[barcode] = Environment.TickCount64 + 2000; } }); })); return false; } catch { _remoteAvatarAssetsLoading.Remove(barcode); _remoteAvatarAssetRetryAt[barcode] = tickCount + 2000; return false; } } public bool ResendCurrentAvatarToFusion(string barcode, out string? error) { if (!IsCurrentAvatar(barcode)) { error = "The equipped avatar changed before multiplayer sharing became ready."; return false; } return _fusion.TryResendCurrentAvatar(barcode, ref error); } public void ReportSharingStatus(string status) { if (!string.IsNullOrWhiteSpace(status)) { this.StatusChanged?.Invoke(status); } } public IReadOnlyList GetPackDirectories(long modId) { if (_installedDirectories.TryGetValue(modId, out IReadOnlyList value)) { return value.ToArray(); } if (_discoveredDirectories.TryGetValue(modId, out IReadOnlyList value2) && value2.Count > 0) { return value2.ToArray(); } return DiscoverPackDirectories(modId); } public void RefreshLocalLibrary() { _libraryRefresh.Request((double)Time.unscaledTime, 0.75); _restoreNotBefore = Time.unscaledTime + 0.75f; } public void RemovePack(long modId) { bool flag = _installedDirectories.Remove(modId); flag |= _discoveredDirectories.Remove(modId); _nativeModListings.Remove(modId); PendingLoad? activeLoad = _activeLoad; if ((object)activeLoad != null && activeLoad.ModId == modId) { _activeLoad = null; } PendingLoad[] array = _loads.Where((PendingLoad load) => load.ModId != modId).ToArray(); _loads.Clear(); PendingLoad[] array2 = array; foreach (PendingLoad item in array2) { _loads.Enqueue(item); } if (_avatars.TryGetValue(modId, out List value)) { foreach (BoneHubAvatar item2 in value) { _quarantinedAvatars.Remove(item2.Barcode); } } if (flag | _avatars.Remove(modId)) { this.AvatarsChanged?.Invoke(modId, Array.Empty()); } } public BoneHubAvatar? FindAvatar(string barcode) { return GetAllAvatars().FirstOrDefault((BoneHubAvatar avatar) => string.Equals(avatar.Barcode, barcode, StringComparison.OrdinalIgnoreCase)); } public void RequestAvatarRestore(string barcode) { _restoreBarcode = barcode?.Trim() ?? string.Empty; _restoreAttempted = _restoreBarcode.Length == 0; _restoreNotBefore = Time.unscaledTime + 0.75f; _nativeSaveWaitDeadline = Time.unscaledTime + 10f; _nativePersistenceActive = false; } public void OnSceneChanged() { _remoteAvatarAssetsLoading.Clear(); _remoteAvatarAssetsReady.Clear(); _remoteAvatarAssetRetryAt.Clear(); if (!_nativePersistenceActive && _restoreBarcode.Length != 0) { _restoreAttempted = false; _restoreNotBefore = Time.unscaledTime + 1f; _nativeSaveWaitDeadline = Time.unscaledTime + 10f; _fusion.ForceRefresh(); } } public void ForgetAvatars(IEnumerable barcodes) { string[] array = barcodes.Where((string barcode) => !string.IsNullOrWhiteSpace(barcode)).ToArray(); string[] array2 = array; foreach (string item in array2) { _quarantinedAvatars.Remove(item); } if (array.Any((string barcode) => string.Equals(barcode, _restoreBarcode, StringComparison.OrdinalIgnoreCase))) { _restoreBarcode = string.Empty; _restoreAttempted = true; } } public void Tick(bool deferHeavyWork = false) { UpdateFusionStatus(); TrackLocalRig(); VerifyPendingPackExit(); VerifyPendingEquip(); RefreshNativeUiScale(); if (!AssetWarehouse.ready) { return; } if (!deferHeavyWork && _libraryRefresh.TryConsume((double)Time.unscaledTime)) { _initialScanComplete = true; ScanLocalLibrary(); int count = GetAllAvatars().Count; this.StatusChanged?.Invoke((count == 0) ? "Asset Warehouse ready; no downloaded avatars found." : $"{count} downloaded avatar{((count == 1) ? string.Empty : "s")} ready."); } TryRestoreAvatar(); if ((object)_activeLoad == null && _loads.Count > 0) { _activeLoad = _loads.Dequeue(); _activePallets = _activeLoad.Directories.SelectMany((string directory) => PalletManifestLocator.FindAll(directory, SearchOption.TopDirectoryOnly)).Distinct(StringComparer.OrdinalIgnoreCase).ToList(); _activePalletIndex = 0; LoadNextPallet(); } } private void VerifyPendingPackExit() { PendingPackExit pendingPackExit = _pendingPackExit; if ((object)pendingPackExit == null) { return; } try { RigManager rigManager = Player.RigManager; object a; if (rigManager == null) { a = null; } else { AvatarCrateReference avatarCrate = rigManager.AvatarCrate; if (avatarCrate == null) { a = null; } else { Barcode barcode = ((ScannableReference)avatarCrate).Barcode; a = ((barcode != null) ? barcode.ID : null); } } bool num = string.Equals((string?)a, "c3534c5a-94b2-40a4-912a-24a8506f6c79", StringComparison.OrdinalIgnoreCase); bool flag = !_fusion.SessionActive || _fusion.IsAvatarSynchronized("c3534c5a-94b2-40a4-912a-24a8506f6c79"); if (num && flag) { _restoreBarcode = "c3534c5a-94b2-40a4-912a-24a8506f6c79"; _restoreAttempted = true; _nativePersistenceActive = TryPersistNativeAvatar("c3534c5a-94b2-40a4-912a-24a8506f6c79", out string error); if (!_nativePersistenceActive) { _log.Warning("PolyBlank was equipped before deletion, but BONELAB could not save it: " + error); } FinishPackExit(success: true, null); } else if (!(Time.unscaledTime < pendingPackExit.Deadline)) { FinishPackExit(success: false, "Timed out while switching to PolyBlank. Nothing was deleted."); } } catch (Exception ex) { FinishPackExit(success: false, "Could not confirm the safe avatar: " + ex.Message); } } private void FinishPackExit(bool success, string? error) { PendingPackExit pendingPackExit = _pendingPackExit; _pendingPackExit = null; _equipping = false; if (!(pendingPackExit == null)) { pendingPackExit.Completed(success, error); } } public void Equip(BoneHubAvatar avatar) { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown try { if (_equipping) { this.EquipFinished?.Invoke(avatar, arg2: false, "Another avatar change is already running."); return; } if (_quarantinedAvatars.Contains(avatar.Barcode)) { string text = "BONELAB previously rejected this avatar. Reload its pallet before trying again."; this.EquipFinished?.Invoke(avatar, arg2: false, text); this.StatusChanged?.Invoke(text); return; } string text2 = default(string); if (!_fusion.CanEquip(avatar.Barcode, ref text2)) { this.EquipFinished?.Invoke(avatar, arg2: false, text2); this.StatusChanged?.Invoke(text2 ?? "Fusion blocked that avatar change."); return; } if (!AssetWarehouse.ready || (Object)(object)Player.RigManager == (Object)null) { this.EquipFinished?.Invoke(avatar, arg2: false, "The player rig or Asset Warehouse is not ready."); return; } AvatarCrateReference crate = new AvatarCrateReference(avatar.Barcode); if ((Object)(object)((CrateReferenceT)(object)crate).Crate == (Object)null) { this.EquipFinished?.Invoke(avatar, arg2: false, "That avatar is not loaded in the Asset Warehouse."); return; } _equipping = true; this.StatusChanged?.Invoke("Checking avatar rig..."); ((CrateT)(object)((CrateReferenceT)(object)crate).Crate).LoadAsset(Action.op_Implicit((Action)delegate(GameObject prefab) { _mainThread.Enqueue(delegate { //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) if ((Object)(object)prefab == (Object)null) { _equipping = false; _quarantinedAvatars.Add(avatar.Barcode); this.StatusChanged?.Invoke("BROKEN AVATAR - CANNOT EQUIP"); this.EquipFinished?.Invoke(avatar, arg2: false, "The avatar asset did not load for validation."); } else { AvatarRigValidationResult val = BoneHubAvatarRigValidator.Validate(prefab); if (!((AvatarRigValidationResult)(ref val)).CanEquip) { _equipping = false; _quarantinedAvatars.Add(avatar.Barcode); this.StatusChanged?.Invoke("BROKEN AVATAR - CANNOT EQUIP"); this.EquipFinished?.Invoke(avatar, arg2: false, ((AvatarRigValidationResult)(ref val)).Reason); _log.Warning("WristHub blocked a malformed avatar before BONELAB ArtRig: " + ((AvatarRigValidationResult)(ref val)).Reason); } else { _equipping = false; StartValidatedEquip(avatar, crate); } } }); })); } catch (Exception ex) { _equipping = false; _log.Error("Avatar swap could not start: " + ex.Message); this.EquipFinished?.Invoke(avatar, arg2: false, ex.Message); } } private void StartValidatedEquip(BoneHubAvatar avatar, AvatarCrateReference crate) { try { if (_equipping || (Object)(object)Player.RigManager == (Object)null) { this.EquipFinished?.Invoke(avatar, arg2: false, "The player rig changed while the avatar was being checked."); return; } AvatarCrateReference avatarCrate = Player.RigManager.AvatarCrate; object obj; if (avatarCrate == null) { obj = null; } else { Barcode barcode = ((ScannableReference)avatarCrate).Barcode; obj = ((barcode != null) ? barcode.ID : null); } string previousBarcode = (string)obj; string text = null; if (_fusion.SessionActive && _fusion.TrySwapAvatar(avatar.Barcode, ref text)) { _equipping = true; _pendingEquip = new PendingEquip(avatar, previousBarcode, Time.unscaledTime + 4f); this.StatusChanged?.Invoke("Broadcasting " + avatar.Title + " through Fusion..."); return; } if (_fusion.SessionActive && !string.IsNullOrWhiteSpace(text)) { _log.Msg("Fusion avatar broadcast fell back to BONELAB's guarded swap: " + text); } _equipping = true; this.StatusChanged?.Invoke("Equipping " + avatar.Title + "..."); Player.RigManager.SwapAvatarCrate(((ScannableReference)crate).Barcode, true, Action.op_Implicit((Action)delegate(bool success) { _mainThread.Enqueue(delegate { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown _equipping = false; if (!success && !string.IsNullOrWhiteSpace(previousBarcode) && previousBarcode != avatar.Barcode) { try { Player.RigManager.SwapAvatarCrate(new Barcode(previousBarcode), true, (Action)null); } catch (Exception ex2) { _log.Error("Avatar rollback failed: " + ex2.Message); } } if (!success) { _quarantinedAvatars.Add(avatar.Barcode); this.StatusChanged?.Invoke("Could not equip " + avatar.Title + "; restored the previous avatar."); this.EquipFinished?.Invoke(avatar, arg2: false, "BONELAB rejected the avatar swap."); } else { _equipping = true; _pendingEquip = new PendingEquip(avatar, previousBarcode, Time.unscaledTime + 1.25f); this.StatusChanged?.Invoke(_fusion.SessionActive ? ("Confirming " + avatar.Title + " with Fusion...") : ("Confirming " + avatar.Title + "...")); } }); })); } catch (Exception ex) { _equipping = false; _log.Error("Avatar swap could not start after validation: " + ex.Message); this.EquipFinished?.Invoke(avatar, arg2: false, ex.Message); } } private void TryRestoreAvatar() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Invalid comparison between Unknown and I4 //IL_005b: 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_008e: Invalid comparison between Unknown and I4 if (_restoreAttempted || !_initialScanComplete || _equipping || (Object)(object)Player.RigManager == (Object)null || Time.unscaledTime < _restoreNotBefore) { return; } string barcode; AvatarRestoreDecision val = AvatarRestorePolicy.Decide(TryReadNativeSavedAvatar(out barcode), Time.unscaledTime >= _nativeSaveWaitDeadline, _restoreBarcode); if ((int)val == 1) { return; } if ((int)val == 0) { _nativePersistenceActive = true; _restoreAttempted = true; if (!string.IsNullOrWhiteSpace(barcode)) { _restoreBarcode = barcode; } _log.Msg("BONELAB's native avatar save owns scene restoration; no WristHub swap was needed."); return; } if ((int)val == 3) { _restoreAttempted = true; return; } AvatarCrateReference avatarCrate = Player.RigManager.AvatarCrate; object a; if (avatarCrate == null) { a = null; } else { Barcode barcode2 = ((ScannableReference)avatarCrate).Barcode; a = ((barcode2 != null) ? barcode2.ID : null); } if (string.Equals((string?)a, _restoreBarcode, StringComparison.OrdinalIgnoreCase)) { _restoreAttempted = true; _log.Msg("The previously equipped WristHub avatar was already active."); return; } BoneHubAvatar boneHubAvatar = FindAvatar(_restoreBarcode); if (boneHubAvatar == null) { _restoreAttempted = true; _log.Msg("The previously equipped WristHub avatar is no longer installed; BONELAB's current avatar was kept."); } else { _restoreAttempted = true; _log.Msg("Restoring the previously equipped WristHub avatar."); Equip(boneHubAvatar); } } private void VerifyPendingEquip() { //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown PendingEquip pendingEquip = _pendingEquip; if ((object)pendingEquip == null || Time.unscaledTime < _nextEquipVerification) { return; } _nextEquipVerification = Time.unscaledTime + 0.1f; try { RigManager rigManager = Player.RigManager; object a; if (rigManager == null) { a = null; } else { AvatarCrateReference avatarCrate = rigManager.AvatarCrate; if (avatarCrate == null) { a = null; } else { Barcode barcode = ((ScannableReference)avatarCrate).Barcode; a = ((barcode != null) ? barcode.ID : null); } } bool num = string.Equals((string?)a, pendingEquip.Avatar.Barcode, StringComparison.OrdinalIgnoreCase); bool flag = _fusion.IsAvatarSynchronized(pendingEquip.Avatar.Barcode); if (num && flag) { _pendingEquip = null; _equipping = false; _restoreBarcode = pendingEquip.Avatar.Barcode; _restoreAttempted = true; _nativePersistenceActive = TryPersistNativeAvatar(pendingEquip.Avatar.Barcode, out string error); if (!_nativePersistenceActive) { _log.Warning("BONELAB avatar persistence was unavailable; WristHub fallback remains active: " + error); } QueueNativeUiScaleRefresh(pendingEquip.Avatar.Barcode); PlayNativeAvatarChangeEffect(); string obj = (_fusion.SessionActive ? ("Equipped " + pendingEquip.Avatar.Title + " · Fusion synchronized.") : ("Equipped " + pendingEquip.Avatar.Title + ".")); this.StatusChanged?.Invoke(obj); this.EquipFinished?.Invoke(pendingEquip.Avatar, arg2: true, null); } else { if (Time.unscaledTime < pendingEquip.Deadline) { return; } _pendingEquip = null; _equipping = false; if (!_fusion.SessionActive && !string.IsNullOrWhiteSpace(pendingEquip.PreviousBarcode)) { try { RigManager rigManager2 = Player.RigManager; if (rigManager2 != null) { rigManager2.SwapAvatarCrate(new Barcode(pendingEquip.PreviousBarcode), true, (Action)null); } } catch (Exception ex) { _log.Error("Avatar verification rollback failed: " + ex.Message); } } string text = (_fusion.SessionActive ? "Fusion did not accept that avatar. Check the lobby's custom-avatar permission and active gamemode overrides." : "The avatar swap did not remain active; the previous avatar was restored."); this.StatusChanged?.Invoke(text); this.EquipFinished?.Invoke(pendingEquip.Avatar, arg2: false, text); } } catch (Exception ex2) { _pendingEquip = null; _equipping = false; _log.Error("Avatar verification failed: " + ex2.Message); this.EquipFinished?.Invoke(pendingEquip.Avatar, arg2: false, ex2.Message); } } private void UpdateFusionStatus() { if (!(Time.unscaledTime < _nextFusionStatusCheck)) { _nextFusionStatusCheck = Time.unscaledTime + 1f; string status = _fusion.Status; if (!string.Equals(status, _lastFusionStatus, StringComparison.Ordinal)) { _lastFusionStatus = status; this.StatusChanged?.Invoke(status); } } } private void TrackLocalRig() { if (Time.unscaledTime < _nextRigIdentityCheck) { return; } _nextRigIdentityCheck = Time.unscaledTime + 0.25f; int num = 0; try { num = ((!((Object)(object)Player.RigManager == (Object)null)) ? ((Object)Player.RigManager).GetInstanceID() : 0); } catch { } if (num != 0 && num != _rigInstanceId) { _rigInstanceId = num; _bodyLogEffectSource = null; _bodyLogEffectRigId = 0; _bodyLogEffectMissingLogged = false; if (!_nativePersistenceActive && _restoreBarcode.Length != 0) { _restoreAttempted = false; _restoreNotBefore = Time.unscaledTime + 1f; _nativeSaveWaitDeadline = Time.unscaledTime + 10f; _fusion.ForceRefresh(); _log.Msg("WristHub detected a new local rig; native avatar save detection was queued before any fallback."); } } } private void PlayNativeAvatarChangeEffect() { try { RigManager rig = Player.RigManager; if ((Object)(object)rig == (Object)null) { return; } int instanceID = ((Object)rig).GetInstanceID(); if ((Object)(object)_bodyLogEffectSource == (Object)null || _bodyLogEffectRigId != instanceID) { _bodyLogEffectSource = ((IEnumerable)((Component)rig).GetComponentsInChildren(true)).FirstOrDefault((Func)((PullCordDevice device) => (Object)(object)device != (Object)null && ((Object)(object)device.rm == (Object)null || (Object)(object)device.rm == (Object)(object)rig))); _bodyLogEffectRigId = instanceID; } if ((Object)(object)_bodyLogEffectSource == (Object)null) { if (!_bodyLogEffectMissingLogged) { _bodyLogEffectMissingLogged = true; _log.Msg("BONELAB's BodyLog effect source is unavailable on this rig; the avatar equip still completed."); } } else { _bodyLogEffectSource.PlayAvatarParticleEffects(); _bodyLogEffectMissingLogged = false; } } catch (Exception ex) { if (!_bodyLogEffectMissingLogged) { _bodyLogEffectMissingLogged = true; _log.Warning("BONELAB's avatar-change effect could not play: " + ex.Message); } } } private void QueueNativeUiScaleRefresh(string barcode) { _uiScaleRefreshBarcode = barcode; _uiScaleRefreshUntil = Time.unscaledTime + 0.75f; _nextUiScaleRefresh = 0f; RefreshNativeUiScale(); } private void RefreshNativeUiScale() { if (string.IsNullOrWhiteSpace(_uiScaleRefreshBarcode) || Time.unscaledTime > _uiScaleRefreshUntil || Time.unscaledTime < _nextUiScaleRefresh) { return; } _nextUiScaleRefresh = Time.unscaledTime + 0.15f; try { RigManager rigManager = Player.RigManager; Avatar val = ((rigManager != null) ? rigManager.avatar : null); if ((Object)(object)rigManager == (Object)null || (Object)(object)val == (Object)null) { return; } AvatarCrateReference avatarCrate = rigManager.AvatarCrate; object a; if (avatarCrate == null) { a = null; } else { Barcode barcode = ((ScannableReference)avatarCrate).Barcode; a = ((barcode != null) ? barcode.ID : null); } if (!string.Equals((string?)a, _uiScaleRefreshBarcode, StringComparison.OrdinalIgnoreCase)) { return; } float armLength = val.armLength; if (float.IsFinite(armLength) && !(armLength <= 0.01f)) { UIRig instance = UIRig.Instance; if (instance != null) { instance.UI_AVATARSCALE(armLength); } } } catch { } } private static bool TryReadNativeSavedAvatar(out string barcode) { barcode = string.Empty; try { Save activeSave = DataManager.ActiveSave; PlayerSettings val = ((activeSave != null) ? activeSave.PlayerSettings : null); if (val == null) { return false; } barcode = val.CurrentAvatar?.Trim() ?? string.Empty; return true; } catch { return false; } } private static bool TryPersistNativeAvatar(string barcode, out string? error) { error = null; try { Save activeSave = DataManager.ActiveSave; PlayerSettings val = ((activeSave != null) ? activeSave.PlayerSettings : null); if (val == null) { error = "The active BONELAB player profile is not ready."; return false; } string currentAvatar = val.CurrentAvatar; val.CurrentAvatar = barcode; if (DataManager.TrySaveActiveSave((SaveFlags)0)) { return true; } val.CurrentAvatar = currentAvatar; error = "BONELAB declined to save the active player profile."; return false; } catch (Exception ex) { error = ex.Message; return false; } } private void LoadNextPallet() { if ((object)_activeLoad == null) { return; } if (_activePalletIndex >= _activePallets.Count) { PendingLoad activeLoad = _activeLoad; _activeLoad = null; ScanMod(activeLoad.ModId, activeLoad.Directories); this.StatusChanged?.Invoke((GetAvatars(activeLoad.ModId).Count > 0) ? "Avatar catalog refreshed." : "Installed safely; no avatar crates were found in this pallet."); return; } string palletPath = _activePallets[_activePalletIndex++]; try { _nativeModListings.TryGetValue(_activeLoad.ModId, out ModListing value); UniTask val = AssetWarehouse.Instance.LoadPalletFromFolderAsync(palletPath, true, (string)null, value); Awaiter awaiter = val.GetAwaiter(); awaiter.OnCompleted((Action)delegate { _mainThread.Enqueue(delegate { try { awaiter.GetResult(); } catch (Exception ex2) { _log.Error("Could not live-load " + palletPath + ": " + ex2.Message); } LoadNextPallet(); }); }); } catch (Exception ex) { _log.Error("Could not schedule live pallet load: " + ex.Message); LoadNextPallet(); } } private void QueuePackLoad(long modId, IReadOnlyList directories) { if (directories.Count != 0) { PendingLoad? activeLoad = _activeLoad; if (((object)activeLoad == null || activeLoad.ModId != modId) && !_loads.Any((PendingLoad load) => load.ModId == modId)) { _loads.Enqueue(new PendingLoad(modId, directories)); } } } private static ModListing? BuildNativeModListing(long modId, string? name, string? version, ModIoSharingMetadata? sharing) { //IL_002b: 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_0060: 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_007b: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_009d: Expected O, but got Unknown if (modId <= 0 || sharing == null || (!sharing.WindowsFileId.HasValue && !sharing.AndroidFileId.HasValue)) { return null; } try { ModListing val = new ModListing { Author = "mod.io", Title = (string.IsNullOrWhiteSpace(sharing.ModSlug) ? (name ?? "WristHub avatar pack") : sharing.ModSlug), Description = (name ?? string.Empty), ThumbnailUrl = string.Empty, Version = (string.IsNullOrWhiteSpace(version) ? "0.0.0" : version), Targets = new StringModTargetListingDictionary() }; long? windowsFileId = sharing.WindowsFileId; if (windowsFileId.HasValue && windowsFileId.GetValueOrDefault() > 0) { ((Dictionary)(object)val.Targets).Add("pc", CreateNativeModTarget(modId, sharing.WindowsFileId.Value)); } windowsFileId = sharing.AndroidFileId; if (windowsFileId.HasValue && windowsFileId.GetValueOrDefault() > 0) { ((Dictionary)(object)val.Targets).Add("android", CreateNativeModTarget(modId, sharing.AndroidFileId.Value)); } return val; } catch { return null; } } private static ModTarget CreateNativeModTarget(long modId, long fileId) { //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_0011: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown return (ModTarget)new ModIOModTarget { GameId = 3809L, ModId = modId, ModfileId = fileId, ThumbnailOverride = null }; } private static bool SameDirectories(IReadOnlyList left, IReadOnlyList right) { if (left.Count == right.Count) { return left.ToHashSet(StringComparer.OrdinalIgnoreCase).SetEquals(right); } return false; } private void ScanMod(long modId, IReadOnlyList directories) { try { if (_suppressedModIds.Contains(modId)) { _avatars.Remove(modId); this.AvatarsChanged?.Invoke(modId, Array.Empty()); return; } string[] source = directories.Select(NormalizeDirectory).ToArray(); Dictionary dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); Enumerator enumerator = AssetWarehouse.Instance.GetPalletManifests().GetEnumerator(); while (enumerator.MoveNext()) { PalletManifest current = enumerator.Current; if (current == null || (Object)(object)current.Pallet == (Object)null || string.IsNullOrWhiteSpace(current.PalletPath)) { continue; } string manifestPath = Path.GetFullPath(current.PalletPath); if (!File.Exists(manifestPath) || !source.Any((string directory) => IsInside(manifestPath, directory))) { continue; } LocalModMetadata val = LocalModMetadata.Read(source.FirstOrDefault((string directory) => IsInside(manifestPath, directory)) ?? Path.GetDirectoryName(manifestPath) ?? _modsRoot); long modId2 = ((modId > 0) ? modId : val.ModId); Enumerator enumerator2 = current.Pallet.Crates.GetEnumerator(); while (enumerator2.MoveNext()) { AvatarCrate val2 = ((Il2CppObjectBase)enumerator2.Current).TryCast(); if ((Object)(object)val2 == (Object)null) { continue; } Barcode barcode = ((Scannable)val2).Barcode; if (!string.IsNullOrWhiteSpace((barcode != null) ? barcode.ID : null)) { string iD = ((Scannable)val2).Barcode.ID; string iD2 = ((Scannable)val2).Barcode.ID; string title = ((Scannable)val2).Title ?? "Unnamed avatar"; string modName = val.ModName; object author; if (!string.IsNullOrWhiteSpace(val.Creator)) { author = val.Creator; } else { Pallet pallet = ((Crate)val2).Pallet; author = ((pallet != null) ? pallet.Author : null) ?? "Unknown creator"; } dictionary[iD] = new BoneHubAvatar(modId2, iD2, title, modName, (string)author, ((Scannable)val2).Description ?? val.Summary, val.ThumbnailUrl); } } } _avatars[modId] = dictionary.Values.OrderBy((BoneHubAvatar avatar) => avatar.Title).ToList(); foreach (string key in dictionary.Keys) { _quarantinedAvatars.Remove(key); } this.AvatarsChanged?.Invoke(modId, _avatars[modId].ToArray()); } catch (Exception ex) { _log.Error($"Avatar discovery failed for mod {modId}: {ex.Message}"); } } private void ScanLocalLibrary() { try { Dictionary> dictionary = new Dictionary>(); Dictionary> dictionary2 = new Dictionary>(); Enumerator enumerator = AssetWarehouse.Instance.GetPalletManifests().GetEnumerator(); while (enumerator.MoveNext()) { PalletManifest current = enumerator.Current; if (current == null || (Object)(object)current.Pallet == (Object)null || string.IsNullOrWhiteSpace(current.PalletPath)) { continue; } string fullPath = Path.GetFullPath(current.PalletPath); if (!File.Exists(fullPath) || !IsInside(fullPath, _modsRoot)) { continue; } string text = ResolvePackageRoot(fullPath); LocalModMetadata val = LocalModMetadata.Read(text); if (_suppressedModIds.Contains(val.ModId)) { continue; } if (!dictionary2.TryGetValue(val.ModId, out var value)) { value = new HashSet(StringComparer.OrdinalIgnoreCase); dictionary2[val.ModId] = value; } value.Add(text); if (!dictionary.TryGetValue(val.ModId, out var value2)) { value2 = new Dictionary(StringComparer.OrdinalIgnoreCase); dictionary[val.ModId] = value2; } Enumerator enumerator2 = current.Pallet.Crates.GetEnumerator(); while (enumerator2.MoveNext()) { AvatarCrate val2 = ((Il2CppObjectBase)enumerator2.Current).TryCast(); if ((Object)(object)val2 == (Object)null) { continue; } Barcode barcode = ((Scannable)val2).Barcode; if (!string.IsNullOrWhiteSpace((barcode != null) ? barcode.ID : null)) { Dictionary dictionary3 = value2; string iD = ((Scannable)val2).Barcode.ID; long modId = val.ModId; string iD2 = ((Scannable)val2).Barcode.ID; string title = ((Scannable)val2).Title ?? "Unnamed avatar"; string modName = val.ModName; object author; if (!string.IsNullOrWhiteSpace(val.Creator)) { author = val.Creator; } else { Pallet pallet = ((Crate)val2).Pallet; author = ((pallet != null) ? pallet.Author : null) ?? "Unknown creator"; } dictionary3[iD] = new BoneHubAvatar(modId, iD2, title, modName, (string)author, ((Scannable)val2).Description ?? val.Summary, val.ThumbnailUrl); } } } long[] array = _avatars.Keys.Where((long id) => !_installedDirectories.ContainsKey(id)).ToArray(); foreach (long key in array) { _avatars.Remove(key); } foreach (KeyValuePair> item in dictionary) { _avatars[item.Key] = item.Value.Values.OrderBy((BoneHubAvatar avatar) => avatar.Title, StringComparer.OrdinalIgnoreCase).ToList(); foreach (string key2 in item.Value.Keys) { _quarantinedAvatars.Remove(key2); } } _discoveredDirectories.Clear(); foreach (KeyValuePair> item2 in dictionary2) { _discoveredDirectories[item2.Key] = item2.Value.ToArray(); } this.AvatarsChanged?.Invoke(long.MinValue, Array.Empty()); _log.Msg($"WristHub indexed {dictionary.Values.Sum((Dictionary group) => group.Count)} downloaded avatar crates across {dictionary.Count} BONELAB mods."); } catch (Exception ex) { _log.Error("Downloaded avatar discovery failed: " + ex.Message); } } private string ResolvePackageRoot(string manifestPath) { string text = Path.GetRelativePath(_modsRoot, manifestPath).Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).FirstOrDefault((string part) => !string.IsNullOrWhiteSpace(part) && part != "."); if (!string.IsNullOrWhiteSpace(text)) { return Path.Combine(_modsRoot, text); } return Path.GetDirectoryName(manifestPath) ?? _modsRoot; } private IReadOnlyList DiscoverPackDirectories(long modId) { HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); try { Enumerator enumerator = AssetWarehouse.Instance.GetPalletManifests().GetEnumerator(); while (enumerator.MoveNext()) { PalletManifest current = enumerator.Current; if ((Object)(object)((current != null) ? current.Pallet : null) == (Object)null || string.IsNullOrWhiteSpace(current.PalletPath)) { continue; } string fullPath = Path.GetFullPath(current.PalletPath); if (File.Exists(fullPath) && IsInside(fullPath, _modsRoot)) { string text = ResolvePackageRoot(fullPath); if (LocalModMetadata.Read(text).ModId == modId) { hashSet.Add(text); } } } } catch (Exception ex) { _log.Warning("Pack-folder discovery failed for deletion: " + ex.Message); } if (hashSet.Count > 0) { _discoveredDirectories[modId] = hashSet.ToArray(); } return hashSet.ToArray(); } private static bool IsInside(string path, string root) { string text = Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); string text2 = NormalizeDirectory(root); if (!string.Equals(text, text2, StringComparison.OrdinalIgnoreCase)) { return text.StartsWith(text2 + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase); } return true; } private static string NormalizeDirectory(string path) { return Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); } public void Dispose() { _pendingEquip = null; _pendingPackExit = null; _loads.Clear(); _avatars.Clear(); _quarantinedAvatars.Clear(); _remoteAvatarAssetsLoading.Clear(); _remoteAvatarAssetsReady.Clear(); _remoteAvatarAssetRetryAt.Clear(); _suppressedModIds.Clear(); _installedDirectories.Clear(); } } internal static class BoneHubTheme { public static readonly Color Cyan = new Color(0.34f, 0.91f, 1f); public static readonly Color Blue = new Color(0.42f, 0.66f, 1f); public static readonly Color Violet = new Color(0.66f, 0.55f, 0.98f); public static readonly Color Green = new Color(0.35f, 0.9f, 0.66f); public static readonly Color Amber = new Color(1f, 0.79f, 0.44f); public static readonly Color Muted = new Color(0.47f, 0.57f, 0.66f); public static readonly Color Danger = new Color(1f, 0.42f, 0.52f); private static Texture2D? _background; private static Texture2D? _logo; public static Texture2D? Background => _background; public static void Initialize(Instance log) { try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); _background = LoadTexture(executingAssembly, "WristHub.Assets.Background.png", "WristHub Background"); _logo = LoadTexture(executingAssembly, "WristHub.Assets.Logo.png", "WristHub Logo"); } catch (Exception ex) { log.Error("WristHub visual assets could not be loaded; using the color theme: " + ex.Message); } } public static Page Style(Page page, bool showLogo = false, float opacity = 0.88f) { if (_background != null) { page.Background = _background; } if (showLogo && _logo != null) { page.Logo = _logo; } page.BackgroundOpacity = opacity; page.ElementSpacing = 48f; return page; } public static string Brand(string subtitle) { return "BONEHUB " + Escape(subtitle).ToUpperInvariant() + ""; } public static string PageTitle(string symbol, string title) { return $"{Escape(symbol)} {Escape(title)}"; } public static string Section(string title) { return "" + Escape(title).ToUpperInvariant() + ""; } public static string Label(string name, string value) { return $"{Escape(name).ToUpperInvariant()} {Escape(value)}"; } public static string Status(string label, string colorHex) { return $" {Escape(label)} "; } public static string PrimaryAction(string label) { return " " + Escape(label) + " → "; } public static string SecondaryAction(string label) { return "" + Escape(label) + " ›"; } public static string Hint(string label) { return "" + Escape(label) + ""; } public static string Body(string value) { return "" + Escape(value) + ""; } public static string Stars(double rating) { int num = Math.Clamp((int)Math.Round(rating), 0, 5); return $"{new string('★', num)}{new string('★', 5 - num)} {rating:0.0}"; } public static string ProgressBar(double progress, int segments = 12) { int num = Math.Clamp((int)Math.Round(progress * (double)segments), 0, segments); return $"{new string('■', num)}{new string('■', segments - num)}"; } public static string CompactNumber(long value) { if (value < 1000000) { if (value >= 1000) { return $"{(double)value / 1000.0:0.#}K"; } return value.ToString("N0"); } return $"{(double)value / 1000000.0:0.#}M"; } public static string Escape(string? value) { return (value ?? string.Empty).Replace("&", "&", StringComparison.Ordinal).Replace("<", "<", StringComparison.Ordinal).Replace(">", ">", StringComparison.Ordinal); } private static Texture2D LoadTexture(Assembly assembly, string resourceName, string textureName) { //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0072: Expected O, but got Unknown using Stream stream = assembly.GetManifestResourceStream(resourceName) ?? throw new InvalidOperationException("Missing embedded resource " + resourceName + "."); using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { name = textureName, hideFlags = (HideFlags)32 }; if (!ImageConversion.LoadImage(val, Il2CppStructArray.op_Implicit(memoryStream.ToArray()), true)) { throw new InvalidDataException("Unity could not decode " + resourceName + "."); } return val; } } internal sealed class BoneHubThumbnailCache : IDisposable { private const int MaximumBytes = 2097152; private const int MaximumMemoryEntries = 32; private const int MaximumDiskEntries = 96; private readonly string _directory; private readonly ConcurrentQueue _mainThread; private readonly Instance _log; private readonly HttpClient _http = new HttpClient { Timeout = TimeSpan.FromSeconds(20.0) }; private readonly Dictionary _memory = new Dictionary(StringComparer.Ordinal); private readonly Dictionary>> _loading = new Dictionary>>(StringComparer.Ordinal); private readonly Dictionary _uris = new Dictionary(StringComparer.Ordinal); private readonly HashSet _decodeRetried = new HashSet(StringComparer.Ordinal); private readonly Queue _memoryOrder = new Queue(); private readonly object _sync = new object(); private readonly CancellationTokenSource _shutdown = new CancellationTokenSource(); private int _disposed; public BoneHubThumbnailCache(string directory, ConcurrentQueue mainThread, Instance log) { _directory = Path.GetFullPath(directory); _mainThread = mainThread; _log = log; _http.DefaultRequestHeaders.UserAgent.ParseAdd("WristHub/4.0.1"); try { Directory.CreateDirectory(_directory); PruneDiskCache(); } catch (Exception ex) { _log.Msg("Thumbnail disk cache is unavailable: " + ex.Message); } } public void Load(string url, Action completed) { if (Volatile.Read(in _disposed) != 0 || !Uri.TryCreate(url, UriKind.Absolute, out Uri result) || result.Scheme != Uri.UriSchemeHttps) { return; } string key = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(result.AbsoluteUri))).ToLowerInvariant(); lock (_sync) { if (_memory.TryGetValue(key, out Texture2D value)) { completed(value); return; } if (_loading.TryGetValue(key, out List> value2)) { value2.Add(completed); return; } _loading[key] = new List> { completed }; _uris[key] = result; } LoadAsync(result, key, _shutdown.Token); } private async Task LoadAsync(Uri uri, string key, CancellationToken cancellationToken) { try { string path = Path.Combine(_directory, key + ".image"); byte[] bytes; if (File.Exists(path)) { try { long length = new FileInfo(path).Length; if ((length <= 0 || length > 2097152) ? true : false) { throw new InvalidDataException("Cached thumbnail size is invalid."); } bytes = await File.ReadAllBytesAsync(path, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); File.SetLastWriteTimeUtc(path, DateTime.UtcNow); } catch when (!cancellationToken.IsCancellationRequested) { try { File.Delete(path); } catch { } bytes = await DownloadAsync(uri, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); await SaveAsync(path, bytes, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); } } else { bytes = await DownloadAsync(uri, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); await SaveAsync(path, bytes, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); } if (Volatile.Read(in _disposed) == 0) { _mainThread.Enqueue(delegate { Decode(key, bytes); }); } } catch (OperationCanceledException) { } catch (Exception ex2) { _log.Msg("Thumbnail was skipped: " + ex2.Message); lock (_sync) { _loading.Remove(key); _uris.Remove(key); _decodeRetried.Remove(key); } } } private async Task DownloadAsync(Uri uri, CancellationToken cancellationToken) { using HttpResponseMessage response = await _http.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); response.EnsureSuccessStatusCode(); if (response.Content.Headers.ContentLength > 2097152) { throw new InvalidDataException("Thumbnail exceeds WristHub's 2 MB limit."); } byte[] obj = await response.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false); int num = obj.Length; if ((num <= 0 || num > 2097152) ? true : false) { throw new InvalidDataException("Thumbnail data is empty or too large."); } return obj; } private async Task SaveAsync(string path, byte[] bytes, CancellationToken cancellationToken) { Directory.CreateDirectory(_directory); await File.WriteAllBytesAsync(path + ".tmp", bytes, cancellationToken).ConfigureAwait(continueOnCapturedContext: false); File.Move(path + ".tmp", path, overwrite: true); } private void Decode(string key, byte[] bytes) { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if (Volatile.Read(in _disposed) != 0) { return; } try { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { name = "WristHub Thumbnail " + key.Substring(0, 8), hideFlags = (HideFlags)32 }; if (!ImageConversion.LoadImage(val, Il2CppStructArray.op_Implicit(bytes), true)) { throw new InvalidDataException("Unity could not decode this thumbnail."); } Action[] array; lock (_sync) { array = (_loading.Remove(key, out List> value) ? value.ToArray() : Array.Empty>()); _uris.Remove(key); _decodeRetried.Remove(key); _memory[key] = val; _memoryOrder.Enqueue(key); while (_memoryOrder.Count > 32) { string key2 = _memoryOrder.Dequeue(); if (_memory.Remove(key2, out Texture2D value2)) { Object.Destroy((Object)(object)value2); } } } if (Volatile.Read(in _disposed) != 0) { return; } Action[] array2 = array; foreach (Action action in array2) { try { action(val); } catch (Exception ex) { _log.Msg("Thumbnail UI callback was skipped: " + ex.Message); } } } catch (Exception ex2) { Uri uri = null; lock (_sync) { if (_uris.TryGetValue(key, out Uri value3) && _decodeRetried.Add(key)) { uri = value3; } else { _loading.Remove(key); _uris.Remove(key); _decodeRetried.Remove(key); } } try { File.Delete(Path.Combine(_directory, key + ".image")); } catch { } if (uri != null && Volatile.Read(in _disposed) == 0) { _log.Msg("A corrupt thumbnail cache entry was discarded and will be downloaded again."); LoadAsync(uri, key, _shutdown.Token); } else { _log.Msg("Thumbnail decode was skipped: " + ex2.Message); } } } private void PruneDiskCache() { foreach (FileInfo item in (from file in new DirectoryInfo(_directory).EnumerateFiles("*.image") orderby file.LastWriteTimeUtc descending select file).Skip(96)) { try { item.Delete(); } catch { } } foreach (string item2 in Directory.EnumerateFiles(_directory, "*.tmp")) { try { File.Delete(item2); } catch { } } } public void Dispose() { if (Interlocked.Exchange(ref _disposed, 1) != 0) { return; } _shutdown.Cancel(); _shutdown.Dispose(); _http.Dispose(); lock (_sync) { foreach (Texture2D value in _memory.Values) { Object.Destroy((Object)(object)value); } } _memory.Clear(); lock (_sync) { _loading.Clear(); } _uris.Clear(); _decodeRetried.Clear(); } } internal sealed class BoneHubWristWatch : IDisposable { private const float MaximumViewDistance = 0.8f; private const float FaceNormal = 0.0064f; private static readonly Color Amber = new Color(1f, 0.67f, 0.22f, 1f); private static readonly Color Green = new Color(0.32f, 0.9f, 0.62f, 1f); private static readonly Color Red = new Color(1f, 0.38f, 0.46f, 1f); private readonly Action _openLauncher; private readonly Action _closeLauncher; private readonly Func _displayOpen; private readonly Func _displayClosing; private readonly BoneHubPreferences _preferences; private readonly Instance _log; private readonly BoneHubFingertipProbeProvider _fingertips = BoneHubFingertipProbeProvider.Shared; private readonly WatchSurfaceAnchorProvider _surfaceAnchors = new WatchSurfaceAnchorProvider(); private readonly List _rim = new List(36); private readonly MaterialPropertyBlock _propertyBlock = new MaterialPropertyBlock(); private GameObject? _root; private Transform? _attachedHand; private Renderer? _face; private TMP_Text? _timeText; private TMP_Text? _secondsText; private TMP_Text? _dateText; private TMP_Text? _statusText; private SmartWatchState _state; private WatchStatusTone _tone; private string _status = "READY"; private float _downloadProgress; private float _observedFor; private float _awakeUntil; private float _pressedUntil; private float _projectingUntil; private int _lastClockSecond = -1; private int _lastRimLit = -1; private bool _touchLatched; private bool _attachErrorLogged; private WatchClearanceSource? _lastClearanceSource; private Quaternion _smoothedFaceRotation = Quaternion.identity; private bool _hasSmoothedFaceRotation; private WristHubTheme _lastTheme = (WristHubTheme)(-1); private bool? _lastClockFormat; private Color Cyan => WristHubThemePalette.Accent(_preferences.HologramTheme); private Color DimCyan => WristHubThemePalette.Dim(_preferences.HologramTheme); public bool Enabled { get { return _preferences.WatchEnabled; } set { _preferences.WatchEnabled = value; } } public bool RaiseToOpen { get { return _preferences.RaiseToOpen; } set { _preferences.RaiseToOpen = value; } } public bool UseLeftWrist { get { return _preferences.UseLeftWrist; } set { _preferences.UseLeftWrist = value; Recenter(); } } public float WatchScale { get { return _preferences.WatchScale; } set { _preferences.WatchScale = Mathf.Clamp(value, 0.65f, 1.6f); } } public float DwellSeconds { get { return 1f; } set { _preferences.DwellSeconds = 1f; } } public float OutwardOffset { get { return _preferences.OutwardOffset; } set { _preferences.OutwardOffset = Mathf.Clamp(value, 0.008f, 0.045f); } } public float FingerOffset { get { return _preferences.FingerOffset; } set { _preferences.FingerOffset = Mathf.Clamp(value, -0.055f, 0.025f); } } public float ForearmOffset { get { return _preferences.WatchForearmOffset; } set { _preferences.WatchForearmOffset = Mathf.Clamp(value, -0.08f, 0.03f); } } public bool ReducedMotion { get { return _preferences.ReducedMotion; } set { _preferences.ReducedMotion = value; } } public SmartWatchState State => _state; public BoneHubWristWatch(Action openLauncher, Action closeLauncher, Func displayOpen, Func displayClosing, BoneHubPreferences preferences, Instance log) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //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_0054: Unknown result type (might be due to invalid IL or missing references) _openLauncher = openLauncher; _closeLauncher = closeLauncher; _displayOpen = displayOpen; _displayClosing = displayClosing; _preferences = preferences; _log = log; _preferences.DwellSeconds = 1f; } public void Tick() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } ResetInteraction(); return; } if ((Object)(object)Player.Head == (Object)null) { Detach(); return; } try { Hand val = (UseLeftWrist ? Player.LeftHand : Player.RightHand); if ((Object)(object)val == (Object)null) { if ((Object)(object)_root != (Object)null) { _root.SetActive(false); } _state = (SmartWatchState)6; return; } if ((Object)(object)_root == (Object)null || (Object)(object)_attachedHand != (Object)(object)((Component)val).transform) { Attach(((Component)val).transform); } if (!((Object)(object)_root == (Object)null)) { _root.SetActive(true); SolvePose(((Component)val).transform); UpdateGaze(Player.Head); UpdateTouch(); UpdatePresentation(); } } catch (Exception value) { if (!_attachErrorLogged) { _attachErrorLogged = true; _log.Error($"WristHub smart watch recovered while attaching: {value}"); } Detach(); } } public void LateTick() { if (!Enabled || (Object)(object)_root == (Object)null) { return; } try { Hand val = (UseLeftWrist ? Player.LeftHand : Player.RightHand); if ((Object)(object)val != (Object)null && (Object)(object)_attachedHand == (Object)(object)((Component)val).transform) { SolvePose(((Component)val).transform); } } catch { } } public void RequireLookAway() { _touchLatched = true; _observedFor = 0f; } public void OnDownloadChanged(DownloadJob job) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected I4, but got Unknown //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) _downloadProgress = Mathf.Clamp01((float)job.Progress); DownloadState state = job.State; (_tone, _status) = (state - 4) switch { 1 => ((WatchStatusTone)2, "DOWNLOAD READY"), 2 => ((WatchStatusTone)3, "DOWNLOAD FAILED"), 3 => ((WatchStatusTone)0, "CANCELLED"), 0 => ((WatchStatusTone)1, $"INSTALL {Mathf.RoundToInt(_downloadProgress * 100f)}%"), _ => ((WatchStatusTone)1, $"DOWNLOAD {Mathf.RoundToInt(_downloadProgress * 100f)}%"), }; } public void SetStatus(string status, bool error = false, bool success = false) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) _status = CompactStatus(status); _tone = (WatchStatusTone)(error ? 3 : (success ? 2 : 0)); } public void Recenter() { Detach(); _surfaceAnchors.Invalidate(); _fingertips.Invalidate(); } public void Dispose() { Detach(); } private void Attach(Transform hand) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0060: 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_00c9: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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) Detach(); _attachedHand = hand; _root = new GameObject(UseLeftWrist ? "[WristHub] Left Circular Watch" : "[WristHub] Right Circular Watch"); Object.DontDestroyOnLoad((Object)(object)_root); CreateDisc("Solid Black Smart Watch Body", 0f, 0.035f, 0.0032f, new Color(0.0015f, 0.003f, 0.004f, 1f)); CreateDisc("Watch Bezel", 0.0034f, 0.0336f, 0.0016f, new Color(0.01f, 0.018f, 0.022f, 1f)); _face = CreateDisc("High Contrast Watch Glass", 0.005f, 0.0325f, 0.0012f, new Color(0.002f, 0.008f, 0.011f, 1f)); for (int i = 0; i < 36; i++) { float num = (float)i / 36f * (float)Math.PI * 2f; Renderer val = CreatePart("Segmented Rim", new Vector3(Mathf.Sin(num) * 0.0328f, 0.0064f, Mathf.Cos(num) * 0.0328f), new Vector3(0.0042f, 0.00075f, 0.00125f), DimCyan, (PrimitiveType)3); ((Component)val).transform.localRotation = Quaternion.Euler(0f, (0f - num) * 57.29578f, 0f); _rim.Add(val); } BuildClockCanvas(); SolvePose(hand); SetAwakeVisuals(visible: false, 0f); _attachErrorLogged = false; _log.Msg("WristHub circular smart watch attached. Look for one second to wake it or tap to open the hub."); } private void BuildClockCanvas() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0046: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00e0: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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) if (!((Object)(object)_root == (Object)null)) { GameObject val = new GameObject("Detailed Watch Face"); val.transform.SetParent(_root.transform, false); val.transform.localPosition = new Vector3(0f, 0.0072f, 0f); val.transform.localRotation = Quaternion.Euler(90f, 0f, 0f); val.transform.localScale = Vector3.one * 0.001f; Canvas obj = val.AddComponent(); obj.renderMode = (RenderMode)2; obj.sortingOrder = 150; val.GetComponent().sizeDelta = new Vector2(65f, 65f); _timeText = CreateWatchText(val.transform, "00:00", new Vector2(-2f, 8f), new Vector2(45f, 22f), 23f, (TextAlignmentOptions)514, (FontStyles)1); _secondsText = CreateWatchText(val.transform, "00", new Vector2(23f, 10f), new Vector2(11f, 12f), 9f, (TextAlignmentOptions)514, (FontStyles)1); _dateText = CreateWatchText(val.transform, "MON JAN 01", new Vector2(0f, -7f), new Vector2(52f, 10f), 8.5f, (TextAlignmentOptions)514, (FontStyles)0); _statusText = CreateWatchText(val.transform, "READY", new Vector2(0f, -20f), new Vector2(52f, 9f), 7.5f, (TextAlignmentOptions)514, (FontStyles)1); } } private void UpdateGaze(Transform head) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) float unscaledTime = Time.unscaledTime; bool flag = _displayOpen(); bool flag2 = !flag && RaiseToOpen && IsObserved(head); if (flag2) { _observedFor += Mathf.Max(0f, Time.unscaledDeltaTime); bool num = (double)_observedFor >= 1.0 && unscaledTime >= _awakeUntil; _awakeUntil = (float)SmartWatchWakeMath.ExtendDeadline(true, (double)_observedFor, (double)unscaledTime, (double)_awakeUntil); if (num) { _log.Msg("WristHub watch woke after a one-second wrist gaze."); } } else { _observedFor = 0f; } _state = SmartWatchWakeMath.Resolve(flag, unscaledTime < _projectingUntil, unscaledTime < _pressedUntil, flag2, (double)_observedFor, (double)unscaledTime, (double)_awakeUntil); } private bool IsObserved(Transform head) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return false; } Vector3 val = _root.transform.position - head.position; float magnitude = ((Vector3)(ref val)).magnitude; float num = CurrentHeightRatio(); if (magnitude >= 0.08f * num && magnitude <= 0.8f * num && magnitude > 0.01f) { return Vector3.Dot(head.forward, val / magnitude) >= 0.82f; } return false; } private void UpdateTouch() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0063: 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) if ((Object)(object)_root == (Object)null) { return; } IReadOnlyList probes = _fingertips.GetProbes(); BoneHubFingertipProbe boneHubFingertipProbe = default(BoneHubFingertipProbe); bool flag = false; for (int i = 0; i < probes.Count; i++) { BoneHubFingertipProbe boneHubFingertipProbe2 = probes[i]; if (!((Object)(object)boneHubFingertipProbe2.Hand == (Object)null)) { Vector3 val = _root.transform.InverseTransformPoint(boneHubFingertipProbe2.Position); if (CircularWatchTouchMath.Contains(val.x, val.y - 0.0064f, val.z, 1f)) { boneHubFingertipProbe = boneHubFingertipProbe2; flag = true; break; } } } if (!flag) { _touchLatched = false; } else { if (_touchLatched) { return; } bool flag2 = _displayOpen(); if (!flag2 || !_displayClosing()) { _touchLatched = true; _pressedUntil = Time.unscaledTime + 0.1f; Pulse(boneHubFingertipProbe.Hand); if (flag2) { _closeLauncher(); _log.Msg("WristHub watch touch started the reverse projection close."); } else { _projectingUntil = Time.unscaledTime + 0.55f; _openLauncher(); _log.Msg("WristHub watch touch started the compact module projection."); } } } } private void UpdatePresentation() { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Invalid comparison between Unknown and I4 //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Invalid comparison between Unknown and I4 //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) SmartWatchState state = _state; bool flag = (int)state <= 1; bool flag2 = !flag; float num = Mathf.Clamp01(_observedFor / 1f); float num2 = (flag2 ? 1f : (((int)_state == 1) ? num : 0f)); if ((int)_state == 5) { num2 = 0.58f; } SetAwakeVisuals(flag2 || num2 > 0f, num2); DateTime now = DateTime.Now; if (flag2 && now.Second != _lastClockSecond) { _lastClockSecond = now.Second; if ((Object)(object)_timeText != (Object)null) { _timeText.text = now.ToString(_preferences.Use24HourClock ? "HH:mm" : "h:mm"); } if ((Object)(object)_secondsText != (Object)null) { _secondsText.text = (_preferences.Use24HourClock ? now.ToString("ss") : now.ToString("ss\ntt").ToUpperInvariant()); } if ((Object)(object)_dateText != (Object)null) { _dateText.text = now.ToString("ddd MMM dd").ToUpperInvariant(); } } if (_lastTheme != _preferences.HologramTheme || _lastClockFormat != _preferences.Use24HourClock) { _lastTheme = _preferences.HologramTheme; _lastClockFormat = _preferences.Use24HourClock; _lastClockSecond = -1; _lastRimLit = -1; if ((Object)(object)_timeText != (Object)null) { ((Graphic)_timeText).color = Cyan; } if ((Object)(object)_dateText != (Object)null) { ((Graphic)_dateText).color = Cyan; } } if ((Object)(object)_statusText != (Object)null) { _statusText.text = (((int)_tone == 1) ? $"{_status} {Mathf.RoundToInt(_downloadProgress * 100f)}%" : _status); ((Graphic)_statusText).color = ToneColor(); } if ((Object)(object)_face != (Object)null) { float num3 = (((int)_state == 3) ? (-0.0014f) : 0f); ((Component)_face).transform.localPosition = new Vector3(0f, 0.005f + num3, 0f); } } private void SetAwakeVisuals(bool visible, float progress) { //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_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_006e: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_timeText != (Object)null) { ((Component)_timeText).gameObject.SetActive(visible); } if ((Object)(object)_secondsText != (Object)null) { ((Component)_secondsText).gameObject.SetActive(visible && !_preferences.ReducedMotion); ((Graphic)_secondsText).color = new Color(Cyan.r, Cyan.g, Cyan.b, Mathf.Clamp01(progress)); } if ((Object)(object)_dateText != (Object)null) { ((Component)_dateText).gameObject.SetActive(visible); } if ((Object)(object)_statusText != (Object)null) { ((Component)_statusText).gameObject.SetActive(visible); } Color val = ToneColor(); int num = (visible ? Mathf.CeilToInt(Mathf.Clamp01(progress) * (float)_rim.Count) : 0); if (!(num == _lastRimLit && visible)) { _lastRimLit = num; for (int i = 0; i < _rim.Count; i++) { SetColor(_rim[i], (i < num) ? val : DimCyan); } } } private void SolvePose(Transform hand, bool positionOnly = false) { //IL_0065: 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_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_0058: 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_006a: 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_00ab: 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_0098: 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_00a2: 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_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_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_00d0: 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_00e4: 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_00ed: 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_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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_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_0143: 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_0153: 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_0175: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } float num = CurrentHeightRatio(); if (_surfaceAnchors.TryGet(UseLeftWrist, num, out var anchor) && anchor.Valid) { Vector3 val; Vector3 val2; if (!((Object)(object)Player.Head == (Object)null)) { val = Player.Head.position - anchor.SurfacePosition; val2 = ((Vector3)(ref val)).normalized; } else { val2 = anchor.OutwardNormal; } Vector3 val3 = val2; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = anchor.OutwardNormal; } Vector3 val4; if (!((Object)(object)Player.Head == (Object)null)) { val = Vector3.ProjectOnPlane(Player.Head.up, val3); val4 = ((Vector3)(ref val)).normalized; } else { val4 = anchor.ForearmDirection; } Vector3 val5 = val4; if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val = Vector3.ProjectOnPlane(anchor.ForearmDirection, val3); val5 = ((Vector3)(ref val)).normalized; } if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = Vector3.up; } if (!positionOnly) { Quaternion smoothedFaceRotation = Quaternion.LookRotation(val5, val3); _smoothedFaceRotation = smoothedFaceRotation; _hasSmoothedFaceRotation = true; } else if (!_hasSmoothedFaceRotation) { _smoothedFaceRotation = Quaternion.LookRotation(val5, val3); _hasSmoothedFaceRotation = true; } Vector3 val6 = anchor.SurfacePosition + anchor.ForearmDirection * (ForearmOffset * num); _root.transform.SetPositionAndRotation(val6, _smoothedFaceRotation); _root.transform.localScale = Vector3.one * (WatchScale * num); if (_lastClearanceSource != anchor.ClearanceSource) { _lastClearanceSource = anchor.ClearanceSource; _log.Msg($"WristHub watch surface anchored using {anchor.ClearanceSource} clearance."); } } } private static float CurrentHeightRatio() { try { RigManager rigManager = Player.RigManager; float? obj; if (rigManager == null) { obj = null; } else { Avatar avatar = rigManager.avatar; obj = ((avatar != null) ? new float?(avatar.height) : ((float?)null)); } float? num = obj; return AvatarUiScaleMath.ResolveMenuScale(num.GetValueOrDefault()); } catch { return 1f; } } private Renderer CreateDisc(string name, float normal, float radius, float halfHeight, Color color) { //IL_000d: 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_001b: Unknown result type (might be due to invalid IL or missing references) return CreatePart(name, new Vector3(0f, normal, 0f), new Vector3(radius, halfHeight, radius), color, (PrimitiveType)2); } private Renderer CreatePart(string name, Vector3 position, Vector3 scale, Color color, PrimitiveType primitive = (PrimitiveType)3) { //IL_0019: 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_0050: 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) if ((Object)(object)_root == (Object)null) { throw new InvalidOperationException("Watch root is unavailable."); } GameObject obj = GameObject.CreatePrimitive(primitive); ((Object)obj).name = name; obj.transform.SetParent(_root.transform, false); obj.transform.localPosition = position; obj.transform.localScale = scale; Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } Renderer component2 = obj.GetComponent(); SetColor(component2, color); return component2; } private TMP_Text CreateWatchText(Transform parent, string value, Vector2 center, Vector2 size, float fontSize, TextAlignmentOptions alignment, FontStyles style = (FontStyles)0) { //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_0072: 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_0083: 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_00c2: 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_00c4: 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_00d1: 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) GameObject val = new GameObject("Watch Text - " + value); val.transform.SetParent(parent, false); TextMeshProUGUI val2 = val.AddComponent(); if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null) { ((TMP_Text)val2).font = TMP_Settings.defaultFontAsset; } ((TMP_Text)val2).text = value; ((TMP_Text)val2).fontSize = fontSize; ((TMP_Text)val2).enableAutoSizing = true; ((TMP_Text)val2).fontSizeMin = Mathf.Max(4f, fontSize * 0.7f); ((TMP_Text)val2).fontSizeMax = fontSize; ((TMP_Text)val2).fontStyle = style; ((TMP_Text)val2).alignment = alignment; ((Graphic)val2).color = Cyan; ((TMP_Text)val2).enableWordWrapping = false; ((TMP_Text)val2).overflowMode = (TextOverflowModes)3; ((Graphic)val2).raycastTarget = false; RectTransform rectTransform = ((TMP_Text)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); rectTransform.pivot = val3; Vector2 anchorMin = (rectTransform.anchorMax = val3); rectTransform.anchorMin = anchorMin; rectTransform.anchoredPosition = center; rectTransform.sizeDelta = size; return (TMP_Text)(object)val2; } private Color ToneColor() { //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_0007: 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_001b: Expected I4, but got Unknown //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_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_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_003c: 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) WatchStatusTone tone = _tone; return (Color)((tone - 1) switch { 0 => Amber, 1 => Green, 2 => Red, _ => Cyan, }); } private void SetColor(Renderer renderer, Color color) { //IL_0022: 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) _propertyBlock.Clear(); renderer.GetPropertyBlock(_propertyBlock); _propertyBlock.SetColor("_Color", color); _propertyBlock.SetColor("_BaseColor", color); renderer.SetPropertyBlock(_propertyBlock); } private void Pulse(Hand hand) { if (!_preferences.HapticsEnabled) { return; } try { BaseController obj = (((Object)(object)hand == (Object)(object)Player.LeftHand) ? Player.LeftController : Player.RightController); if (obj != null) { Haptor haptor = obj.haptor; if (haptor != null) { haptor.Haptic_Tap(); } } } catch { } } private static string CompactStatus(string value) { if (string.IsNullOrWhiteSpace(value)) { return "READY"; } string text = value.Trim().ToUpperInvariant(); if (text.Length > 24) { return text.Substring(0, 24); } return text; } private void ResetInteraction() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) _state = (SmartWatchState)0; _observedFor = 0f; _awakeUntil = 0f; _pressedUntil = 0f; _projectingUntil = 0f; _touchLatched = false; } private void Detach() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _attachedHand = null; _face = null; _timeText = null; _secondsText = null; _dateText = null; _statusText = null; _rim.Clear(); _lastClearanceSource = null; _smoothedFaceRotation = Quaternion.identity; _hasSmoothedFaceRotation = false; _lastRimLit = -1; _lastClockSecond = -1; ResetInteraction(); } } internal readonly record struct FusionMiniMapPeer(int Id, Vector3 Position, float HeadingDegrees, MiniMapPeerRole Role, Transform RigRoot, Transform TrackingTransform) { [CompilerGenerated] public void Deconstruct(out int Id, out Vector3 Position, out float HeadingDegrees, out MiniMapPeerRole Role, out Transform RigRoot, out Transform TrackingTransform) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected I4, but got Unknown Id = this.Id; Position = this.Position; HeadingDegrees = this.HeadingDegrees; Role = (MiniMapPeerRole)(int)this.Role; RigRoot = this.RigRoot; TrackingTransform = this.TrackingTransform; } } internal sealed class FusionMiniMapBridge { public int LastDetectedCount { get; private set; } public int LastValidPoseCount { get; private set; } public void Collect(List destination) { destination.Clear(); LastDetectedCount = 0; LastValidPoseCount = 0; try { foreach (NetworkPlayer player in NetworkPlayer.Players) { try { TryAddPlayer(destination, player); } catch { } } } catch { } } private void TryAddPlayer(List destination, NetworkPlayer? player) { //IL_00b0: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_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_0109: Unknown result type (might be due to invalid IL or missing references) if (((player != null) ? player.PlayerID : null) == null || player.PlayerID.IsMe) { return; } LastDetectedCount++; if (!player.HasRig || !player.ReceivedPose) { return; } try { RigRefs rigRefs = player.RigRefs; if (rigRefs != null && rigRefs.IsValid && !((Object)(object)rigRefs.Head == (Object)null) && !((Object)(object)rigRefs.RigManager == (Object)null)) { Transform head = rigRefs.Head; Transform transform = ((Component)rigRefs.RigManager).transform; if (!((Object)(object)transform == (Object)null)) { LastValidPoseCount++; int smallID = player.PlayerID.SmallID; Vector3 val = Vector3.ProjectOnPlane(head.forward, Vector3.up); float headingDegrees = ((((Vector3)(ref val)).sqrMagnitude < 0.001f) ? 0f : (Mathf.Atan2(val.x, val.z) * 57.29578f)); MiniMapPeerRole role = ResolveRole(player.PlayerID); destination.Add(new FusionMiniMapPeer(smallID, head.position, headingDegrees, role, transform, head)); } } } catch { } } private static MiniMapPeerRole ResolveRole(PlayerID playerId) { //IL_0027: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (playerId.IsHost) { return (MiniMapPeerRole)2; } try { PermissionLevel val = default(PermissionLevel); Color val2 = default(Color); FusionPermissions.FetchPermissionLevel(playerId.PlatformID, ref val, ref val2); return (MiniMapPeerRole)((int)val >= 1); } catch { return (MiniMapPeerRole)0; } } public void Invalidate() { LastDetectedCount = 0; LastValidPoseCount = 0; } } internal static class FusionPortalBridge { private const byte StateCommand = 1; private const byte RemoveCommand = 2; private const byte SnapshotCommand = 3; private static readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; private static Action? _onState; private static Action? _onRemove; private static PortalLinkState? _hostState; private static bool _registered; private static bool _snapshotRequested; private static bool _loginRequested; private static string _pendingServerSwitchCode = string.Empty; private static bool _pendingServerSwitchLoginLogged; private static readonly FusionServerSwitchCoordinator ServerSwitch = new FusionServerSwitchCoordinator(); private static readonly List CompatibilityBeaconIds = new List(2); public static bool IsConnected { get { EnsureRegistered(); return IsSessionReady; } } public static bool IsServerSwitchPending => ServerSwitch.Active; private static bool IsSessionReady { get { if (NetworkInfo.HasServer) { if (!NetworkInfo.IsHost) { return PlayerIDManager.LocalID != null; } return true; } return false; } } public static bool IsHost { get { EnsureRegistered(); if (NetworkInfo.HasServer) { return NetworkInfo.IsHost; } return true; } } public static void Attach(Action stateReceiver, Action removeReceiver) { _onState = stateReceiver; _onRemove = removeReceiver; EnsureRegistered(); } public static void Publish(PortalLinkState state, Action receiver) { EnsureRegistered(); _onState = receiver; if (IsSessionReady && NetworkInfo.IsHost) { _hostState = state; Broadcast(1, JsonSerializer.SerializeToUtf8Bytes(state, JsonOptions)); ShowCompatibilityBeacons(state); } } public static void Remove(int generation, Action receiver) { EnsureRegistered(); _onRemove = receiver; if (IsSessionReady && NetworkInfo.IsHost) { _hostState = null; Broadcast(2, BitConverter.GetBytes(generation)); RemoveCompatibilityBeacons(); } } public static void LoadLevel(string barcode, string loadingBarcode, bool leaveLobby, Instance log) { if (!string.IsNullOrWhiteSpace(barcode)) { MelonCoroutines.Start(LoadLevelRoutine(barcode, loadingBarcode ?? string.Empty, leaveLobby, log)); } } public static void RequestPublicServers(int generation, Action, string> completed) { ArgumentNullException.ThrowIfNull(completed, "completed"); MelonCoroutines.Start(RequestPublicServersRoutine(generation, completed)); } private static IEnumerator RequestPublicServersRoutine(int generation, Action, string> completed) { if (!NetworkLayerManager.LoggedIn || !NetworkInfo.HasLayer) { if (!_loginRequested) { try { NetworkLayer targetLayer = NetworkLayerManager.GetTargetLayer(); if (targetLayer == null) { completed(generation, Array.Empty(), "Fusion is installed but no network layer is available"); yield break; } _loginRequested = true; NetworkLayerManager.LogIn(targetLayer); } catch (Exception ex) { _loginRequested = false; completed(generation, Array.Empty(), Clean(ex.Message, "Fusion login could not start", 96)); yield break; } } float loginDeadline = Time.realtimeSinceStartup + 15f; while ((!NetworkLayerManager.LoggedIn || !NetworkInfo.HasLayer) && Time.realtimeSinceStartup < loginDeadline) { yield return null; } if (!NetworkLayerManager.LoggedIn || !NetworkInfo.HasLayer) { _loginRequested = false; completed(generation, Array.Empty(), "Fusion login timed out - open Fusion once, then refresh"); yield break; } _loginRequested = false; } bool requestComplete = false; IReadOnlyList result = Array.Empty(); string requestError = string.Empty; string text = null; try { IMatchmaker matchmaker = NetworkInfo.Layer.Matchmaker; if (matchmaker == null) { text = "Fusion matchmaker is unavailable"; } else { matchmaker.RequestLobbies(LobbyFilterManager.CreateMatchmakerFilters(), (Action)delegate(MatchmakerCallbackInfo info) { //IL_0000: 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_0027: 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_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_0079: 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_008b: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Expected O, but got Unknown try { LobbyInfo[] lobbies = info.Lobbies; List list = new List(Math.Min((lobbies != null) ? lobbies.Length : 0, 100)); if (info.Lobbies != null) { LobbyInfo[] lobbies2 = info.Lobbies; foreach (LobbyInfo val in lobbies2) { LobbyMetadataInfo metadata = val.Metadata; LobbyInfo lobbyInfo = ((LobbyMetadataInfo)(ref metadata)).LobbyInfo; if (lobbyInfo != null && ((LobbyMetadataInfo)(ref metadata)).HasLobbyOpen && FusionServerEntry.IsValidCode(((LobbyMetadataInfo)(ref metadata)).LobbyCode) && LobbyFilterManager.CheckOptionalFilters(val.Lobby, metadata) && LobbyFilterManager.CheckPersistentFilters(val.Lobby, metadata) && (int)lobbyInfo.Privacy != 1 && (int)lobbyInfo.Privacy != 3 && ((int)lobbyInfo.Privacy != 2 || NetworkInfo.Layer.IsFriend(lobbyInfo.LobbyID))) { int num = Math.Max(1, lobbyInfo.MaxPlayers); int num2 = Math.Clamp(lobbyInfo.PlayerCount, 0, num); PlayerList playerList = lobbyInfo.PlayerList; FusionServerPlayer[] array = ((playerList == null) ? null : playerList.Players?.Where((PlayerInfo player) => player != null).Select((Func)((PlayerInfo player) => new FusionServerPlayer(Clean(player.Username, "Player", 32), Clean(((object)player.PermissionLevel/*cast due to .constrained prefix*/).ToString(), "Player", 20), Clean(player.AvatarTitle, "Unknown avatar", 48), (long)player.AvatarModID, player.PlatformID))).Take(num) .ToArray()) ?? Array.Empty(); string[] array2 = (from player in array select player.Name into name where !string.IsNullOrWhiteSpace(name) select name).Distinct(StringComparer.OrdinalIgnoreCase).Take(num).ToArray() ?? Array.Empty(); string text2 = Clean(lobbyInfo.LobbyHostName, "Unknown host", 40); string text3 = (string.IsNullOrWhiteSpace(lobbyInfo.LobbyName) ? (text2 + "'s Server") : Clean(lobbyInfo.LobbyName, text2 + "'s Server", 48)); FusionServerEntry entry = new FusionServerEntry(((LobbyMetadataInfo)(ref metadata)).LobbyCode.Trim().ToUpperInvariant(), text3, text2, Clean(lobbyInfo.LevelTitle, "Unknown level", 48), num2, num, ((LobbyMetadataInfo)(ref metadata)).Full || num2 >= num, ((LobbyMetadataInfo)(ref metadata)).ClientHasLevel, (long)lobbyInfo.LevelModID, lobbyInfo.LevelBarcode ?? string.Empty, Clean(lobbyInfo.GamemodeTitle, "Sandbox", 36), lobbyInfo.LobbyVersion?.ToString() ?? string.Empty, Clean(lobbyInfo.LobbyDescription, string.Empty, 240), (IReadOnlyList)array2, (IReadOnlyList)array, ParseLobbyId(lobbyInfo.LobbyID)); if (entry.IsValid && list.All((FusionServerEntry value) => !value.Code.Equals(entry.Code, StringComparison.OrdinalIgnoreCase))) { list.Add(entry); } } } } list.Sort(delegate(FusionServerEntry left, FusionServerEntry right) { int num3 = right.Players.CompareTo(left.Players); return (num3 == 0) ? string.Compare(left.Name, right.Name, StringComparison.OrdinalIgnoreCase) : num3; }); result = list; } catch (Exception ex3) { requestError = Clean(ex3.Message, "Fusion returned an invalid lobby list", 96); } finally { requestComplete = true; } }); } } catch (Exception ex2) { text = Clean(ex2.Message, "Could not request Fusion lobbies", 96); } if (text != null) { completed(generation, Array.Empty(), text); yield break; } float requestDeadline = Time.realtimeSinceStartup + 22f; while (!requestComplete && Time.realtimeSinceStartup < requestDeadline) { yield return null; } if (!requestComplete) { completed(generation, Array.Empty(), "Fusion server search timed out - touch refresh to retry"); } else { completed(generation, result, requestError); } } public static bool JoinServer(string code, Instance log) { string text = default(string); if (!FusionServerEntry.TryNormalizeCode(code, ref text)) { return false; } try { if (!NetworkInfo.HasLayer) { log.Warning("WristHub could not join the selected server because Fusion has no active network layer."); return false; } NetworkHelper.JoinServerByCode(text); log.Msg("WristHub handed the selected room to Fusion's fresh native join-by-code flow."); return true; } catch (Exception value) { log.Error($"WristHub could not join the selected Fusion server: {value}"); return false; } } public static bool BeginServerSwitch(string code, Instance log, ulong lobbyId = 0uL) { string text = default(string); if (!FusionServerEntry.TryNormalizeCode(code, ref text)) { return false; } try { _pendingServerSwitchCode = text; _pendingServerSwitchLoginLogged = false; bool flag = lobbyId != 0L && TryJoinLobbyId(lobbyId); if (!flag) { NetworkHelper.JoinServerByCode(text); } ServerSwitch.Begin((double)Time.unscaledTime, true, false); log.Msg(flag ? "WristHub handed the portal directly to Fusion's active lobby connection." : "WristHub asked Fusion to resolve and switch to the portal destination natively."); return true; } catch (Exception value) { _pendingServerSwitchCode = string.Empty; ServerSwitch.Cancel(); log.Error($"WristHub could not begin the Fusion server switch: {value}"); return false; } } public static void TickServerSwitch(Instance log) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Invalid comparison between Unknown and I4 //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Invalid comparison between Unknown and I4 if (string.IsNullOrWhiteSpace(_pendingServerSwitchCode) || !ServerSwitch.Active) { return; } string pendingServerSwitchCode = _pendingServerSwitchCode; FusionServerEntry val = (NetworkInfo.HasLayer ? GetCurrentServer() : null); bool flag = val != (FusionServerEntry)null && val.Code.Equals(pendingServerSwitchCode, StringComparison.OrdinalIgnoreCase) && PlayerIDManager.LocalID != null; FusionServerSwitchAction val2 = ServerSwitch.Evaluate((double)Time.unscaledTime, flag, NetworkInfo.HasLayer, NetworkInfo.HasServer); if ((int)val2 == 4) { _pendingServerSwitchCode = string.Empty; _pendingServerSwitchLoginLogged = false; log.Msg("WristHub portal confirmed the destination Fusion lobby is connected."); return; } if ((int)val2 == 5) { log.Warning("WristHub portal server switch timed out before Fusion confirmed the destination lobby."); _pendingServerSwitchCode = string.Empty; _pendingServerSwitchLoginLogged = false; return; } if ((int)val2 == 1) { try { NetworkLayer targetLayer = NetworkLayerManager.GetTargetLayer(); if (targetLayer != null) { NetworkLayerManager.LogIn(targetLayer); if (!_pendingServerSwitchLoginLogged) { _pendingServerSwitchLoginLogged = true; log.Msg("WristHub portal restored Fusion's network layer for the destination lobby."); } } return; } catch (Exception value) { log.Error($"WristHub portal could not restore Fusion networking: {value}"); return; } } _pendingServerSwitchLoginLogged = false; if ((int)val2 == 2) { try { NetworkHelper.Disconnect("Completing WristHub portal server switch"); return; } catch (Exception value2) { log.Error($"WristHub portal could not leave the previous Fusion lobby: {value2}"); return; } } if ((int)val2 != 3) { return; } try { NetworkHelper.JoinServerByCode(pendingServerSwitchCode); log.Msg((ServerSwitch.JoinAttempts == 1) ? "WristHub portal requested the destination Fusion lobby." : "WristHub portal used its single guarded Fusion join fallback."); } catch (Exception value3) { log.Error($"WristHub portal destination fallback failed: {value3}"); } } public static FusionServerEntry? GetCurrentServer() { //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown EnsureRegistered(); if (!IsSessionReady) { return null; } try { LobbyInfo lobbyInfo = LobbyInfoManager.LobbyInfo; if (lobbyInfo == null) { return null; } int num = Math.Max(1, lobbyInfo.MaxPlayers); PlayerList playerList = lobbyInfo.PlayerList; FusionServerPlayer[] array = ((playerList == null) ? null : playerList.Players?.Where((PlayerInfo player) => player != null).Select((Func)((PlayerInfo player) => new FusionServerPlayer(Clean(player.Username, "Player", 32), Clean(((object)player.PermissionLevel/*cast due to .constrained prefix*/).ToString(), "Player", 20), Clean(player.AvatarTitle, "Unknown avatar", 48), (long)player.AvatarModID, player.PlatformID))).Take(num) .ToArray()) ?? Array.Empty(); string text = Clean(lobbyInfo.LobbyCode, NetworkHelper.GetServerCode() ?? "LOCAL", 16).ToUpperInvariant(); if (!FusionServerEntry.IsValidCode(text)) { text = "LOCAL"; } return new FusionServerEntry(text, Clean(lobbyInfo.LobbyName, "Fusion Lobby", 48), Clean(lobbyInfo.LobbyHostName, "Unknown host", 40), Clean(lobbyInfo.LevelTitle, "Unknown level", 48), Math.Clamp(lobbyInfo.PlayerCount, 0, num), num, false, true, (long)lobbyInfo.LevelModID, lobbyInfo.LevelBarcode ?? string.Empty, Clean(lobbyInfo.GamemodeTitle, "Sandbox", 36), lobbyInfo.LobbyVersion?.ToString() ?? string.Empty, Clean(lobbyInfo.LobbyDescription, string.Empty, 240), (IReadOnlyList)array.Select((FusionServerPlayer player) => player.Name).ToArray(), (IReadOnlyList)array, 0uL); } catch { return null; } } public static bool Disconnect(Instance log) { try { if (!NetworkInfo.HasServer) { return false; } NetworkHelper.Disconnect("Disconnected from WristHubOS"); log.Msg("WristHub handed disconnect to Fusion's native network layer."); return true; } catch (Exception value) { log.Error($"WristHub could not disconnect from Fusion: {value}"); return false; } } public static bool OpenNativeFusionMenu(bool useLeftController, Instance log) { try { if (MenuCreator.MenuPageIndex < 0 || (Object)(object)MenuCreator.MenuGameObject == (Object)null) { return false; } if (!NativeMenuHostBridge.TryOpenPreferences(useLeftController, out string error)) { log.Warning("WristHub could not activate BONELAB's menu for Fusion: " + error); return false; } MethodInfo method = typeof(MenuCreator).GetMethod("OnMenuButtonClicked", BindingFlags.Static | BindingFlags.NonPublic); if (method == null) { return false; } method.Invoke(null, null); if ((Object)(object)MenuCreator.MenuGameObject == (Object)null || !MenuCreator.MenuGameObject.activeInHierarchy) { return false; } MelonCoroutines.Start(NativeMenuHostBridge.RecenterInFrontRoutine()); log.Msg("WristHub opened Fusion's native full menu for advanced features."); return true; } catch (Exception value) { log.Error($"WristHub could not open Fusion's native menu: {value}"); return false; } } private static ulong ParseLobbyId(object? value) { if (value == null) { return 0uL; } if (!ulong.TryParse(value.ToString(), out var result)) { return 0uL; } return result; } private static bool TryJoinLobbyId(ulong lobbyId) { NetworkLayer layer = NetworkInfo.Layer; if (layer == null || lobbyId == 0L) { return false; } MethodInfo methodInfo = ((object)layer).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault((MethodInfo method) => method.Name == "JoinServer" && method.GetParameters().Length == 1); if (methodInfo == null) { return false; } Type parameterType = methodInfo.GetParameters()[0].ParameterType; MethodInfo methodInfo2 = parameterType.GetMethods(BindingFlags.Static | BindingFlags.Public).FirstOrDefault(delegate(MethodInfo method) { if (method.Name == "op_Implicit" && method.ReturnType == parameterType) { ParameterInfo[] parameters = method.GetParameters(); if (parameters != null && parameters.Length == 1) { return parameters[0].ParameterType == typeof(ulong); } } return false; }); if (methodInfo2 == null) { return false; } object obj = methodInfo2.Invoke(null, new object[1] { lobbyId }); if (obj == null) { return false; } methodInfo.Invoke(layer, new object[1] { obj }); return true; } private static string Clean(string? value, string fallback, int maximum) { string source = (string.IsNullOrWhiteSpace(value) ? fallback : value.Trim()); source = new string(source.Where((char character) => !char.IsControl(character)).ToArray()); if (source.Length > maximum) { return source.Substring(0, maximum); } return source; } private static IEnumerator LoadLevelRoutine(string barcode, string loadingBarcode, bool leaveLobby, Instance log) { float animationDeadline = Time.realtimeSinceStartup + 0.55f; while (Time.realtimeSinceStartup < animationDeadline) { yield return null; } if (leaveLobby && NetworkInfo.HasServer && !NetworkInfo.IsHost) { try { NetworkHelper.Disconnect("Traveling through a WristHub World Gate"); } catch (Exception value) { log.Error($"WristHub World Gate could not leave the Fusion lobby: {value}"); yield break; } float disconnectDeadline = Time.realtimeSinceStartup + 2f; while (NetworkInfo.HasServer && Time.realtimeSinceStartup < disconnectDeadline) { yield return null; } } try { NetworkSceneManager.Purgatory = false; SceneStreamerPatches.IgnorePatches = true; try { Barcode val = (string.IsNullOrWhiteSpace(loadingBarcode) ? ((Barcode)null) : new Barcode(loadingBarcode)); SceneStreamer.Load(new Barcode(barcode), val); } finally { SceneStreamerPatches.IgnorePatches = false; } log.Msg(leaveLobby ? "WristHub World Gate disconnected the client and started solo level travel." : ((NetworkInfo.HasServer && NetworkInfo.IsHost) ? "WristHub World Gate started Fusion's native host level travel." : "WristHub World Gate started native level travel.")); } catch (Exception value2) { log.Error($"WristHub World Gate could not start level travel: {value2}"); } } internal static void Receive(ReceivedMessage message) { try { byte[] bytes = ((ReceivedMessage)(ref message)).Bytes; if (bytes == null || bytes.Length < 1 || bytes.Length > 32768) { return; } byte b = bytes[0]; if (b == 3) { if (NetworkInfo.IsHost && _hostState != (PortalLinkState)null) { Broadcast(1, JsonSerializer.SerializeToUtf8Bytes(_hostState, JsonOptions)); } } else { if (NetworkInfo.IsHost || (((ReceivedMessage)(ref message)).Sender.HasValue && ((ReceivedMessage)(ref message)).Sender.Value != 0)) { return; } switch (b) { case 1: { PortalLinkState val = JsonSerializer.Deserialize(bytes.AsSpan(1), JsonOptions); if (val != null && val.IsValid) { _onState?.Invoke(val); } break; } case 2: if (bytes.Length == 5) { _onRemove?.Invoke(BitConverter.ToInt32(bytes, 1)); } break; } } } catch { } } private static void EnsureRegistered() { if (!_registered) { ModuleManager.RegisterModule(); ModuleMessageManager.RegisterHandler(); _registered = true; } if (IsSessionReady && !NetworkInfo.IsHost && !_snapshotRequested) { _snapshotRequested = true; SendToServer(3, Array.Empty()); } if (!IsSessionReady) { _snapshotRequested = false; } } private static void Broadcast(byte command, byte[] body) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) NetMessage val = CreateMessage(command, body, new MessageRoute((RelayType)2, (NetworkChannel)0)); try { MessageSender.BroadcastMessage((NetworkChannel)0, val); } finally { ((IDisposable)val)?.Dispose(); } } private static void SendToServer(byte command, byte[] body) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) NetMessage val = CreateMessage(command, body, new MessageRoute((RelayType)1, (NetworkChannel)0)); try { MessageSender.SendToServer((NetworkChannel)0, val); } finally { ((IDisposable)val)?.Dispose(); } } private static NetMessage CreateMessage(byte command, byte[] body, MessageRoute route) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) byte[] array = new byte[body.Length + 1]; array[0] = command; if (body.Length != 0) { Buffer.BlockCopy(body, 0, array, 1, body.Length); } return NetMessage.ModuleCreate(typeof(WristHubPortalMessage), new ArraySegment(array), route, (byte?)null); } private static void ShowCompatibilityBeacons(PortalLinkState state) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0078: 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_00a2: Unknown result type (might be due to invalid IL or missing references) if (!IsSessionReady || !NetworkInfo.IsHost) { return; } RemoveCompatibilityBeacons(); try { SpawnableCrateReference laserCursorReference = FusionSpawnableReferences.LaserCursorReference; if (laserCursorReference == null) { return; } Spawnable val = new Spawnable { crateRef = laserCursorReference }; if (!val.IsValid()) { return; } PortalLinkState? hostState = _hostState; if (((hostState != null) ? new int?(hostState.Generation) : ((int?)null)) == state.Generation) { SpawnCompatibilityBeacon(val, state.Entrance, state.Generation); PortalEndpoint? exit = state.Exit; if (exit.HasValue) { PortalEndpoint valueOrDefault = exit.GetValueOrDefault(); SpawnCompatibilityBeacon(val, valueOrDefault, state.Generation); } } } catch { } } private static void SpawnCompatibilityBeacon(Spawnable spawnable, PortalEndpoint endpoint, int generation) { //IL_000f: 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_007f: 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_0094: 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) NetworkAssetSpawner.Spawn(new SpawnRequestInfo { Spawnable = spawnable, Position = new Vector3(((PortalEndpoint)(ref endpoint)).Position.X, ((PortalEndpoint)(ref endpoint)).Position.Y, ((PortalEndpoint)(ref endpoint)).Position.Z), Rotation = new Quaternion(((PortalEndpoint)(ref endpoint)).Rotation.X, ((PortalEndpoint)(ref endpoint)).Rotation.Y, ((PortalEndpoint)(ref endpoint)).Rotation.Z, ((PortalEndpoint)(ref endpoint)).Rotation.W), SpawnEffect = true, SpawnSource = (EntitySource)2, SpawnCallback = delegate(SpawnCallbackInfo callback) { //IL_0000: 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_0072: 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_0087: 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_0028: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (callback.Entity != null) { PortalLinkState? hostState = _hostState; if (hostState == null || hostState.Generation != generation) { NetworkAssetSpawner.Despawn(new DespawnRequestInfo { EntityID = callback.Entity.ID, DespawnEffect = true }); return; } CompatibilityBeaconIds.Add(callback.Entity.ID); } if ((Object)(object)callback.Spawned != (Object)null) { callback.Spawned.transform.localScale = Vector3.one * 0.35f; } } }); } private static void RemoveCompatibilityBeacons() { //IL_0007: 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) for (int i = 0; i < CompatibilityBeaconIds.Count; i++) { try { NetworkAssetSpawner.Despawn(new DespawnRequestInfo { EntityID = CompatibilityBeaconIds[i], DespawnEffect = true }); } catch { } } CompatibilityBeaconIds.Clear(); } } internal sealed class WristHubPortalMessage : ModuleMessageHandler { protected override void OnHandleMessage(ReceivedMessage message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) FusionPortalBridge.Receive(message); } } internal sealed class WristHubFusionModule : Module { public override string Name => "WristHub Shared Portals"; public override string Author => "WristHub contributors"; public override Version Version => new Version(4, 0, 0); public override ConsoleColor Color => ConsoleColor.Cyan; } internal sealed class LobbyAvatarSharingBridge { private readonly Instance _log; private Assembly? _assembly; private bool _reportedMissing; private float _nextRefresh; private long _nextDownloadStateCheckAt; private long _nextPeerRecoveryAt; private long _peerRecoveryDeadline; private bool _networkerDownloadWasBusy; private bool _peerRecoveryLogged; private readonly HashSet _recoveredAvatarTargets = new HashSet(StringComparer.OrdinalIgnoreCase); public bool Available => ResolveAssembly() != null; public bool LobbyReadyToAnnounce { get { try { return ReadStaticBoolean(ResolveAssembly()?.GetType("ModioModNetworker.MainClass"), "confirmedHostHasIt"); } catch { return false; } } } public bool RegistrationRefreshBusy { get { try { Type type = ResolveAssembly()?.GetType("ModioModNetworker.MainClass"); return ReadStaticBoolean(type, "handlingInstalled") || ReadStaticBoolean(type, "refreshInstalledModsRequested"); } catch { return false; } } } public LobbyAvatarSharingBridge(Instance log) { _log = log; } public void RequestRefresh(bool immediate = false) { float num = (float)Environment.TickCount64 / 1000f; if (!immediate && num < _nextRefresh) { return; } _nextRefresh = num + 1f; try { ((ResolveAssembly()?.GetType("ModioModNetworker.MainClass"))?.GetMethod("RequestInstallCheck", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(float) }, null))?.Invoke(null, new object[1] { immediate ? 0f : 0.25f }); } catch (Exception ex) { _log.Msg("Warning: Fusion mod registration refresh failed: " + ex.Message); } } public void TickPeerAvatarRecovery(Func isAvatarAssetReady) { long tickCount = Environment.TickCount64; if (tickCount < _nextDownloadStateCheckAt) { return; } _nextDownloadStateCheckAt = tickCount + 250; try { Assembly assembly = ResolveAssembly(); Type type = assembly?.GetType("ModioModNetworker.MainClass"); Type type2 = assembly?.GetType("ModioModNetworker.ModFileManager"); if (assembly == null || type == null || type2 == null) { return; } if (ReadStaticBoolean(type, "warehouseReloadRequested") || ReadStaticBoolean(type2, "isDownloading") || ReadStaticMember(type2, "activeDownloadQueueElement") != null) { _networkerDownloadWasBusy = true; _peerRecoveryDeadline = 0L; _recoveredAvatarTargets.Clear(); return; } if (_networkerDownloadWasBusy) { _networkerDownloadWasBusy = false; _peerRecoveryDeadline = tickCount + 90000; _nextPeerRecoveryAt = tickCount + 250; _peerRecoveryLogged = false; } if (_peerRecoveryDeadline > tickCount && tickCount >= _nextPeerRecoveryAt) { _nextPeerRecoveryAt = tickCount + 750; int num = RefreshReadyRemoteAvatarSetters(assembly, isAvatarAssetReady, _recoveredAvatarTargets); if (num > 0 && !_peerRecoveryLogged) { _peerRecoveryLogged = true; _log.Msg($"WristHub handed {num} downloaded avatar rig{((num == 1) ? string.Empty : "s")} back to Fusion after the native avatar asset became ready."); } } } catch { } } public bool IsRegistered(IEnumerable palletBarcodes) { HashSet hashSet = palletBarcodes.Where((string value) => !string.IsNullOrWhiteSpace(value)).ToHashSet(StringComparer.OrdinalIgnoreCase); if (hashSet.Count == 0) { return false; } try { foreach (object item in SnapshotItems((ResolveAssembly()?.GetType("ModioModNetworker.MainClass"))?.GetField("InstalledModInfos", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null))) { if (item != null) { string text = ReadString(item, "palletBarcode") ?? ReadString(item, "PalletBarcode"); if (text != null && hashSet.Contains(text)) { return true; } } } } catch { } return false; } public bool IsRegistered(IEnumerable palletBarcodes, long modId) { HashSet hashSet = palletBarcodes.Where((string value) => !string.IsNullOrWhiteSpace(value)).ToHashSet(StringComparer.OrdinalIgnoreCase); if (hashSet.Count == 0 || modId <= 0) { return false; } try { foreach (object item in SnapshotItems((ResolveAssembly()?.GetType("ModioModNetworker.MainClass"))?.GetField("InstalledModInfos", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null))) { if (item == null) { continue; } string text = ReadString(item, "palletBarcode") ?? ReadString(item, "PalletBarcode"); if (text != null && hashSet.Contains(text)) { object obj = ReadMember(item, "ModInfo"); if (string.Equals((obj == null) ? null : ReadString(obj, "numericalId"), modId.ToString(), StringComparison.OrdinalIgnoreCase)) { return true; } } } } catch { } return false; } public bool IsSubscribed(long modId) { try { if (!((ResolveAssembly()?.GetType("ModioModNetworker.MainClass"))?.GetField("subscribedModIoNumericalIds", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) is IEnumerable enumerable)) { return false; } foreach (object item in enumerable) { if (string.Equals(item?.ToString(), modId.ToString(), StringComparison.OrdinalIgnoreCase)) { return true; } } } catch { } return false; } public bool IsLocalAvatarAnnounced(long modId) { try { if (!((ResolveAssembly()?.GetType("ModioModNetworker.ModlistMessage"))?.GetField("avatarMods", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) is IDictionary dictionary)) { return false; } Type type = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly candidate) => candidate.GetName().Name?.Equals("LabFusion", StringComparison.OrdinalIgnoreCase) ?? false)?.GetType("LabFusion.Player.PlayerIDManager"); object obj = type?.GetProperty("LocalID", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type?.GetField("LocalID", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj == null || !dictionary.Contains(obj)) { return false; } object obj2 = dictionary[obj]; return string.Equals((obj2 == null) ? null : ReadString(obj2, "numericalId"), modId.ToString(), StringComparison.OrdinalIgnoreCase); } catch { return false; } } public bool Unsubscribe(long modId) { return InvokeManager("UnSubscribe", modId.ToString()); } public bool Subscribe(long modId) { return InvokeManager("Subscribe", modId.ToString()); } private bool InvokeManager(string name, string modId) { try { Type type = ResolveAssembly()?.GetType("ModioModNetworker.ModFileManager"); MethodInfo methodInfo = type?.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo candidate) => candidate.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && candidate.GetParameters().Length == 1); if (methodInfo == null) { return false; } object obj = (methodInfo.IsStatic ? null : Activator.CreateInstance(type)); object obj2 = ((methodInfo.GetParameters()[0].ParameterType == typeof(long)) ? ((object)long.Parse(modId)) : modId); methodInfo.Invoke(obj, new object[1] { obj2 }); return true; } catch (Exception ex) { _log.Msg("Warning: Fusion subscription " + name + " failed: " + ex.Message); return false; } } private Assembly? ResolveAssembly() { if (_assembly != null) { return _assembly; } _assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly assembly) => assembly.GetName().Name?.Equals("ModioModNetworker", StringComparison.OrdinalIgnoreCase) ?? false); if (_assembly == null && !_reportedMissing) { _reportedMissing = true; _log.Msg("Warning: ModioModNetworker is not loaded. Local installs work, but Fusion auto-download sharing is unavailable."); } return _assembly; } private static string? ReadString(object value, string name) { Type type = value.GetType(); object obj = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(value)?.ToString(); if (obj == null) { PropertyInfo? property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if ((object)property == null) { return null; } object? value2 = property.GetValue(value); if (value2 == null) { return null; } obj = value2.ToString(); } return (string?)obj; } private static object? ReadMember(object value, string name) { Type type = value.GetType(); object obj = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(value); if (obj == null) { PropertyInfo? property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if ((object)property == null) { return null; } obj = property.GetValue(value); } return obj; } private static object? ReadStaticMember(Type? type, string name) { if (type == null) { return null; } object obj = type.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); if (obj == null) { PropertyInfo? property = type.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if ((object)property == null) { return null; } obj = property.GetValue(null); } return obj; } private static int RefreshReadyRemoteAvatarSetters(Assembly assembly, Func isAvatarAssetReady, ISet recoveredTargets) { MethodInfo methodInfo = assembly.GetType("ModioModNetworker.Utilities.NetworkPlayerUtilities")?.GetMethod("GetAllNetworkPlayers", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (!(assembly.GetType("ModioModNetworker.ModlistMessage")?.GetField("avatarMods", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) is IDictionary dictionary)) { return 0; } IReadOnlyList readOnlyList = SnapshotItems(methodInfo?.Invoke(null, null)); int num = 0; foreach (object item2 in readOnlyList) { if (item2 == null) { continue; } try { object obj = ReadMember(item2, "PlayerID"); if (obj == null || !dictionary.Contains(obj)) { continue; } object obj2 = ReadMember(item2, "AvatarSetter"); if (obj2 == null) { continue; } string text = ReadString(obj2, "AvatarBarcode"); if (string.IsNullOrWhiteSpace(text) || !isAvatarAssetReady(text)) { continue; } string item = obj?.ToString() + "|" + text; if (!recoveredTargets.Contains(item)) { MethodInfo methodInfo2 = obj2.GetType().GetMethod("SetAvatarDirty", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null) ?? obj2.GetType().GetMethod("SetDirty", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (!(methodInfo2 == null)) { methodInfo2.Invoke(obj2, null); recoveredTargets.Add(item); num++; } } } catch { } } return num; } private static IReadOnlyList SnapshotItems(object? value) { if (value == null) { return Array.Empty(); } if (value is IList list) { for (int i = 0; i < 2; i++) { try { int count = list.Count; object[] array = new object[count]; for (int j = 0; j < count; j++) { array[j] = list[j]; } return array; } catch (ArgumentOutOfRangeException) { } } return Array.Empty(); } if (!(value is IEnumerable source)) { return Array.Empty(); } try { return source.Cast().ToArray(); } catch (InvalidOperationException) { return Array.Empty(); } } private static bool ReadStaticBoolean(Type? type, string name) { if (type == null) { return false; } object obj = type.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } } internal sealed class MiniMapPeerOverlay : IDisposable { public const int MaximumMarkers = 17; private readonly byte[] _pixels = new byte[147456]; private readonly MiniMapOverlayMarker[] _markers = (MiniMapOverlayMarker[])(object)new MiniMapOverlayMarker[17]; private GameObject? _root; private Texture2D? _texture; private RawImage? _image; public bool IsReady { get { if ((Object)(object)_root != (Object)null && (Object)(object)_texture != (Object)null) { return (Object)(object)_image != (Object)null; } return false; } } public int LastOpaquePixels { get; private set; } public int LastMarkerCount { get; private set; } public void Bind(Transform parent) { //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_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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00a1: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00eb: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) if (IsReady) { _root.transform.SetAsLastSibling(); return; } Dispose(); _texture = new Texture2D(192, 192, (TextureFormat)4, false) { name = "WristHub Guaranteed Fusion Player Overlay", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; _root = new GameObject("Guaranteed Fusion Player Overlay"); _root.transform.SetParent(parent, false); _image = _root.AddComponent(); _image.texture = (Texture)(object)_texture; ((Graphic)_image).color = Color.white; ((Graphic)_image).raycastTarget = false; RectTransform rectTransform = ((Graphic)_image).rectTransform; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); rectTransform.pivot = val; Vector2 anchorMin = (rectTransform.anchorMax = val); rectTransform.anchorMin = anchorMin; rectTransform.anchoredPosition = Vector2.zero; rectTransform.sizeDelta = new Vector2(158f, 158f); ((Transform)rectTransform).localScale = Vector3.one; ((Transform)rectTransform).localRotation = Quaternion.identity; Clear(); _root.transform.SetAsLastSibling(); } public bool UpdatePose(int index, Vector2 normalizedPosition, float rotationDegrees, MiniMapOverlayColor color, float scale = 1f) { //IL_003c: 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) if (index < 0 || index >= _markers.Length || !float.IsFinite(normalizedPosition.X) || !float.IsFinite(normalizedPosition.Y) || !float.IsFinite(rotationDegrees)) { return false; } _markers[index] = new MiniMapOverlayMarker(normalizedPosition, rotationDegrees, color, scale); return true; } public int Render(int markerCount) { if ((Object)(object)_texture == (Object)null || (Object)(object)_image == (Object)null) { return 0; } markerCount = Math.Clamp(markerCount, 0, _markers.Length); LastOpaquePixels = MiniMapPeerOverlayRaster.Render((Span)_pixels, 192, 192, (ReadOnlySpan)_markers.AsSpan(0, markerCount)); LastMarkerCount = markerCount; _texture.LoadRawTextureData(Il2CppStructArray.op_Implicit(_pixels)); _texture.Apply(false, false); ((Behaviour)_image).enabled = true; ((Component)_image).transform.SetAsLastSibling(); return LastOpaquePixels; } public void Clear() { Array.Clear(_pixels, 0, _pixels.Length); Array.Clear(_markers, 0, _markers.Length); LastOpaquePixels = 0; LastMarkerCount = 0; if (!((Object)(object)_texture == (Object)null)) { _texture.LoadRawTextureData(Il2CppStructArray.op_Implicit(_pixels)); _texture.Apply(false, false); } } public void Dispose() { try { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } } catch { } try { if ((Object)(object)_texture != (Object)null) { Object.Destroy((Object)(object)_texture); } } catch { } _root = null; _texture = null; _image = null; LastOpaquePixels = 0; LastMarkerCount = 0; } } internal static class NativeMenuHostBridge { private static Vector3 _lastStableForward = Vector3.forward; private static bool _hasStableForward; private static bool _nativeCursorRequested; public static bool TryOpenPreferences(bool useLeftController, out string error) { error = string.Empty; try { UIRig val = Player.UIRig; if ((Object)(object)val == (Object)null) { val = UIRig.Instance; } PopUpMenuView val2 = ((val != null) ? val.popUpMenu : null); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { error = "BONELAB's popup menu is not ready"; return false; } UIControllerInput val3 = (useLeftController ? val.leftUIController : val.rightUIController); BaseController val4 = (useLeftController ? Player.LeftController : Player.RightController); if ((Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null) { val3 = (useLeftController ? val.rightUIController : val.leftUIController); val4 = (useLeftController ? Player.RightController : Player.LeftController); } if (!val2.m_IsActivated) { if ((Object)(object)Player.Head == (Object)null || (Object)(object)Player.ControllerRig == (Object)null || (Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null) { error = "BONELAB's menu controller is not ready"; return false; } val2.Activate(Player.Head, ((Component)Player.ControllerRig).transform, val3, val4); } val2.UpdateStartPosition(); val2.BypassToPreferences(); if (!val2.m_IsActivated) { error = "BONELAB did not activate its popup menu"; return false; } EnableNativeCursor(val, val2, useLeftController); TryRecenterInFront(out string _); return true; } catch (Exception ex) { error = ex.GetBaseException().Message; return false; } } public static bool TryRecenterInFront(out string error) { //IL_00c5: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_017b: 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_019a: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: 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) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) error = string.Empty; try { UIRig val = Player.UIRig; if ((Object)(object)val == (Object)null) { val = UIRig.Instance; } PopUpMenuView val2 = ((val != null) ? val.popUpMenu : null); Transform val3 = ResolveViewTransform(); OpenControllerRig controllerRig = Player.ControllerRig; Transform val4 = ((controllerRig != null) ? ((Component)controllerRig).transform : null); if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null || !val2.m_IsActivated) { error = "BONELAB's native menu is not active"; return false; } float num; try { RigManager rigManager = Player.RigManager; float? obj; if (rigManager == null) { obj = null; } else { Avatar avatar = rigManager.avatar; obj = ((avatar != null) ? new float?(avatar.height) : ((float?)null)); } num = obj ?? 1.75f; } catch { num = 1.75f; } Vector3 vector = new Vector3(val3.forward.x, val3.forward.y, val3.forward.z); Vector3 val5; if (val3.forward.x * val3.forward.x + val3.forward.z * val3.forward.z >= 0.04f) { val5 = Vector3.ProjectOnPlane(val3.forward, Vector3.up); _lastStableForward = ((Vector3)(ref val5)).normalized; _hasStableForward = true; } Vector3 val6; if (!_hasStableForward) { val5 = Vector3.ProjectOnPlane(val4.forward, Vector3.up); val6 = ((Vector3)(ref val5)).normalized; } else { val6 = _lastStableForward; } Vector3 val7 = val6; Vector3 vector2 = NativeMenuPlacementMath.ResolveForward(vector, new Vector3(val7.x, val7.y, val7.z)); NativeMenuPlacement val8 = NativeMenuPlacementMath.Resolve(new Vector3(val3.position.x, val3.position.y, val3.position.z), vector2, num); Vector3 val9 = default(Vector3); ((Vector3)(ref val9))..ctor(((NativeMenuPlacement)(ref val8)).Position.X, ((NativeMenuPlacement)(ref val8)).Position.Y, ((NativeMenuPlacement)(ref val8)).Position.Z); Vector3 val10 = default(Vector3); ((Vector3)(ref val10))..ctor(((NativeMenuPlacement)(ref val8)).Forward.X, ((NativeMenuPlacement)(ref val8)).Forward.Y, ((NativeMenuPlacement)(ref val8)).Forward.Z); Quaternion val11 = Quaternion.LookRotation(val10, Vector3.up); SimpleTransform val12 = default(SimpleTransform); ((SimpleTransform)(ref val12))..ctor(val9, val11); val2.m_RootTransform = val4; val2.m_UITransform = SimpleTransform.InverseTransform(val4, val12); val2.m_StartUIDirection = val10; val2.m_StartUIPlane = new Plane(-val10, val9); val2.uiDistanceFromPlayer = ((NativeMenuPlacement)(ref val8)).DistanceMeters; ((Component)val2).transform.SetPositionAndRotation(val9, val11); return true; } catch (Exception ex) { error = ex.GetBaseException().Message; return false; } } public static IEnumerator RecenterInFrontRoutine(int frameCount = 30) { frameCount = Math.Clamp(frameCount, 1, 45); for (int frame = 0; frame < frameCount; frame++) { yield return null; if (!TryRecenterInFront(out string _)) { break; } } } public static void TickSelectorLine() { if (!_nativeCursorRequested) { return; } try { UIRig val = Player.UIRig; if ((Object)(object)val == (Object)null) { val = UIRig.Instance; } PopUpMenuView val2 = ((val != null) ? val.popUpMenu : null); if ((Object)(object)val2 == (Object)null || !val2.m_IsActivated) { SetNativeInputsActive(val, active: false); _nativeCursorRequested = false; return; } SetNativeInputsActive(val, active: true); SetCursorPartActive((Component?)(object)val2.cursorStart, active: true); SetCursorPartActive((Component?)(object)val2.cursorMid, active: true); SetCursorPartActive((Component?)(object)val2.cursorEnd, active: true); } catch { } } public static void DisposeSelectorLine() { _nativeCursorRequested = false; } private static void EnableNativeCursor(UIRig uiRig, PopUpMenuView popup, bool useLeftController) { _nativeCursorRequested = true; SetNativeInputsActive(uiRig, active: true); UIControllerInput val = (useLeftController ? uiRig.leftUIController : uiRig.rightUIController); if ((Object)(object)val != (Object)null) { popup._lastCursor = val; } popup.ShowCursor(); SetCursorPartActive((Component?)(object)popup.cursorStart, active: true); SetCursorPartActive((Component?)(object)popup.cursorMid, active: true); SetCursorPartActive((Component?)(object)popup.cursorEnd, active: true); } private static void SetNativeInputsActive(UIRig? uiRig, bool active) { if ((Object)(object)((uiRig != null) ? uiRig.leftUIController : null) != (Object)null) { uiRig.leftUIController.m_IsMenuActive = active; } if ((Object)(object)((uiRig != null) ? uiRig.rightUIController : null) != (Object)null) { uiRig.rightUIController.m_IsMenuActive = active; } } private static void SetCursorPartActive(Component? part, bool active) { if ((Object)(object)part != (Object)null && (Object)(object)part.gameObject != (Object)null) { part.gameObject.SetActive(active); } } private static Transform? ResolveViewTransform() { try { Camera main = Camera.main; if ((Object)(object)main != (Object)null && ((Behaviour)main).isActiveAndEnabled) { return ((Component)main).transform; } } catch { } return Player.Head; } } internal enum WatchClearanceSource { RigCollider, EstimatedForearm } internal readonly record struct WatchSurfaceAnchor(Transform ForearmSource, Transform HandSource, Vector3 SurfacePosition, Vector3 OutwardNormal, Vector3 ForearmDirection, float AvatarHeightRatio, WatchClearanceSource ClearanceSource, bool Valid); internal sealed class WatchSurfaceAnchorProvider { private const float SurfaceClearanceMeters = 0.0015f; private readonly RaycastHit[] _hits = (RaycastHit[])(object)new RaycastHit[16]; private readonly HashSet _localColliderIds = new HashSet(); private Animator? _animator; private Transform? _leftForearm; private Transform? _leftHand; private Transform? _rightForearm; private Transform? _rightHand; private int _rigId; private int _leftControllerHandId; private int _rightControllerHandId; private float _nextResolveAt; private float _leftSurfaceRadiusRatio; private float _rightSurfaceRadiusRatio; private bool _leftSurfaceRadiusValid; private bool _rightSurfaceRadiusValid; public bool TryGet(bool left, float heightRatio, out WatchSurfaceAnchor anchor) { //IL_033a: 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_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: 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_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037f: 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_038a: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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) //IL_00fb: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0159: 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_0164: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_01b7: 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_019f: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_023a: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) anchor = default(WatchSurfaceAnchor); RefreshIdentity(); if (Time.unscaledTime >= _nextResolveAt || (Object)(object)_animator == (Object)null || (left ? ((Object)(object)_leftForearm == (Object)null) : ((Object)(object)_rightForearm == (Object)null))) { ResolveRig(); } Transform val = (left ? _leftForearm : _rightForearm); Transform val2 = (left ? _leftHand : _rightHand); Hand obj = (left ? Player.LeftHand : Player.RightHand); Transform val3 = ((obj != null) ? ((Component)obj).transform : null); if ((Object)(object)val == (Object)null) { val = val3; } if ((Object)(object)val2 == (Object)null) { val2 = val3; } if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { return false; } float num = ((float.IsFinite(heightRatio) && heightRatio > 0f) ? heightRatio : 1f); Vector3 val4 = val2.position - val.position; Vector3 val5 = ((((Vector3)(ref val4)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val4)).normalized : val.forward); if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = Vector3.forward; } Vector3 val6 = Vector3.Lerp(val.position, val2.position, 0.9f); Vector3 val7 = (((Object)(object)Player.Head == (Object)null) ? val.up : (Player.Head.position - val6)); Vector3 val8 = Vector3.ProjectOnPlane(val7, val5); Vector3 val9 = ((Vector3)(ref val8)).normalized; if (((Vector3)(ref val9)).sqrMagnitude < 0.01f) { val8 = Vector3.ProjectOnPlane(val.up, val5); val9 = ((Vector3)(ref val8)).normalized; } if (((Vector3)(ref val9)).sqrMagnitude < 0.01f) { val8 = Vector3.Cross(val5, val.right); val9 = ((Vector3)(ref val8)).normalized; } if (Vector3.Dot(val9, val7) < 0f) { val9 = -val9; } float num2 = 0.026f * num; bool num3 = (left ? _leftSurfaceRadiusValid : _rightSurfaceRadiusValid); float num4 = (num3 ? ((left ? _leftSurfaceRadiusRatio : _rightSurfaceRadiusRatio) * num) : num2); Vector3 val10 = val6 + val9 * (num2 * 2.4f); float num5 = num2 * 4.2f; WatchClearanceSource clearanceSource = ((!num3) ? WatchClearanceSource.EstimatedForearm : WatchClearanceSource.RigCollider); if (!num3) { try { int num6 = Physics.RaycastNonAlloc(val10, -val9, Il2CppStructArray.op_Implicit(_hits), num5, -1, (QueryTriggerInteraction)1); float num7 = float.MaxValue; for (int i = 0; i < num6; i++) { RaycastHit val11 = _hits[i]; Collider collider = ((RaycastHit)(ref val11)).collider; if ((Object)(object)collider == (Object)null || !_localColliderIds.Contains(((Object)collider).GetInstanceID()) || !float.IsFinite(((RaycastHit)(ref val11)).distance) || ((RaycastHit)(ref val11)).distance >= num7) { continue; } float num8 = Vector3.Dot(((RaycastHit)(ref val11)).point - val6, val9); if (float.IsFinite(num8) && !(num8 < 0.01f * num) && !(num8 > 0.075f * num)) { num7 = ((RaycastHit)(ref val11)).distance; num4 = num8; if (left) { _leftSurfaceRadiusRatio = num8 / num; _leftSurfaceRadiusValid = true; } else { _rightSurfaceRadiusRatio = num8 / num; _rightSurfaceRadiusValid = true; } clearanceSource = WatchClearanceSource.RigCollider; } } } catch { } } Vector3 val12 = val6 + val9 * num4 + val9 * (0.0015f * num); if (!Finite(val12) || !Finite(val9) || !Finite(val5)) { return false; } anchor = new WatchSurfaceAnchor(val, val2, val12, ((Vector3)(ref val9)).normalized, ((Vector3)(ref val5)).normalized, num, clearanceSource, Valid: true); return true; } public void Invalidate() { _animator = null; _leftForearm = null; _leftHand = null; _rightForearm = null; _rightHand = null; _localColliderIds.Clear(); _rigId = 0; _leftControllerHandId = 0; _rightControllerHandId = 0; _nextResolveAt = 0f; _leftSurfaceRadiusRatio = 0f; _rightSurfaceRadiusRatio = 0f; _leftSurfaceRadiusValid = false; _rightSurfaceRadiusValid = false; } private void RefreshIdentity() { int num = SafeId((Object?)(object)Player.RigManager); int num2 = SafeId((Object?)(object)Player.LeftHand); int num3 = SafeId((Object?)(object)Player.RightHand); if (num != _rigId || num2 != _leftControllerHandId || num3 != _rightControllerHandId) { Invalidate(); _rigId = num; _leftControllerHandId = num2; _rightControllerHandId = num3; } } private void ResolveRig() { _nextResolveAt = Time.unscaledTime + 1f; try { RigManager rigManager = Player.RigManager; _animator = ((rigManager != null) ? ((IEnumerable)((Component)rigManager).GetComponentsInChildren(true)).FirstOrDefault((Func)((Animator candidate) => (Object)(object)candidate != (Object)null && candidate.isHuman && (Object)(object)candidate.GetBoneTransform((HumanBodyBones)15) != (Object)null)) : null); if ((Object)(object)_animator != (Object)null) { _leftForearm = _animator.GetBoneTransform((HumanBodyBones)15); _leftHand = _animator.GetBoneTransform((HumanBodyBones)17); _rightForearm = _animator.GetBoneTransform((HumanBodyBones)16); _rightHand = _animator.GetBoneTransform((HumanBodyBones)18); } _localColliderIds.Clear(); RigManager rigManager2 = Player.RigManager; if ((Object)(object)rigManager2 == (Object)null) { return; } foreach (Collider componentsInChild in ((Component)rigManager2).GetComponentsInChildren(true)) { if ((Object)(object)componentsInChild != (Object)null) { _localColliderIds.Add(((Object)componentsInChild).GetInstanceID()); } } } catch { _animator = null; _leftForearm = null; _leftHand = null; _rightForearm = null; _rightHand = null; _localColliderIds.Clear(); } } private static bool Finite(Vector3 value) { //IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (float.IsFinite(value.x) && float.IsFinite(value.y)) { return float.IsFinite(value.z); } return false; } private static int SafeId(Object? value) { try { return (!(value == (Object)null)) ? value.GetInstanceID() : 0; } catch { return 0; } } } internal static class WristHubThemePalette { public static Color Accent(WristHubTheme theme) { //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_001c: Expected I4, but got Unknown //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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: 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_00c9: Unknown result type (might be due to invalid IL or missing references) return (Color)((theme - 1) switch { 0 => new Color(0.68f, 0.72f, 0.76f, 1f), 1 => new Color(1f, 0.24f, 0.31f, 1f), 2 => new Color(0.24f, 0.94f, 0.55f, 1f), 3 => new Color(0.68f, 0.42f, 1f, 1f), 4 => new Color(1f, 0.66f, 0.18f, 1f), _ => new Color(0.2f, 0.9f, 1f, 1f), }); } public static Color Dim(WristHubTheme theme) { //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_0007: 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_001f: 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) Color val = Accent(theme); return new Color(val.r * 0.24f, val.g * 0.28f, val.b * 0.3f, 1f); } }