using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyInformationalVersion("4.0.0")] [assembly: AssemblyProduct("EmpressSpawnBrowser")] [assembly: AssemblyTitle("EmpressSpawnBrowser")] [assembly: AssemblyVersion("4.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Empress.SpawnBrowser { internal static class SectorAccess { private static readonly FieldInfo? PlayerAvatarPlayerHealthField = AccessTools.Field(typeof(PlayerAvatar), "playerHealth"); private static readonly FieldInfo? PlayerAvatarPlayerDeathHeadField = AccessTools.Field(typeof(PlayerAvatar), "playerDeathHead"); private static readonly FieldInfo? PlayerAvatarPlayerNameField = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static readonly FieldInfo? PlayerAvatarIsLocalField = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static readonly FieldInfo? PlayerAvatarIsDisabledField = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo? PlayerAvatarDeadSetField = AccessTools.Field(typeof(PlayerAvatar), "deadSet"); private static readonly FieldInfo? PlayerAvatarSteamIdField = AccessTools.Field(typeof(PlayerAvatar), "steamID"); private static readonly FieldInfo? PlayerHealthHealthField = AccessTools.Field(typeof(PlayerHealth), "health"); private static readonly FieldInfo? PlayerHealthMaxHealthField = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); private static readonly FieldInfo? PlayerHealthGodModeField = AccessTools.Field(typeof(PlayerHealth), "godMode"); private static readonly FieldInfo? PlayerControllerDebugEnergyField = AccessTools.Field(typeof(PlayerController), "DebugEnergy"); private static readonly FieldInfo? PlayerControllerEnergyCurrentField = AccessTools.Field(typeof(PlayerController), "EnergyCurrent"); private static readonly FieldInfo? PlayerControllerEnergyStartField = AccessTools.Field(typeof(PlayerController), "EnergyStart"); private static readonly FieldInfo? PlayerControllerAvatarField = AccessTools.Field(typeof(PlayerController), "playerAvatarScript"); private static readonly FieldInfo? PlayerControllerSteamIdField = AccessTools.Field(typeof(PlayerController), "playerSteamID"); private static readonly FieldInfo? PlayerDeathHeadInExtractionPointField = AccessTools.Field(typeof(PlayerDeathHead), "inExtractionPoint"); private static readonly FieldInfo? EnemyDirectorDebugNoVisionField = AccessTools.Field(typeof(EnemyDirector), "debugNoVision"); private static readonly FieldInfo? EnemyDirectorDebugNoSpawnIdlePauseField = AccessTools.Field(typeof(EnemyDirector), "debugNoSpawnIdlePause"); private static readonly FieldInfo? EnemyDirectorDebugSpawnCloseField = AccessTools.Field(typeof(EnemyDirector), "debugSpawnClose"); private static readonly FieldInfo? EnemyDirectorEnemiesSpawnedField = AccessTools.Field(typeof(EnemyDirector), "enemiesSpawned"); private static readonly FieldInfo? EnemyParentSpawnedField = AccessTools.Field(typeof(EnemyParent), "Spawned"); private static readonly FieldInfo? EnemyParentSetupDoneField = AccessTools.Field(typeof(EnemyParent), "SetupDone"); private static readonly FieldInfo? EnemyParentFirstSpawnPointUsedField = AccessTools.Field(typeof(EnemyParent), "firstSpawnPointUsed"); private static readonly FieldInfo? ValuableObjectPhysGrabObjectField = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); private static readonly FieldInfo? AssetManagerEnemyValuableSmallField = AccessTools.Field(typeof(AssetManager), "enemyValuableSmall"); private static readonly FieldInfo? AssetManagerEnemyValuableMediumField = AccessTools.Field(typeof(AssetManager), "enemyValuableMedium"); private static readonly FieldInfo? AssetManagerEnemyValuableBigField = AccessTools.Field(typeof(AssetManager), "enemyValuableBig"); private static readonly FieldInfo? PrefabRefPrefabNameField = AccessTools.Field(typeof(PrefabRef), "prefabName"); private static readonly FieldInfo? PrefabRefResourcePathField = AccessTools.Field(typeof(PrefabRef), "resourcePath"); private static readonly FieldInfo? DebugCommandHandlerEnemyNoVisionField = AccessTools.Field(typeof(DebugCommandHandler), "enemyNoVision"); private static readonly FieldInfo? MetaManagerCosmeticTokensField = AccessTools.Field(typeof(MetaManager), "cosmeticTokens"); private static readonly MethodInfo? MetaManagerSaveMethod = AccessTools.Method(typeof(MetaManager), "Save", (Type[])null, (Type[])null); private static readonly MethodInfo? CosmeticTokenUiSetupMethod = AccessTools.Method(typeof(CosmeticTokenUI), "Setup", (Type[])null, (Type[])null); private static readonly FieldInfo? RoundDirectorExtractionPointActiveField = AccessTools.Field(typeof(RoundDirector), "extractionPointActive"); private static readonly FieldInfo? RoundDirectorExtractionPointListField = AccessTools.Field(typeof(RoundDirector), "extractionPointList"); private static readonly FieldInfo? RoundDirectorExtractionPointCurrentField = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent"); private static readonly FieldInfo? ExtractionPointCurrentStateField = AccessTools.Field(typeof(ExtractionPoint), "currentState"); private static readonly FieldInfo? ExtractionPointCompletedRightAwayField = AccessTools.Field(typeof(ExtractionPoint), "isCompletedRightAway"); private static readonly MethodInfo? ExtractionPointOnClickMethod = AccessTools.Method(typeof(ExtractionPoint), "OnClick", (Type[])null, (Type[])null); private static readonly MethodInfo? ExtractionPointStateSetMethod = AccessTools.Method(typeof(ExtractionPoint), "StateSet", (Type[])null, (Type[])null); private static readonly FieldInfo? RunManagerDebugLevelField = AccessTools.Field(typeof(RunManager), "debugLevel"); private static readonly FieldInfo? RunManagerGameOverField = AccessTools.Field(typeof(RunManager), "gameOver"); private static readonly FieldInfo? MenuCursorMeshField = AccessTools.Field(typeof(MenuCursor), "mesh"); private static readonly FieldInfo? MenuCursorShowTimerField = AccessTools.Field(typeof(MenuCursor), "showTimer"); private static readonly FieldInfo? MenuCursorOverridePosTimerField = AccessTools.Field(typeof(MenuCursor), "overridePosTimer"); private static readonly FieldInfo? CursorManagerUnlockTimerField = AccessTools.Field(typeof(CursorManager), "unlockTimer"); private static readonly FieldInfo? PunManagerPhotonViewField = AccessTools.Field(typeof(PunManager), "photonView"); public static PlayerHealth? GetPlayerHealth(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarPlayerHealthField, player); } public static PlayerDeathHead? GetPlayerDeathHead(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarPlayerDeathHeadField, player); } public static string GetPlayerName(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarPlayerNameField, player, "Unknown operative"); } public static bool IsPlayerLocal(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarIsLocalField, player, fallback: false); } public static bool IsPlayerDisabled(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarIsDisabledField, player, fallback: false); } public static bool IsPlayerDead(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarDeadSetField, player, fallback: false); } public static string GetPlayerSteamId(PlayerAvatar? player) { return GetFieldValue(PlayerAvatarSteamIdField, player, string.Empty); } public static string GetLocalSteamId() { string fieldValue = GetFieldValue(PlayerControllerSteamIdField, PlayerController.instance, string.Empty); if (string.IsNullOrWhiteSpace(fieldValue)) { return GetPlayerSteamId(PlayerAvatar.instance); } return fieldValue; } public static int GetHealth(PlayerHealth? playerHealth) { return GetFieldValue(PlayerHealthHealthField, playerHealth, 0); } public static int GetMaxHealth(PlayerHealth? playerHealth) { return GetFieldValue(PlayerHealthMaxHealthField, playerHealth, 0); } public static void SetPlayerGodMode(PlayerHealth? playerHealth, bool enabled) { SetFieldValue(PlayerHealthGodModeField, playerHealth, enabled); } public static float GetEnergyCurrent(PlayerController? playerController) { return GetFieldValue(PlayerControllerEnergyCurrentField, playerController, 0f); } public static float GetEnergyStart(PlayerController? playerController) { return GetFieldValue(PlayerControllerEnergyStartField, playerController, 0f); } public static void SetEnergyCurrent(PlayerController? playerController, float value) { SetFieldValue(PlayerControllerEnergyCurrentField, playerController, value); } public static void SetDebugEnergy(PlayerController? playerController, bool enabled) { SetFieldValue(PlayerControllerDebugEnergyField, playerController, enabled); } public static PlayerAvatar? GetControllerAvatar(PlayerController? playerController) { return GetFieldValue(PlayerControllerAvatarField, playerController); } public static void SetInExtractionPoint(PlayerDeathHead? playerDeathHead, bool enabled) { SetFieldValue(PlayerDeathHeadInExtractionPointField, playerDeathHead, enabled); } public static bool GetEnemyNoVision(EnemyDirector? enemyDirector) { return GetEnemyNoVision(enemyDirector, GetLocalSteamId()); } public static void SetEnemyNoVision(EnemyDirector? enemyDirector, bool enabled) { SetEnemyNoVision(enemyDirector, GetLocalSteamId(), enabled); } public static bool GetEnemyNoVision(EnemyDirector? enemyDirector, string steamId) { if (string.IsNullOrWhiteSpace(steamId)) { return false; } return GetFieldValue>(EnemyDirectorDebugNoVisionField, enemyDirector)?.Contains(steamId) ?? false; } public static void SetEnemyNoVision(EnemyDirector? enemyDirector, string steamId, bool enabled) { SetStringListMembership(EnemyDirectorDebugNoVisionField, enemyDirector, steamId, enabled); } public static void SetDebugCommandEnemyNoVision(DebugCommandHandler? debugCommandHandler, string steamId, bool enabled) { SetStringListMembership(DebugCommandHandlerEnemyNoVisionField, debugCommandHandler, steamId, enabled); } public static bool AddTaxToken(Rarity rarity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AddTaxTokens(rarity, 1); } public static bool AddTaxTokens(Rarity rarity, int amount) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected I4, but got Unknown MetaManager instance = MetaManager.instance; List fieldValue = GetFieldValue>(MetaManagerCosmeticTokensField, instance); if (fieldValue == null) { return false; } int num = Mathf.Clamp(amount, 1, 999); for (int i = 0; i < num; i++) { fieldValue.Add((int)rarity); } InvokeMethod(CosmeticTokenUiSetupMethod, CosmeticTokenUI.instance); InvokeMethod(MetaManagerSaveMethod, instance); return true; } public static bool GetEnemyNoSpawnIdlePause(EnemyDirector? enemyDirector) { return GetFieldValue(EnemyDirectorDebugNoSpawnIdlePauseField, enemyDirector, fallback: false); } public static void SetEnemyNoSpawnIdlePause(EnemyDirector? enemyDirector, bool enabled) { SetFieldValue(EnemyDirectorDebugNoSpawnIdlePauseField, enemyDirector, enabled); } public static bool GetEnemySpawnClose(EnemyDirector? enemyDirector) { return GetFieldValue(EnemyDirectorDebugSpawnCloseField, enemyDirector, fallback: false); } public static void SetEnemySpawnClose(EnemyDirector? enemyDirector, bool enabled) { SetFieldValue(EnemyDirectorDebugSpawnCloseField, enemyDirector, enabled); } public static List GetSpawnedEnemies(EnemyDirector? enemyDirector) { return GetFieldValue(EnemyDirectorEnemiesSpawnedField, enemyDirector, new List()); } public static bool IsEnemySpawned(EnemyParent? enemyParent) { return GetFieldValue(EnemyParentSpawnedField, enemyParent, fallback: false); } public static void SetEnemySetupDone(EnemyParent? enemyParent, bool enabled) { SetFieldValue(EnemyParentSetupDoneField, enemyParent, enabled); } public static void SetEnemyFirstSpawnPointUsed(EnemyParent? enemyParent, bool enabled) { SetFieldValue(EnemyParentFirstSpawnPointUsedField, enemyParent, enabled); } public static GameObject? GetMenuCursorMesh(MenuCursor? menuCursor) { return GetFieldValue(MenuCursorMeshField, menuCursor); } public static void SetMenuCursorShowTimer(MenuCursor? menuCursor, float value) { SetFieldValue(MenuCursorShowTimerField, menuCursor, value); } public static void SetMenuCursorOverridePosTimer(MenuCursor? menuCursor, float value) { SetFieldValue(MenuCursorOverridePosTimerField, menuCursor, value); } public static void SetCursorUnlockTimer(CursorManager? cursorManager, float value) { SetFieldValue(CursorManagerUnlockTimerField, cursorManager, value); } public static PhysGrabObject? GetValuablePhysGrabObject(ValuableObject? valuableObject) { return GetFieldValue(ValuableObjectPhysGrabObjectField, valuableObject); } public static GameObject? GetEnemyValuableSmall(AssetManager? assetManager) { return GetFieldValue(AssetManagerEnemyValuableSmallField, assetManager); } public static GameObject? GetEnemyValuableMedium(AssetManager? assetManager) { return GetFieldValue(AssetManagerEnemyValuableMediumField, assetManager); } public static GameObject? GetEnemyValuableBig(AssetManager? assetManager) { return GetFieldValue(AssetManagerEnemyValuableBigField, assetManager); } public static PrefabRef? CreateResourcePrefabRef(GameObject? prefab, string resourcePath) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if ((Object)(object)prefab == (Object)null || string.IsNullOrWhiteSpace(resourcePath)) { return null; } PrefabRef val = new PrefabRef(); SetFieldValue(PrefabRefPrefabNameField, val, ((Object)prefab).name); SetFieldValue(PrefabRefResourcePathField, val, resourcePath); if (!val.IsValid()) { return null; } return val; } public static PhotonView? GetPunManagerPhotonView(PunManager? punManager) { return GetFieldValue(PunManagerPhotonViewField, punManager); } public static bool GetRoundExtractionPointActive(RoundDirector? roundDirector) { return GetFieldValue(RoundDirectorExtractionPointActiveField, roundDirector, fallback: false); } public static List GetRoundExtractionPointList(RoundDirector? roundDirector) { return GetFieldValue(RoundDirectorExtractionPointListField, roundDirector, new List()); } public static ExtractionPoint? GetRoundExtractionPointCurrent(RoundDirector? roundDirector) { return GetFieldValue(RoundDirectorExtractionPointCurrentField, roundDirector); } public static void SetRoundExtractionPointCurrent(RoundDirector? roundDirector, ExtractionPoint? extractionPoint) { SetFieldValue(RoundDirectorExtractionPointCurrentField, roundDirector, extractionPoint); } public static State GetExtractionPointState(ExtractionPoint? extractionPoint) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetFieldValue(ExtractionPointCurrentStateField, extractionPoint, (State)0); } public static bool ActivateExtractionPoint(ExtractionPoint? extractionPoint) { return InvokeMethod(ExtractionPointOnClickMethod, extractionPoint); } public static bool CompleteExtractionPoint(ExtractionPoint? extractionPoint) { if ((Object)(object)extractionPoint == (Object)null) { return false; } SetFieldValue(ExtractionPointCompletedRightAwayField, extractionPoint, value: true); return InvokeMethod(ExtractionPointStateSetMethod, extractionPoint, (object)(State)6); } public static bool GetRunGameOver(RunManager? runManager) { return GetFieldValue(RunManagerGameOverField, runManager, fallback: false); } public static void SetRunDebugLevel(RunManager? runManager, Level? level) { SetFieldValue(RunManagerDebugLevelField, runManager, level); } private static T GetFieldValue(FieldInfo? fieldInfo, object? instance, T fallback = default(T)) { if (fieldInfo == null || instance == null) { return fallback; } try { return (T)((fieldInfo.GetValue(instance) is T val) ? ((object)val) : ((object)fallback)); } catch { return fallback; } } private static void SetFieldValue(FieldInfo? fieldInfo, object? instance, T value) { if (fieldInfo == null || instance == null) { return; } try { fieldInfo.SetValue(instance, value); } catch { } } private static void SetStringListMembership(FieldInfo? fieldInfo, object? instance, string value, bool enabled) { if (fieldInfo == null || instance == null || string.IsNullOrWhiteSpace(value)) { return; } try { if (!(fieldInfo.GetValue(instance) is List list)) { return; } if (enabled) { if (!list.Contains(value)) { list.Add(value); } } else { list.Remove(value); } } catch { } } private static bool InvokeMethod(MethodInfo? methodInfo, object? instance, params object?[] parameters) { if (methodInfo == null || instance == null) { return false; } try { methodInfo.Invoke(instance, parameters); return true; } catch { return false; } } } internal sealed class SectorActions { private const float InfiniteStrengthGrabValue = 100f; private readonly ManualLogSource _logger; private readonly SectorOverlayState _state; private readonly SectorCatalog _catalog; private PhysGrabber? _strengthGrabber; private float _strengthGrabberOriginal = 1f; public SectorActions(ManualLogSource logger, SectorOverlayState state, SectorCatalog catalog) { _logger = logger; _state = state; _catalog = catalog; } public void Tick() { try { ApplyLocalPowerState(); } catch (Exception ex) { _logger.LogError((object)ex); } } public void ResetLocalPowerState() { PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(PlayerAvatar.instance); if ((Object)(object)playerHealth != (Object)null) { SectorAccess.SetPlayerGodMode(playerHealth, enabled: false); } if ((Object)(object)PlayerController.instance != (Object)null) { SectorAccess.SetDebugEnergy(PlayerController.instance, enabled: false); PlayerController.instance.OverrideSpeed(1f, 0.05f); } _state.GodMode = false; _state.InfiniteEnergy = false; RestoreInfiniteStrength(); _state.InfiniteStrength = false; _state.StickyBoost = false; } public SectorRuntimeSnapshot GetSnapshot() { List list = SectorGame.GetPlayers().ToList(); PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(SectorGame.GetLocalPlayer()); PlayerController instance = PlayerController.instance; List spawnedEnemies = SectorAccess.GetSpawnedEnemies(EnemyDirector.instance); bool inRun = SectorGame.IsInPlayableRun(); bool isHost = SemiFunc.IsMasterClientOrSingleplayer(); object obj = RunManager.instance?.levelCurrent?.NarrativeName; if (obj == null) { RunManager instance2 = RunManager.instance; if (instance2 == null) { obj = null; } else { Level levelCurrent = instance2.levelCurrent; obj = ((levelCurrent != null) ? ((Object)levelCurrent).name : null); } if (obj == null) { obj = "No active level"; } } return new SectorRuntimeSnapshot(inRun, isHost, (string)obj, list.Count, list.Count((PlayerAvatar player) => (Object)(object)player != (Object)null && !SectorAccess.IsPlayerDead(player) && !SectorAccess.IsPlayerDisabled(player)), list.Count((PlayerAvatar player) => (Object)(object)player != (Object)null && SectorAccess.IsPlayerDead(player)), spawnedEnemies.Count((EnemyParent enemy) => (Object)(object)enemy != (Object)null), Object.FindObjectsByType((FindObjectsSortMode)0).Length, SectorAccess.GetHealth(playerHealth), SectorAccess.GetMaxHealth(playerHealth), SectorAccess.GetEnergyCurrent(instance), SectorAccess.GetEnergyStart(instance), SectorAccess.GetEnemyNoVision(EnemyDirector.instance)); } public void ExecuteCommand(string input) { string text = (input ?? string.Empty).Trim(); if (string.IsNullOrEmpty(text)) { _state.PushToast("Command deck is empty."); return; } string[] array = text.Split(' ', StringSplitOptions.RemoveEmptyEntries); if (array.Length == 0) { _state.PushToast("Command deck is empty."); return; } switch (array[0].ToLowerInvariant()) { case "help": _state.PushToast("Commands: spawn, heal, revive, despawn, destroy, noaggro, energy, god, strength, boost, truck, level."); return; case "spawn": ExecuteSpawnCommand(array); return; case "heal": ExecuteHealCommand(array); return; case "revive": ExecuteReviveCommand(array); return; case "despawn": if (array.Length >= 2 && array[1].Equals("enemies", StringComparison.OrdinalIgnoreCase)) { DespawnEnemies(); return; } break; case "destroy": if (array.Length >= 2 && array[1].Equals("enemies", StringComparison.OrdinalIgnoreCase)) { DestroyEnemies(); return; } break; case "noaggro": SetNoAggro(array.Length < 2 || ParseToggle(array[1], _state.NoAggro)); return; case "energy": SetInfiniteEnergy(array.Length < 2 || ParseToggle(array[1], _state.InfiniteEnergy)); return; case "god": SetGodMode(array.Length < 2 || ParseToggle(array[1], _state.GodMode)); return; case "strength": SetInfiniteStrength(array.Length < 2 || ParseToggle(array[1], _state.InfiniteStrength)); return; case "boost": ExecuteBoostCommand(array); return; case "truck": if (array.Length >= 2 && array[1].Equals("valuables", StringComparison.OrdinalIgnoreCase)) { RecallValuablesToTruck(); return; } break; case "level": ExecuteLevelCommand(array); return; } _state.PushToast("Unknown command: " + text); } public void Spawn(SectorSpawnEntry entry, int count) { count = Mathf.Clamp(count, 1, 25); if (EnsureHostTools("spawning")) { switch (entry.Kind) { case SectorSpawnKind.Enemy: SpawnEnemyEntry(entry, count); break; case SectorSpawnKind.Item: SpawnItemEntry(entry, count); break; case SectorSpawnKind.Valuable: SpawnValuableEntry(entry, count); break; case SectorSpawnKind.CosmeticBox: SpawnValuableEntry(entry, count); break; } } } public void RefillLocalPlayer() { PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(PlayerAvatar.instance); if ((Object)(object)playerHealth != (Object)null) { int num = Mathf.Max(0, SectorAccess.GetMaxHealth(playerHealth) - SectorAccess.GetHealth(playerHealth)); if (num > 0) { playerHealth.Heal(num, true); } } if ((Object)(object)PlayerController.instance != (Object)null) { SectorAccess.SetEnergyCurrent(PlayerController.instance, SectorAccess.GetEnergyStart(PlayerController.instance)); } _state.PushToast("Local player refilled."); } public void HealPlayer(PlayerAvatar? player) { PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(player); if ((Object)(object)playerHealth == (Object)null) { _state.PushToast("Player health is unavailable."); return; } int num = Mathf.Max(0, SectorAccess.GetMaxHealth(playerHealth) - SectorAccess.GetHealth(playerHealth)); if (num <= 0) { _state.PushToast(SectorAccess.GetPlayerName(player) + " is already full."); return; } playerHealth.HealOther(num, true); _state.PushToast("Healed " + SectorAccess.GetPlayerName(player) + "."); } public void AddLobbyTaxToken(Rarity rarity) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) AddLobbyTaxToken(rarity, 1); } public void AddLobbyTaxToken(Rarity rarity, string amountText) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!int.TryParse((amountText ?? string.Empty).Trim(), out var result)) { _state.PushToast("Enter a whole number for tax tokens."); } else { AddLobbyTaxToken(rarity, result); } } public void AddLobbyTaxToken(Rarity rarity, int amount) { //IL_0059: 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_0073: 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) if (!EnsureCurrencyTools()) { return; } int num = Mathf.Clamp(amount, 1, 999); if (!SemiFunc.IsMultiplayer()) { if (SectorAccess.AddTaxTokens(rarity, num)) { _state.PushToast($"Added {num} {GetRarityName(rarity)} tax token(s)."); } else { _state.PushToast("Tax token bank is unavailable right now."); } } else if (SectorNetwork.BroadcastLobbyTaxToken(rarity, num)) { _state.PushToast($"Sent {num} {GetRarityName(rarity)} tax token(s) to Sector clients."); } else { _state.PushToast("Tax token broadcast failed."); } } public void HealAllPlayers() { int num = 0; foreach (PlayerAvatar player in SectorGame.GetPlayers()) { PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(player); if (!((Object)(object)playerHealth == (Object)null)) { int num2 = Mathf.Max(0, SectorAccess.GetMaxHealth(playerHealth) - SectorAccess.GetHealth(playerHealth)); if (num2 > 0) { playerHealth.HealOther(num2, true); num++; } } } _state.PushToast((num > 0) ? $"Healed {num} player(s)." : "Nobody needed healing."); } public void RevivePlayer(PlayerAvatar? player) { PlayerDeathHead playerDeathHead = SectorAccess.GetPlayerDeathHead(player); if ((Object)(object)player == (Object)null || !SectorAccess.IsPlayerDead(player) || (Object)(object)playerDeathHead == (Object)null) { _state.PushToast("That player is not in a revivable state."); } else if (EnsureHostTools("reviving")) { SectorAccess.SetInExtractionPoint(playerDeathHead, enabled: true); playerDeathHead.Revive(); _state.PushToast("Revive requested for " + SectorAccess.GetPlayerName(player) + "."); } } public void ReviveAllPlayers() { if (!EnsureHostTools("reviving")) { return; } int num = 0; foreach (PlayerAvatar player in SectorGame.GetPlayers()) { PlayerDeathHead playerDeathHead = SectorAccess.GetPlayerDeathHead(player); if (!((Object)(object)player == (Object)null) && SectorAccess.IsPlayerDead(player) && !((Object)(object)playerDeathHead == (Object)null)) { SectorAccess.SetInExtractionPoint(playerDeathHead, enabled: true); playerDeathHead.Revive(); num++; } } _state.PushToast((num > 0) ? $"Revive requested for {num} player(s)." : "No dead players found."); } public void DespawnEnemies() { if (!EnsureHostTools("enemy despawn")) { return; } int num = 0; if ((Object)(object)EnemyDirector.instance != (Object)null) { foreach (EnemyParent item in SectorAccess.GetSpawnedEnemies(EnemyDirector.instance).ToList()) { if (!((Object)(object)item == (Object)null) && SectorAccess.IsEnemySpawned(item)) { item.SpawnedTimerSet(0f); item.DespawnedTimerSet(10f, false); num++; } } } _state.PushToast((num > 0) ? $"Queued {num} enemy despawn(s)." : "No spawned enemies to despawn."); } public void DestroyEnemies() { if (!EnsureHostTools("enemy destroy")) { return; } int num = 0; if ((Object)(object)EnemyDirector.instance != (Object)null) { List spawnedEnemies = SectorAccess.GetSpawnedEnemies(EnemyDirector.instance); foreach (EnemyParent item in spawnedEnemies.ToList()) { if (!((Object)(object)item == (Object)null)) { spawnedEnemies.Remove(item); if (SemiFunc.IsMultiplayer()) { PhotonNetwork.Destroy(((Component)item).gameObject); } else { Object.Destroy((Object)(object)((Component)item).gameObject); } num++; } } } _state.PushToast((num > 0) ? $"Destroyed {num} enemy object(s)." : "No enemies found."); } public void RecallValuablesToTruck() { //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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (!EnsureHostTools("valuable recall")) { return; } if ((Object)(object)TruckSafetySpawnPoint.instance == (Object)null) { _state.PushToast("Truck safety spawn is unavailable in this scene."); return; } ValuableObject[] array = Object.FindObjectsByType((FindObjectsSortMode)0); int num = 0; Vector3 val2 = default(Vector3); for (int i = 0; i < array.Length; i++) { ValuableObject val = array[i]; PhysGrabObject valuablePhysGrabObject = SectorAccess.GetValuablePhysGrabObject(val); if (!((Object)(object)valuablePhysGrabObject == (Object)null)) { int num2 = i % 8; int num3 = i / 8; float num4 = (float)num2 / 8f * MathF.PI * 2f; float num5 = 1.2f + (float)num3 * 0.8f; ((Vector3)(ref val2))..ctor(Mathf.Cos(num4) * num5, 0.35f + (float)num3 * 0.1f, Mathf.Sin(num4) * num5); valuablePhysGrabObject.Teleport(((Component)TruckSafetySpawnPoint.instance).transform.position + val2, ((Component)TruckSafetySpawnPoint.instance).transform.rotation); val.DollarValueSetLogic(); num++; } } _state.PushToast((num > 0) ? $"Recalled {num} valuable(s) to the truck." : "No valuables found."); } public void DiscoverExtractionPoint() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 if (!EnsureHostTools("extraction discovery")) { return; } ExtractionPoint roundExtractionPointCurrent = SectorAccess.GetRoundExtractionPointCurrent(RoundDirector.instance); if ((Object)(object)roundExtractionPointCurrent != (Object)null && (int)SectorAccess.GetExtractionPointState(roundExtractionPointCurrent) > 1) { _state.PushToast("An extraction point is already discovered."); return; } ExtractionPoint val = FindNearestExtractionPoint(idleOnly: true); if ((Object)(object)val == (Object)null) { _state.PushToast("No idle extraction point is available."); } else if (SectorAccess.ActivateExtractionPoint(val)) { _state.PushToast("Extraction point discovery requested."); } else { _state.PushToast("Extraction point discovery failed."); } } public void CompleteExtractionPoint() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_003e: 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_0054: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Invalid comparison between Unknown and I4 //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 if (!EnsureHostTools("extraction completion")) { return; } ExtractionPoint roundExtractionPointCurrent = SectorAccess.GetRoundExtractionPointCurrent(RoundDirector.instance); if ((Object)(object)roundExtractionPointCurrent == (Object)null) { _state.PushToast("Discover an extraction point first."); return; } State extractionPointState = SectorAccess.GetExtractionPointState(roundExtractionPointCurrent); if ((int)extractionPointState == 1 || (int)extractionPointState == 0) { _state.PushToast("Discover an extraction point first."); } else if ((int)extractionPointState == 6) { _state.PushToast("Extraction point is already completing."); } else if ((int)extractionPointState == 7 || (int)extractionPointState == 9) { _state.PushToast("Extraction point is already complete."); } else if (SectorAccess.CompleteExtractionPoint(roundExtractionPointCurrent)) { _state.PushToast("Extraction point completion requested."); } else { _state.PushToast("Extraction point completion failed."); } } public void ForceEnemyInvestigateHere() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (EnsureHostTools("enemy redirect")) { PlayerAvatar localPlayer = SectorGame.GetLocalPlayer(); if ((Object)(object)localPlayer == (Object)null) { _state.PushToast("Local player anchor is unavailable."); return; } SemiFunc.EnemyInvestigate(((Component)localPlayer).transform.position, 100f, true); _state.PushToast("Enemies redirected toward your position."); } } public void ToggleSpawnIdlePause() { if (EnsureHostTools("enemy idle timer toggle")) { if ((Object)(object)EnemyDirector.instance == (Object)null) { _state.PushToast("Enemy director is unavailable."); return; } bool flag = !SectorAccess.GetEnemyNoSpawnIdlePause(EnemyDirector.instance); SectorAccess.SetEnemyNoSpawnIdlePause(EnemyDirector.instance, flag); _state.PushToast(flag ? "Enemy spawn idle pause disabled." : "Enemy spawn idle pause restored."); } } public void SwitchLevel(string target) { string text = (target ?? string.Empty).Trim(); if (string.IsNullOrEmpty(text)) { _state.PushToast("Type a level target or use one of the quick switch buttons."); } else { if (!EnsureHostTools("level switching")) { return; } if ((Object)(object)RunManager.instance == (Object)null) { _state.PushToast("Run manager is unavailable."); return; } switch (text.ToLowerInvariant()) { case "next": RunManager.instance.ChangeLevel(true, SemiFunc.RunIsArena(), (ChangeLevelType)0); _state.PushToast("Advancing to the next level."); break; case "random": RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)1); _state.PushToast("Switching to a random run level."); break; case "refresh": RunManager.instance.RestartScene(); if (!SemiFunc.RunIsTutorial()) { SemiFunc.OnSceneSwitch(SectorAccess.GetRunGameOver(RunManager.instance), false); } _state.PushToast("Refreshing the current level."); break; case "shop": RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)5); _state.PushToast("Switching to the shop."); break; case "recording": RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)6); _state.PushToast("Switching to the recording level."); break; case "lobby": SwitchToSpecificLevel(RunManager.instance.levelLobby); break; case "arena": SwitchToSpecificLevel(RunManager.instance.levelArena.FirstOrDefault()); break; default: { Level val = FindLevelMatch(text); if ((Object)(object)val == (Object)null) { _state.PushToast("No level matched '" + text + "'."); } else { SwitchToSpecificLevel(val); } break; } } } } public void AddMoney(int amount) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Invalid comparison between Unknown and I4 if (amount <= 0) { _state.PushToast("Money amount must be above zero."); } else { if (!EnsureCurrencyTools()) { return; } int num = SemiFunc.StatGetRunCurrency(); int num2 = ((num > int.MaxValue - amount) ? int.MaxValue : (num + amount)); SemiFunc.StatSetRunCurrency(num2); CurrencyUI instance = CurrencyUI.instance; if (instance != null) { instance.FetchCurrency(); } if (SemiFunc.RunIsShop()) { RunManager instance2 = RunManager.instance; if (instance2 != null) { instance2.ChangeLevel(false, false, (ChangeLevelType)5); } } else if (SemiFunc.RunIsLevel() && (int)SectorAccess.GetExtractionPointState(SectorAccess.GetRoundExtractionPointCurrent(RoundDirector.instance)) > 1) { RunManager instance3 = RunManager.instance; if (instance3 != null) { instance3.ChangeLevel(false, false, (ChangeLevelType)0); } } _state.PushToast("Added " + SemiFunc.DollarGetString(amount) + ". Cash now " + SemiFunc.DollarGetString(num2) + "."); } } public void AddMoney(string amountText) { if (!int.TryParse((amountText ?? string.Empty).Trim(), out var result)) { _state.PushToast("Enter a whole number for cash."); } else { AddMoney(result); } } public IReadOnlyList GetLevelSuggestions(string search) { if (RunManager.instance?.levels == null) { return Array.Empty(); } IEnumerable source = RunManager.instance.levels.Where((Level level) => (Object)(object)level != (Object)null); string trimmedSearch = (search ?? string.Empty).Trim(); if (!string.IsNullOrEmpty(trimmedSearch)) { source = source.Where((Level level) => LevelMatches(level, trimmedSearch, allowPartial: true)); } return (from name in (from name in source.Select(GetLevelDisplayName) where !string.IsNullOrWhiteSpace(name) select name).Distinct(StringComparer.OrdinalIgnoreCase) orderby name select name).Take(8).ToList(); } public void SetGodMode(bool enabled) { _state.GodMode = enabled; _state.PushToast(enabled ? "God mode armed for the local player." : "God mode disabled."); } public void SetInfiniteEnergy(bool enabled) { _state.InfiniteEnergy = enabled; _state.PushToast(enabled ? "Infinite energy armed." : "Infinite energy disabled."); } public void SetInfiniteStrength(bool enabled) { _state.InfiniteStrength = enabled; if (!enabled) { RestoreInfiniteStrength(); } _state.PushToast(enabled ? "Infinite strength armed. Pick up whatever you want." : "Infinite strength disabled."); } public void SetNoAggro(bool enabled) { _state.NoAggro = enabled; ApplyNoAggroState(sendRpc: true); _state.PushToast(enabled ? "Enemy vision disabled." : "Enemy vision restored."); } private void ApplyLocalPowerState() { PlayerAvatar localPlayer = SectorGame.GetLocalPlayer(); PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(localPlayer); if ((Object)(object)playerHealth != (Object)null) { SectorAccess.SetPlayerGodMode(playerHealth, _state.GodMode); } if ((Object)(object)PlayerController.instance != (Object)null) { SectorAccess.SetDebugEnergy(PlayerController.instance, _state.InfiniteEnergy); if (_state.InfiniteEnergy) { SectorAccess.SetEnergyCurrent(PlayerController.instance, SectorAccess.GetEnergyStart(PlayerController.instance)); } ApplyInfiniteStrength(localPlayer); if (_state.StickyBoost && _state.SpeedMultiplier > 1.01f) { PlayerController.instance.OverrideSpeed(_state.SpeedMultiplier, 0.25f); } } if ((Object)(object)EnemyDirector.instance != (Object)null) { ApplyNoAggroState(sendRpc: false); } } private void ApplyNoAggroState(bool sendRpc) { string localSteamId = SectorAccess.GetLocalSteamId(); if (string.IsNullOrWhiteSpace(localSteamId)) { return; } SectorAccess.SetDebugCommandEnemyNoVision(DebugCommandHandler.instance, localSteamId, _state.NoAggro); SectorAccess.SetEnemyNoVision(EnemyDirector.instance, localSteamId, _state.NoAggro); if (sendRpc && SemiFunc.IsMultiplayer() && !((Object)(object)PunManager.instance == (Object)null)) { PhotonView punManagerPhotonView = SectorAccess.GetPunManagerPhotonView(PunManager.instance); if (!((Object)(object)punManagerPhotonView == (Object)null)) { punManagerPhotonView.RPC("TesterNoAggroCommandRPC", (RpcTarget)2, new object[2] { localSteamId, _state.NoAggro }); } } } private void ApplyInfiniteStrength(PlayerAvatar? localPlayer) { PhysGrabber val = localPlayer?.physGrabber ?? PhysGrabber.instance; if (!_state.InfiniteStrength) { RestoreInfiniteStrength(); } else if (!((Object)(object)val == (Object)null)) { if ((Object)(object)_strengthGrabber != (Object)(object)val) { RestoreInfiniteStrength(); _strengthGrabber = val; _strengthGrabberOriginal = Mathf.Max(1f, val.grabStrength); } val.grabStrength = 100f; } } private void RestoreInfiniteStrength() { PhysGrabber strengthGrabber = _strengthGrabber; if ((Object)(object)strengthGrabber == (Object)null) { _strengthGrabber = null; _strengthGrabberOriginal = 1f; } else { strengthGrabber.grabStrength = Mathf.Max(1f, _strengthGrabberOriginal); _strengthGrabber = null; _strengthGrabberOriginal = 1f; } } private void ExecuteSpawnCommand(string[] tokens) { if (tokens.Length < 3) { _state.PushToast("Usage: spawn enemy|item|valuable [count]"); return; } int result = 1; bool num = int.TryParse(tokens[^1], out result); result = Mathf.Clamp(result, 1, 25); string text = tokens[1].ToLowerInvariant(); int startIndex = 2; int num2 = (num ? (tokens.Length - 3) : (tokens.Length - 2)); if (num2 < 1) { _state.PushToast("Spawn command is missing a target name."); return; } string text2 = string.Join(" ", tokens, startIndex, num2); if (!TryParseKind(text, out var kind)) { _state.PushToast("Unknown spawn type: " + text); return; } SectorSpawnEntry sectorSpawnEntry = _catalog.FindBestMatch(kind, text2); if (sectorSpawnEntry == null) { _state.PushToast("No " + text + " matched '" + text2 + "'."); } else { Spawn(sectorSpawnEntry, result); } } private void ExecuteHealCommand(string[] tokens) { if (tokens.Length < 2) { _state.PushToast("Usage: heal me|all"); return; } string text = tokens[1].ToLowerInvariant(); if (!(text == "me")) { if (text == "all") { HealAllPlayers(); } else { _state.PushToast("Usage: heal me|all"); } } else { RefillLocalPlayer(); } } private void ExecuteReviveCommand(string[] tokens) { if (tokens.Length < 2) { _state.PushToast("Usage: revive all"); } else if (tokens[1].Equals("all", StringComparison.OrdinalIgnoreCase)) { ReviveAllPlayers(); } else { _state.PushToast("Usage: revive all"); } } private void ExecuteBoostCommand(string[] tokens) { float result; if (tokens.Length < 2) { _state.StickyBoost = !_state.StickyBoost; _state.PushToast(_state.StickyBoost ? $"Sticky boost enabled at {_state.SpeedMultiplier:0.0}x." : "Sticky boost disabled."); } else if (tokens[1].Equals("off", StringComparison.OrdinalIgnoreCase)) { _state.StickyBoost = false; _state.PushToast("Sticky boost disabled."); } else if (float.TryParse(tokens[1], out result)) { _state.SpeedMultiplier = Mathf.Clamp(result, 1f, 4f); _state.StickyBoost = _state.SpeedMultiplier > 1.01f; _state.PushToast(_state.StickyBoost ? $"Sticky boost set to {_state.SpeedMultiplier:0.0}x." : "Sticky boost disabled."); } else { _state.PushToast("Usage: boost |off"); } } private void ExecuteLevelCommand(string[] tokens) { if (tokens.Length < 2) { _state.PushToast("Usage: level "); } else { SwitchLevel(string.Join(" ", tokens.Skip(1))); } } private static ExtractionPoint? FindNearestExtractionPoint(bool idleOnly) { //IL_0034: 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_0039: Unknown result type (might be due to invalid IL or missing references) RoundDirector instance = RoundDirector.instance; if ((Object)(object)instance == (Object)null) { return null; } PlayerAvatar? localPlayer = SectorGame.GetLocalPlayer(); Vector3 anchor = ((localPlayer != null) ? ((Component)localPlayer).transform.position : Vector3.zero); return (from point in SectorAccess.GetRoundExtractionPointList(instance) select (!((Object)(object)point != (Object)null)) ? null : point.GetComponent() into point where (Object)(object)point != (Object)null && (!idleOnly || (int)SectorAccess.GetExtractionPointState(point) == 1) orderby Vector3.Distance(((Component)point).transform.position, anchor) select point).FirstOrDefault(); } private void SpawnEnemyEntry(SectorSpawnEntry entry, int count) { //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_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_0118: 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_0104: 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_0164: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)entry.EnemySetup == (Object)null || entry.EnemySetup.spawnObjects == null || entry.EnemySetup.spawnObjects.Count == 0) { _state.PushToast("Enemy profile '" + entry.DisplayName + "' has no spawn objects."); return; } List list = SectorGame.GetSpawnPoints(count).ToList(); if (list.Count == 0) { _state.PushToast("No usable level points are available yet."); return; } int num = 0; RunManager instance = RunManager.instance; if (instance != null) { instance.EnemiesSpawnedRemoveStart(); } try { for (int i = 0; i < count; i++) { Vector3 val = ((Component)list[Mathf.Min(i, list.Count - 1)]).transform.position + Vector3.up * 0.1f; bool flag = false; foreach (PrefabRef spawnObject in entry.EnemySetup.spawnObjects) { if (spawnObject == null || !spawnObject.IsValid()) { continue; } GameObject val2 = (SemiFunc.IsMultiplayer() ? PhotonNetwork.InstantiateRoomObject(spawnObject.ResourcePath, val, Quaternion.identity, (byte)0, (object[])null) : Object.Instantiate(spawnObject.Prefab, val, Quaternion.identity)); if ((Object)(object)val2 == (Object)null) { continue; } EnemyParent component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { flag = true; SectorAccess.SetEnemySetupDone(component, enabled: true); SectorAccess.SetEnemyFirstSpawnPointUsed(component, enabled: true); Enemy componentInChildren = ((Component)component).GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.EnemyTeleported(val); } EnemyDirector instance2 = EnemyDirector.instance; if (instance2 != null) { instance2.FirstSpawnPointAdd(component); } } } if (flag) { num++; } } } finally { RunManager instance3 = RunManager.instance; if (instance3 != null) { instance3.EnemiesSpawnedRemoveEnd(); } } _state.PushToast($"Spawned {num} '{entry.DisplayName}' pack(s)."); } private void SpawnItemEntry(SectorSpawnEntry entry, int count) { //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_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_00b1: 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_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_00cc: 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_0103: 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_00e6: Unknown result type (might be due to invalid IL or missing references) if (entry.Item?.prefab == null || !entry.Item.prefab.IsValid()) { _state.PushToast("Item '" + entry.DisplayName + "' is missing a valid prefab reference."); return; } List list = SectorGame.GetSpawnPoints(count).ToList(); if (list.Count == 0) { _state.PushToast("No usable level points are available yet."); return; } int num = 0; for (int i = 0; i < count; i++) { LevelPoint obj = list[Mathf.Min(i, list.Count - 1)]; Vector3 val = ((Component)obj).transform.position + Vector3.up * (1f + (float)i * 0.03f); Quaternion val2 = ((Component)obj).transform.rotation * entry.Item.spawnRotationOffset; if (SemiFunc.IsMultiplayer()) { PhotonNetwork.InstantiateRoomObject(entry.Item.prefab.ResourcePath, val, val2, (byte)0, (object[])null); } else { Object.Instantiate(entry.Item.prefab.Prefab, val, val2); } num++; } _state.PushToast($"Spawned {num} '{entry.DisplayName}' item(s)."); } private void SpawnValuableEntry(SectorSpawnEntry entry, int count) { //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_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_00f3: 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_00d3: 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) string text = ((entry.Kind == SectorSpawnKind.CosmeticBox) ? "cosmetic box" : "valuable"); if (entry.PrefabRef == null || !entry.PrefabRef.IsValid()) { _state.PushToast(GetSentenceCase(text) + " '" + entry.DisplayName + "' is missing a valid prefab reference."); return; } List list = SectorGame.GetSpawnPoints(count).ToList(); if (list.Count == 0) { _state.PushToast("No usable level points are available yet."); return; } int num = 0; for (int i = 0; i < count; i++) { LevelPoint val = list[Mathf.Min(i, list.Count - 1)]; Vector3 val2 = ((Component)val).transform.position + Vector3.up * (1f + (float)i * 0.04f); GameObject obj = (SemiFunc.IsMultiplayer() ? PhotonNetwork.InstantiateRoomObject(entry.PrefabRef.ResourcePath, val2, ((Component)val).transform.rotation, (byte)0, (object[])null) : Object.Instantiate(entry.PrefabRef.Prefab, val2, ((Component)val).transform.rotation)); if (obj != null) { ValuableObject component = obj.GetComponent(); if (component != null) { component.DollarValueSetLogic(); } } num++; } _state.PushToast($"Spawned {num} '{entry.DisplayName}' {text}(s)."); } private bool EnsureHostTools(string label) { if (!SectorGame.IsInPlayableRun()) { _state.PushToast("Start or join a live run before using " + label + "."); return false; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { _state.PushToast(label + " is host or singleplayer only."); return false; } return true; } private void SwitchToSpecificLevel(Level? level) { if ((Object)(object)RunManager.instance == (Object)null || (Object)(object)level == (Object)null) { _state.PushToast("That level target is unavailable."); return; } string levelDisplayName = GetLevelDisplayName(level); SectorAccess.SetRunDebugLevel(RunManager.instance, level); try { RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)0); } finally { SectorAccess.SetRunDebugLevel(RunManager.instance, null); } _state.PushToast("Switching to " + levelDisplayName + "."); } private bool EnsureCurrencyTools() { if ((Object)(object)RunManager.instance == (Object)null || (Object)(object)StatsManager.instance == (Object)null) { _state.PushToast("Currency controls are unavailable right now."); return false; } if (SemiFunc.IsMainMenu() && !SemiFunc.RunIsLobbyMenu()) { _state.PushToast("Join a lobby or start singleplayer before editing cash."); return false; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { _state.PushToast("Currency editing is host or singleplayer only."); return false; } return true; } private static string GetRarityName(Rarity rarity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown return (int)rarity switch { 0 => "green", 1 => "blue", 2 => "purple", 3 => "gold", _ => "unknown", }; } private static string GetSentenceCase(string value) { if (!string.IsNullOrEmpty(value)) { return char.ToUpperInvariant(value[0]) + value.Substring(1); } return value; } private static Level? FindLevelMatch(string target) { string target2 = target; if (RunManager.instance?.levels == null) { return null; } Level val = ((IEnumerable)RunManager.instance.levels).FirstOrDefault((Func)((Level level) => LevelMatches(level, target2, allowPartial: false))); if ((Object)(object)val != (Object)null) { return val; } return ((IEnumerable)RunManager.instance.levels).FirstOrDefault((Func)((Level level) => LevelMatches(level, target2, allowPartial: true))); } private static bool LevelMatches(Level? level, string target, bool allowPartial) { if ((Object)(object)level == (Object)null) { return false; } string value = target.Trim().ToLowerInvariant(); if (string.IsNullOrEmpty(value)) { return false; } foreach (string item in EnumerateLevelTerms(level)) { string text = item.ToLowerInvariant(); if (text.Equals(value, StringComparison.Ordinal)) { return true; } if (allowPartial && text.Contains(value, StringComparison.Ordinal)) { return true; } } return false; } private static IEnumerable EnumerateLevelTerms(Level? level) { if (!((Object)(object)level == (Object)null)) { string text = level.NarrativeName?.Trim(); if (!string.IsNullOrEmpty(text)) { yield return text; } string text2 = CleanLevelName(((Object)level).name); if (!string.IsNullOrEmpty(text2)) { yield return text2; } string text3 = ((Object)level).name?.Trim(); if (!string.IsNullOrEmpty(text3)) { yield return text3; } } } private static string GetLevelDisplayName(Level? level) { if ((Object)(object)level == (Object)null) { return "Unknown level"; } string text = level.NarrativeName?.Trim(); if (!string.IsNullOrEmpty(text)) { return text; } string text2 = CleanLevelName(((Object)level).name); if (!string.IsNullOrEmpty(text2)) { return text2; } return "Unknown level"; } private static string CleanLevelName(string? rawName) { string text = (rawName ?? string.Empty).Trim(); if (!text.StartsWith("Level - ", StringComparison.OrdinalIgnoreCase)) { return text; } return text.Substring("Level - ".Length).Trim(); } private static bool ParseToggle(string token, bool currentValue) { switch (token.ToLowerInvariant()) { case "1": case "enabled": case "on": case "true": case "enable": return true; case "0": case "disable": case "off": case "false": case "disabled": return false; default: return !currentValue; } } private static bool TryParseKind(string token, out SectorSpawnKind kind) { switch (token.ToLowerInvariant()) { case "enemy": case "enemies": kind = SectorSpawnKind.Enemy; return true; case "items": case "item": kind = SectorSpawnKind.Item; return true; case "valuable": case "valuables": kind = SectorSpawnKind.Valuable; return true; case "boxes": case "cosmetic": case "cosmetics": case "box": case "cosmeticbox": case "cosmeticboxes": kind = SectorSpawnKind.CosmeticBox; return true; default: kind = SectorSpawnKind.Enemy; return false; } } } internal static class SectorGame { public static bool IsInPlayableRun() { if ((Object)(object)RunManager.instance == (Object)null || (Object)(object)LevelGenerator.Instance == (Object)null) { return false; } if (!LevelGenerator.Instance.Generated) { return false; } if (SemiFunc.IsMainMenu() || SemiFunc.RunIsLobbyMenu() || SemiFunc.RunIsTutorial()) { return false; } return true; } public static PlayerAvatar? GetLocalPlayer() { PlayerAvatar controllerAvatar = SectorAccess.GetControllerAvatar(PlayerController.instance); if ((Object)(object)controllerAvatar != (Object)null) { return controllerAvatar; } return PlayerAvatar.instance; } public static IEnumerable GetPlayers() { return SemiFunc.PlayerGetList() ?? new List(); } public static IEnumerable GetSpawnPoints(int desiredCount) { //IL_0029: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (!IsInPlayableRun()) { return Array.Empty(); } PlayerAvatar? localPlayer = GetLocalPlayer(); Vector3 anchor = ((localPlayer != null) ? ((Component)localPlayer).transform.position : Vector3.zero); List list = SemiFunc.LevelPointsGetAll(); if (list == null || list.Count == 0) { return Array.Empty(); } return (from point in list where (Object)(object)point != (Object)null orderby Vector3.Distance(((Component)point).transform.position, anchor) select point).Take(Mathf.Max(desiredCount, 1)).ToList(); } } internal sealed class SectorCatalog { private static readonly Regex EnemyPrefix = new Regex("^Enemy (- )?", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex ItemPrefix = new Regex("^Item ", RegexOptions.IgnoreCase | RegexOptions.Compiled); private static readonly Regex ValuablePrefix = new Regex("^Valuable ", RegexOptions.IgnoreCase | RegexOptions.Compiled); private readonly ManualLogSource _logger; private readonly List _entries = new List(); private float _nextRefreshTime; public int EnemyCount => _entries.Count((SectorSpawnEntry entry) => entry.Kind == SectorSpawnKind.Enemy); public int ItemCount => _entries.Count((SectorSpawnEntry entry) => entry.Kind == SectorSpawnKind.Item); public int ValuableCount => _entries.Count((SectorSpawnEntry entry) => entry.Kind == SectorSpawnKind.Valuable); public int CosmeticBoxCount => _entries.Count((SectorSpawnEntry entry) => entry.Kind == SectorSpawnKind.CosmeticBox); public SectorCatalog(ManualLogSource logger) { _logger = logger; } public IReadOnlyList GetEntries(SectorSpawnKind kind, string search) { RefreshIfNeeded(); string text = (search ?? string.Empty).Trim(); if (string.IsNullOrEmpty(text)) { return (from entry in _entries where entry.Kind == kind orderby entry.DisplayName select entry).ToList(); } string normalized = text.ToLowerInvariant(); return (from entry in _entries where entry.Kind == kind && entry.SearchText.Contains(normalized, StringComparison.Ordinal) orderby entry.DisplayName select entry).ToList(); } public SectorSpawnEntry? FindBestMatch(SectorSpawnKind kind, string query) { RefreshIfNeeded(); if (string.IsNullOrWhiteSpace(query)) { return null; } string trimmed = query.Trim(); string lowered = trimmed.ToLowerInvariant(); SectorSpawnEntry sectorSpawnEntry = _entries.FirstOrDefault((SectorSpawnEntry entry) => entry.Kind == kind && (entry.Key.Equals(lowered, StringComparison.Ordinal) || entry.DisplayName.Equals(trimmed, StringComparison.OrdinalIgnoreCase))); if (sectorSpawnEntry != null) { return sectorSpawnEntry; } return (from entry in _entries where entry.Kind == kind orderby entry.DisplayName select entry).FirstOrDefault((SectorSpawnEntry entry) => entry.Key.StartsWith(lowered, StringComparison.Ordinal) || entry.SearchText.Contains(lowered, StringComparison.Ordinal)); } private void RefreshIfNeeded() { if (_entries.Count == 0 || !(Time.unscaledTime < _nextRefreshTime)) { _nextRefreshTime = Time.unscaledTime + 2.5f; BuildCatalog(); } } private void BuildCatalog() { _entries.Clear(); try { BuildEnemyEntries(); BuildItemEntries(); BuildValuableEntries(); BuildCosmeticWorldObjectEntries(); } catch (Exception ex) { _logger.LogError((object)ex); } } private void BuildEnemyEntries() { if ((Object)(object)EnemyDirector.instance == (Object)null) { return; } HashSet hashSet = new HashSet(StringComparer.Ordinal); foreach (EnemySetup item in Enumerate(EnemyDirector.instance.enemiesDifficulty1).Concat(Enumerate(EnemyDirector.instance.enemiesDifficulty2)).Concat(Enumerate(EnemyDirector.instance.enemiesDifficulty3))) { if (!((Object)(object)item == (Object)null)) { string text = CleanEnemyName(((Object)item).name); string text2 = text.ToLowerInvariant(); if (hashSet.Add(text2)) { _entries.Add(new SectorSpawnEntry(SectorSpawnKind.Enemy, text2, text, "Enemy profile", BuildSearchText(text, ((Object)item).name, "enemy"), item)); } } } } private void BuildItemEntries() { if ((Object)(object)StatsManager.instance == (Object)null) { return; } HashSet hashSet = new HashSet(StringComparer.Ordinal); foreach (Item value in StatsManager.instance.itemDictionary.Values) { if (!((Object)(object)value == (Object)null) && !value.disabled) { string text = CleanItemName(((Object)value).name); string text2 = text.ToLowerInvariant(); if (hashSet.Add(text2)) { _entries.Add(new SectorSpawnEntry(SectorSpawnKind.Item, text2, text, ((object)(itemType)(ref value.itemType)).ToString(), BuildSearchText(text, value.itemName, value.description, ((object)(itemType)(ref value.itemType)).ToString(), "item"), null, value)); } } } } private void BuildValuableEntries() { if ((Object)(object)RunManager.instance == (Object)null || RunManager.instance.levels == null) { return; } HashSet hashSet = new HashSet(StringComparer.Ordinal); foreach (Level level in RunManager.instance.levels) { if ((Object)(object)level == (Object)null || level.ValuablePresets == null) { continue; } foreach (LevelValuables valuablePreset in level.ValuablePresets) { foreach (PrefabRef item in EnumerateValuables(valuablePreset)) { if (item != null && item.IsValid()) { string text = CleanValuableName(item.PrefabName); string text2 = text.ToLowerInvariant(); if (hashSet.Add(text2)) { _entries.Add(new SectorSpawnEntry(SectorSpawnKind.Valuable, text2, text, level.NarrativeName, BuildSearchText(text, item.PrefabName, level.NarrativeName, "valuable"), null, null, item)); } } } } } BuildEnemyValuableEntries(hashSet); } private void BuildEnemyValuableEntries(HashSet seen) { if (!((Object)(object)AssetManager.instance == (Object)null)) { AddEnemyValuableEntry(seen, SectorAccess.GetEnemyValuableSmall(AssetManager.instance), "Small"); AddEnemyValuableEntry(seen, SectorAccess.GetEnemyValuableMedium(AssetManager.instance), "Medium"); AddEnemyValuableEntry(seen, SectorAccess.GetEnemyValuableBig(AssetManager.instance), "Large"); } } private void AddEnemyValuableEntry(HashSet seen, GameObject? prefab, string size) { if ((Object)(object)prefab == (Object)null) { return; } string text = "Enemy Orb (" + size + ")"; string text2 = text.ToLowerInvariant(); if (seen.Add(text2)) { PrefabRef val = SectorAccess.CreateResourcePrefabRef(prefab, "Valuables/" + ((Object)prefab).name); if (val != null) { _entries.Add(new SectorSpawnEntry(SectorSpawnKind.Valuable, text2, text, "Enemy Orb", BuildSearchText(text, ((Object)prefab).name, size, "enemy", "monster", "orb", "valuable"), null, null, val)); } } } private void BuildCosmeticWorldObjectEntries() { if ((Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.cosmeticWorldObjectSetups == null) { return; } HashSet hashSet = new HashSet(StringComparer.Ordinal); foreach (CosmeticWorldObjectSetup cosmeticWorldObjectSetup in ValuableDirector.instance.cosmeticWorldObjectSetups) { if (cosmeticWorldObjectSetup == null) { continue; } PrefabRef prefab = cosmeticWorldObjectSetup.prefab; if (prefab != null && prefab.IsValid()) { string text = ((object)(Rarity)(ref cosmeticWorldObjectSetup.rarity)).ToString().Replace("UltraRare", "Ultra Rare"); string text2 = "Cosmetic Box (" + text + ")"; string text3 = text2.ToLowerInvariant(); if (hashSet.Add(text3)) { _entries.Add(new SectorSpawnEntry(SectorSpawnKind.CosmeticBox, text3, text2, "Cosmetics", BuildSearchText(text2, prefab.PrefabName, text, "cosmetic", "box", "valuable"), null, null, prefab)); } } } } private static IEnumerable Enumerate(IEnumerable? source) { return source ?? Array.Empty(); } private static IEnumerable EnumerateValuables(LevelValuables? preset) { if ((Object)(object)preset == (Object)null) { yield break; } foreach (PrefabRef item in Enumerate(preset.tiny)) { yield return item; } foreach (PrefabRef item2 in Enumerate(preset.small)) { yield return item2; } foreach (PrefabRef item3 in Enumerate(preset.medium)) { yield return item3; } foreach (PrefabRef item4 in Enumerate(preset.big)) { yield return item4; } foreach (PrefabRef item5 in Enumerate(preset.wide)) { yield return item5; } foreach (PrefabRef item6 in Enumerate(preset.tall)) { yield return item6; } foreach (PrefabRef item7 in Enumerate(preset.veryTall)) { yield return item7; } } private static string BuildSearchText(params string?[] fragments) { return string.Join(" ", fragments.Where((string fragment) => !string.IsNullOrWhiteSpace(fragment))).ToLowerInvariant(); } private static string CleanEnemyName(string rawName) { return EnemyPrefix.Replace(rawName ?? string.Empty, string.Empty).Trim(); } private static string CleanItemName(string rawName) { return ItemPrefix.Replace(rawName ?? string.Empty, string.Empty).Trim(); } private static string CleanValuableName(string rawName) { return ValuablePrefix.Replace(rawName ?? string.Empty, string.Empty).Trim(); } } internal enum SectorTab { Ops, Spawn, Players, World, Scene } internal enum SectorSpawnKind { Enemy, Item, Valuable, CosmeticBox } internal sealed class SectorSpawnEntry { public SectorSpawnKind Kind { get; } public string Key { get; } public string DisplayName { get; } public string Subtitle { get; } public string SearchText { get; } public EnemySetup? EnemySetup { get; } public Item? Item { get; } public PrefabRef? PrefabRef { get; } public SectorSpawnEntry(SectorSpawnKind kind, string key, string displayName, string subtitle, string searchText, EnemySetup? enemySetup = null, Item? item = null, PrefabRef? prefabRef = null) { Kind = kind; Key = key; DisplayName = displayName; Subtitle = subtitle; SearchText = searchText; EnemySetup = enemySetup; Item = item; PrefabRef = prefabRef; } } internal sealed class SectorOverlayState { private readonly List _activity = new List(); public bool Visible; public Rect WindowRect = new Rect(72f, 72f, 1180f, 720f); public SectorTab ActiveTab; public SectorSpawnKind ActiveSpawnKind; public Vector2 OpsScroll; public Vector2 SpawnScroll; public Vector2 PlayersScroll; public Vector2 WorldScroll; public Vector2 SceneScroll; public string SpawnSearch = string.Empty; public string CommandText = string.Empty; public string SpawnAmountText = "1"; public string ObjectSearch = string.Empty; public string LevelSwitchText = string.Empty; public string MoneyAddText = "1000"; public string TaxTokenAmountText = "1"; public bool GodMode; public bool InfiniteEnergy; public bool InfiniteStrength; public bool StickyBoost; public bool NoAggro; public float SpeedMultiplier = 2f; public bool ShowLevelPoints; public bool ShowMeshLabels; public bool ShowMeshBounds; public int SelectedSceneObjectId; public string FlashMessage = string.Empty; public float FlashUntil; public bool ToggleKeyCaptureActive; public bool ToggleKeyPresetPickerOpen; public IReadOnlyList Activity => _activity; public int SpawnAmount { get { if (int.TryParse(SpawnAmountText, out var result)) { return Mathf.Clamp(result, 1, 25); } return 1; } } public int TaxTokenAmount { get { if (int.TryParse(TaxTokenAmountText, out var result)) { return Mathf.Clamp(result, 1, 999); } return 1; } } public void PushToast(string message) { if (!string.IsNullOrWhiteSpace(message)) { FlashMessage = message.Trim(); FlashUntil = Time.unscaledTime + 4.5f; _activity.Insert(0, $"[{DateTime.Now:HH:mm:ss}] {FlashMessage}"); if (_activity.Count > 10) { _activity.RemoveRange(10, _activity.Count - 10); } } } } internal readonly struct SectorRuntimeSnapshot { public bool InRun { get; } public bool IsHost { get; } public string LevelName { get; } public int Players { get; } public int AlivePlayers { get; } public int DeadPlayers { get; } public int Enemies { get; } public int Valuables { get; } public int LocalHealth { get; } public int LocalMaxHealth { get; } public float LocalEnergy { get; } public float LocalEnergyMax { get; } public bool NoAggroEnabled { get; } public SectorRuntimeSnapshot(bool inRun, bool isHost, string levelName, int players, int alivePlayers, int deadPlayers, int enemies, int valuables, int localHealth, int localMaxHealth, float localEnergy, float localEnergyMax, bool noAggroEnabled) { InRun = inRun; IsHost = isHost; LevelName = levelName; Players = players; AlivePlayers = alivePlayers; DeadPlayers = deadPlayers; Enemies = enemies; Valuables = valuables; LocalHealth = localHealth; LocalMaxHealth = localMaxHealth; LocalEnergy = localEnergy; LocalEnergyMax = localEnergyMax; NoAggroEnabled = noAggroEnabled; } } internal readonly struct SectorSceneSnapshot { public bool FreecamActive { get; } public bool CopyForgeActive { get; } public int TrackedObjects { get; } public int LevelPoints { get; } public int MeshObjects { get; } public string ModeLabel { get; } public SectorSceneSnapshot(bool freecamActive, bool copyForgeActive, int trackedObjects, int levelPoints, int meshObjects, string modeLabel) { FreecamActive = freecamActive; CopyForgeActive = copyForgeActive; TrackedObjects = trackedObjects; LevelPoints = levelPoints; MeshObjects = meshObjects; ModeLabel = modeLabel; } } internal sealed class SectorSceneObjectInfo { public int InstanceId { get; } public string Name { get; } public string Path { get; } public string Category { get; } public Vector3 Position { get; } public bool Active { get; } public int RendererCount { get; } public bool HasCollider { get; } public bool HasPhotonView { get; } public bool CanDelete { get; } public bool CanCopy { get; } public SectorSceneObjectInfo(int instanceId, string name, string path, string category, Vector3 position, bool active, int rendererCount, bool hasCollider, bool hasPhotonView, bool canDelete, bool canCopy) { //IL_0024: 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) InstanceId = instanceId; Name = name; Path = path; Category = category; Position = position; Active = active; RendererCount = rendererCount; HasCollider = hasCollider; HasPhotonView = hasPhotonView; CanDelete = canDelete; CanCopy = canCopy; } } internal sealed class SectorSceneQueryResult { public IReadOnlyList Entries { get; } public int TotalMatches { get; } public SectorSceneQueryResult(IReadOnlyList entries, int totalMatches) { Entries = entries; TotalMatches = totalMatches; } } internal static class SectorNetwork { private const byte TaxTokenEventCode = 171; public static bool BroadcastLobbyTaxToken(Rarity rarity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return BroadcastLobbyTaxToken(rarity, 1); } public static bool BroadcastLobbyTaxToken(Rarity rarity, int amount) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected I4, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if (!PhotonNetwork.InRoom) { return false; } return PhotonNetwork.RaiseEvent((byte)171, (object)new object[2] { (int)rarity, amount }, new RaiseEventOptions { Receivers = (ReceiverGroup)1 }, SendOptions.SendReliable); } public static void HandleEvent(EventData photonEvent, SectorOverlayState? state) { //IL_002c: 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) if (photonEvent.Code == 171 && IsFromMasterClient(photonEvent) && TryReadTaxToken(photonEvent.CustomData, out var rarity, out var amount)) { state?.PushToast(SectorAccess.AddTaxTokens(rarity, amount) ? $"Received {amount} {GetRarityName(rarity)} tax token(s)." : "Tax token bank is unavailable right now."); } } private static bool IsFromMasterClient(EventData photonEvent) { if (PhotonNetwork.MasterClient != null) { return photonEvent.Sender == PhotonNetwork.MasterClient.ActorNumber; } return false; } private static bool TryReadTaxToken(object? data, out Rarity rarity, out int amount) { rarity = (Rarity)0; amount = 1; object obj = ((data is object[] array && array.Length != 0) ? array[0] : data); object obj2 = ((data is object[] array2 && array2.Length > 1) ? array2[1] : null); int num2; if (!(obj is byte b)) { if (!(obj is int num)) { return false; } num2 = num; } else { num2 = b; } if (num2 < 0 || num2 > 3) { return false; } rarity = (Rarity)num2; if (obj2 is byte b2) { amount = b2; } else if (obj2 is int num3) { amount = num3; } amount = Mathf.Clamp(amount, 1, 999); return true; } private static string GetRarityName(Rarity rarity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown return (int)rarity switch { 0 => "green", 1 => "blue", 2 => "purple", 3 => "gold", _ => "unknown", }; } } [BepInPlugin("Empress.SpawnBrowser", "Empress Spawn Browser", "4.0.0")] internal sealed class SectorPlugin : BaseUnityPlugin, IOnEventCallback { internal const string PluginGuid = "Empress.SpawnBrowser"; internal const string PluginName = "Empress Spawn Browser"; internal const string PluginVersion = "4.0.0"; private ConfigEntry? _toggleKey; private SectorOverlayState? _state; private SectorCatalog? _catalog; private SectorActions? _actions; private SectorSceneController? _scene; private SectorUi? _ui; private bool _cursorCaptured; private bool _photonCallbacksAttached; private bool _previousCursorVisible; private CursorLockMode _previousCursorLockState; private Texture2D? _sectorCursorTexture; private void Awake() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); _toggleKey = ((BaseUnityPlugin)this).Config.Bind("Input", "ToggleKey", (KeyCode)277, "Toggle the Empress Spawn Browser window."); _state = new SectorOverlayState(); _catalog = new SectorCatalog(((BaseUnityPlugin)this).Logger); _actions = new SectorActions(((BaseUnityPlugin)this).Logger, _state, _catalog); _scene = new SectorSceneController(((BaseUnityPlugin)this).Logger, _state); _ui = new SectorUi(((BaseUnityPlugin)this).Logger, _state, _catalog, _actions, _scene, _toggleKey); ((BaseUnityPlugin)this).Logger.LogInfo((object)"\n ________ __ __ _______ _______ ________ ______ ______ \n/ |/ \\ / |/ \\ / \\ / | / \\ / \\ \n$$$$$$$$/ $$ \\ /$$ |$$$$$$$ |$$$$$$$ |$$$$$$$$/ /$$$$$$ |/$$$$$$ |\n$$ |__ $$$ \\ /$$$ |$$ |__$$ |$$ |__$$ |$$ |__ $$ \\__$$/ $$ \\__$$/ \n$$ | $$$$ /$$$$ |$$ $$/ $$ $$< $$ | $$ \\ $$ \\ \n$$$$$/ $$ $$ $$/$$ |$$$$$$$/ $$$$$$$ |$$$$$/ $$$$$$ | $$$$$$ |\n$$ |_____ $$ |$$$/ $$ |$$ | $$ | $$ |$$ |_____ / \\__$$ |/ \\__$$ |\n$$ |$$ | $/ $$ |$$ | $$ | $$ |$$ |$$ $$/ $$ $$/ \n$$$$$$$$/ $$/ $$/ $$/ $$/ $$/ $$$$$$$$/ $$$$$$/ $$$$$$/ \n"); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Empress Spawn Browser 4.0 loaded. Press {_toggleKey.Value} to open the Empress control suite."); } private void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (_state == null || _actions == null || _scene == null || _toggleKey == null) { return; } bool flag = _ui?.IsCapturingToggleKey ?? false; if (!flag && Input.GetKeyDown(_toggleKey.Value)) { bool num = !_state.Visible; _state.Visible = !_state.Visible; if (num) { _scene.MarkSceneCacheDirty(); } _state.PushToast(_state.Visible ? "Empress Spawn Browser opened." : "Empress Spawn Browser hidden."); } if (_state.Visible && !flag && Input.GetKeyDown((KeyCode)27)) { _state.Visible = false; } _actions.Tick(); _scene.Tick(_state.Visible); UpdatePhotonCallbackState(); if (_state.Visible) { ApplySectorCursor(); } else { RestoreCursorState(); } } private void OnGUI() { _ui?.Draw(); _scene?.DrawOverlay(); } private void OnDisable() { DetachPhotonCallbacks(); } public void OnEvent(EventData photonEvent) { if (_state != null && _state.Visible && PhotonNetwork.InRoom) { SectorNetwork.HandleEvent(photonEvent, _state); } } private void OnDestroy() { DetachPhotonCallbacks(); RestoreCursorState(); _scene?.Reset(); _actions?.ResetLocalPowerState(); } private void UpdatePhotonCallbackState() { if (_state != null && _state.Visible && PhotonNetwork.InRoom) { AttachPhotonCallbacks(); } else { DetachPhotonCallbacks(); } } private void AttachPhotonCallbacks() { if (!_photonCallbacksAttached) { PhotonNetwork.AddCallbackTarget((object)this); _photonCallbacksAttached = true; } } private void DetachPhotonCallbacks() { if (_photonCallbacksAttached) { PhotonNetwork.RemoveCallbackTarget((object)this); _photonCallbacksAttached = false; } } private void CaptureCursorState() { //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 (!_cursorCaptured) { _previousCursorVisible = Cursor.visible; _previousCursorLockState = Cursor.lockState; _cursorCaptured = true; } } private void RestoreCursorState() { //IL_000a: 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_0034: Unknown result type (might be due to invalid IL or missing references) if (_cursorCaptured) { Cursor.SetCursor((Texture2D)null, Vector2.zero, (CursorMode)0); Cursor.visible = _previousCursorVisible; Cursor.lockState = _previousCursorLockState; if ((_previousCursorVisible || (int)_previousCursorLockState == 0) && (Object)(object)MenuCursor.instance != (Object)null) { MenuCursor.instance.Show(); } _cursorCaptured = false; } } private void ApplySectorCursor() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) CaptureCursorState(); EnsureSectorCursorTexture(); SuppressGameCursorSystems(); Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; Cursor.SetCursor(_sectorCursorTexture, new Vector2((float)((Texture)_sectorCursorTexture).width * 0.5f, (float)((Texture)_sectorCursorTexture).height * 0.5f), (CursorMode)0); } private void SuppressGameCursorSystems() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) SectorAccess.SetCursorUnlockTimer(CursorManager.instance, -1234f); if (!((Object)(object)MenuCursor.instance == (Object)null)) { SectorAccess.SetMenuCursorShowTimer(MenuCursor.instance, 0f); SectorAccess.SetMenuCursorOverridePosTimer(MenuCursor.instance, 0f); GameObject menuCursorMesh = SectorAccess.GetMenuCursorMesh(MenuCursor.instance); if ((Object)(object)menuCursorMesh != (Object)null && menuCursorMesh.activeSelf) { menuCursorMesh.SetActive(false); } ((Component)MenuCursor.instance).transform.localScale = Vector3.zero; } } private void EnsureSectorCursorTexture() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_005a: 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_00d6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_sectorCursorTexture != (Object)null) { return; } _sectorCursorTexture = new Texture2D(32, 32, (TextureFormat)4, false) { filterMode = (FilterMode)0, hideFlags = (HideFlags)61 }; for (int i = 0; i < ((Texture)_sectorCursorTexture).height; i++) { for (int j = 0; j < ((Texture)_sectorCursorTexture).width; j++) { float num = (float)j - 15.5f; float num2 = (float)i - 15.5f; float num3 = Mathf.Sqrt(num * num + num2 * num2); Color clear = Color.clear; if (num3 <= 2.25f) { ((Color)(ref clear))..ctor(1f, 0.94f, 0.94f, 1f); } else if (num3 <= 5.2f) { ((Color)(ref clear))..ctor(0.98f, 0.22f, 0.16f, 1f); } else if (num3 <= 7.4f) { ((Color)(ref clear))..ctor(1f, 0.2f, 0.16f, 0.4f); } _sectorCursorTexture.SetPixel(j, i, clear); } } _sectorCursorTexture.Apply(); } } internal sealed class SectorSceneController { private readonly struct PlacementState { public Vector3 Position { get; } public Quaternion Rotation { get; } public PlacementState(Vector3 position, Quaternion rotation) { //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_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) Position = position; Rotation = rotation; } } private const HideFlags RuntimeHideFlags = 61; private const float FreezeRefresh = 0.2f; private const int MaxBrowserEntries = 140; private const int MaxLabelEntries = 48; private const int MaxBoundsEntries = 28; private readonly ManualLogSource _logger; private readonly SectorOverlayState _state; private readonly List _sceneObjects = new List(); private readonly Dictionary> _sceneObjectRefs = new Dictionary>(); private bool _sceneCacheDirty = true; private Transform? _freecamRoot; private Transform? _freecamRestoreParent; private Vector3 _freecamRestoreLocalPosition; private Quaternion _freecamRestoreLocalRotation; private float _freecamYaw; private float _freecamPitch; private bool _freecamActive; private int _copySourceId; private string _copySourceName = string.Empty; private GameObject? _copyPreview; private float _copyDistance = 5f; private float _copyHeightOffset; private Vector3 _copyRotationEuler; private GUIStyle? _overlayLabelStyle; private GUIStyle? _overlayHintStyle; private Texture2D? _overlayLineTexture; private Texture2D? _blueOrbGlowTexture; private Texture2D? _blueOrbCoreTexture; private Texture2D? _orangeOrbGlowTexture; private Texture2D? _orangeOrbCoreTexture; private GameObject? _worldVisualRoot; private Material? _worldLineMaterial; private Material? _worldOrbMaterial; private readonly List _worldLinePool = new List(); private readonly List _worldOrbPool = new List(); private bool IsCopyForgeActive { get { if ((Object)(object)_copyPreview != (Object)null) { return _copySourceId != 0; } return false; } } public SectorSceneController(ManualLogSource logger, SectorOverlayState state) { _logger = logger; _state = state; } public void MarkSceneCacheDirty() { _sceneCacheDirty = true; } public void RefreshSceneCacheNow() { RefreshSceneCache(force: true); _state.PushToast("Scene object browser refreshed."); } public SectorSceneSnapshot GetSnapshot() { EnsureSceneCache(); List list = SemiFunc.LevelPointsGetAll(); int meshObjects = _sceneObjects.Count((SectorSceneObjectInfo info) => info.RendererCount > 0); string modeLabel = (IsCopyForgeActive ? ("COPY FORGE: " + _copySourceName) : (_freecamActive ? "FREECAM ACTIVE" : "SCENE TOOLING READY")); return new SectorSceneSnapshot(_freecamActive, IsCopyForgeActive, _sceneObjects.Count, list?.Count ?? 0, meshObjects, modeLabel); } public SectorSceneQueryResult QueryObjects(string search) { EnsureSceneCache(); IEnumerable source = _sceneObjects; string text = (search ?? string.Empty).Trim(); if (!string.IsNullOrEmpty(text)) { string lowered = text.ToLowerInvariant(); source = source.Where((SectorSceneObjectInfo info) => info.Name.Contains(lowered, StringComparison.OrdinalIgnoreCase) || info.Path.Contains(lowered, StringComparison.OrdinalIgnoreCase) || info.Category.Contains(lowered, StringComparison.OrdinalIgnoreCase)); } List list = source.ToList(); return new SectorSceneQueryResult(list.Take(140).ToList(), list.Count); } public SectorSceneObjectInfo? GetSelectedObject() { if (_state.SelectedSceneObjectId == 0) { return null; } GameObject val = ResolveSceneObject(_state.SelectedSceneObjectId); if (!((Object)(object)val == (Object)null)) { return BuildSceneInfo(val); } return null; } public void Tick(bool menuVisible) { try { if (!SectorGame.IsInPlayableRun()) { SetWorldVisualsVisible(visible: false); if (_freecamActive || IsCopyForgeActive) { Reset(); } return; } if (menuVisible || _freecamActive || IsCopyForgeActive) { KeepPlayerFrozen(); } if (IsCopyForgeActive) { EnsureFreecamCamera(); UpdateFreecamMotion(menuVisible); UpdateCopyForge(menuVisible); } else if (_freecamActive) { EnsureFreecamCamera(); UpdateFreecamMotion(menuVisible); if (!menuVisible && Input.GetKeyDown((KeyCode)27)) { ExitFreecam(); _state.PushToast("Freecam disengaged."); } } else if ((Object)(object)_freecamRoot != (Object)null) { RestoreMainCamera(); } UpdateWorldVisuals(); } catch (Exception ex) { _logger.LogError((object)ex); Reset(); _state.PushToast("Scene tooling hit an error and reset safely."); } } public void DrawOverlay() { if (SectorGame.IsInPlayableRun()) { EnsureOverlayStyles(); if (_freecamActive) { DrawHintBox(IsCopyForgeActive ? ("COPY FORGE: " + _copySourceName + " | Left Click place | Right Click / Esc cancel | Mouse Wheel distance | Q/E rotate | R/F height") : "FREECAM ACTIVE | WASD move | Space / Ctrl vertical | Shift boost | Esc exit | F8 reopen Empress Spawn Browser", 16f); } _ = IsCopyForgeActive; } } public void ToggleFreecam() { if (_freecamActive) { bool isCopyForgeActive = IsCopyForgeActive; ExitFreecam(); _state.PushToast(isCopyForgeActive ? "Copy forge aborted." : "Freecam disengaged."); } else if (!EnsureFreecamCamera()) { _state.PushToast("Main camera is unavailable for freecam."); } else { _freecamActive = true; _state.Visible = false; _state.PushToast("Freecam engaged. Press F8 to reopen Empress Spawn Browser."); } } public void FocusObject(int instanceId) { GameObject val = ResolveSceneObject(instanceId); if ((Object)(object)val == (Object)null) { RefreshSceneCache(force: true); _state.PushToast("That scene object is no longer available."); return; } if (!EnsureFreecamCamera()) { _state.PushToast("Main camera is unavailable for focus jump."); return; } _state.SelectedSceneObjectId = instanceId; _freecamActive = true; PositionFreecamForTarget(val); _state.Visible = false; _state.PushToast("Focused freecam on " + ((Object)val).name + "."); } public void DeleteObject(int instanceId) { GameObject val = ResolveSceneObject(instanceId); if ((Object)(object)val == (Object)null) { RefreshSceneCache(force: true); _state.PushToast("That scene object is already gone."); return; } if (IsProtectedObject(val)) { _state.PushToast(((Object)val).name + " is protected from deletion."); return; } _state.SelectedSceneObjectId = instanceId; try { PhotonView component = val.GetComponent(); if (SemiFunc.IsMultiplayer() && (Object)(object)component != (Object)null) { PhotonNetwork.Destroy(val); } else { Object.Destroy((Object)(object)val); } RefreshSceneCache(force: true); _state.PushToast("Deleted " + ((Object)val).name + "."); } catch (Exception ex) { _logger.LogError((object)ex); _state.PushToast("Could not delete " + ((Object)val).name + "."); } } public void BeginCopyForge(int instanceId) { //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_00f6: 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) GameObject val = ResolveSceneObject(instanceId); if ((Object)(object)val == (Object)null) { RefreshSceneCache(force: true); _state.PushToast("That scene object is no longer available."); return; } if (!HasRenderableGeometry(val)) { _state.PushToast(((Object)val).name + " has no visible mesh data to forge from."); return; } if (SemiFunc.IsMultiplayer()) { _state.PushToast("Copy forge creates a local visual clone in multiplayer right now."); } if (!EnsureFreecamCamera()) { _state.PushToast("Main camera is unavailable for copy forge."); return; } ClearCopyForgeState(); GameObject val2 = CreateVisualClone(val, preview: true); if ((Object)(object)val2 == (Object)null) { _state.PushToast("Could not build a forge preview for " + ((Object)val).name + "."); return; } _state.SelectedSceneObjectId = 0; _copySourceId = instanceId; _copySourceName = ((Object)val).name; _copyPreview = val2; _copyHeightOffset = 0f; Quaternion rotation = val.transform.rotation; _copyRotationEuler = ((Quaternion)(ref rotation)).eulerAngles; _copyDistance = Mathf.Clamp(GetSuggestedDistance(val), 2.2f, 14f); _freecamActive = true; PositionFreecamForTarget(val); _state.Visible = false; _state.PushToast("Copy forge armed for " + ((Object)val).name + "."); } public void Reset() { ClearCopyForgeState(); _freecamActive = false; RestoreMainCamera(); SetWorldVisualsVisible(visible: false); } private void UpdateWorldVisuals() { //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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_053d: 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_028c: 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_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: 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_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: 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_034c: 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) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_037e: 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_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: 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_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: 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_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_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_03fd: 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_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_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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) if (!SectorGame.IsInPlayableRun() || IsCopyForgeActive) { SetWorldVisualsVisible(visible: false); return; } bool flag = _state.SelectedSceneObjectId != 0; if (!(_state.ShowLevelPoints || _state.ShowMeshLabels || _state.ShowMeshBounds || flag)) { SetWorldVisualsVisible(visible: false); return; } EnsureWorldVisualRoot(); SetWorldVisualsVisible(visible: true); int lineIndex = 0; int orbIndex = 0; if (_state.ShowLevelPoints) { HashSet hashSet = new HashSet(); foreach (LevelPoint item2 in EnumerateLevelPointLabels().Take(48)) { if ((Object)(object)item2 == (Object)null) { continue; } AddWorldOrb(ref orbIndex, ((Component)item2).transform.position + Vector3.up * 0.08f, 0.2f); foreach (LevelPoint connectedPoint in item2.ConnectedPoints) { if (!((Object)(object)connectedPoint == (Object)null)) { int instanceID = ((Object)item2).GetInstanceID(); int instanceID2 = ((Object)connectedPoint).GetInstanceID(); uint num = (uint)Mathf.Min(instanceID, instanceID2); uint num2 = (uint)Mathf.Max(instanceID, instanceID2); ulong item = ((ulong)num << 32) | num2; if (hashSet.Add(item)) { AddWorldLine(ref lineIndex, ((Component)item2).transform.position + Vector3.up * 0.06f, ((Component)connectedPoint).transform.position + Vector3.up * 0.06f, new Color(0.35f, 0.84f, 1f, 0.92f), 0.045f); } } } } } if (_state.ShowMeshLabels || _state.ShowMeshBounds) { EnsureSceneCache(); } if (_state.ShowMeshLabels) { Vector3 start = default(Vector3); Vector3 end = default(Vector3); foreach (SectorSceneObjectInfo item3 in _sceneObjects.Where((SectorSceneObjectInfo entry) => entry.RendererCount > 0).Take(48)) { GameObject val = ResolveSceneObject(item3.InstanceId); if (!((Object)(object)val == (Object)null) && TryGetWorldBounds(val, out var bounds)) { ((Vector3)(ref start))..ctor(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).max.y, ((Bounds)(ref bounds)).center.z); ((Vector3)(ref end))..ctor(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).min.y, ((Bounds)(ref bounds)).center.z); AddWorldLine(ref lineIndex, start, end, new Color(1f, 0.42f, 0.18f, 0.9f), 0.03f); Vector3 extents = ((Bounds)(ref bounds)).extents; float num3 = Mathf.Clamp(((Vector3)(ref extents)).magnitude * 0.1f, 0.1f, 0.32f); AddWorldLine(ref lineIndex, ((Bounds)(ref bounds)).center + Vector3.left * num3, ((Bounds)(ref bounds)).center + Vector3.right * num3, new Color(1f, 0.42f, 0.18f, 0.82f), 0.026f); AddWorldLine(ref lineIndex, ((Bounds)(ref bounds)).center + Vector3.forward * num3, ((Bounds)(ref bounds)).center + Vector3.back * num3, new Color(1f, 0.42f, 0.18f, 0.82f), 0.026f); AddWorldLine(ref lineIndex, ((Bounds)(ref bounds)).center + Vector3.up * num3, ((Bounds)(ref bounds)).center + Vector3.down * num3, new Color(1f, 0.42f, 0.18f, 0.82f), 0.026f); } } } if (_state.ShowMeshBounds) { foreach (SectorSceneObjectInfo item4 in _sceneObjects.Where((SectorSceneObjectInfo entry) => entry.RendererCount > 0).Take(28)) { GameObject val2 = ResolveSceneObject(item4.InstanceId); if ((Object)(object)val2 != (Object)null && TryGetWorldBounds(val2, out var bounds2)) { AddWorldBoundsBox(ref lineIndex, ExpandBounds(bounds2), new Color(1f, 0.34f, 0.19f, 0.88f), 0.024f); } } } GameObject val3 = ResolveSceneObject(_state.SelectedSceneObjectId); if ((Object)(object)val3 != (Object)null && TryGetWorldBounds(val3, out var bounds3)) { AddWorldBoundsBox(ref lineIndex, ExpandBounds(bounds3), new Color(1f, 0.92f, 0.36f, 0.96f), 0.032f); } TrimWorldVisualPools(lineIndex, orbIndex); } private void EnsureWorldVisualRoot() { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (!((Object)(object)_worldVisualRoot != (Object)null)) { _worldVisualRoot = new GameObject("EmpressSpawnBrowser.WorldVisuals") { hideFlags = (HideFlags)61, layer = 2 }; Object.DontDestroyOnLoad((Object)(object)_worldVisualRoot); ApplyRuntimeHideFlags(_worldVisualRoot); } } private void SetWorldVisualsVisible(bool visible) { if ((Object)(object)_worldVisualRoot != (Object)null) { _worldVisualRoot.SetActive(visible); } } private void TrimWorldVisualPools(int usedLines, int usedOrbs) { for (int i = usedLines; i < _worldLinePool.Count; i++) { if ((Object)(object)_worldLinePool[i] != (Object)null) { ((Component)_worldLinePool[i]).gameObject.SetActive(false); } } for (int j = usedOrbs; j < _worldOrbPool.Count; j++) { if ((Object)(object)_worldOrbPool[j] != (Object)null) { _worldOrbPool[j].SetActive(false); } } } private void AddWorldOrb(ref int orbIndex, Vector3 position, float scale) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) GameObject orCreateWorldOrb = GetOrCreateWorldOrb(orbIndex++); orCreateWorldOrb.transform.position = position; orCreateWorldOrb.transform.rotation = Quaternion.identity; orCreateWorldOrb.transform.localScale = Vector3.one * scale; orCreateWorldOrb.SetActive(true); } private void AddWorldLine(ref int lineIndex, Vector3 start, Vector3 end, Color color, float width) { //IL_0024: 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_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) LineRenderer orCreateWorldLine = GetOrCreateWorldLine(lineIndex++); ((Component)orCreateWorldLine).gameObject.SetActive(true); orCreateWorldLine.widthMultiplier = width; orCreateWorldLine.startColor = color; orCreateWorldLine.endColor = color; orCreateWorldLine.positionCount = 2; orCreateWorldLine.SetPosition(0, start); orCreateWorldLine.SetPosition(1, end); } private void AddWorldBoundsBox(ref int lineIndex, Bounds bounds, Color color, float width) { //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_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_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_001e: 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_0031: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_007c: 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_008f: 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_00a8: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_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_00da: 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_00dc: 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_00e7: 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_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_00f6: 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_0101: 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_010d: 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_0110: 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: 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_012a: 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_0136: 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_013a: 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_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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0172: Unknown result type (might be due to invalid IL or missing references) Vector3 min = ((Bounds)(ref bounds)).min; Vector3 max = ((Bounds)(ref bounds)).max; Vector3 start = default(Vector3); ((Vector3)(ref start))..ctor(min.x, min.y, min.z); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(min.x, min.y, max.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(min.x, max.y, min.z); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(min.x, max.y, max.z); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(max.x, min.y, min.z); Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(max.x, min.y, max.z); Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(max.x, max.y, min.z); Vector3 end = default(Vector3); ((Vector3)(ref end))..ctor(max.x, max.y, max.z); AddWorldLine(ref lineIndex, start, val, color, width); AddWorldLine(ref lineIndex, start, val2, color, width); AddWorldLine(ref lineIndex, start, val4, color, width); AddWorldLine(ref lineIndex, val, val3, color, width); AddWorldLine(ref lineIndex, val, val5, color, width); AddWorldLine(ref lineIndex, val2, val3, color, width); AddWorldLine(ref lineIndex, val2, val6, color, width); AddWorldLine(ref lineIndex, val4, val5, color, width); AddWorldLine(ref lineIndex, val4, val6, color, width); AddWorldLine(ref lineIndex, val3, end, color, width); AddWorldLine(ref lineIndex, val5, end, color, width); AddWorldLine(ref lineIndex, val6, end, color, width); } private LineRenderer GetOrCreateWorldLine(int index) { //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_0032: 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_0050: 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_00af: Expected O, but got Unknown while (_worldLinePool.Count <= index) { EnsureWorldVisualRoot(); GameObject val = new GameObject($"EmpressSpawnBrowserLine.{_worldLinePool.Count}") { hideFlags = (HideFlags)61, layer = 2 }; val.transform.SetParent(_worldVisualRoot.transform, false); LineRenderer val2 = val.AddComponent(); ((Renderer)val2).sharedMaterial = GetWorldLineMaterial(); val2.useWorldSpace = true; val2.loop = false; val2.alignment = (LineAlignment)0; val2.textureMode = (LineTextureMode)0; val2.numCapVertices = 4; val2.numCornerVertices = 4; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; ((Renderer)val2).motionVectorGenerationMode = (MotionVectorGenerationMode)2; ((Renderer)val2).enabled = true; ApplyRuntimeHideFlags(val); val.SetActive(false); _worldLinePool.Add(val2); } return _worldLinePool[index]; } private GameObject GetOrCreateWorldOrb(int index) { while (_worldOrbPool.Count <= index) { EnsureWorldVisualRoot(); GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = $"EmpressSpawnBrowserLevelPoint.{_worldOrbPool.Count}"; ((Object)val).hideFlags = (HideFlags)61; val.layer = 2; val.transform.SetParent(_worldVisualRoot.transform, false); Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.enabled = false; Object.Destroy((Object)(object)component); } MeshRenderer component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Renderer)component2).sharedMaterial = GetWorldOrbMaterial(); ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; ((Renderer)component2).lightProbeUsage = (LightProbeUsage)0; ((Renderer)component2).reflectionProbeUsage = (ReflectionProbeUsage)0; ((Renderer)component2).motionVectorGenerationMode = (MotionVectorGenerationMode)2; } ApplyRuntimeHideFlags(val); val.SetActive(false); _worldOrbPool.Add(val); } return _worldOrbPool[index]; } private Material GetWorldLineMaterial() { //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_0050: Expected O, but got Unknown if ((Object)(object)_worldLineMaterial != (Object)null) { return _worldLineMaterial; } Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color") ?? Shader.Find("Standard"); _worldLineMaterial = new Material(val) { hideFlags = (HideFlags)61 }; ApplyRuntimeHideFlags((Object)(object)_worldLineMaterial); return _worldLineMaterial; } private Material GetWorldOrbMaterial() { //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_0050: Expected O, but got Unknown //IL_006a: 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_00f0: 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) if ((Object)(object)_worldOrbMaterial != (Object)null) { return _worldOrbMaterial; } Shader val = Shader.Find("Standard") ?? Shader.Find("Unlit/Color") ?? Shader.Find("Sprites/Default"); _worldOrbMaterial = new Material(val) { hideFlags = (HideFlags)61 }; _worldOrbMaterial.color = new Color(0.35f, 0.86f, 1f, 0.96f); if (_worldOrbMaterial.HasProperty("_Color")) { _worldOrbMaterial.SetColor("_Color", new Color(0.35f, 0.86f, 1f, 0.96f)); } if (_worldOrbMaterial.HasProperty("_EmissionColor")) { _worldOrbMaterial.EnableKeyword("_EMISSION"); _worldOrbMaterial.SetColor("_EmissionColor", new Color(0.22f, 0.72f, 1f, 1f) * 1.8f); } ApplyRuntimeHideFlags((Object)(object)_worldOrbMaterial); return _worldOrbMaterial; } private static Bounds ExpandBounds(Bounds bounds) { //IL_0009: 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_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 extents = ((Bounds)(ref bounds)).extents; ((Bounds)(ref bounds)).Expand(Mathf.Max(0.04f, ((Vector3)(ref extents)).magnitude * 0.02f)); return bounds; } private void RefreshSceneCache(bool force = false) { //IL_004e: 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_0053: Unknown result type (might be due to invalid IL or missing references) if (!force && !_sceneCacheDirty && _sceneObjects.Count != 0) { return; } _sceneCacheDirty = false; _sceneObjects.Clear(); _sceneObjectRefs.Clear(); Transform? cameraTransform = GetCameraTransform(); Vector3 anchor = ((cameraTransform != null) ? cameraTransform.position : Vector3.zero); Transform[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (Transform val in array) { GameObject val2 = (((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null); if (!((Object)(object)val2 == (Object)null) && ShouldIncludeObject(val2)) { SectorSceneObjectInfo sectorSceneObjectInfo = BuildSceneInfo(val2); _sceneObjects.Add(sectorSceneObjectInfo); _sceneObjectRefs[sectorSceneObjectInfo.InstanceId] = new WeakReference(val2); } } _sceneObjects.Sort(delegate(SectorSceneObjectInfo left, SectorSceneObjectInfo right) { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) int num = right.Active.CompareTo(left.Active); if (num != 0) { return num; } float num2 = Vector3.SqrMagnitude(left.Position - anchor); float value = Vector3.SqrMagnitude(right.Position - anchor); int num3 = num2.CompareTo(value); return (num3 != 0) ? num3 : string.Compare(left.Path, right.Path, StringComparison.OrdinalIgnoreCase); }); } private void EnsureSceneCache() { if (_sceneCacheDirty || _sceneObjects.Count == 0) { RefreshSceneCache(force: true); } } private static SectorSceneObjectInfo BuildSceneInfo(GameObject gameObject) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) int num = gameObject.GetComponentsInChildren(true).Count((Renderer renderer) => renderer is MeshRenderer || renderer is SkinnedMeshRenderer); bool hasCollider = (Object)(object)gameObject.GetComponentInChildren(true) != (Object)null; bool hasPhotonView = (Object)(object)gameObject.GetComponent() != (Object)null; bool canDelete = !IsProtectedObject(gameObject); bool canCopy = num > 0 && !HasCriticalRole(gameObject); return new SectorSceneObjectInfo(((Object)gameObject).GetInstanceID(), ((Object)gameObject).name, BuildHierarchyPath(gameObject.transform), BuildCategory(gameObject, num), gameObject.transform.position, gameObject.activeInHierarchy, num, hasCollider, hasPhotonView, canDelete, canCopy); } private static string BuildCategory(GameObject gameObject, int rendererCount) { if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Level Point"; } if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Module"; } if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Valuable"; } if ((Object)(object)gameObject.GetComponent() != (Object)null || (Object)(object)gameObject.GetComponent() != (Object)null) { return "Enemy"; } if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Player"; } if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Map Object"; } if ((Object)(object)gameObject.GetComponent() != (Object)null) { return "Empress Spawn Copy"; } if (rendererCount > 0) { if (rendererCount <= 1) { return "Mesh Object"; } return $"Mesh Cluster ({rendererCount})"; } if ((Object)(object)gameObject.GetComponentInChildren(true) != (Object)null) { return "Collider Object"; } return "Scene Object"; } private static string BuildHierarchyPath(Transform transform) { Stack stack = new Stack(); Transform val = transform; while ((Object)(object)val != (Object)null) { stack.Push(((Object)val).name); val = val.parent; } return string.Join("/", stack); } private static bool ShouldIncludeObject(GameObject gameObject) { //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_001a: Unknown result type (might be due to invalid IL or missing references) Scene scene = gameObject.scene; if (!((Scene)(ref scene)).IsValid()) { return false; } if ((((Object)gameObject).hideFlags & 0x3D) != 0) { return false; } if (((Object)gameObject).name.StartsWith("EmpressSpawnCopyForge.", StringComparison.OrdinalIgnoreCase) || ((Object)gameObject).name.StartsWith("EmpressSpawnFreecam.", StringComparison.OrdinalIgnoreCase)) { return false; } if (!((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponentInChildren(true) != (Object)null)) { return (Object)(object)gameObject.GetComponentInChildren(true) != (Object)null; } return true; } private static bool HasCriticalRole(GameObject gameObject) { if (!((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null)) { return (Object)(object)gameObject.GetComponent() != (Object)null; } return true; } private static bool IsProtectedObject(GameObject gameObject) { if (!HasCriticalRole(gameObject) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null) && !((Object)(object)gameObject.GetComponent() != (Object)null)) { return ((Object)gameObject).name.StartsWith("EmpressSpawnBrowser", StringComparison.OrdinalIgnoreCase); } return true; } private static bool HasRenderableGeometry(GameObject gameObject) { return gameObject.GetComponentsInChildren(true).Any((Renderer renderer) => renderer is MeshRenderer || renderer is SkinnedMeshRenderer); } private GameObject? ResolveSceneObject(int instanceId) { if (instanceId == 0) { return null; } if (_sceneObjectRefs.TryGetValue(instanceId, out WeakReference value) && value.TryGetTarget(out var target) && (Object)(object)target != (Object)null) { return target; } GameObject val = (from transform in Object.FindObjectsByType((FindObjectsSortMode)0) select (transform == null) ? null : ((Component)transform).gameObject).FirstOrDefault((Func)((GameObject gameObject) => (Object)(object)gameObject != (Object)null && ((Object)gameObject).GetInstanceID() == instanceId)); if ((Object)(object)val != (Object)null) { _sceneObjectRefs[instanceId] = new WeakReference(val); } return val; } private static IEnumerable EnumerateLevelPointLabels() { List list = SemiFunc.LevelPointsGetAll(); if (list == null) { return Array.Empty(); } return list; } private void KeepPlayerFrozen() { //IL_002b: 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) if (!((Object)(object)PlayerController.instance == (Object)null)) { Rigidbody rb = PlayerController.instance.rb; if ((Object)(object)rb != (Object)null && !rb.isKinematic) { rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; } PlayerController.instance.InputDisable(0.2f); PlayerController.instance.Kinematic(0.2f); GameDirector instance = GameDirector.instance; if (instance != null) { instance.SetDisableInput(0.2f); } } } private bool EnsureFreecamCamera() { //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_0033: Expected O, but got Unknown //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_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_00a5: 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_00cc: 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_010e: 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) Camera activeCamera = GetActiveCamera(); if ((Object)(object)activeCamera == (Object)null) { return false; } if ((Object)(object)_freecamRoot == (Object)null) { GameObject val = new GameObject("EmpressSpawnFreecam.Root") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)(object)val); ApplyRuntimeHideFlags(val); _freecamRoot = val.transform; } if ((Object)(object)((Component)activeCamera).transform.parent != (Object)(object)_freecamRoot) { _freecamRestoreParent = ((Component)activeCamera).transform.parent; _freecamRestoreLocalPosition = ((Component)activeCamera).transform.localPosition; _freecamRestoreLocalRotation = ((Component)activeCamera).transform.localRotation; _freecamRoot.position = ((Component)activeCamera).transform.position; _freecamRoot.rotation = ((Component)activeCamera).transform.rotation; _freecamYaw = _freecamRoot.eulerAngles.y; _freecamPitch = NormalizePitch(_freecamRoot.eulerAngles.x); ((Component)activeCamera).transform.SetParent(_freecamRoot, false); ((Component)activeCamera).transform.localPosition = Vector3.zero; ((Component)activeCamera).transform.localRotation = Quaternion.identity; } return true; } private void RestoreMainCamera() { //IL_0037: 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) Camera activeCamera = GetActiveCamera(); if ((Object)(object)activeCamera != (Object)null && (Object)(object)_freecamRestoreParent != (Object)null) { ((Component)activeCamera).transform.SetParent(_freecamRestoreParent, false); ((Component)activeCamera).transform.localPosition = _freecamRestoreLocalPosition; ((Component)activeCamera).transform.localRotation = _freecamRestoreLocalRotation; } if ((Object)(object)_freecamRoot != (Object)null) { Object.Destroy((Object)(object)((Component)_freecamRoot).gameObject); _freecamRoot = null; } _freecamRestoreParent = null; } private void ExitFreecam() { if (IsCopyForgeActive) { ClearCopyForgeState(); } _freecamActive = false; RestoreMainCamera(); } private void UpdateFreecamMotion(bool menuVisible) { //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_008c: 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_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_00a1: 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_00ac: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //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_00d5: 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_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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0116: 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_013b: 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_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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_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_017e: 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_0185: 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_0194: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_freecamRoot == (Object)null || menuVisible)) { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; _freecamYaw += Input.GetAxisRaw("Mouse X") * 4f; _freecamPitch = Mathf.Clamp(_freecamPitch - Input.GetAxisRaw("Mouse Y") * 4f, -85f, 85f); _freecamRoot.rotation = Quaternion.Euler(_freecamPitch, _freecamYaw, 0f); Vector3 val = Vector3.zero; if (Input.GetKey((KeyCode)119)) { val += Vector3.forward; } if (Input.GetKey((KeyCode)115)) { val += Vector3.back; } if (Input.GetKey((KeyCode)100)) { val += Vector3.right; } if (Input.GetKey((KeyCode)97)) { val += Vector3.left; } if (Input.GetKey((KeyCode)32)) { val += Vector3.up; } if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)99)) { val += Vector3.down; } float num = (Input.GetKey((KeyCode)304) ? 18f : 7f); Vector3 val2 = _freecamRoot.forward * val.z + _freecamRoot.right * val.x + Vector3.up * val.y; Transform? freecamRoot = _freecamRoot; freecamRoot.position += val2 * num * Time.unscaledDeltaTime; } } private void PositionFreecamForTarget(GameObject target) { //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_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) //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_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_007b: 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_0080: 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_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_009a: 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_00c5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_freecamRoot == (Object)null)) { Vector3 val = target.transform.position; float num = 1.8f; Vector3 val2; if (TryGetWorldBounds(target, out var bounds)) { val = ((Bounds)(ref bounds)).center; val2 = ((Bounds)(ref bounds)).extents; num = Mathf.Clamp(((Vector3)(ref val2)).magnitude, 1.5f, 7f); } val2 = _freecamRoot.forward; Vector3 val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? _freecamRoot.forward : Vector3.forward); _freecamRoot.position = val - val3 * (num + 2.8f) + Vector3.up * Mathf.Max(1.1f, num * 0.45f); _freecamRoot.LookAt(val); _freecamYaw = _freecamRoot.eulerAngles.y; _freecamPitch = NormalizePitch(_freecamRoot.eulerAngles.x); } } private void UpdateCopyForge(bool menuVisible) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_copyPreview == (Object)null) { ClearCopyForgeState(); } else if (!menuVisible) { HandleCopyPlacementInput(); PlacementState placementState = GetPlacementState(_copyPreview); _copyPreview.transform.SetPositionAndRotation(placementState.Position, placementState.Rotation); if (Input.GetMouseButtonDown(1) || Input.GetKeyDown((KeyCode)27)) { ClearCopyForgeState(); ExitFreecam(); _state.PushToast("Copy forge canceled."); } else if (Input.GetMouseButtonDown(0)) { PlaceCopyClone(placementState); } } } private void HandleCopyPlacementInput() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _copyDistance = Mathf.Clamp(_copyDistance + Input.mouseScrollDelta.y * 0.65f, 1.5f, 20f); if (Input.GetKeyDown((KeyCode)113)) { _copyRotationEuler.y -= 15f; } if (Input.GetKeyDown((KeyCode)101)) { _copyRotationEuler.y += 15f; } if (Input.GetKey((KeyCode)114)) { _copyHeightOffset += 1.6f * Time.unscaledDeltaTime; } if (Input.GetKey((KeyCode)102)) { _copyHeightOffset -= 1.6f * Time.unscaledDeltaTime; } } private void PlaceCopyClone(PlacementState placement) { //IL_006e: 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) GameObject val = ResolveSceneObject(_copySourceId); if ((Object)(object)val == (Object)null) { ClearCopyForgeState(); ExitFreecam(); _state.PushToast("The source object vanished before placement."); return; } GameObject val2 = CreateVisualClone(val, preview: false); if ((Object)(object)val2 == (Object)null) { _state.PushToast("Could not place a copy of " + ((Object)val).name + "."); return; } val2.transform.SetPositionAndRotation(placement.Position, placement.Rotation); ((Object)val2).name = "EmpressSpawnCopy." + ((Object)val).name; _state.SelectedSceneObjectId = 0; RefreshSceneCache(force: true); ClearCopyForgeState(); ExitFreecam(); _state.PushToast("Placed a copy of " + ((Object)val).name + "."); } private GameObject? CreateVisualClone(GameObject source, bool preview) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00db: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_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_0104: 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_0116: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_027d: 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_0260: 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) GameObject val = new GameObject(preview ? "EmpressSpawnCopyForge.Preview" : ("EmpressSpawnCopy." + ((Object)source).name)); if (preview) { ((Object)val).hideFlags = (HideFlags)61; } val.transform.position = source.transform.position; val.transform.rotation = source.transform.rotation; val.transform.localScale = Vector3.one; Vector3 position = source.transform.position; Quaternion rotation = source.transform.rotation; int num = 0; Renderer[] componentsInChildren = source.GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (!(val2 is MeshRenderer) && !(val2 is SkinnedMeshRenderer)) { continue; } GameObject val3 = new GameObject(((Object)((Component)val2).gameObject).name); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = Quaternion.Inverse(rotation) * (((Component)val2).transform.position - position); val3.transform.localRotation = Quaternion.Inverse(rotation) * ((Component)val2).transform.rotation; val3.transform.localScale = ((Component)val2).transform.lossyScale; MeshRenderer val4 = (MeshRenderer)(object)((val2 is MeshRenderer) ? val2 : null); if (val4 != null) { MeshFilter component = ((Component)val4).GetComponent(); if ((Object)(object)((component != null) ? component.sharedMesh : null) == (Object)null) { Object.Destroy((Object)(object)val3); continue; } val3.AddComponent().sharedMesh = component.sharedMesh; MeshRenderer val5 = val3.AddComponent(); ((Renderer)val5).sharedMaterials = (Material[])(preview ? ((Array)CreatePreviewMaterials(((Renderer)val4).sharedMaterials)) : ((Array)((Renderer)val4).sharedMaterials)); if (preview) { ((Renderer)val5).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val5).receiveShadows = false; } num++; continue; } SkinnedMeshRenderer val6 = (SkinnedMeshRenderer)(object)((val2 is SkinnedMeshRenderer) ? val2 : null); if (val6 != null) { Mesh val7 = new Mesh(); val6.BakeMesh(val7); val3.AddComponent().sharedMesh = val7; MeshRenderer val8 = val3.AddComponent(); ((Renderer)val8).sharedMaterials = (Material[])(preview ? ((Array)CreatePreviewMaterials(((Renderer)val6).sharedMaterials)) : ((Array)((Renderer)val6).sharedMaterials)); if (preview) { ((Renderer)val8).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val8).receiveShadows = false; } num++; } } if (num == 0) { Object.Destroy((Object)(object)val); return null; } if (!preview) { if (TryGetLocalBounds(val, out var bounds)) { BoxCollider obj = val.AddComponent(); obj.center = ((Bounds)(ref bounds)).center; obj.size = ((Bounds)(ref bounds)).size; } Rigidbody obj2 = val.AddComponent(); obj2.velocity = Vector3.zero; obj2.angularVelocity = Vector3.zero; obj2.isKinematic = true; obj2.useGravity = false; val.AddComponent().SourceName = ((Object)source).name; } else { ApplyRuntimeHideFlags(val); } return val; } private static Material[] CreatePreviewMaterials(Material[] sourceMaterials) { if (sourceMaterials == null || sourceMaterials.Length == 0) { return (Material[])(object)new Material[1] { CreatePreviewMaterial(null) }; } Material[] array = (Material[])(object)new Material[sourceMaterials.Length]; for (int i = 0; i < sourceMaterials.Length; i++) { array[i] = CreatePreviewMaterial(sourceMaterials[i]); } return array; } private static Material CreatePreviewMaterial(Material? sourceMaterial) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0055: 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_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) Material val = new Material(Shader.Find("Standard")); Color color = default(Color); ((Color)(ref color))..ctor(0.96f, 0.38f, 0.2f, 0.28f); if ((Object)(object)sourceMaterial != (Object)null && sourceMaterial.HasProperty("_Color")) { color = sourceMaterial.color; color.a = 0.28f; } val.color = color; val.SetFloat("_Mode", 3f); val.SetInt("_SrcBlend", 5); val.SetInt("_DstBlend", 10); val.SetInt("_ZWrite", 0); val.DisableKeyword("_ALPHATEST_ON"); val.EnableKeyword("_ALPHABLEND_ON"); val.DisableKeyword("_ALPHAPREMULTIPLY_ON"); val.renderQueue = 3000; if (val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", new Color(0.14f, 0.04f, 0.03f, 1f)); } ApplyRuntimeHideFlags((Object)(object)val); return val; } private float GetSuggestedDistance(GameObject target) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (TryGetWorldBounds(target, out var bounds)) { Vector3 extents = ((Bounds)(ref bounds)).extents; return ((Vector3)(ref extents)).magnitude * 1.35f; } return 5f; } private PlacementState GetPlacementState(GameObject movingObject) { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00ac: 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_0071: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) Camera activeCamera = GetActiveCamera(); if ((Object)(object)activeCamera == (Object)null) { return new PlacementState(movingObject.transform.position, movingObject.transform.rotation); } Vector3 val = ((Component)activeCamera).transform.position + ((Component)activeCamera).transform.forward * _copyDistance; if (TryGetPlacementHit(movingObject, out var hitInfo)) { val = ((RaycastHit)(ref hitInfo)).point; } if (TryGetLocalBounds(movingObject, out var bounds)) { val += Vector3.up * (0f - ((Bounds)(ref bounds)).min.y); } val += Vector3.up * _copyHeightOffset; return new PlacementState(val, Quaternion.Euler(_copyRotationEuler)); } private bool TryGetPlacementHit(GameObject movingObject, out RaycastHit hitInfo) { //IL_0001: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b6: Unknown result type (might be due to invalid IL or missing references) hitInfo = default(RaycastHit); Camera activeCamera = GetActiveCamera(); if ((Object)(object)activeCamera == (Object)null) { return false; } RaycastHit[] array = Physics.RaycastAll(new Ray(((Component)activeCamera).transform.position, ((Component)activeCamera).transform.forward), Mathf.Max(14f, _copyDistance + 5f), -1, (QueryTriggerInteraction)2); if (array.Length == 0) { return false; } foreach (RaycastHit item in array.OrderBy((RaycastHit item) => ((RaycastHit)(ref item)).distance)) { RaycastHit current = item; if (!((Object)(object)((RaycastHit)(ref current)).collider == (Object)null) && !((Component)((RaycastHit)(ref current)).collider).transform.IsChildOf(movingObject.transform)) { hitInfo = current; return true; } } return false; } private void DrawDebugVisuals() { //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: 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_0073: 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_0423: 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_0214: 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_0233: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: 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_0380: 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_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_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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) if (IsCopyForgeActive) { return; } if (_state.ShowLevelPoints) { HashSet hashSet = new HashSet(); foreach (LevelPoint item2 in EnumerateLevelPointLabels().Take(48)) { if ((Object)(object)item2 == (Object)null) { continue; } DrawWorldCross(((Component)item2).transform.position, 0.16f, new Color(0.38f, 0.9f, 1f, 0.55f), 1.4f); foreach (LevelPoint connectedPoint in item2.ConnectedPoints) { if (!((Object)(object)connectedPoint == (Object)null)) { int instanceID = ((Object)item2).GetInstanceID(); int instanceID2 = ((Object)connectedPoint).GetInstanceID(); uint num = (uint)Mathf.Min(instanceID, instanceID2); uint num2 = (uint)Mathf.Max(instanceID, instanceID2); ulong item = ((ulong)num << 32) | num2; if (hashSet.Add(item)) { DrawWorldConnection(((Component)item2).transform.position + Vector3.up * 0.06f, ((Component)connectedPoint).transform.position + Vector3.up * 0.06f, new Color(0.35f, 0.84f, 1f, 0.76f), 2.25f); } } } } } if (_state.ShowMeshLabels) { EnsureSceneCache(); Vector3 worldStart = default(Vector3); Vector3 worldEnd = default(Vector3); foreach (SectorSceneObjectInfo item3 in _sceneObjects.Where((SectorSceneObjectInfo entry) => entry.RendererCount > 0).Take(48)) { GameObject val = ResolveSceneObject(item3.InstanceId); if (!((Object)(object)val == (Object)null) && TryGetWorldBounds(val, out var bounds)) { ((Vector3)(ref worldStart))..ctor(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).max.y, ((Bounds)(ref bounds)).center.z); ((Vector3)(ref worldEnd))..ctor(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).min.y, ((Bounds)(ref bounds)).center.z); DrawWorldConnection(worldStart, worldEnd, new Color(1f, 0.42f, 0.18f, 0.78f), 2f); Vector3 center = ((Bounds)(ref bounds)).center; Vector3 extents = ((Bounds)(ref bounds)).extents; DrawWorldCross(center, Mathf.Clamp(((Vector3)(ref extents)).magnitude * 0.1f, 0.1f, 0.32f), new Color(1f, 0.42f, 0.18f, 0.62f), 1.5f); } } } if (_state.ShowMeshBounds) { EnsureSceneCache(); foreach (SectorSceneObjectInfo item4 in _sceneObjects.Where((SectorSceneObjectInfo entry) => entry.RendererCount > 0).Take(28)) { GameObject val2 = ResolveSceneObject(item4.InstanceId); if ((Object)(object)val2 != (Object)null && TryGetWorldBounds(val2, out var bounds2)) { DrawProjectedBounds(bounds2, new Color(1f, 0.34f, 0.19f, 0.82f), 1.8f); } } } GameObject val3 = ResolveSceneObject(_state.SelectedSceneObjectId); if ((Object)(object)val3 != (Object)null && TryGetWorldBounds(val3, out var bounds3)) { DrawProjectedBounds(bounds3, new Color(1f, 0.92f, 0.36f, 0.94f), 2.2f); } if ((Object)(object)_copyPreview != (Object)null && TryGetWorldBounds(_copyPreview, out var bounds4)) { DrawProjectedBounds(bounds4, new Color(1f, 0.4f, 0.2f, 0.96f), 2.25f); } } private void DrawWorldCross(Vector3 position, float size, Color color, float thickness) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: 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_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_0079: Unknown result type (might be due to invalid IL or missing references) DrawWorldConnection(position + Vector3.left * size, position + Vector3.right * size, color, thickness); DrawWorldConnection(position + Vector3.forward * size, position + Vector3.back * size, color, thickness); DrawWorldConnection(position + Vector3.up * size, position + Vector3.down * size, color, thickness); } private void DrawWorldConnection(Vector3 worldStart, Vector3 worldEnd, Color color, float thickness) { //IL_0001: 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_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_001a: Unknown result type (might be due to invalid IL or missing references) if (TryGetGuiPoint(worldStart, out var guiPoint) && TryGetGuiPoint(worldEnd, out var guiPoint2)) { DrawScreenLine(guiPoint, guiPoint2, color, thickness); } } private void DrawProjectedBounds(Bounds bounds, Color color, float thickness) { //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_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: 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_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0117: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_01f3: 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_0202: 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) //IL_0218: 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_0224: 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_0235: 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) Vector3 min = ((Bounds)(ref bounds)).min; Vector3 max = ((Bounds)(ref bounds)).max; Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(min.x, min.y, min.z), new Vector3(min.x, min.y, max.z), new Vector3(min.x, max.y, min.z), new Vector3(min.x, max.y, max.z), new Vector3(max.x, min.y, min.z), new Vector3(max.x, min.y, max.z), new Vector3(max.x, max.y, min.z), new Vector3(max.x, max.y, max.z) }; Vector2[] array2 = (Vector2[])(object)new Vector2[8]; for (int i = 0; i < array.Length; i++) { if (!TryGetGuiPoint(array[i], out array2[i])) { return; } } DrawScreenLine(array2[0], array2[1], color, thickness); DrawScreenLine(array2[0], array2[2], color, thickness); DrawScreenLine(array2[0], array2[4], color, thickness); DrawScreenLine(array2[1], array2[3], color, thickness); DrawScreenLine(array2[1], array2[5], color, thickness); DrawScreenLine(array2[2], array2[3], color, thickness); DrawScreenLine(array2[2], array2[6], color, thickness); DrawScreenLine(array2[4], array2[5], color, thickness); DrawScreenLine(array2[4], array2[6], color, thickness); DrawScreenLine(array2[3], array2[7], color, thickness); DrawScreenLine(array2[5], array2[7], color, thickness); DrawScreenLine(array2[6], array2[7], color, thickness); } private static bool TryGetWorldBounds(GameObject target, out Bounds bounds) { //IL_0001: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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) bounds = default(Bounds); bool flag = false; Renderer[] componentsInChildren = target.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } if (flag) { return true; } Collider[] componentsInChildren2 = target.GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren2) { if (!flag) { bounds = val2.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val2.bounds); } } return flag; } private static bool TryGetLocalBounds(GameObject target, out Bounds bounds) { //IL_0001: 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_0057: Unknown result type (might be due to invalid IL or missing references) bounds = default(Bounds); bool hasBounds = false; Renderer[] componentsInChildren = target.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { EncapsulateLocalBounds(target.transform, val.bounds, ref bounds, ref hasBounds); } if (hasBounds) { return true; } Collider[] componentsInChildren2 = target.GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren2) { EncapsulateLocalBounds(target.transform, val2.bounds, ref bounds, ref hasBounds); } return hasBounds; } private static void EncapsulateLocalBounds(Transform root, Bounds worldBounds, ref Bounds localBounds, ref bool hasBounds) { //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_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: 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_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_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_010d: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0125: 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) Vector3 min = ((Bounds)(ref worldBounds)).min; Vector3 max = ((Bounds)(ref worldBounds)).max; Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(min.x, min.y, min.z), new Vector3(min.x, min.y, max.z), new Vector3(min.x, max.y, min.z), new Vector3(min.x, max.y, max.z), new Vector3(max.x, min.y, min.z), new Vector3(max.x, min.y, max.z), new Vector3(max.x, max.y, min.z), new Vector3(max.x, max.y, max.z) }; foreach (Vector3 val in array) { Vector3 val2 = root.InverseTransformPoint(val); if (!hasBounds) { localBounds = new Bounds(val2, Vector3.zero); hasBounds = true; } else { ((Bounds)(ref localBounds)).Encapsulate(val2); } } } private void ClearCopyForgeState() { //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) if ((Object)(object)_copyPreview != (Object)null) { Object.Destroy((Object)(object)_copyPreview); _copyPreview = null; } _copySourceId = 0; _copySourceName = string.Empty; _copyDistance = 5f; _copyHeightOffset = 0f; _copyRotationEuler = Vector3.zero; _state.SelectedSceneObjectId = 0; } private static void ApplyRuntimeHideFlags(GameObject root) { Transform[] componentsInChildren = root.GetComponentsInChildren(true); foreach (Transform obj in componentsInChildren) { GameObject gameObject = ((Component)obj).gameObject; ((Object)gameObject).hideFlags = (HideFlags)61; ((Object)obj).hideFlags = (HideFlags)61; Component[] components = gameObject.GetComponents(); foreach (Component val in components) { if ((Object)(object)val != (Object)null) { ((Object)val).hideFlags = (HideFlags)61; } } } } private static void ApplyRuntimeHideFlags(Object unityObject) { if (unityObject != (Object)null) { unityObject.hideFlags = (HideFlags)61; } } private Camera? GetActiveCamera() { if (!((Object)(object)GameDirector.instance?.MainCamera != (Object)null)) { return Camera.main; } return GameDirector.instance.MainCamera; } private Transform? GetCameraTransform() { Camera? activeCamera = GetActiveCamera(); if (activeCamera == null) { return null; } return ((Component)activeCamera).transform; } private void DrawWorldLabel(Vector3 worldPosition, string text, Color color) { //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_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_0027: 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_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_005b: 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) Camera activeCamera = GetActiveCamera(); if (!((Object)(object)activeCamera == (Object)null)) { Vector3 val = activeCamera.WorldToScreenPoint(worldPosition); if (!(val.z <= 0f)) { Rect val2 = new Rect(val.x - 110f, (float)Screen.height - val.y - 10f, 220f, 20f); Color color2 = GUI.color; GUI.color = color; GUI.Label(val2, text, _overlayLabelStyle); GUI.color = color2; } } } private void DrawWorldOrb(Vector3 worldPosition, Texture2D glowTexture, Texture2D coreTexture, float glowSize, float coreSize, Color glowColor, Color coreColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0070: Unknown result type (might be due to invalid IL or missing references) if (TryGetGuiPoint(worldPosition, out var guiPoint)) { Color color = GUI.color; GUI.color = glowColor; GUI.DrawTexture(new Rect(guiPoint.x - glowSize * 0.5f, guiPoint.y - glowSize * 0.5f, glowSize, glowSize), (Texture)(object)glowTexture, (ScaleMode)0, true); GUI.color = coreColor; GUI.DrawTexture(new Rect(guiPoint.x - coreSize * 0.5f, guiPoint.y - coreSize * 0.5f, coreSize, coreSize), (Texture)(object)coreTexture, (ScaleMode)0, true); GUI.color = color; } } private bool TryGetGuiPoint(Vector3 worldPosition, out Vector2 guiPoint) { //IL_0001: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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) guiPoint = default(Vector2); Camera activeCamera = GetActiveCamera(); if ((Object)(object)activeCamera == (Object)null) { return false; } Vector3 val = activeCamera.WorldToScreenPoint(worldPosition); if (val.z <= 0f) { return false; } guiPoint = new Vector2(val.x, (float)Screen.height - val.y); return true; } private void DrawScreenLine(Vector2 start, Vector2 end, Color color, float thickness) { //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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_0031: 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_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_0055: Unknown result type (might be due to invalid IL or missing references) Color color2 = GUI.color; Matrix4x4 matrix = GUI.matrix; Vector2 val = end - start; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; float magnitude = ((Vector2)(ref val)).magnitude; GUI.color = color; GUIUtility.RotateAroundPivot(num, start); GUI.DrawTexture(new Rect(start.x, start.y - thickness * 0.5f, magnitude, thickness), (Texture)(object)_overlayLineTexture); GUI.matrix = matrix; GUI.color = color2; } private void EnsureOverlayStyles() { //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_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_003c: Expected O, but got Unknown //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00ac: Expected O, but got Unknown //IL_00b1: Expected O, but got Unknown //IL_00b2: 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_0108: 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_0168: Unknown result type (might be due to invalid IL or missing references) if (_overlayLabelStyle == null || _overlayHintStyle == null) { _overlayLabelStyle = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 12, fontStyle = (FontStyle)1 }; GUIStyle val = new GUIStyle(GUI.skin.box) { alignment = (TextAnchor)3, fontSize = 12, wordWrap = true }; val.normal.textColor = Color.white; val.normal.background = MakeTexture(new Color(0.08f, 0.08f, 0.09f, 0.92f)); val.padding = new RectOffset(12, 12, 8, 8); _overlayHintStyle = val; _overlayLineTexture = MakeTexture(Color.white); _blueOrbGlowTexture = MakeRadialTexture(32, new Color(1f, 1f, 1f, 0.65f), 0.28f, 1f); _blueOrbCoreTexture = MakeRadialTexture(32, new Color(1f, 1f, 1f, 1f), 0.02f, 0.2f); _orangeOrbGlowTexture = MakeRadialTexture(32, new Color(1f, 1f, 1f, 0.55f), 0.22f, 1f); _orangeOrbCoreTexture = MakeRadialTexture(32, new Color(1f, 1f, 1f, 1f), 0.02f, 0.18f); } } private void DrawHintBox(string text, float y) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) GUI.Box(new Rect(16f, y, Mathf.Min(760f, (float)Screen.width - 32f), 36f), text, _overlayHintStyle); } private static Texture2D MakeTexture(Color color) { //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_0011: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, color); val.Apply(); return val; } private static Texture2D MakeRadialTexture(int size, Color color, float innerRadius, float outerRadius) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61, filterMode = (FilterMode)1 }; float num = (float)(size - 1) * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = ((float)j - num) / num; float num3 = ((float)i - num) / num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.InverseLerp(outerRadius, innerRadius, num4); val.SetPixel(j, i, new Color(color.r, color.g, color.b, color.a * num5)); } } val.Apply(); return val; } private static float NormalizePitch(float rawPitch) { float num = rawPitch; if (num > 180f) { num -= 360f; } return Mathf.Clamp(num, -85f, 85f); } } internal sealed class SectorPlacedCopyMarker : MonoBehaviour { public string SourceName = string.Empty; } internal sealed class SectorUi { private const float SidebarWidth = 214f; private const float SidebarTabHeight = 96f; private static readonly KeyCode[][] ToggleKeyPresetRows; private readonly ManualLogSource _logger; private readonly SectorOverlayState _state; private readonly SectorCatalog _catalog; private readonly SectorActions _actions; private readonly SectorSceneController _scene; private readonly ConfigEntry _toggleKeyEntry; private SectorStyles? _styles; internal bool IsCapturingToggleKey => _state.ToggleKeyCaptureActive; public SectorUi(ManualLogSource logger, SectorOverlayState state, SectorCatalog catalog, SectorActions actions, SectorSceneController scene, ConfigEntry toggleKeyEntry) { _logger = logger; _state = state; _catalog = catalog; _actions = actions; _scene = scene; _toggleKeyEntry = toggleKeyEntry; } public void Draw() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0046: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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) if (!_state.Visible) { return; } EnsureStyles(); ClampWindowToScreen(); Color color = GUI.color; Color backgroundColor = GUI.backgroundColor; Color contentColor = GUI.contentColor; bool enabled = GUI.enabled; try { GUI.color = Color.white; GUI.backgroundColor = Color.white; GUI.contentColor = Color.white; GUI.enabled = true; _state.WindowRect = GUI.Window(418421, _state.WindowRect, new WindowFunction(DrawWindow), GUIContent.none, _styles.Window); ClampWindowToScreen(); DrawFlashMessage(); } catch (Exception ex) { _logger.LogError((object)ex); } finally { GUI.color = color; GUI.backgroundColor = backgroundColor; GUI.contentColor = contentColor; GUI.enabled = enabled; } } private void DrawWindow(int id) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) HandleToggleKeyCapture(Event.current); GUILayout.BeginVertical(Array.Empty()); DrawHeader(); GUILayout.Space(12f); float bodyHeight = GetBodyHeight(); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(bodyHeight) }); DrawTabs(bodyHeight); GUILayout.Space(12f); GUILayout.BeginVertical(_styles.Panel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(bodyHeight) }); switch (_state.ActiveTab) { case SectorTab.Ops: DrawOpsTab(); break; case SectorTab.Spawn: DrawSpawnTab(); break; case SectorTab.Players: DrawPlayersTab(); break; case SectorTab.World: DrawWorldTab(); break; case SectorTab.Scene: DrawSceneTab(); break; } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _state.WindowRect)).width, 52f)); } private void DrawHeader() { //IL_016e: Unknown result type (might be due to invalid IL or missing references) SectorStyles styles = _styles; GUILayout.BeginVertical(styles.Header, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label("SPAWN BROWSER", styles.Title, Array.Empty()); GUILayout.Label("Empress control suite for R.E.P.O.", styles.Subtitle, Array.Empty()); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); SectorRuntimeSnapshot snapshot = _actions.GetSnapshot(); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f) }); DrawHeaderPill(snapshot.InRun ? ("LIVE RUN: " + snapshot.LevelName) : "NO ACTIVE RUN", snapshot.InRun ? styles.PillActive : styles.PillMuted); GUILayout.Space(6f); DrawHeaderPill(snapshot.IsHost ? "HOST / SINGLEPLAYER AUTHORITY" : "CLIENT MODE", snapshot.IsHost ? styles.PillAccent : styles.PillMuted); GUILayout.EndVertical(); GUILayout.Space(10f); if (GUILayout.Button("X", styles.DangerButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(32f) })) { _state.Visible = false; } GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Toggle: " + FormatKeyCode(_toggleKeyEntry.Value), styles.MicroLabel, Array.Empty()); GUILayout.Space(8f); if (GUILayout.Button(_state.ToggleKeyCaptureActive ? "Press A Key..." : "Rebind", _state.ToggleKeyCaptureActive ? styles.AccentButton : styles.SubtleButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(132f), GUILayout.Height(26f) })) { _state.ToggleKeyCaptureActive = !_state.ToggleKeyCaptureActive; _state.ToggleKeyPresetPickerOpen = false; _state.PushToast(_state.ToggleKeyCaptureActive ? "Press a key to rebind Empress Spawn Browser. Press Escape to cancel." : "Toggle key capture cancelled."); } GUILayout.Space(8f); if (GUILayout.Button(_state.ToggleKeyPresetPickerOpen ? "Hide Key List" : "Key List", styles.SubtleButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(116f), GUILayout.Height(26f) })) { _state.ToggleKeyPresetPickerOpen = !_state.ToggleKeyPresetPickerOpen; if (_state.ToggleKeyPresetPickerOpen) { _state.ToggleKeyCaptureActive = false; } } GUILayout.Space(12f); GUILayout.Label("Empress Signature", styles.MicroLabel, Array.Empty()); GUILayout.EndHorizontal(); if (_state.ToggleKeyCaptureActive) { GUILayout.Space(8f); GUILayout.Label("Waiting for keyboard input. Press Escape to cancel.", styles.MicroLabel, Array.Empty()); } if (_state.ToggleKeyPresetPickerOpen) { DrawToggleKeyPresetPicker(); } GUILayout.EndVertical(); } private void DrawToggleKeyPresetPicker() { //IL_0079: 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_00d3: Unknown result type (might be due to invalid IL or missing references) SectorStyles styles = _styles; GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Toggle Key Presets", styles.SectionTitle, Array.Empty()); GUILayout.Label("Pick a quick preset or use Rebind and press the exact key you want.", styles.SectionBody, Array.Empty()); GUILayout.Space(8f); KeyCode[][] toggleKeyPresetRows = ToggleKeyPresetRows; foreach (KeyCode[] obj in toggleKeyPresetRows) { GUILayout.BeginHorizontal(Array.Empty()); KeyCode[] array = obj; for (int j = 0; j < array.Length; j++) { KeyCode val = array[j]; bool flag = _toggleKeyEntry.Value == val; if (GUILayout.Button(((object)(KeyCode)(ref val)).ToString(), flag ? styles.AccentButton : styles.SubtleButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(96f), GUILayout.Height(28f) })) { SetToggleKey(val); } } GUILayout.EndHorizontal(); GUILayout.Space(6f); } GUILayout.EndVertical(); } private float GetBodyHeight() { float num = 184f; if (_state.ToggleKeyCaptureActive) { num += 24f; } if (_state.ToggleKeyPresetPickerOpen) { num += 154f; } return Mathf.Max(280f, ((Rect)(ref _state.WindowRect)).height - num); } private void HandleToggleKeyCapture(Event currentEvent) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (_state.ToggleKeyCaptureActive && currentEvent != null && (int)currentEvent.type == 4 && (int)currentEvent.keyCode != 0) { currentEvent.Use(); if ((int)currentEvent.keyCode == 27) { _state.ToggleKeyCaptureActive = false; _state.PushToast("Toggle key capture cancelled."); } else if (!IsModifierKey(currentEvent.keyCode)) { SetToggleKey(currentEvent.keyCode); } } } private void SetToggleKey(KeyCode keyCode) { //IL_0006: 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) _toggleKeyEntry.Value = keyCode; ((ConfigEntryBase)_toggleKeyEntry).ConfigFile.Save(); _state.ToggleKeyCaptureActive = false; _state.ToggleKeyPresetPickerOpen = false; _state.PushToast("Empress Spawn Browser toggle key set to " + FormatKeyCode(keyCode) + "."); } private static bool IsModifierKey(KeyCode keyCode) { //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_0008: Invalid comparison between Unknown and I4 if (keyCode - 303 <= 7) { return true; } return false; } private static string FormatKeyCode(KeyCode keyCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if ((int)keyCode == 0) { return "Unbound"; } return ((object)(KeyCode)(ref keyCode)).ToString(); } private void DrawTabs(float bodyHeight) { SectorStyles styles = _styles; float height = Mathf.Clamp((bodyHeight - 78f) / 5f, 62f, 96f); GUILayout.BeginVertical(styles.Sidebar, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(214f), GUILayout.Height(bodyHeight) }); DrawTabButton(SectorTab.Ops, "Ops Deck", "Status, powers, quick actions, command deck", height); DrawTabButton(SectorTab.Spawn, "Spawn Forge", "Enemies, items, valuables, searchable catalog", height); DrawTabButton(SectorTab.Players, "Crew Board", "Health, revives, refills, local power tuning", height); DrawTabButton(SectorTab.World, "World Rail", "Threat control, valuables, enemy flow tools", height); DrawTabButton(SectorTab.Scene, "Scene Rail", "Freecam, level points, mesh overlays, object browser", height); GUILayout.FlexibleSpace(); GUILayout.Label("Empress Spawn Browser favors host-safe world actions and keeps local powers obvious and fast.", styles.SidebarNote, Array.Empty()); GUILayout.EndVertical(); } private void DrawOpsTab() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) SectorStyles styles = _styles; SectorRuntimeSnapshot snapshot = _actions.GetSnapshot(); _state.OpsScroll = GUILayout.BeginScrollView(_state.OpsScroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); DrawStatCard("Players", snapshot.Players.ToString(), $"{snapshot.AlivePlayers} active / {snapshot.DeadPlayers} down"); DrawStatCard("Enemies", snapshot.Enemies.ToString(), snapshot.NoAggroEnabled ? "vision disabled" : "vision live"); DrawStatCard("Valuables", snapshot.Valuables.ToString(), "physical haulables in scene"); DrawStatCard("Catalog", (_catalog.EnemyCount + _catalog.ItemCount + _catalog.ValuableCount + _catalog.CosmeticBoxCount).ToString(), $"{_catalog.EnemyCount}E / {_catalog.ItemCount}I / {_catalog.ValuableCount}V / {_catalog.CosmeticBoxCount}B"); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Local Power Stack", styles.SectionTitle, Array.Empty()); GUILayout.Label("These are applied to your local avatar each frame while enabled.", styles.SectionBody, Array.Empty()); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); DrawToggleButton("God Mode", _state.GodMode, delegate { _actions.SetGodMode(!_state.GodMode); }); DrawToggleButton("Infinite Energy", _state.InfiniteEnergy, delegate { _actions.SetInfiniteEnergy(!_state.InfiniteEnergy); }); DrawToggleButton("Infinite Strength", _state.InfiniteStrength, delegate { _actions.SetInfiniteStrength(!_state.InfiniteStrength); }); DrawToggleButton("Sticky Boost", _state.StickyBoost, delegate { _state.StickyBoost = !_state.StickyBoost; _state.PushToast(_state.StickyBoost ? $"Sticky boost enabled at {_state.SpeedMultiplier:0.0}x." : "Sticky boost disabled."); }); DrawToggleButton("No Aggro", _state.NoAggro, delegate { _actions.SetNoAggro(!_state.NoAggro); }); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label($"Speed Multiplier: {_state.SpeedMultiplier:0.0}x", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(190f) }); _state.SpeedMultiplier = GUILayout.HorizontalSlider(_state.SpeedMultiplier, 1f, 4f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(240f) }); GUILayout.Space(12f); GUILayout.Label($"Health {snapshot.LocalHealth}/{snapshot.LocalMaxHealth}", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.Label($"Energy {snapshot.LocalEnergy:0}/{snapshot.LocalEnergyMax:0}", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Quick Actions", styles.SectionTitle, Array.Empty()); GUILayout.Label("High-signal actions for fast testing and sandboxing.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Refill Me", _actions.RefillLocalPlayer); DrawActionButton("Heal Everyone", _actions.HealAllPlayers); DrawActionButton("Revive Everyone", _actions.ReviveAllPlayers); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Despawn Enemies", _actions.DespawnEnemies, danger: true); DrawActionButton("Recall Valuables", _actions.RecallValuablesToTruck); DrawActionButton("Redirect Enemies Here", _actions.ForceEnemyInvestigateHere); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) }); GUILayout.Label("Run Notes", styles.SectionTitle, Array.Empty()); GUILayout.Label(snapshot.IsHost ? "You currently have authority for world-changing tools." : "Client mode detected. Local powers still work; host-only tools will refuse cleanly.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); DrawHeaderPill(snapshot.InRun ? snapshot.LevelName : "Menu / loading state", snapshot.InRun ? styles.PillActive : styles.PillMuted); GUILayout.Space(8f); DrawHeaderPill(snapshot.IsHost ? "WORLD AUTHORITY PRESENT" : "WORLD AUTHORITY MISSING", snapshot.IsHost ? styles.PillAccent : styles.PillMuted); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Command Deck", styles.SectionTitle, Array.Empty()); GUILayout.Label("Examples: `spawn enemy clown 3`, `heal all`, `despawn enemies`, `noaggro on`, `strength on`, `boost 2.5`, `truck valuables`, `level next`, `level random`, `level shop`", styles.SectionBody, Array.Empty()); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); GUI.SetNextControlName("EmpressSpawnBrowserCommandField"); _state.CommandText = GUILayout.TextField(_state.CommandText, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }); if (GUILayout.Button("Run", styles.AccentButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(34f) })) { _actions.ExecuteCommand(_state.CommandText); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Activity", styles.SectionTitle, Array.Empty()); foreach (string item in _state.Activity.Take(8)) { GUILayout.Label(item, styles.ActivityLine, Array.Empty()); } GUILayout.EndVertical(); GUILayout.EndScrollView(); } private void DrawSpawnTab() { //IL_01f9: 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) SectorStyles styles = _styles; IReadOnlyList entries = _catalog.GetEntries(_state.ActiveSpawnKind, _state.SpawnSearch); GUILayout.BeginVertical(Array.Empty()); GUILayout.BeginVertical(_styles.PanelAlt, Array.Empty()); GUILayout.Label("Spawn Category", styles.SectionTitle, Array.Empty()); GUILayout.Space(4f); GUILayout.BeginHorizontal(Array.Empty()); DrawSpawnKindButton(SectorSpawnKind.Enemy, "Enemies"); DrawSpawnKindButton(SectorSpawnKind.Item, "Items"); DrawSpawnKindButton(SectorSpawnKind.Valuable, "Valuables"); DrawSpawnKindButton(SectorSpawnKind.CosmeticBox, "Cosmetic Boxes"); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Count", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(48f) }); _state.SpawnAmountText = GUILayout.TextField(_state.SpawnAmountText, styles.ShortTextField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(28f) }); GUILayout.Space(10f); GUILayout.Label("Search", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); _state.SpawnSearch = GUILayout.TextField(_state.SpawnSearch, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[3] { GUILayout.MinWidth(120f), GUILayout.ExpandWidth(true), GUILayout.Height(28f) }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(8f); GUILayout.Label($"Showing {entries.Count} {GetSpawnKindLabel(_state.ActiveSpawnKind)} profiles.", styles.SectionBody, Array.Empty()); GUILayout.Space(8f); _state.SpawnScroll = GUILayout.BeginScrollView(_state.SpawnScroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); foreach (SectorSpawnEntry item in entries) { GUILayout.BeginHorizontal(styles.PanelAlt, Array.Empty()); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label(item.DisplayName, styles.ItemTitle, Array.Empty()); GUILayout.Label(item.Subtitle, styles.ItemSubtitle, Array.Empty()); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button($"Deploy x{_state.SpawnAmount}", styles.AccentButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(150f), GUILayout.Height(34f) })) { _actions.Spawn(item, _state.SpawnAmount); } GUILayout.EndHorizontal(); GUILayout.Space(8f); } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private void DrawPlayersTab() { //IL_014d: 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) SectorStyles styles = _styles; List list = (from player in SectorGame.GetPlayers() where (Object)(object)player != (Object)null orderby SectorAccess.IsPlayerLocal(player) descending, SectorAccess.GetPlayerName(player) select player).ToList(); GUILayout.BeginVertical(Array.Empty()); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Local Tuning", styles.SectionTitle, Array.Empty()); GUILayout.Label("This tab blends crew management with your local movement tuning.", styles.SectionBody, Array.Empty()); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Refill Me", _actions.RefillLocalPlayer); DrawActionButton("Heal Everyone", _actions.HealAllPlayers); DrawActionButton("Revive Everyone", _actions.ReviveAllPlayers); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); _state.PlayersScroll = GUILayout.BeginScrollView(_state.PlayersScroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); foreach (PlayerAvatar player2 in list) { string playerName = SectorAccess.GetPlayerName(player2); bool isLocal = SectorAccess.IsPlayerLocal(player2); bool flag = SectorAccess.IsPlayerDead(player2); bool flag2 = SectorAccess.IsPlayerDisabled(player2); PlayerHealth playerHealth = SectorAccess.GetPlayerHealth(player2); GUILayout.BeginHorizontal(styles.PanelAlt, Array.Empty()); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(340f) }); GUILayout.Label(playerName + (isLocal ? " [LOCAL]" : string.Empty), styles.ItemTitle, Array.Empty()); string obj = (flag ? "Downed" : (flag2 ? "Disabled" : "Active")); string text = (((Object)(object)playerHealth != (Object)null) ? $"{SectorAccess.GetHealth(playerHealth)}/{SectorAccess.GetMaxHealth(playerHealth)} HP" : "Health unavailable"); GUILayout.Label(obj + " | " + text, styles.ItemSubtitle, Array.Empty()); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); DrawInlineAction("Heal", delegate { _actions.HealPlayer(player2); }); DrawInlineAction("Refill", delegate { _actions.HealPlayer(player2); if (isLocal) { _actions.RefillLocalPlayer(); } }); DrawInlineAction("Revive", delegate { _actions.RevivePlayer(player2); }, flag); GUILayout.EndHorizontal(); GUILayout.Space(8f); } if (list.Count == 0) { GUILayout.Label("No live player avatars are available yet.", styles.SectionBody, Array.Empty()); } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private void DrawWorldTab() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) SectorStyles styles = _styles; SectorRuntimeSnapshot snapshot = _actions.GetSnapshot(); _state.WorldScroll = GUILayout.BeginScrollView(_state.WorldScroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Authority Rail", styles.SectionTitle, Array.Empty()); GUILayout.Label(snapshot.IsHost ? "World tools are armed. You currently have enough authority to mutate the run." : "World tools that affect shared state will refuse unless you are the host or in singleplayer.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); DrawHeaderPill(snapshot.IsHost ? "HOST / SINGLEPLAYER" : "CLIENT", snapshot.IsHost ? styles.PillAccent : styles.PillMuted); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Enemy Flow", styles.SectionTitle, Array.Empty()); GUILayout.Label("Control the run's threat rhythm without leaving the game.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Toggle No Aggro", delegate { _actions.SetNoAggro(!_state.NoAggro); }); DrawActionButton("Despawn Enemies", _actions.DespawnEnemies, danger: true); DrawActionButton("Destroy Enemies", _actions.DestroyEnemies, danger: true); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Redirect Enemies Here", _actions.ForceEnemyInvestigateHere); DrawActionButton("Toggle Spawn Idle Timer", _actions.ToggleSpawnIdlePause); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Loot Control", styles.SectionTitle, Array.Empty()); GUILayout.Label("Move scene valuables to the truck so you can prototype haul loops faster.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Recall Valuables To Truck", _actions.RecallValuablesToTruck); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Tax Tokens", styles.SectionTitle, Array.Empty()); GUILayout.Label("Send cosmetic tax tokens to players running Empress Spawn Browser in this lobby.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Amount", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); _state.TaxTokenAmountText = GUILayout.TextField(_state.TaxTokenAmountText, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(100f), GUILayout.Height(28f) }); GUILayout.Space(8f); DrawHeaderPill($"SEND x{_state.TaxTokenAmount}", styles.PillAccent); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Green Token", delegate { _actions.AddLobbyTaxToken((Rarity)0, _state.TaxTokenAmountText); }); DrawActionButton("Blue Token", delegate { _actions.AddLobbyTaxToken((Rarity)1, _state.TaxTokenAmountText); }); DrawActionButton("Purple Token", delegate { _actions.AddLobbyTaxToken((Rarity)2, _state.TaxTokenAmountText); }); DrawActionButton("Gold Token", delegate { _actions.AddLobbyTaxToken((Rarity)3, _state.TaxTokenAmountText); }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Extraction Point", styles.SectionTitle, Array.Empty()); GUILayout.Label("Host-only controls for the active extraction loop.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Discover Extraction", _actions.DiscoverExtractionPoint); DrawActionButton("Complete Extraction", _actions.CompleteExtractionPoint); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Cash Rail", styles.SectionTitle, Array.Empty()); GUILayout.Label("Add run cash in singleplayer or while you're the host. Lobby, run, and shop states are all fair game.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); DrawHeaderPill("CURRENT CASH: " + SemiFunc.DollarGetString(SemiFunc.StatGetRunCurrency()), styles.PillAccent); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("+1,000", delegate { _actions.AddMoney(1000); }); DrawActionButton("+10,000", delegate { _actions.AddMoney(10000); }); DrawActionButton("+100,000", delegate { _actions.AddMoney(100000); }); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Custom Amount", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); _state.MoneyAddText = GUILayout.TextField(_state.MoneyAddText, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(180f), GUILayout.Height(28f) }); GUILayout.Space(8f); if (GUILayout.Button("Add Cash", styles.AccentButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(28f) })) { _actions.AddMoney(_state.MoneyAddText); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Level Switch", styles.SectionTitle, Array.Empty()); GUILayout.Label("Jump the run forward, reroll the next map, refresh the active scene, or skip directly to a named level.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("Next Level", delegate { _actions.SwitchLevel("next"); }); DrawActionButton("Random Level", delegate { _actions.SwitchLevel("random"); }); DrawActionButton("Refresh Scene", delegate { _actions.SwitchLevel("refresh"); }); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton("To Shop", delegate { _actions.SwitchLevel("shop"); }); DrawActionButton("To Lobby", delegate { _actions.SwitchLevel("lobby"); }); DrawActionButton("To Arena", delegate { _actions.SwitchLevel("arena"); }); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Specific Level", styles.FieldLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); _state.LevelSwitchText = GUILayout.TextField(_state.LevelSwitchText, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(320f), GUILayout.Height(28f) }); GUILayout.Space(8f); if (GUILayout.Button("Skip Level", styles.AccentButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(28f) })) { _actions.SwitchLevel(_state.LevelSwitchText); } GUILayout.EndHorizontal(); IReadOnlyList levelSuggestions = _actions.GetLevelSuggestions(_state.LevelSwitchText); if (levelSuggestions.Count > 0) { GUILayout.Space(8f); GUILayout.Label("Run levels: " + string.Join(" | ", levelSuggestions), styles.SectionBody, Array.Empty()); } GUILayout.Space(4f); GUILayout.Label("Quick targets: next, random, refresh, shop, lobby, arena, recording, or a run level name.", styles.MicroLabel, Array.Empty()); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Notes", styles.SectionTitle, Array.Empty()); GUILayout.Label("Empress Spawn Browser keeps world tools direct and readable so host-safe routing, enemy control, and loot flow stay fast in live runs.", styles.SectionBody, Array.Empty()); GUILayout.EndVertical(); GUILayout.EndScrollView(); } private void DrawSceneTab() { //IL_0042: 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) SectorStyles styles = _styles; SectorSceneSnapshot snapshot = _scene.GetSnapshot(); SectorSceneQueryResult sectorSceneQueryResult = _scene.QueryObjects(_state.ObjectSearch); SectorSceneObjectInfo selectedObject = _scene.GetSelectedObject(); _state.SceneScroll = GUILayout.BeginScrollView(_state.SceneScroll, GUIStyle.none, GUI.skin.verticalScrollbar, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); DrawStatCard("Tracked Objects", snapshot.TrackedObjects.ToString(), "filtered scene objects Empress Spawn Browser can act on"); DrawStatCard("Level Points", snapshot.LevelPoints.ToString(), _state.ShowLevelPoints ? "overlay live" : "overlay hidden"); DrawStatCard("Mesh Objects", snapshot.MeshObjects.ToString(), _state.ShowMeshBounds ? "bounds live" : "bounds hidden"); GUILayout.EndHorizontal(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Scene Modes", styles.SectionTitle, Array.Empty()); GUILayout.Label("Freecam detaches the live camera, freezes your player body, and turns Empress Spawn Browser into a fly-through scene toolkit.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); DrawHeaderPill(snapshot.ModeLabel, snapshot.CopyForgeActive ? styles.PillAccent : (snapshot.FreecamActive ? styles.PillActive : styles.PillMuted)); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawActionButton(snapshot.FreecamActive ? "Exit Freecam" : "Enter Freecam", _scene.ToggleFreecam); if (snapshot.CopyForgeActive) { DrawActionButton("Abort Copy Forge", _scene.Reset, danger: true); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Visualizers", styles.SectionTitle, Array.Empty()); GUILayout.Label("Use these to make the level readable while you scout, browse, or line up a copy forge placement.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); DrawToggleButton("Level Points", _state.ShowLevelPoints, delegate { _state.ShowLevelPoints = !_state.ShowLevelPoints; _state.PushToast(_state.ShowLevelPoints ? "Level point graph enabled." : "Level point graph disabled."); }); DrawToggleButton("Mesh Lines", _state.ShowMeshLabels, delegate { _state.ShowMeshLabels = !_state.ShowMeshLabels; _state.PushToast(_state.ShowMeshLabels ? "Mesh line markers enabled." : "Mesh line markers disabled."); }); DrawToggleButton("Mesh Bounds", _state.ShowMeshBounds, delegate { _state.ShowMeshBounds = !_state.ShowMeshBounds; _state.PushToast(_state.ShowMeshBounds ? "Mesh bounds enabled." : "Mesh bounds disabled."); }); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(10f); if (selectedObject != null) { GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); GUILayout.Label("Selected Object", styles.SectionTitle, Array.Empty()); GUILayout.Label(selectedObject.Name, styles.ItemTitle, Array.Empty()); GUILayout.Label(string.Format("{0} | {1} | Meshes {2} | Colliders {3} | Photon {4}", selectedObject.Category, selectedObject.Active ? "Active" : "Inactive", selectedObject.RendererCount, selectedObject.HasCollider ? "Yes" : "No", selectedObject.HasPhotonView ? "Yes" : "No"), styles.ItemSubtitle, Array.Empty()); GUILayout.Label(selectedObject.Path, styles.MicroLabel, Array.Empty()); GUILayout.EndVertical(); GUILayout.Space(10f); } GUILayout.BeginVertical(styles.PanelAlt, Array.Empty()); DrawHeaderPill("OBJECT BROWSER", styles.PillAccent); GUILayout.Space(8f); GUILayout.Label("Scans when opened or refreshed. Search, focus, copy, or delete tracked objects from here.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Object Browser", styles.SectionTitle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.FlexibleSpace(); GUILayout.Label("Search", styles.FieldLabel, Array.Empty()); _state.ObjectSearch = GUILayout.TextField(_state.ObjectSearch, styles.TextField, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(300f), GUILayout.Height(28f) }); if (GUILayout.Button("Refresh", styles.SubtleButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(92f), GUILayout.Height(28f) })) { _scene.RefreshSceneCacheNow(); } GUILayout.EndHorizontal(); GUILayout.Space(6f); GUILayout.Label($"Showing {sectorSceneQueryResult.Entries.Count} of {sectorSceneQueryResult.TotalMatches} scene object matches.", styles.SectionBody, Array.Empty()); GUILayout.Space(10f); foreach (SectorSceneObjectInfo entry in sectorSceneQueryResult.Entries) { GUILayout.BeginHorizontal((entry.InstanceId == _state.SelectedSceneObjectId) ? styles.StatCard : styles.PanelAlt, Array.Empty()); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(520f) }); GUILayout.Label(entry.Name, styles.ItemTitle, Array.Empty()); GUILayout.Label(string.Format("{0} | {1} | Meshes {2} | Colliders {3} | Photon {4}", entry.Category, entry.Active ? "Active" : "Inactive", entry.RendererCount, entry.HasCollider ? "Yes" : "No", entry.HasPhotonView ? "Yes" : "No"), styles.ItemSubtitle, Array.Empty()); GUILayout.Label(entry.Path, styles.MicroLabel, Array.Empty()); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Focus", styles.SubtleButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(84f), GUILayout.Height(30f) })) { _scene.FocusObject(entry.InstanceId); } bool enabled = GUI.enabled; GUI.enabled = entry.CanCopy; if (GUILayout.Button("Copy", styles.AccentButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(84f), GUILayout.Height(30f) })) { _scene.BeginCopyForge(entry.InstanceId); } GUI.enabled = entry.CanDelete; if (GUILayout.Button("Delete", styles.DangerButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(84f), GUILayout.Height(30f) })) { _scene.DeleteObject(entry.InstanceId); } GUI.enabled = enabled; GUILayout.EndHorizontal(); GUILayout.Space(8f); } if (sectorSceneQueryResult.TotalMatches == 0) { GUILayout.Label("No scene objects matched the current filter.", styles.SectionBody, Array.Empty()); } GUILayout.EndVertical(); GUILayout.EndScrollView(); } private void DrawHeaderPill(string text, GUIStyle style) { GUILayout.Label(text, style, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }); } private void DrawTabButton(SectorTab tab, string title, string subtitle, float height) { GUIStyle val = ((_state.ActiveTab == tab) ? _styles.SidebarTabActive : _styles.SidebarTab); if (GUILayout.Button(title + "\n" + subtitle, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(height) })) { _state.ActiveTab = tab; } } private void DrawSpawnKindButton(SectorSpawnKind kind, string label) { GUIStyle val = ((_state.ActiveSpawnKind == kind) ? _styles.AccentButton : _styles.SubtleButton); float num = ((kind == SectorSpawnKind.CosmeticBox) ? 132f : 96f); if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(num), GUILayout.Height(28f) })) { _state.ActiveSpawnKind = kind; } } private static string GetSpawnKindLabel(SectorSpawnKind kind) { return kind switch { SectorSpawnKind.Enemy => "enemy", SectorSpawnKind.Item => "item", SectorSpawnKind.Valuable => "valuable", SectorSpawnKind.CosmeticBox => "cosmetic box", _ => "spawn", }; } private void DrawStatCard(string label, string value, string detail) { SectorStyles styles = _styles; GUILayout.BeginVertical(styles.StatCard, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(212f), GUILayout.Height(110f) }); GUILayout.Label(label, styles.StatLabel, Array.Empty()); GUILayout.Label(value, styles.StatValue, Array.Empty()); GUILayout.Label(detail, styles.StatDetail, Array.Empty()); GUILayout.EndVertical(); } private void DrawToggleButton(string label, bool enabled, Action action) { GUIStyle val = (enabled ? _styles.AccentButton : _styles.SubtleButton); if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(160f), GUILayout.Height(34f) })) { action(); } } private void DrawActionButton(string label, Action action, bool danger = false) { GUIStyle val = (danger ? _styles.DangerButton : _styles.AccentButton); if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(170f), GUILayout.Height(34f) })) { action(); } } private void DrawInlineAction(string label, Action action, bool danger = false) { GUIStyle val = (danger ? _styles.DangerButton : _styles.SubtleButton); if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(90f), GUILayout.Height(30f) })) { action(); } } private void DrawFlashMessage() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(_state.FlashMessage) && !(Time.unscaledTime > _state.FlashUntil)) { float num = Mathf.Min(560f, (float)Screen.width - 32f); GUI.Box(new Rect(16f, (float)Screen.height - 64f, num, 40f), _state.FlashMessage, _styles.FlashBox); } } private void DrawSectorCursor() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0069: 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_0087: 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_00a8: 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_00cd: 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_00ef: Unknown result type (might be due to invalid IL or missing references) SectorStyles styles = _styles; Vector3 mousePosition = Input.mousePosition; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(mousePosition.x, (float)Screen.height - mousePosition.y); bool num = ((Rect)(ref _state.WindowRect)).Contains(val); float num2 = (num ? 24f : 18f); float num3 = (num ? 12f : 9f); float num4 = (num ? 6f : 4f); GUI.DrawTexture(new Rect(val.x - num2 * 0.5f, val.y - num2 * 0.5f, num2, num2), (Texture)(object)styles.CursorGlow, (ScaleMode)0, true); GUI.DrawTexture(new Rect(val.x - num3 * 0.5f, val.y - num3 * 0.5f, num3, num3), (Texture)(object)styles.CursorHalo, (ScaleMode)0, true); GUI.DrawTexture(new Rect(val.x - num4 * 0.5f, val.y - num4 * 0.5f, num4, num4), (Texture)(object)styles.CursorCore, (ScaleMode)0, true); } private void ClampWindowToScreen() { //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_00d4: 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) float num = Mathf.Max(720f, (float)Screen.width - 24f); float num2 = Mathf.Max(420f, (float)Screen.height - 24f); Rect windowRect = _state.WindowRect; ((Rect)(ref windowRect)).width = Mathf.Min(((Rect)(ref windowRect)).width, num); ((Rect)(ref windowRect)).height = Mathf.Min(((Rect)(ref windowRect)).height, num2); ((Rect)(ref windowRect)).x = Mathf.Clamp(((Rect)(ref windowRect)).x, 12f, Mathf.Max(12f, (float)Screen.width - ((Rect)(ref windowRect)).width - 12f)); ((Rect)(ref windowRect)).y = Mathf.Clamp(((Rect)(ref windowRect)).y, 12f, Mathf.Max(12f, (float)Screen.height - ((Rect)(ref windowRect)).height - 12f)); _state.WindowRect = windowRect; } private void EnsureStyles() { if (_styles == null) { _styles = new SectorStyles(); } } static SectorUi() { KeyCode[][] array = new KeyCode[4][]; KeyCode[] array2 = new KeyCode[6]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[0] = (KeyCode[])(object)array2; KeyCode[] array3 = new KeyCode[6]; RuntimeHelpers.InitializeArray(array3, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[1] = (KeyCode[])(object)array3; KeyCode[] array4 = new KeyCode[6]; RuntimeHelpers.InitializeArray(array4, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[2] = (KeyCode[])(object)array4; KeyCode[] array5 = new KeyCode[6]; RuntimeHelpers.InitializeArray(array5, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[3] = (KeyCode[])(object)array5; ToggleKeyPresetRows = array; } } internal sealed class SectorStyles { public GUIStyle Window { get; } public GUIStyle Header { get; } public GUIStyle Panel { get; } public GUIStyle PanelAlt { get; } public GUIStyle Sidebar { get; } public GUIStyle StatCard { get; } public GUIStyle Title { get; } public GUIStyle Subtitle { get; } public GUIStyle MicroLabel { get; } public GUIStyle SectionTitle { get; } public GUIStyle SectionBody { get; } public GUIStyle FieldLabel { get; } public GUIStyle ItemTitle { get; } public GUIStyle ItemSubtitle { get; } public GUIStyle StatLabel { get; } public GUIStyle StatValue { get; } public GUIStyle StatDetail { get; } public GUIStyle ActivityLine { get; } public GUIStyle TextField { get; } public GUIStyle ShortTextField { get; } public GUIStyle AccentButton { get; } public GUIStyle SubtleButton { get; } public GUIStyle DangerButton { get; } public GUIStyle SidebarTab { get; } public GUIStyle SidebarTabActive { get; } public GUIStyle SidebarNote { get; } public GUIStyle FlashBox { get; } public GUIStyle PillActive { get; } public GUIStyle PillMuted { get; } public GUIStyle PillAccent { get; } public Texture2D CursorGlow { get; } public Texture2D CursorHalo { get; } public Texture2D CursorCore { get; } public SectorStyles() { //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) //IL_0058: 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_0096: 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_00d6: 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_0116: 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_0156: 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_0196: 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_01d6: 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_0224: 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_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0282: 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_0295: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Expected O, but got Unknown //IL_02ad: Expected O, but got Unknown //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_02d8: Expected O, but got Unknown //IL_02d8: 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_02eb: Expected O, but got Unknown //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_02ff: Expected O, but got Unknown //IL_033c: 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_0349: 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_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0391: 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_03ba: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Expected O, but got Unknown //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_041a: 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_042f: Expected O, but got Unknown //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0447: 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_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Expected O, but got Unknown //IL_0482: 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_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0496: 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_04bf: Expected O, but got Unknown //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: 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_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Expected O, but got Unknown //IL_04fe: 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_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Expected O, but got Unknown //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: 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_0553: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Expected O, but got Unknown //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0594: 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_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Expected O, but got Unknown //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Expected O, but got Unknown //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Expected O, but got Unknown //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0664: 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_0679: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: 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_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Expected O, but got Unknown //IL_06f4: Expected O, but got Unknown //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Expected O, but got Unknown //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_074f: 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_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Expected O, but got Unknown //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Expected O, but got Unknown //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07ab: 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_07cd: Expected O, but got Unknown //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Expected O, but got Unknown //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0832: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_0851: 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_0861: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Expected O, but got Unknown //IL_0870: Expected O, but got Unknown Texture2D background = MakeTexture(new Color(0.08f, 0.08f, 0.09f, 0.98f)); Texture2D background2 = MakeTexture(new Color(0.12f, 0.11f, 0.1f, 1f)); Texture2D background3 = MakeTexture(new Color(0.12f, 0.12f, 0.13f, 0.95f)); Texture2D background4 = MakeTexture(new Color(0.16f, 0.15f, 0.14f, 0.95f)); Texture2D background5 = MakeTexture(new Color(0.1f, 0.09f, 0.09f, 0.95f)); Texture2D val = MakeTexture(new Color(0.78f, 0.54f, 0.19f, 1f)); Texture2D hover = MakeTexture(new Color(0.88f, 0.62f, 0.22f, 1f)); Texture2D val2 = MakeTexture(new Color(0.24f, 0.23f, 0.22f, 1f)); Texture2D val3 = MakeTexture(new Color(0.31f, 0.29f, 0.28f, 1f)); Texture2D val4 = MakeTexture(new Color(0.43f, 0.18f, 0.14f, 1f)); Texture2D normal = MakeTexture(new Color(0.6f, 0.16f, 0.14f, 1f)); Texture2D background6 = MakeTexture(new Color(0.84f, 0.69f, 0.28f, 0.95f)); Texture2D background7 = MakeTexture(new Color(0.18f, 0.17f, 0.16f, 0.95f)); Texture2D background8 = MakeTexture(new Color(0.2f, 0.38f, 0.24f, 1f)); Texture2D background9 = MakeTexture(new Color(0.28f, 0.28f, 0.29f, 1f)); Texture2D val5 = MakeRadialTexture(32, new Color(1f, 0.16f, 0.12f, 0.65f), 0.65f, 1f); Texture2D val6 = MakeRingTexture(32, new Color(1f, 0.35f, 0.3f, 0.95f), 0.2f, 0.52f); Texture2D val7 = MakeRadialTexture(32, new Color(1f, 0.92f, 0.92f, 1f), 0.08f, 0.28f); GUIStyle val8 = new GUIStyle(GUI.skin.window); val8.normal.background = background; val8.padding = new RectOffset(18, 18, 18, 18); val8.border = new RectOffset(12, 12, 12, 12); Window = val8; GUIStyle val9 = new GUIStyle(GUI.skin.box); val9.normal.background = background2; val9.border = new RectOffset(8, 8, 8, 8); val9.padding = new RectOffset(16, 16, 14, 14); val9.margin = new RectOffset(0, 0, 0, 0); Header = val9; Panel = CreatePanel(background3); PanelAlt = CreatePanel(background4); Sidebar = CreatePanel(background5); StatCard = CreatePanel(background7); GUIStyle val10 = new GUIStyle(GUI.skin.label) { fontSize = 30, fontStyle = (FontStyle)1 }; val10.normal.textColor = new Color(0.96f, 0.86f, 0.56f, 1f); Title = val10; GUIStyle val11 = new GUIStyle(GUI.skin.label) { fontSize = 13 }; val11.normal.textColor = new Color(0.87f, 0.85f, 0.82f, 1f); Subtitle = val11; GUIStyle val12 = new GUIStyle(GUI.skin.label) { fontSize = 11 }; val12.normal.textColor = new Color(0.67f, 0.66f, 0.64f, 1f); MicroLabel = val12; GUIStyle val13 = new GUIStyle(GUI.skin.label) { fontSize = 17, fontStyle = (FontStyle)1 }; val13.normal.textColor = Color.white; SectionTitle = val13; GUIStyle val14 = new GUIStyle(GUI.skin.label) { fontSize = 12, wordWrap = true }; val14.normal.textColor = new Color(0.8f, 0.79f, 0.76f, 1f); SectionBody = val14; GUIStyle val15 = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1 }; val15.normal.textColor = new Color(0.93f, 0.9f, 0.84f, 1f); FieldLabel = val15; GUIStyle val16 = new GUIStyle(GUI.skin.label) { fontSize = 15, fontStyle = (FontStyle)1 }; val16.normal.textColor = Color.white; ItemTitle = val16; GUIStyle val17 = new GUIStyle(GUI.skin.label) { fontSize = 12 }; val17.normal.textColor = new Color(0.74f, 0.72f, 0.7f, 1f); ItemSubtitle = val17; GUIStyle val18 = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1 }; val18.normal.textColor = new Color(0.82f, 0.79f, 0.74f, 1f); StatLabel = val18; GUIStyle val19 = new GUIStyle(GUI.skin.label) { fontSize = 26, fontStyle = (FontStyle)1 }; val19.normal.textColor = new Color(0.99f, 0.92f, 0.69f, 1f); StatValue = val19; GUIStyle val20 = new GUIStyle(GUI.skin.label) { fontSize = 11, wordWrap = true }; val20.normal.textColor = new Color(0.68f, 0.67f, 0.65f, 1f); StatDetail = val20; GUIStyle val21 = new GUIStyle(GUI.skin.label) { fontSize = 11, wordWrap = true }; val21.normal.textColor = new Color(0.86f, 0.84f, 0.8f, 1f); ActivityLine = val21; GUIStyle val22 = new GUIStyle(GUI.skin.textField) { fontSize = 13 }; val22.normal.background = val2; val22.normal.textColor = Color.white; val22.hover.background = val3; val22.hover.textColor = Color.white; val22.focused.background = background4; val22.focused.textColor = Color.white; val22.active.background = background4; val22.active.textColor = Color.white; val22.padding = new RectOffset(10, 10, 8, 8); TextField = val22; ShortTextField = new GUIStyle(TextField) { alignment = (TextAnchor)4 }; AccentButton = CreateButton(val, hover, Color.black); SubtleButton = CreateButton(val2, val3, Color.white); DangerButton = CreateButton(normal, val4, Color.white); SidebarTab = new GUIStyle(SubtleButton) { alignment = (TextAnchor)3, padding = new RectOffset(12, 12, 12, 12), wordWrap = true, fontSize = 12 }; GUIStyle val23 = new GUIStyle(SidebarTab); val23.normal.background = val4; val23.normal.textColor = Color.white; val23.hover.background = val4; val23.hover.textColor = Color.white; SidebarTabActive = val23; GUIStyle val24 = new GUIStyle(GUI.skin.label) { fontSize = 11, wordWrap = true }; val24.normal.textColor = new Color(0.72f, 0.7f, 0.67f, 1f); SidebarNote = val24; GUIStyle val25 = new GUIStyle(GUI.skin.box); val25.normal.background = background6; val25.normal.textColor = Color.black; val25.alignment = (TextAnchor)3; val25.fontSize = 12; val25.fontStyle = (FontStyle)1; val25.padding = new RectOffset(14, 14, 10, 10); FlashBox = val25; PillActive = CreatePill(background8); PillMuted = CreatePill(background9); PillAccent = CreatePill(val); CursorGlow = val5; CursorHalo = val6; CursorCore = val7; } private static GUIStyle CreatePanel(Texture2D background) { //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_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_002a: Expected O, but got Unknown //IL_002a: 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_003d: Expected O, but got Unknown //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_004c: Expected O, but got Unknown //IL_004d: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.box); val.normal.background = background; val.border = new RectOffset(8, 8, 8, 8); val.padding = new RectOffset(14, 14, 14, 14); val.margin = new RectOffset(0, 0, 0, 0); return val; } private static GUIStyle CreateButton(Texture2D normal, Texture2D hover, Color textColor) { //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_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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0051: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0075: 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_0086: Expected O, but got Unknown //IL_0087: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.button); val.normal.background = normal; val.normal.textColor = textColor; val.hover.background = hover; val.hover.textColor = textColor; val.active.background = hover; val.active.textColor = textColor; val.fontSize = 12; val.fontStyle = (FontStyle)1; val.border = new RectOffset(6, 6, 6, 6); val.padding = new RectOffset(10, 10, 8, 8); return val; } private static GUIStyle CreatePill(Texture2D background) { //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_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_002b: 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_003a: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0062: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.box); val.normal.background = background; val.normal.textColor = Color.white; val.alignment = (TextAnchor)4; val.fontSize = 11; val.fontStyle = (FontStyle)1; val.padding = new RectOffset(10, 10, 6, 6); val.border = new RectOffset(6, 6, 6, 6); return val; } private static Texture2D MakeTexture(Color color) { //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_0011: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, color); val.Apply(); return val; } private static Texture2D MakeRadialTexture(int size, Color color, float innerRadius, float outerRadius) { //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_0012: Expected O, but got Unknown //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_0093: 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_00a1: 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) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; float num = (float)(size - 1) * 0.5f; float num2 = 1f / Mathf.Max(0.0001f, outerRadius - innerRadius); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num3 = ((float)j - num) / num; float num4 = ((float)i - num) / num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = ((num5 <= innerRadius) ? color.a : ((num5 >= outerRadius) ? 0f : (color.a * (1f - (num5 - innerRadius) * num2)))); val.SetPixel(j, i, new Color(color.r, color.g, color.b, num6)); } } val.Apply(); return val; } private static Texture2D MakeRingTexture(int size, Color color, float innerRadius, float outerRadius) { //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_0012: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; float num = (float)(size - 1) * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = ((float)j - num) / num; float num3 = ((float)i - num) / num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); if (num4 < innerRadius || num4 > outerRadius) { val.SetPixel(j, i, Color.clear); continue; } float num5 = (innerRadius + outerRadius) * 0.5f; float num6 = 1f - Mathf.Abs(num4 - num5) / Mathf.Max(0.0001f, outerRadius - num5); val.SetPixel(j, i, new Color(color.r, color.g, color.b, color.a * num6)); } } val.Apply(); return val; } } }