Decompiled source of suitsTerminal v1.8.1
plugins/com.github.darmuh.suitsTerminal.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using InjectionLibrary.Attributes; using Microsoft.CodeAnalysis; using OpenLib; using OpenLib.Common; using OpenLib.Compat; using OpenLib.ConfigManager; using OpenLib.CoreMethods; using OpenLib.Events; using OpenLib.InteractiveMenus; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.UI; using suitsTerminal.Interfaces; using suitsTerminal.Misc; using suitsTerminal.OfTerminal; using suitsTerminal.Suits; using suitsTerminal.Util; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RequiresInjections] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.darmuh.suitsTerminal")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.8.1.0")] [assembly: AssemblyInformationalVersion("1.8.1+a896b5373498a4e77cecfc200e5971556978de84")] [assembly: AssemblyProduct("com.github.darmuh.suitsTerminal")] [assembly: AssemblyTitle("suitsTerminal")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.8.1.0")] [module: UnverifiableCode] [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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace suitsTerminal { [BepInDependency("darmuh.OpenLib", "0.4.1")] [BepInPlugin("com.github.darmuh.suitsTerminal", "suitsTerminal", "1.8.1")] public class Plugin : BaseUnityPlugin { internal static bool HintOnce = false; internal static bool EquipDefault = true; private static string _personalFiles = string.Empty; internal static Random Rand = new Random(); public const string Id = "com.github.darmuh.suitsTerminal"; internal static ManualLogSource Log { get; private set; } = null; internal static bool TooManySuits => Chainloader.PluginInfos.ContainsKey("TooManySuits"); internal static bool SuitSaver => Chainloader.PluginInfos.ContainsKey("Hexnet.lethalcompany.suitsaver"); internal static Terminal Terminal { get { Terminal terminal = Plugin.instance.Terminal; if ((Object)(object)terminal == (Object)null) { Loggers.ERROR("Trying to get null Terminal Reference!"); } return terminal; } } internal static PlayerControllerB LocalPlayer { get { if ((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null) { Loggers.ERROR("Trying to get null localplayer!!"); } return StartOfRound.Instance.localPlayerController; } } public static string Name => "suitsTerminal"; public static string Version => "1.8.1"; private void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Log.LogMessage((object)("Plugin " + Name + " is loaded with version " + Version + "!")); ModConfig.Init(((BaseUnityPlugin)this).Config); EventManagement.Subscribe(); Menu.CreateBetterCommand(); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); Log.LogInfo((object)"Built on v73 of Lethal Company ;)"); Log.LogMessage((object)$"Current logging level is {ModConfig.LogLevel.Value}"); ((BaseUnityPlugin)this).Config.SettingChanged += ModConfig.HandleChangedSetting; } internal static void ShowHint() { if (!HintOnce) { if ((Object)(object)Terminal == (Object)null) { Log.LogError((object)"~~ FATAL ERROR ~~"); Log.LogError((object)"Terminal instance is NULL"); Log.LogError((object)"~~ FATAL ERROR ~~"); } else { ((MonoBehaviour)Terminal).StartCoroutine(Coroutines.ChatHints()); ((MonoBehaviour)Terminal).StartCoroutine(Coroutines.HudHints()); HintOnce = true; } } } internal static bool TryGetGameObject(string location, out GameObject gameobj) { gameobj = GameObject.Find(location); return (Object)(object)gameobj != (Object)null; } internal static void SaveToConfig(List<string> stringList, out string configItem) { configItem = string.Join(", ", stringList); Loggers.LogDebug("Saving to config\n" + configItem); } internal static string PersonalFilesPath() { if (!string.IsNullOrEmpty(_personalFiles)) { return _personalFiles; } _personalFiles = Path.Combine("%userprofile%\\appdata\\locallow\\ZeekerssRBLX\\Lethal Company", "suitsTerminal"); _personalFiles = Environment.ExpandEnvironmentVariables(_personalFiles); if (!Directory.Exists(_personalFiles)) { Directory.CreateDirectory(_personalFiles); } Loggers.LogDebug("suitsTerminal files path - " + _personalFiles); return _personalFiles; } internal static void SaveFavorites(string saveText) { if (ModConfig.PersonalizedFavorites.Value) { string name = Path.Combine("%userprofile%\\appdata\\locallow\\ZeekerssRBLX\\Lethal Company", "suitsTerminal") + "\\masterFavsListing.txt"; name = Environment.ExpandEnvironmentVariables(name); File.WriteAllText(name, saveText); Loggers.LogDebug("Favorites saved to file at " + name); } else { ModConfig.FavoritesMenuList.Value = saveText; } } internal static void SaveDefault(string saveText) { if (ModConfig.PersonalizedDefault.Value) { string name = Path.Combine("%userprofile%\\appdata\\locallow\\ZeekerssRBLX\\Lethal Company", "suitsTerminal") + "\\defaultSuit.txt"; name = Environment.ExpandEnvironmentVariables(name); File.WriteAllText(name, saveText); Loggers.LogDebug("Personalized default saved to file at " + name); } else { ModConfig.DefaultSuit.Value = saveText; } } internal static string TerminalFriendlyString(string s) { StringBuilder stringBuilder = new StringBuilder(); foreach (char c in s) { if (!char.IsPunctuation(c)) { stringBuilder.Append(c); } } if (stringBuilder.Length > 14) { int length = stringBuilder.Length - 14; stringBuilder.Remove(14, length); } return stringBuilder.ToString().ToLower(); } internal static string ChatListing(int pageSize, int currentPage) { int count = RackManager.AllSuits.Count; currentPage = Mathf.Clamp(currentPage, 1, Mathf.CeilToInt((float)count / (float)pageSize)); int num = (currentPage - 1) * pageSize; int num2 = Mathf.Min(num + pageSize, count); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("\r\n"); for (int i = num; i < num2; i++) { SuitAttributes suitAttributes = RackManager.AllSuits[i]; string text = suitAttributes.Name + (suitAttributes.IsCurrent() ? " [EQUIPPED]" : ""); stringBuilder.Append($"'!wear {i}' (" + text + ")\r\n"); } stringBuilder.Append("\r\n"); stringBuilder.Append($"Page {currentPage}/{Mathf.CeilToInt((float)count / (float)pageSize)}\r\n"); return stringBuilder.ToString(); } } } namespace suitsTerminal.Util { public static class Extensions { public static void GetSuitAttributes(this UnlockableSuit suit) { if (!((Object)(object)suit == (Object)null) && (Object)(object)((IUnlockableSuit)suit).SuitsTerminalAttributes == (Object)null) { ((IUnlockableSuit)suit).SuitsTerminalAttributes = ((Component)suit).gameObject.AddComponent<SuitAttributes>(); } } public static void ResetPosition(this UnlockableSuit suit) { if (!((Object)(object)suit == (Object)null)) { RackManager.SuitSpawn(suit); } } internal static List<string> GetKeywordValues(this ConfigEntry<string> entry, bool isMain = false) { if (string.IsNullOrEmpty(entry.Value)) { if (isMain) { return new List<string>(1) { "suits" }; } return new List<string>(); } string[] array = entry.Value.Split(','); List<string> list = new List<string>(); string[] array2 = array; foreach (string text in array2) { if (!string.IsNullOrWhiteSpace(text)) { list.Add(text.Trim()); } } return list; } } public class Loggers { private static void Log(LogLevel bepLevel, object data) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected I4, but got Unknown //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) int num = (int)ModConfig.LogLevel.Value; int num2 = (int)bepLevel; if (num2 <= num) { Plugin.Log.Log(bepLevel, data); } } internal static void LogDebug(object data) { Log((LogLevel)32, data); } internal static void LogInfo(object data) { Log((LogLevel)16, data); } internal static void LogMessage(object data) { Log((LogLevel)8, data); } internal static void WARNING(object data) { Log((LogLevel)4, data); } internal static void ERROR(object data) { Log((LogLevel)2, data); } internal static void FATAL(object data) { Log((LogLevel)1, data); } } } namespace suitsTerminal.Suits { internal class RackManager { internal static List<SuitAttributes> AllSuits = new List<SuitAttributes>(); internal static List<string> FavsList = new List<string>(); private static int _realcurrent = 0; private static SuitAttributes _current = null; private static GameObject _clothingRack = null; internal static bool IsRackFull { get { int count = AllSuits.FindAll((SuitAttributes c) => c.IsOnRack).Count; return count >= ModConfig.SuitsOnRack.Value; } } internal static int RealCurrentID { get { return _realcurrent; } set { _realcurrent = value; } } internal static SuitAttributes CurrentSuit { get { if (AllSuits.Count > 0) { _current = AllSuits.FirstOrDefault((SuitAttributes x) => x.Suit.suitID == RealCurrentID); } return _current; } set { _current = value; } } internal static int FavCount => AllSuits.FindAll((SuitAttributes x) => x.IsFav).Count; internal static List<string> FavList => AllSuits.FindAll((SuitAttributes x) => x.IsFav).ConvertAll((SuitAttributes x) => x.Name); internal static bool RackDisabled { get { if ((Object)(object)ClothingRack == (Object)null) { return true; } if (ModConfig.RackSettings.Value != ModConfig.Removal.OnlyRackAndExtraSuits) { return ModConfig.RackSettings.Value == ModConfig.Removal.Everything; } return true; } } internal static int RackCount => AllSuits.FindAll((SuitAttributes x) => x.IsOnRack).Count; internal static GameObject ClothingRack { get { if ((Object)(object)_clothingRack == (Object)null) { if (Plugin.TryGetGameObject("Environment/HangarShip/NurbsPath.002", out _clothingRack)) { return _clothingRack; } return null; } return _clothingRack; } } public static void SuitSpawn(UnlockableSuit unlockableSuit) { AutoParentToShip component = ((Component)unlockableSuit).gameObject.GetComponent<AutoParentToShip>(); SuitAttributes component2 = ((Component)unlockableSuit).gameObject.GetComponent<SuitAttributes>(); if (!Plugin.TooManySuits) { if (ModConfig.RackSettings.Value == ModConfig.Removal.DontRemoveAnything) { Loggers.WARNING("suitsTerminal is NOT touching the rack!!!"); } else if (RackDisabled) { ProcessHiddenSuit(component); Loggers.LogDebug("Hiding suit - [ " + component2.Name + " ]"); component2.IsOnRack = false; } else if (ShouldShowSuit(component2, RackCount)) { ProcessVisibleSuit(component, RackCount); Loggers.LogDebug("Showing suit - [ " + component2.Name + " ]"); component2.IsOnRack = true; } else { ProcessHiddenSuit(component); Loggers.LogDebug("Hiding suit - [ " + component2.Name + " ]"); component2.IsOnRack = false; } } } internal static void HideBootsAndRack() { bool flag = ModConfig.RackSettings.Value == ModConfig.Removal.OnlyBootsAndExtraSuits || ModConfig.RackSettings.Value == ModConfig.Removal.Everything; bool flag2 = ModConfig.RackSettings.Value == ModConfig.Removal.OnlyRackAndExtraSuits || ModConfig.RackSettings.Value == ModConfig.Removal.Everything; if (flag && Plugin.TryGetGameObject("Environment/HangarShip/ScavengerModelSuitParts/Circle.004", out GameObject gameobj)) { Object.Destroy((Object)(object)gameobj); } if (flag2 && Plugin.TryGetGameObject("Environment/HangarShip/NurbsPath.002", out GameObject gameobj2)) { Object.Destroy((Object)(object)gameobj2); } } internal static void RemovePreview() { if ((Object)(object)CurrentSuit == (Object)null) { Loggers.WARNING("Unable to re-equip the correct suit!"); } else { UnlockableSuit.SwitchSuitForPlayer(Plugin.LocalPlayer, CurrentSuit.Suit.suitID, false); } } internal static void InitFavoritesListing() { if (ModConfig.PersonalizedFavorites.Value) { string text = Plugin.PersonalFilesPath(); if (!File.Exists(text + "\\masterFavsListing.txt")) { File.WriteAllText(text + "\\masterFavsListing.txt", ModConfig.FavoritesMenuList.Value); } string text2 = File.ReadAllText(text + "\\masterFavsListing.txt"); Loggers.LogDebug("favoritesText: " + text2); FavsList = CommonStringStuff.GetKeywordsPerConfigItem(text2, ','); { foreach (string favs in FavsList) { Loggers.LogDebug("-- " + favs + " --"); } return; } } FavsList = CommonStringStuff.GetKeywordsPerConfigItem(ModConfig.FavoritesMenuList.Value, ','); } internal static void ProcessHiddenSuit(AutoParentToShip component) { component.disableObject = true; ((Renderer)((Component)component).gameObject.GetComponentInChildren<SkinnedMeshRenderer>()).enabled = false; ((Renderer)((Component)component).gameObject.GetComponentInChildren<MeshRenderer>()).enabled = false; } internal static void ProcessVisibleSuit(AutoParentToShip component, int suitNumber) { //IL_001d: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_005f: Unknown result type (might be due to invalid IL or missing references) component.overrideOffset = true; float value = ModConfig.RackOffset.Value; component.positionOffset = StartOfRound.Instance.rightmostSuitPosition.localPosition + StartOfRound.Instance.rightmostSuitPosition.forward * value * (float)(suitNumber - 1); component.rotationOffset = new Vector3(0f, 90f, 0f); } internal static bool ShouldShowSuit(SuitAttributes suit, int count) { SuitAttributes suit2 = suit; if (RackDisabled) { return false; } List<string> keywordsPerConfigItem = CommonStringStuff.GetKeywordsPerConfigItem(ModConfig.SuitsOnRackOnly.Value, ','); List<string> listToLower = CommonStringStuff.GetListToLower(CommonStringStuff.GetKeywordsPerConfigItem(ModConfig.DontAddToRack.Value, ',')); if (listToLower.Contains(suit2.Name.ToLower())) { return false; } if (!IsRackFull) { if (keywordsPerConfigItem.Count == 0 && count < ModConfig.SuitsOnRack.Value) { return true; } if (suit2.Name.Length > 1 && keywordsPerConfigItem.Count > 0 && keywordsPerConfigItem.Any((string s) => s.Equals(suit2.Name, StringComparison.InvariantCultureIgnoreCase))) { return true; } } else if (suit2.IsOnRack) { return true; } return false; } } public class SuitAttributes : MonoBehaviour { private static string _defaultSuit = string.Empty; internal static bool UpdateDefault = true; internal SuitMenuItem MenuItem; internal UnlockableSuit Suit; internal bool HideFromTerminal; internal bool IsOnRack; internal string Name = string.Empty; internal int ID = -1; internal bool IsFav; internal void Reset() { Loggers.LogDebug(Name + " is being reset!"); HideFromTerminal = false; IsOnRack = false; } internal bool IsDefault() { if (Plugin.SuitSaver) { return false; } if (!UpdateDefault) { return Name.Equals(_defaultSuit, StringComparison.InvariantCultureIgnoreCase); } if (ModConfig.PersonalizedDefault.Value) { string text = Plugin.PersonalFilesPath(); if (!File.Exists(text + "\\defaultSuit.txt")) { File.WriteAllText(text + "\\defaultSuit.txt", string.Empty); } _defaultSuit = File.ReadAllText(text + "\\defaultSuit.txt"); Loggers.LogDebug("Default Suit from personal files - " + _defaultSuit); UpdateDefault = false; return Name.Equals(_defaultSuit, StringComparison.InvariantCultureIgnoreCase); } if (ModConfig.DefaultSuit.Value.Length < 1 || ModConfig.DefaultSuit.Value.Equals("default", StringComparison.InvariantCultureIgnoreCase)) { return false; } return Name.Equals(ModConfig.DefaultSuit.Value, StringComparison.InvariantCultureIgnoreCase); } internal static void WearDefault() { UpdateDefault = true; Plugin.EquipDefault = false; SuitAttributes suitAttributes = RackManager.AllSuits.FirstOrDefault((SuitAttributes x) => x.IsDefault()); if ((Object)(object)suitAttributes != (Object)null) { Loggers.LogMessage("Equipping default suit - " + suitAttributes.Name); suitAttributes.WearSuit(); } else { Loggers.LogDebug("No default suit detected"); } } internal bool IsLocked() { if (!ModConfig.EnforcePaidSuits.Value) { return false; } List<UnlockableItem> unlockables = StartOfRound.Instance.unlockablesList.unlockables; if ((Object)(object)unlockables[Suit.syncedSuitID.Value].shopSelectionNode == (Object)null) { return false; } if (!unlockables[Suit.syncedSuitID.Value].spawnPrefab) { Loggers.LogMessage("Locked suit [" + unlockables[Suit.syncedSuitID.Value].unlockableName + "] detected, menu item is disabled."); Loggers.LogDebug($"hasBeenUnlockedByPlayer: {unlockables[Suit.syncedSuitID.Value].hasBeenUnlockedByPlayer} \nalreadyUnlocked: {unlockables[Suit.syncedSuitID.Value].alreadyUnlocked}"); return true; } Loggers.LogDebug($"{Name} is not locked.\n{unlockables[Suit.syncedSuitID.Value].unlockableName}:\nhasBeenUnlockedByPlayer: {unlockables[Suit.syncedSuitID.Value].hasBeenUnlockedByPlayer} \nalreadyUnlocked: {unlockables[Suit.syncedSuitID.Value].alreadyUnlocked}"); return false; } internal void Awake() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown UnlockableSuit val = (Suit = ((Component)this).GetComponent<UnlockableSuit>()); ID = val.syncedSuitID.Value; Name = GetName(val); HideFromTerminal = ShouldHideTerm(); MenuItem val2 = ((IEnumerable<MenuItem>)((BetterMenuBase)Menu.SuitsMenu).AllMenuItemsOfType).FirstOrDefault((Func<MenuItem, bool>)((MenuItem x) => x.Name == Name)); if (val2 != null) { MenuItem = (SuitMenuItem)(object)val2; } else { SuitMenuItem suitMenuItem = new SuitMenuItem(Name, new CustomEvent()); ((MenuItem)suitMenuItem).Header = () => "========[( " + Name + " )]========\r\n"; ((MenuItem)suitMenuItem).Footer = Menu.GetFooter; ((MenuItem)suitMenuItem).OnPageLoad = OnPageLoad; MenuItem = suitMenuItem; } MenuItem.SuitProps = this; IsFav = IsFavorite(); if (!HideFromTerminal) { ((MenuItem)Menu.SuitsList).AddNestedItem((MenuItem)(object)MenuItem); if (IsFav) { ((MenuItem)Menu.FavoritesList).NestedMenus.Add((MenuItem)(object)MenuItem); } ((MenuItem)MenuItem).SelectionEvent.RemoveAllListeners(); ((MenuItem)MenuItem).SelectionEvent.AddListener(new Event(Selection)); Loggers.LogDebug("SuitAttributes created for " + Name); RackManager.AllSuits.Add(this); } } private void OnDestroy() { Plugin.Log.LogDebug((object)("Destroying SuitAttribute! [" + Name + "]")); ((MenuItem)MenuItem).RemoveFromParent(); RackManager.AllSuits.Remove(this); } internal void Preview() { Loggers.LogDebug("Preview"); if (Menu.CurrentNest != null && Menu.SuitsMenu.ActiveSelection < Menu.CurrentNest.Count && Menu.CurrentNest[Menu.SuitsMenu.ActiveSelection] == MenuItem) { UnlockableSuit.SwitchSuitForPlayer(Plugin.LocalPlayer, Suit.suitID, false); } } internal void Selection() { Menu.PotentialSelection = this; ((MenuItem)Menu.PotentialSelection.MenuItem).Parent = Menu.SuitsMenu.CurrentMenuItem; } internal void WearSuit() { if ((Object)(object)Suit == (Object)null) { Loggers.ERROR("suit is null!"); return; } Plugin.LocalPlayer.currentSuitID = RackManager.RealCurrentID; Suit.SwitchSuitToThis(Plugin.LocalPlayer); Plugin.Log.LogMessage((object)("Switched suit to " + Name)); RackManager.RealCurrentID = Suit.suitID; } internal bool IsFavorite() { RemoveFromFavs(); if (RackManager.FavsList.Count == 0) { return false; } if (RackManager.FavsList.Any((string x) => x.Equals(Name, StringComparison.InvariantCultureIgnoreCase))) { Loggers.LogDebug(Name + " is detected in favorites list"); AddToFavs(); return true; } Loggers.LogDebug(Name + " is *NOT* a favorite"); return false; } internal void ToggleDefault() { UpdateDefault = true; if (IsDefault()) { Plugin.SaveDefault(string.Empty); } else { Plugin.SaveDefault(Name); } } internal void ToggleFav() { if (IsFav) { RemoveFromFavs(); Loggers.LogInfo(Name + " removed from favorites listing"); if (RackManager.FavCount < 1 && ((MenuItem)Menu.FavoritesList).IsActive) { Plugin.SaveToConfig(RackManager.FavList, out string configItem); Plugin.SaveFavorites(configItem); return; } } else { AddToFavs(); Loggers.LogInfo(Name + " added to favorites listing"); } Plugin.SaveToConfig(RackManager.FavList, out string configItem2); Plugin.SaveFavorites(configItem2); } internal void RemoveFromFavs() { IsFav = false; ((MenuItem)Menu.FavoritesList).RemoveChild((MenuItem)(object)MenuItem); } internal void AddToFavs() { if (MenuItem == null) { Loggers.WARNING("menuItem is null for " + Name); return; } IsFav = true; ((MenuItem)Menu.FavoritesList).AddNestedItem((MenuItem)(object)MenuItem); Loggers.LogDebug("AddToFavs has added " + Name + "!"); } internal bool ShouldHideTerm() { List<string> listToLower = CommonStringStuff.GetListToLower(CommonStringStuff.GetKeywordsPerConfigItem(ModConfig.DontAddToTerminal.Value, ',')); return listToLower.Any((string x) => x.Equals(Name, StringComparison.InvariantCultureIgnoreCase)); } private void DetermineChildren(bool isLocked) { ((MenuItem)MenuItem).NestedMenus.Clear(); if (isLocked) { ((MenuItem)MenuItem).NestedMenus.Add((MenuItem)(object)Menu.PurchaseSuitFromStore); } else { ((MenuItem)MenuItem).NestedMenus.Add((MenuItem)(object)Menu.SelectSuit); } ((MenuItem)MenuItem).NestedMenus.Add((MenuItem)(object)Menu.FavoriteSuit); ((MenuItem)MenuItem).NestedMenus.Add((MenuItem)(object)Menu.SetDefaultSuit); } internal void OnPageLoad() { if (Menu.SuitsMenu.CurrentMenuItem != MenuItem) { Loggers.LogDebug(Name + " OnPageLoad, Current - [" + Menu.SuitsMenu.CurrentMenuItem.Name + "]"); if (Plugin.LocalPlayer.currentSuitID != ID) { Preview(); } bool flag = IsLocked(); ((MenuItem)MenuItem).Suffix = string.Empty; DetermineChildren(flag); if (flag) { ((MenuItem)MenuItem).Prefix = "<color=#666663>"; ((MenuItem)MenuItem).Suffix = "</color>"; } if (IsFav) { SuitMenuItem menuItem = MenuItem; ((MenuItem)menuItem).Suffix = ((MenuItem)menuItem).Suffix + " (*)"; } if ((Object)(object)RackManager.CurrentSuit == (Object)(object)this) { SuitMenuItem menuItem2 = MenuItem; ((MenuItem)menuItem2).Suffix = ((MenuItem)menuItem2).Suffix + " [EQUIPPED]"; } } } internal static string GetName(UnlockableSuit item) { string SuitName = StartOfRound.Instance.unlockablesList.unlockables[item.syncedSuitID.Value].unlockableName; if (RackManager.AllSuits.FindAll((SuitAttributes x) => x.Name == SuitName).Count > 0) { SuitName += $"({item.syncedSuitID.Value})"; } return SuitName; } internal bool IsCurrent() { return (Object)(object)RackManager.CurrentSuit == (Object)(object)this; } } internal class SuitMenuItem : MenuItem { private string _name; public bool _showEmpty; private CustomEvent _selection; private List<MenuItem> _nested; public SuitAttributes SuitProps; public override string Name { get { return _name; } set { _name = value; } } public override bool ShowIfEmptyNest { get { return _showEmpty; } set { _showEmpty = value; } } public override CustomEvent SelectionEvent { get { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown if (_selection == null) { _selection = new CustomEvent(); } return _selection; } set { _selection = value; } } public override List<MenuItem> NestedMenus { get { return _nested; } set { _nested = value; } } public SuitMenuItem(string name, CustomEvent select = null) { _name = name; _showEmpty = true; _selection = select; _nested = new List<MenuItem>(); ((MenuItem)this)..ctor((BetterMenuBase)(object)Menu.SuitsMenu); } internal static MenuItem GetStartMenu() { if (ModConfig.MenuStartPage.Value == ModConfig.Page.HelpPage) { return (MenuItem)(object)Menu.HelpPage; } if (ModConfig.MenuStartPage.Value == ModConfig.Page.FavoritesListing) { return (MenuItem)(object)Menu.FavoritesList; } if (ModConfig.MenuStartPage.Value == ModConfig.Page.SuitsListing) { return (MenuItem)(object)Menu.SuitsList; } return (MenuItem)(object)Menu.HomePage; } } } namespace suitsTerminal.OfTerminal { internal class CommandHandler { internal static string RandomSuit() { Loggers.LogDebug($"Suit Count: {RackManager.AllSuits.Count}"); int num = Plugin.Rand.Next(RackManager.AllSuits.Count); SuitAttributes suitAttributes = RackManager.AllSuits[num]; suitAttributes.WearSuit(); return $"========== Rolled random number [ {num} ] ==========\n\n\n\n\n\n\n\n\n\n\n\n\n\tChanging suit to {suitAttributes.Name}!\n\tPress any key to continue...\n\n"; } private static void EnteringMenu() { Menu.SuitsMenu.ExitAction = null; RackManager.RealCurrentID = Plugin.LocalPlayer.currentSuitID; } internal static string MainSuitsMenu() { ((MenuItem)Menu.HomePage).AddNestedItem((MenuItem)(object)Menu.FavoritesList); ((MenuItem)Menu.HomePage).AddNestedItem((MenuItem)(object)Menu.SuitsList); Menu.SuitsMenu.MenuNode = Menu.Main.terminalNode; EnteringMenu(); Menu.SuitsMenu.EnterAtPage(SuitMenuItem.GetStartMenu()); return ""; } internal static string FavsSuitsMenu() { ((MenuItem)Menu.FavoritesList).RemoveFromParent(); Menu.SuitsMenu.MenuNode = Menu.FavListing.terminalNode; EnteringMenu(); Menu.SuitsMenu.EnterAtPage((MenuItem)(object)Menu.FavoritesList); return ""; } internal static string SuitsListMenu() { ((MenuItem)Menu.SuitsList).RemoveFromParent(); Menu.SuitsMenu.MenuNode = Menu.SuitListing.terminalNode; EnteringMenu(); Menu.SuitsMenu.EnterAtPage((MenuItem)(object)Menu.SuitsList); return ""; } } internal class Menu { [CompilerGenerated] private static class <>O { public static Event <0>__OnEnterStuff; public static Event <1>__OnExitStuff; public static Func<string> <2>__MainFooter; public static Action <3>__MainMenuStuff; public static Event <4>__RemovePreview; public static Func<string> <5>__GetFooter; public static Event <6>__ShowFavs; public static Event <7>__ShowNormal; public static Event <8>__RandomSuitPage; public static Event <9>__ShowHelpPage; public static ParameterEvent<List<MenuItem>> <10>__SortSuits; public static Func<string> <11>__MainSuitsMenu; public static Func<string> <12>__FavsSuitsMenu; public static Func<string> <13>__SuitsListMenu; public static Action <14>__PipHeight; public static Action <15>__PipRotate; public static Action <16>__PipZoom; public static Action <17>__PipAction; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<string> <>9__27_4; public static Func<string> <>9__27_5; public static Func<string> <>9__27_6; public static Action <>9__27_7; public static Event <>9__27_0; public static Action <>9__27_8; public static Event <>9__27_1; public static Action <>9__27_9; public static Event <>9__27_2; public static Action <>9__27_10; public static Event <>9__27_3; public static Func<SuitMenuItem, string> <>9__28_0; public static Func<SuitMenuItem, int> <>9__28_1; internal string <InitMenuListing>b__27_4() { return "============= suitsTerminal Menu =============\r\n"; } internal string <InitMenuListing>b__27_5() { return "============= Favorite Suits =============\r\n"; } internal string <InitMenuListing>b__27_6() { return "============= Select a Suit! =============\r\n"; } internal void <InitMenuListing>b__27_7() { ((MenuItem)SelectSuit).Name = "Wear " + PotentialSelection.Name; } internal void <InitMenuListing>b__27_0() { PotentialSelection.WearSuit(); } internal void <InitMenuListing>b__27_8() { if (PotentialSelection.IsFav) { ((MenuItem)FavoriteSuit).Name = "Remove Favorite " + PotentialSelection.Name; } else { ((MenuItem)FavoriteSuit).Name = "Add Favorite " + PotentialSelection.Name; } } internal void <InitMenuListing>b__27_1() { PotentialSelection.ToggleFav(); } internal void <InitMenuListing>b__27_9() { SuitAttributes.UpdateDefault = true; if (PotentialSelection.IsDefault()) { ((MenuItem)SetDefaultSuit).Name = "Remove " + PotentialSelection.Name + " as Default"; } else { ((MenuItem)SetDefaultSuit).Name = "Make " + PotentialSelection.Name + " the default suit"; } } internal void <InitMenuListing>b__27_2() { PotentialSelection.ToggleDefault(); } internal void <InitMenuListing>b__27_10() { List<UnlockableItem> unlockables = StartOfRound.Instance.unlockablesList.unlockables; ((MenuItem)PurchaseSuitFromStore).Name = $"Purchase {PotentialSelection.Name} from store {unlockables[PotentialSelection.MenuItem.SuitProps.Suit.syncedSuitID.Value].shopSelectionNode.itemCost}"; } internal void <InitMenuListing>b__27_3() { <>c__DisplayClass27_0 CS$<>8__locals0 = new <>c__DisplayClass27_0 { UnlockableItems = StartOfRound.Instance.unlockablesList.unlockables }; SuitsMenu.ExitAction = delegate { CommonTerminal.LoadNewNode(CS$<>8__locals0.UnlockableItems[PotentialSelection.MenuItem.SuitProps.Suit.syncedSuitID.Value].shopSelectionNode); }; SuitsMenu.ExitMenu(true); } internal string <SortSuits>b__28_0(SuitMenuItem x) { return ((MenuItem)x).Name; } internal int <SortSuits>b__28_1(SuitMenuItem x) { return x.SuitProps.ID; } } [CompilerGenerated] private sealed class <>c__DisplayClass27_0 { public List<UnlockableItem> UnlockableItems; internal void <InitMenuListing>b__11() { CommonTerminal.LoadNewNode(UnlockableItems[PotentialSelection.MenuItem.SuitProps.Suit.syncedSuitID.Value].shopSelectionNode); } } [CompilerGenerated] private sealed class <SuitsMenuShowPicture>d__55 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool isCentered; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SuitsMenuShowPicture>d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; PictureInPicture.TogglePicture(state: true, isCentered); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static BetterMenu<SuitMenuItem> SuitsMenu = null; internal static Dictionary<Key, Action> ExtraKeyActions = new Dictionary<Key, Action>(); internal static bool InitOnce = false; internal static SuitMenuItem HomePage = null; internal static SuitMenuItem FavoritesList = null; internal static SuitMenuItem SuitsList = null; internal static SuitMenuItem HelpPage = null; internal static SuitMenuItem SelectSuit = null; internal static SuitMenuItem FavoriteSuit = null; internal static SuitMenuItem SetDefaultSuit = null; internal static SuitMenuItem PurchaseSuitFromStore = null; internal static SuitMenuItem SetRandomSuit = null; internal static CommandManager Main = null; internal static CommandManager FavListing = null; internal static CommandManager SuitListing = null; internal static SuitAttributes PotentialSelection = null; internal static string togglePiPstring = string.Empty; internal static string pipHeightString = string.Empty; internal static string pipRotateString = string.Empty; internal static string pipZoomString = string.Empty; internal static List<MenuItem> CurrentNest = new List<MenuItem>(); internal static bool initKeySettings = false; public static Color CaretOriginal = Color.green; public static bool specialMenusActive = false; internal static void InitBetterMenu() { if (!initKeySettings) { initKeySettings = true; SetupExtraKeys(); Loggers.LogDebug("Loading keybinds from config"); InitOneTime(); UpdateMainKeys(); initKeySettings = false; } } private static void InitOneTime() { //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_005d: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (!InitOnce) { Plugin.Log.LogMessage((object)"InitOneTime for BetterMenu stuff!"); AddHintToOther(); SuitsMenu = new BetterMenu<SuitMenuItem>("suitsTerminal", ExtraKeyActions) { PageSize = 10 }; CustomEvent onEnter = SuitsMenu.OnEnter; object obj = <>O.<0>__OnEnterStuff; if (obj == null) { Event val = OnEnterStuff; <>O.<0>__OnEnterStuff = val; obj = (object)val; } onEnter.AddListener((Event)obj); CustomEvent onExit = SuitsMenu.OnExit; object obj2 = <>O.<1>__OnExitStuff; if (obj2 == null) { Event val2 = OnExitStuff; <>O.<1>__OnExitStuff = val2; obj2 = (object)val2; } onExit.AddListener((Event)obj2); InitMenuListing(); InitOnce = true; } } private static void MainMenuStuff() { PictureInPicture.TogglePicture(state: false); } private static void InitMenuListing() { //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_00ad: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Expected O, but got Unknown //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Expected O, but got Unknown //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Expected O, but got Unknown SuitMenuItem suitMenuItem = new SuitMenuItem("suitsTerminal Home"); ((MenuItem)suitMenuItem).Header = () => "============= suitsTerminal Menu =============\r\n"; ((MenuItem)suitMenuItem).Footer = MainFooter; ((MenuItem)suitMenuItem).OnPageLoad = MainMenuStuff; HomePage = suitMenuItem; ((BetterMenuBase)SuitsMenu).MainMenu = (MenuItem)(object)HomePage; CustomEvent onExit = SuitsMenu.OnExit; object obj = <>O.<4>__RemovePreview; if (obj == null) { Event val = RackManager.RemovePreview; <>O.<4>__RemovePreview = val; obj = (object)val; } onExit.AddListener((Event)obj); suitMenuItem = new SuitMenuItem("Favorites"); ((MenuItem)suitMenuItem).ShowIfEmptyNest = false; ((MenuItem)suitMenuItem).Header = () => "============= Favorite Suits =============\r\n"; ((MenuItem)suitMenuItem).Footer = GetFooter; FavoritesList = suitMenuItem; CustomEvent selectionEvent = ((MenuItem)FavoritesList).SelectionEvent; object obj2 = <>O.<6>__ShowFavs; if (obj2 == null) { Event val2 = ShowFavs; <>O.<6>__ShowFavs = val2; obj2 = (object)val2; } selectionEvent.AddListener((Event)obj2); ((MenuItem)FavoritesList).SetParentMenu((MenuItem)(object)HomePage); suitMenuItem = new SuitMenuItem("Change Suits"); ((MenuItem)suitMenuItem).Header = () => "============= Select a Suit! =============\r\n"; ((MenuItem)suitMenuItem).Footer = GetFooter; SuitsList = suitMenuItem; CustomEvent selectionEvent2 = ((MenuItem)SuitsList).SelectionEvent; object obj3 = <>O.<7>__ShowNormal; if (obj3 == null) { Event val3 = ShowNormal; <>O.<7>__ShowNormal = val3; obj3 = (object)val3; } selectionEvent2.AddListener((Event)obj3); ((MenuItem)SuitsList).SetParentMenu((MenuItem)(object)HomePage); SetRandomSuit = new SuitMenuItem("Random Suit"); CustomEvent selectionEvent3 = ((MenuItem)SetRandomSuit).SelectionEvent; object obj4 = <>O.<8>__RandomSuitPage; if (obj4 == null) { Event val4 = RandomSuitPage; <>O.<8>__RandomSuitPage = val4; obj4 = (object)val4; } selectionEvent3.AddListener((Event)obj4); ((MenuItem)SetRandomSuit).SetParentMenu((MenuItem)(object)HomePage); HelpPage = new SuitMenuItem("Help Page"); CustomEvent selectionEvent4 = ((MenuItem)HelpPage).SelectionEvent; object obj5 = <>O.<9>__ShowHelpPage; if (obj5 == null) { Event val5 = ShowHelpPage; <>O.<9>__ShowHelpPage = val5; obj5 = (object)val5; } selectionEvent4.AddListener((Event)obj5); ((MenuItem)HelpPage).SetParentMenu((MenuItem)(object)HomePage); ((MenuItem)SuitsList).AdjustNestedMenuList.AddListener((ParameterEvent<List<MenuItem>>)SortSuits); ((MenuItem)FavoritesList).AdjustNestedMenuList.AddListener((ParameterEvent<List<MenuItem>>)SortSuits); SuitMenuItem suitMenuItem2 = new SuitMenuItem("Select Suit"); ((MenuItem)suitMenuItem2).OnPageLoad = delegate { ((MenuItem)SelectSuit).Name = "Wear " + PotentialSelection.Name; }; SelectSuit = suitMenuItem2; CustomEvent selectionEvent5 = ((MenuItem)SelectSuit).SelectionEvent; object obj6 = <>c.<>9__27_0; if (obj6 == null) { Event val6 = delegate { PotentialSelection.WearSuit(); }; <>c.<>9__27_0 = val6; obj6 = (object)val6; } selectionEvent5.AddListener((Event)obj6); SuitMenuItem suitMenuItem3 = new SuitMenuItem("Favorite Suit"); ((MenuItem)suitMenuItem3).OnPageLoad = delegate { if (PotentialSelection.IsFav) { ((MenuItem)FavoriteSuit).Name = "Remove Favorite " + PotentialSelection.Name; } else { ((MenuItem)FavoriteSuit).Name = "Add Favorite " + PotentialSelection.Name; } }; FavoriteSuit = suitMenuItem3; CustomEvent selectionEvent6 = ((MenuItem)FavoriteSuit).SelectionEvent; object obj7 = <>c.<>9__27_1; if (obj7 == null) { Event val7 = delegate { PotentialSelection.ToggleFav(); }; <>c.<>9__27_1 = val7; obj7 = (object)val7; } selectionEvent6.AddListener((Event)obj7); SuitMenuItem suitMenuItem4 = new SuitMenuItem("Set Default"); ((MenuItem)suitMenuItem4).OnPageLoad = delegate { SuitAttributes.UpdateDefault = true; if (PotentialSelection.IsDefault()) { ((MenuItem)SetDefaultSuit).Name = "Remove " + PotentialSelection.Name + " as Default"; } else { ((MenuItem)SetDefaultSuit).Name = "Make " + PotentialSelection.Name + " the default suit"; } }; SetDefaultSuit = suitMenuItem4; CustomEvent selectionEvent7 = ((MenuItem)SetDefaultSuit).SelectionEvent; object obj8 = <>c.<>9__27_2; if (obj8 == null) { Event val8 = delegate { PotentialSelection.ToggleDefault(); }; <>c.<>9__27_2 = val8; obj8 = (object)val8; } selectionEvent7.AddListener((Event)obj8); SuitMenuItem suitMenuItem5 = new SuitMenuItem("Purchase from store"); ((MenuItem)suitMenuItem5).OnPageLoad = delegate { List<UnlockableItem> unlockables = StartOfRound.Instance.unlockablesList.unlockables; ((MenuItem)PurchaseSuitFromStore).Name = $"Purchase {PotentialSelection.Name} from store {unlockables[PotentialSelection.MenuItem.SuitProps.Suit.syncedSuitID.Value].shopSelectionNode.itemCost}"; }; PurchaseSuitFromStore = suitMenuItem5; CustomEvent selectionEvent8 = ((MenuItem)PurchaseSuitFromStore).SelectionEvent; object obj9 = <>c.<>9__27_3; if (obj9 == null) { Event val9 = delegate { List<UnlockableItem> UnlockableItems = StartOfRound.Instance.unlockablesList.unlockables; SuitsMenu.ExitAction = delegate { CommonTerminal.LoadNewNode(UnlockableItems[PotentialSelection.MenuItem.SuitProps.Suit.syncedSuitID.Value].shopSelectionNode); }; SuitsMenu.ExitMenu(true); }; <>c.<>9__27_3 = val9; obj9 = (object)val9; } selectionEvent8.AddListener((Event)obj9); } private static void SortSuits(ref List<MenuItem> list) { if (ModConfig.SuitsSortingStyle.Value == ModConfig.Sort.Alphabetical) { list = ((IEnumerable<MenuItem>)(from SuitMenuItem x in list orderby ((MenuItem)x).Name select x)).ToList(); } else if (ModConfig.SuitsSortingStyle.Value == ModConfig.Sort.Numerical) { list = ((IEnumerable<MenuItem>)(from SuitMenuItem x in list orderby x.SuitProps.ID select x)).ToList(); } CurrentNest = list; } private static void ReplaceKey(ref Key current, Key newKey, ref int replacements) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Expected I4, but got Unknown current = (Key)(int)newKey; replacements++; } internal static void RefreshKeys() { //IL_0024: 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_003c: 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_006b: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)SuitsMenu.MenuNode == (Object)null)) { int replacements = 0; if (IsValidReplacement(ModConfig.MenuUp.Value, SuitsMenu.upMenu, out var validKey)) { ReplaceKey(ref SuitsMenu.upMenu, validKey, ref replacements); } if (IsValidReplacement(ModConfig.MenuDown.Value, SuitsMenu.downMenu, out var validKey2)) { ReplaceKey(ref SuitsMenu.downMenu, validKey2, ref replacements); } if (IsValidReplacement(ModConfig.MenuLeft.Value, SuitsMenu.leftMenu, out var validKey3)) { ReplaceKey(ref SuitsMenu.leftMenu, validKey3, ref replacements); } if (IsValidReplacement(ModConfig.MenuRight.Value, SuitsMenu.rightMenu, out var validKey4)) { ReplaceKey(ref SuitsMenu.rightMenu, validKey4, ref replacements); } if (IsValidReplacement(ModConfig.LeaveMenu.Value, SuitsMenu.leaveMenu, out var validKey5)) { ReplaceKey(ref SuitsMenu.leaveMenu, validKey5, ref replacements); } if (IsValidReplacement(ModConfig.SelectMenu.Value, SuitsMenu.selectMenu, out var validKey6)) { ReplaceKey(ref SuitsMenu.selectMenu, validKey6, ref replacements); } if (replacements > 0) { SuitsMenu.UpdateMainActions(); } if (IsAnyExtraKeyDifferent()) { SetupExtraKeys(); SuitsMenu.OtherActions = ExtraKeyActions; } } } private static bool IsAnyExtraKeyDifferent() { if (ModConfig.CamStyle.Value == ModConfig.PiP.Disabled) { return false; } if (!pipHeightString.Equals(ModConfig.TogglePiPHeight.Value, StringComparison.InvariantCultureIgnoreCase)) { return true; } if (!pipRotateString.Equals(ModConfig.TogglePiPRotation.Value, StringComparison.InvariantCultureIgnoreCase)) { return true; } if (!pipZoomString.Equals(ModConfig.TogglePiPZoom.Value, StringComparison.InvariantCultureIgnoreCase)) { return true; } if (!togglePiPstring.Equals(ModConfig.TogglePiP.Value, StringComparison.InvariantCultureIgnoreCase)) { return true; } return false; } internal static void CreateBetterCommand() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown Main = new CommandManager("suitsTerminal Main Menu", ModConfig.MainMenuKWs.GetKeywordValues(isMain: true), (Func<string>)CommandHandler.MainSuitsMenu, (ConfigEntry<bool>)null, 0, true); FavListing = new CommandManager("suitsTerminal Favorites Listing", ModConfig.FavMenuKWs.GetKeywordValues(), (Func<string>)CommandHandler.FavsSuitsMenu, (ConfigEntry<bool>)null, 0, true); SuitListing = new CommandManager("suitsTerminal Suits Listing", ModConfig.SuitsListingKWs.GetKeywordValues(), (Func<string>)CommandHandler.SuitsListMenu, (ConfigEntry<bool>)null, 0, true); } internal static void AddHintToOther() { TerminalNode val = default(TerminalNode); if (LogicHandling.TryGetFromAllNodes("OtherCommands", ref val)) { AddingThings.AddToExistingNodeText("\n>SUITS\nsuitsTerminal advanced menu for changing & viewing suits", ref val); } } private static void SetupExtraKeys() { ExtraKeyActions = new Dictionary<Key, Action>(); PiPKeys(); } private static void UpdateMainKeys() { //IL_000f: 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_0022: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00c4: 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_00ed: Unknown result type (might be due to invalid IL or missing references) if (IsValidReplacement(ModConfig.MenuUp.Value, SuitsMenu.upMenu, out var validKey)) { SuitsMenu.upMenu = validKey; } if (IsValidReplacement(ModConfig.MenuDown.Value, SuitsMenu.downMenu, out var validKey2)) { SuitsMenu.downMenu = validKey2; } if (IsValidReplacement(ModConfig.MenuLeft.Value, SuitsMenu.leftMenu, out var validKey3)) { SuitsMenu.leftMenu = validKey3; } if (IsValidReplacement(ModConfig.MenuRight.Value, SuitsMenu.rightMenu, out var validKey4)) { SuitsMenu.rightMenu = validKey4; } if (IsValidReplacement(ModConfig.LeaveMenu.Value, SuitsMenu.leaveMenu, out var validKey5)) { SuitsMenu.leaveMenu = validKey5; } if (IsValidReplacement(ModConfig.SelectMenu.Value, SuitsMenu.selectMenu, out var validKey6)) { SuitsMenu.selectMenu = validKey6; } SuitsMenu.UpdateMainActions(); } internal static string GetFooter() { //IL_0036: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) string equippedSuitName = GetEquippedSuitName(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("\r\n\r\n\r\n\r\nCurrently Wearing: " + equippedSuitName + "\r\n\r\n"); stringBuilder.Append($"Page [{SuitsMenu.leftMenu}] < {SuitsMenu.CurrentPage}/{Mathf.CeilToInt((float)SuitsMenu.DisplayMenuItemsOfType.Count / (float)SuitsMenu.PageSize)} > [{SuitsMenu.rightMenu}]\r\n"); stringBuilder.Append($"Leave Menu: [{SuitsMenu.leaveMenu}] Select Suit: [{SuitsMenu.selectMenu}]\r\n"); return stringBuilder.ToString(); } internal static string MainFooter() { //IL_0019: 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_0087: 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) StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append($"\r\n\r\n\r\n\r\nPage [{SuitsMenu.leftMenu}] < {SuitsMenu.CurrentPage}/{Mathf.CeilToInt((float)SuitsMenu.DisplayMenuItemsOfType.Count / (float)SuitsMenu.PageSize)} > [{SuitsMenu.rightMenu}]\r\n"); stringBuilder.Append($"Leave Menu: [{SuitsMenu.leaveMenu}] Select Item: [{SuitsMenu.selectMenu}]\r\n"); return stringBuilder.ToString(); } private static string GetEquippedSuitName() { if ((Object)(object)RackManager.CurrentSuit == (Object)null) { return string.Empty; } return RackManager.CurrentSuit.Name; } private static void BindKeys(Action menuAction, Key givenKey, ref string givenKeyString, string defaultKeyString, Key defaultKey) { //IL_0010: 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_0018: Unknown result type (might be due to invalid IL or missing references) Loggers.LogDebug($"Binding {menuAction}"); if ((int)givenKey != 0) { ExtraKeyActions.Add(givenKey, menuAction); Loggers.LogDebug(givenKeyString + " bound"); } else { ExtraKeyActions.Add(defaultKey, menuAction); givenKeyString = defaultKeyString; Loggers.LogDebug(givenKeyString + " bound"); } } private static void CheckKeys(string configString, out Key usingKey, out string keyString) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown if (IsValidKey(configString, out var validKey)) { usingKey = (Key)(int)validKey; keyString = ((object)(Key)(ref validKey)).ToString(); } else { usingKey = (Key)0; keyString = "FAIL"; } } private static void PiPKeys() { //IL_003e: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.CamStyle.Value != 0) { CheckKeys(ModConfig.TogglePiPHeight.Value, out var usingKey, out pipHeightString); BindKeys(PipHeight, usingKey, ref pipHeightString, "Backslash", (Key)10); CheckKeys(ModConfig.TogglePiPRotation.Value, out var usingKey2, out pipRotateString); BindKeys(PipRotate, usingKey2, ref pipRotateString, "Equals", (Key)14); CheckKeys(ModConfig.TogglePiPZoom.Value, out var usingKey3, out pipZoomString); BindKeys(PipZoom, usingKey3, ref pipZoomString, "Minus", (Key)13); CheckKeys(ModConfig.TogglePiP.Value, out var usingKey4, out togglePiPstring); BindKeys(PipAction, usingKey4, ref togglePiPstring, "F12", (Key)105); } } private static bool IsValidReplacement(string key, Key original, out Key validKey) { //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) //IL_0023: 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_0020: Expected I4, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected I4, but got Unknown List<Key> list = new List<Key>(1) { (Key)3 }; if (Enum.TryParse<Key>(key, ignoreCase: true, out Key result)) { if (original == result) { validKey = (Key)(int)original; return false; } if (list.Contains(result)) { Loggers.WARNING("Tab Key detected, rejecting bind."); validKey = (Key)0; return false; } if (SuitsMenu.MainActions.ContainsKey(result)) { Loggers.WARNING("Key was already bound to something, returning false"); string text = string.Join(", ", SuitsMenu.MainActions.Keys); Loggers.WARNING("Key list: " + text); validKey = (Key)0; return false; } Loggers.LogDebug("Valid Key Detected and being assigned"); validKey = (Key)(int)result; return true; } validKey = (Key)0; return false; } private static bool IsValidKey(string key, out Key validKey) { //IL_001a: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected I4, but got Unknown List<Key> list = new List<Key>(1) { (Key)3 }; if (Enum.TryParse<Key>(key, ignoreCase: true, out Key result)) { if (list.Contains(result)) { Loggers.WARNING("Tab Key detected, rejecting bind."); validKey = (Key)0; return false; } if (ExtraKeyActions.ContainsKey(result)) { Loggers.WARNING("Key was already bound to something, returning false"); string text = string.Join(", ", ExtraKeyActions.Keys); Loggers.WARNING("Key list: " + text); validKey = (Key)0; return false; } Loggers.LogDebug("Valid Key Detected and being assigned to bind"); validKey = (Key)(int)result; return true; } validKey = (Key)0; return false; } private static Camera GetCam() { if (Plugin.instance.OpenBodyCamsMod && ModConfig.CamStyle.Value == ModConfig.PiP.OpenBodyCams) { Loggers.LogDebug("Returning Cam from OpenLib OpenBodyCams Compat!"); return OpenBodyCamFuncs.GetCam(OpenBodyCamFuncs.TerminalMirrorCam); } PictureInPicture.PlayerCam = CamStuff.MyCameraHolder.GetComponent<Camera>(); return PictureInPicture.PlayerCam; } private static void PipAction() { PictureInPicture.TogglePicture(!PictureInPicture.PipActive); Loggers.LogDebug($"Toggling PiP to state {!PictureInPicture.PipActive}"); } private static void PipHeight() { if (PictureInPicture.PipActive) { Camera cam = GetCam(); if (!((Object)(object)cam == (Object)null)) { PictureInPicture.MoveCamera(((Component)cam).transform, ref PictureInPicture.HeightStep); Loggers.LogDebug($"Changing PiP height to {PictureInPicture.HeightStep}"); } } } private static void PipRotate() { if (PictureInPicture.PipActive) { Camera cam = GetCam(); if (!((Object)(object)cam == (Object)null)) { PictureInPicture.RotateCameraAroundPlayer(Plugin.LocalPlayer.meshContainer, ((Component)cam).transform); Loggers.LogDebug("Rotating PiP around player"); } } } private static void PipZoom() { if (PictureInPicture.PipActive) { Camera cam = GetCam(); if (!((Object)(object)cam == (Object)null)) { PictureInPicture.ChangeCamZoom(cam, ref PictureInPicture.ZoomStep); Loggers.LogDebug($"Changing PiP zoom to zoomStep: [{PictureInPicture.ZoomStep}]"); } } } private static void RandomSuitPage() { SuitsMenu.MenuNode.displayText = CommandHandler.RandomSuit(); SuitsMenu.AcceptAnything = true; SuitsMenu.Load(); ((MonoBehaviour)Plugin.Terminal).StartCoroutine(SuitsMenuShowPicture(isCentered: true)); } private static void ShowHelpPage() { SuitsMenu.MenuNode.displayText = HelpMenuDisplay(); SuitsMenu.AcceptAnything = true; SuitsMenu.Load(); PictureInPicture.TogglePicture(state: false); } private static void ShowFavs() { if (((MenuItem)FavoritesList).NestedMenus.Count < 1) { Plugin.Terminal.PlayTerminalAudioServerRpc(1); Loggers.LogInfo("Empty favorites menu! Playing error audio for user"); } else { ((MonoBehaviour)Plugin.Terminal).StartCoroutine(SuitsMenuShowPicture()); } } private static void ShowNormal() { ((MonoBehaviour)Plugin.Terminal).StartCoroutine(SuitsMenuShowPicture()); } private static void OnExitStuff() { PictureInPicture.TogglePicture(state: false); } private static void OnEnterStuff() { PictureInPicture.RotateStep = 0; PictureInPicture.HeightStep = 0; PictureInPicture.ZoomStep = 1; ((MenuItem)SetRandomSuit).ShowIfEmptyNest = ModConfig.RandomSuitMenu.Value; } [IteratorStateMachine(typeof(<SuitsMenuShowPicture>d__55))] internal static IEnumerator SuitsMenuShowPicture(bool isCentered = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SuitsMenuShowPicture>d__55(0) { isCentered = isCentered }; } internal static string HelpMenuDisplay() { //IL_0033: 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_00c9: 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) Loggers.LogDebug("Help Menu Enabled, showing help information"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("========= AdvancedsuitsMenu Help Page =========\r\n"); stringBuilder.Append("\r\n\r\n"); stringBuilder.Append($"Highlight Next Item: [{SuitsMenu.downMenu}]\r\nHighlight Last Item: [{SuitsMenu.upMenu}]\r\n"); if (ModConfig.CamStyle.Value != 0) { stringBuilder.Append("Toggle Camera Preview: [" + togglePiPstring + "]\r\nRotate Camera: [" + pipRotateString + "]\r\nChange Camera Height: [" + pipHeightString + "]\r\nChange Camera Zoom: [" + pipZoomString + "]\r\n"); } stringBuilder.Append($"Leave Suits Menu: [{SuitsMenu.leaveMenu}]\r\nSelect Suit: [{SuitsMenu.selectMenu}]\r\n"); stringBuilder.Append("\r\n>>>\tReturn to Menu: [ANY KEY]\t<<\r\n"); return stringBuilder.ToString(); } } } namespace suitsTerminal.Misc { internal class Coroutines { [CompilerGenerated] private sealed class <ChatHints>d__2 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ChatHints>d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (ModConfig.HintStyle.Value != ModConfig.Hint.ChatOnly && ModConfig.HintStyle.Value != ModConfig.Hint.AllHints) { return false; } <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)HUDManager.Instance == (Object)null) { Loggers.WARNING("Unable to hint on chat! HUDManager instance is null!"); return false; } Loggers.LogMessage("displaying hint in chat."); HUDManager.Instance.AddChatMessage("[suitsTerminal]: Access more suits by typing 'suits' in the terminal.", "", -1, false); if (ModConfig.ChatCommands.Value) { HUDManager.Instance.AddChatMessage("[suitsTerminal]: Access more suits by typing '!suits' in chat.", "", -1, false); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <DelayStartOnReset>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayStartOnReset>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; RackManager.RealCurrentID = 0; Menu.specialMenusActive = false; Loggers.LogDebug("ShipResetStuff!"); Plugin.EquipDefault = true; <>2__current = SetDefaultSuit(); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <HudHints>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HudHints>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (ModConfig.HintStyle.Value != ModConfig.Hint.BannerOnly && ModConfig.HintStyle.Value != ModConfig.Hint.AllHints) { return false; } <>2__current = (object)new WaitForSeconds(20f); <>1__state = 1; return true; case 1: { <>1__state = -1; Loggers.LogDebug("hint on hud."); bool flag = ModConfig.RackSettings.Value != ModConfig.Removal.OnlyRackAndExtraSuits && ModConfig.RackSettings.Value != ModConfig.Removal.Everything; if (ModConfig.SuitsOnRack.Value > 0 && flag && !ModConfig.ChatCommands.Value) { HUDManager.Instance.DisplayTip("Suits Access", "Excess suits have been moved to the terminal for storage. Use command 'suits' in the terminal to access them and change your suit!", false, false, "suitsTerminal-Hint"); } else if (ModConfig.SuitsOnRack.Value == 0 && !flag && !ModConfig.ChatCommands.Value) { HUDManager.Instance.DisplayTip("Suits Access", "All suits have been moved to the terminal for storage. Use command 'suits' in the terminal to access them and change your suit!", false, false, "suitsTerminal-Hint"); } else if (ModConfig.SuitsOnRack.Value == 0 && !flag && ModConfig.ChatCommands.Value) { HUDManager.Instance.DisplayTip("Suits Access", "All suits have been moved to the terminal for storage. Use command 'suits' in the terminal or !suits in the chat to access them and change your suit!", false, false, "suitsTerminal-Hint"); } else if (ModConfig.SuitsOnRack.Value > 0 && flag && ModConfig.ChatCommands.Value) { HUDManager.Instance.DisplayTip("Suits Access", "Excess suits have been moved to the terminal for storage. Use command 'suits' in the terminal or !suits in the chat to access them and change your suit!", false, false, "suitsTerminal-Hint"); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SetDefaultSuit>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetDefaultSuit>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!Plugin.EquipDefault) { return false; } break; case 1: <>1__state = -1; break; } if (Plugin.LocalPlayer.inSpecialInteractAnimation) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } Debug.Log((object)"Setting default suit!"); SuitAttributes.WearDefault(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(<DelayStartOnReset>d__0))] internal static IEnumerator DelayStartOnReset() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayStartOnReset>d__0(0); } [IteratorStateMachine(typeof(<SetDefaultSuit>d__1))] internal static IEnumerator SetDefaultSuit() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetDefaultSuit>d__1(0); } [IteratorStateMachine(typeof(<ChatHints>d__2))] internal static IEnumerator ChatHints() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ChatHints>d__2(0); } [IteratorStateMachine(typeof(<HudHints>d__3))] internal static IEnumerator HudHints() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HudHints>d__3(0); } } internal class EventManagement { [CompilerGenerated] private static class <>O { public static Event <0>__OnTerminalDisable; public static Event <1>__OnStartRound; public static Event <2>__OnPlayerSpawn; public static Event <3>__OnShipReset; } internal static void Subscribe() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //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_008f: Expected O, but got Unknown CustomEvent terminalDisable = EventManager.TerminalDisable; object obj = <>O.<0>__OnTerminalDisable; if (obj == null) { Event val = OnTerminalDisable; <>O.<0>__OnTerminalDisable = val; obj = (object)val; } terminalDisable.AddListener((Event)obj); CustomEvent terminalStart = EventManager.TerminalStart; object obj2 = <>O.<1>__OnStartRound; if (obj2 == null) { Event val2 = OnStartRound; <>O.<1>__OnStartRound = val2; obj2 = (object)val2; } terminalStart.AddListener((Event)obj2); CustomEvent playerSpawn = EventManager.PlayerSpawn; object obj3 = <>O.<2>__OnPlayerSpawn; if (obj3 == null) { Event val3 = OnPlayerSpawn; <>O.<2>__OnPlayerSpawn = val3; obj3 = (object)val3; } playerSpawn.AddListener((Event)obj3); CustomEvent shipReset = EventManager.ShipReset; object obj4 = <>O.<3>__OnShipReset; if (obj4 == null) { Event val4 = OnShipReset; <>O.<3>__OnShipReset = val4; obj4 = (object)val4; } shipReset.AddListener((Event)obj4); TerminalUpdatePatch.usePatch = true; } private static void OnShipReset() { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(Coroutines.DelayStartOnReset()); } private static void OnTerminalDisable() { Plugin.HintOnce = false; PictureInPicture.PiPCreated = false; Menu.specialMenusActive = false; Menu.PotentialSelection = null; Plugin.EquipDefault = true; Loggers.LogDebug("set initial variables"); ResetSuitPlacementVars(); } internal static void ResetSuitPlacementVars() { RackManager.RealCurrentID = 0; if (RackManager.AllSuits.Count != 0) { RackManager.AllSuits.ForEach(delegate(SuitAttributes s) { s.Reset(); }); } } private static void OnStartRound() { Menu.InitBetterMenu(); RackManager.InitFavoritesListing(); } private static void OnPlayerSpawn() { Loggers.LogDebug("OnPlayerSpawn"); if (!Plugin.HintOnce) { Loggers.LogDebug("First spawn detected!"); RackManager.HideBootsAndRack(); Plugin.ShowHint(); PiPStuff(); ((MonoBehaviour)Plugin.Terminal).StartCoroutine(Coroutines.SetDefaultSuit()); } } private static void PiPStuff() { //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) PictureInPicture.ShadowDefault = ((Renderer)Plugin.LocalPlayer.thisPlayerModel).shadowCastingMode; PictureInPicture.ModelLayerDefault = ((Component)Plugin.LocalPlayer.thisPlayerModel).gameObject.layer; } } internal class ModConfig { public enum Removal { DontRemoveAnything, OnlyExtraSuits, OnlyBootsAndExtraSuits, OnlyRackAndExtraSuits, Everything } public enum Hint { None, BannerOnly, ChatOnly, AllHints } public enum PiP { Disabled, OpenLib, OpenBodyCams } public enum Page { Main, FavoritesListing, SuitsListing, HelpPage } public enum Sort { None, Alphabetical, Numerical } public static ConfigEntry<LoggingLevel> LogLevel { get; internal set; } public static ConfigEntry<bool> RandomSuitMenu { get; internal set; } public static ConfigEntry<bool> ChatCommands { get; internal set; } public static ConfigEntry<int> SuitsOnRack { get; internal set; } public static ConfigEntry<float> RackOffset { get; internal set; } public static ConfigEntry<Removal> RackSettings { get; internal set; } public static ConfigEntry<bool> EnforcePaidSuits { get; internal set; } public static ConfigEntry<Hint> HintStyle { get; internal set; } public static ConfigEntry<PiP> CamStyle { get; internal set; } public static ConfigEntry<string> ObcResolution { get; internal set; } public static ConfigEntry<string> MainMenuKWs { get; internal set; } public static ConfigEntry<string> SuitsListingKWs { get; internal set; } public static ConfigEntry<string> FavMenuKWs { get; internal set; } public static ConfigEntry<string> MenuUp { get; internal set; } public static ConfigEntry<string> MenuDown { get; internal set; } public static ConfigEntry<string> MenuLeft { get; internal set; } public static ConfigEntry<string> MenuRight { get; internal set; } public static ConfigEntry<string> LeaveMenu { get; internal set; } public static ConfigEntry<string> SelectMenu { get; internal set; } public static ConfigEntry<string> TogglePiP { get; internal set; } public static ConfigEntry<string> TogglePiPZoom { get; internal set; } public static ConfigEntry<string> TogglePiPRotation { get; internal set; } public static ConfigEntry<string> TogglePiPHeight { get; internal set; } public static ConfigEntry<Page> MenuStartPage { get; internal set; } public static ConfigEntry<string> SuitsOnRackOnly { get; internal set; } public static ConfigEntry<string> DontAddToRack { get; internal set; } public static ConfigEntry<string> DontAddToTerminal { get; internal set; } public static ConfigEntry<string> FavoritesMenuList { get; internal set; } public static ConfigEntry<string> DefaultSuit { get; internal set; } public static ConfigEntry<bool> PersonalizedFavorites { get; internal set; } public static ConfigEntry<bool> PersonalizedDefault { get; internal set; } public static ConfigEntry<Sort> SuitsSortingStyle { get; internal set; } public static List<ConfigEntryBase> MenuControls { get; internal set; } public static void Init(ConfigFile config) { LogLevel = ConfigSetup.MakeGeneric<LoggingLevel>(config, "Debug", "Logging Level", (LoggingLevel)16, "Set the mod's logging level to determine what messages populate the logs"); ChatCommands = ConfigSetup.MakeGeneric<bool>(config, "General", "Chat Commands", false, "Create suit related chat commands (!suits/!wear) that can be run from chat"); EnforcePaidSuits = ConfigSetup.MakeGeneric<bool>(config, "General", "Enforce Paid Suits", true, "Determines whether paid suits need to be unlocked before appearing in the listing."); HintStyle = ConfigSetup.MakeGeneric<Hint>(config, "General", "Hint Style", Hint.AllHints, "Determines what style of Hints display on player load-in"); PersonalizedDefault = ConfigSetup.MakeGeneric<bool>(config, "General", "Personalized Default Suit", true, "Your default suit is saved and loaded from a local file. \nUse this if you dont want your default suit to be shared with other players in modpacks/profile codes."); DefaultSuit = ConfigSetup.MakeGeneric<string>(config, "General", "Profile Default Suit", "", "Automatically equip this suit when first loading in (in-place of the default orange suit)\nThis configuration item will not be used if SuitSaver is present or personalized defaults are enabled"); RackConfigs(config); MenuConfigs(config); InitControls(config); } private static void RackConfigs(ConfigFile config) { SuitsOnRack = ConfigSetup.MakeGeneric<int>(config, "Rack Settings", "SuitsOnRack", 13, "Number of suits to keep on the rack", 0, 99); RackOffset = ConfigSetup.MakeGeneric<float>(config, "Rack Settings", "Rack Offset", 0.18f, "This determines the gap between each suit on the rack", 0f, 3f); RackSettings = ConfigSetup.MakeGeneric<Removal>(config, "Rack Settings", "Rack Removal", Removal.OnlyExtraSuits, "This setting determines what of the suits rack is removed, if anything."); SuitsOnRackOnly = ConfigSetup.MakeGeneric<string>(config, "Rack Settings", "Rack Suits (ONLY)", "", "Comma-separated list of suits to display on the rack by name. \nSuits that do not match the names in this list will not be added to the rack. \nLeave blank to allow any suit to be added to the rack.\nNOTE: If no suits match this configuration item when it's populated, no suits will be added to the rack."); DontAddToRack = ConfigSetup.MakeGeneric<string>(config, "Rack Settings", "DONT Add To Rack", "", "Comma-separated list of suits you do NOT want added to the rack in any situation. \nLeave blank to allow any suit to be added to the rack."); DontAddToTerminal = ConfigSetup.MakeGeneric<string>(config, "Rack Settings", "DONT Add To Terminal", "", "Comma-separated list of suits you do NOT want added to the terminal in any situation. \nLeave blank to allow any suit to be added to the terminal."); SuitsSortingStyle = ConfigSetup.MakeGeneric<Sort>(config, "Menu", "Suit Sorting Style", Sort.Alphabetical, "Determines how the suits listing will be sorted, set to none to ignore any potential sorting"); } private static void MenuConfigs(ConfigFile config) { MenuStartPage = ConfigSetup.MakeGeneric<Page>(config, "Menu", "Start Page", Page.Main, "Determines what page in the menu you start at when entering the suits command"); PersonalizedFavorites = ConfigSetup.MakeGeneric<bool>(config, "Menu", "Personalized Favorites", true, "Favorites are saved and loaded from a local file. \nUse this if you dont want your favorites list to be shared with other players in modpacks/profile codes."); FavoritesMenuList = ConfigSetup.MakeGeneric<string>(config, "Menu", "Profile Favorites List", "", "If PersonalizedFavorites is disabled, favorited suit names will be stored and loaded into the menu from here\n"); CamStyle = ConfigSetup.MakeGeneric<PiP>(config, "Menu", "Picture-In-Picture Style", PiP.OpenLib, "Determines what kind of camera is created, if at all"); ObcResolution = ConfigSetup.MakeGeneric<string>(config, "Menu", "OpenBodyCams Resolution", "1000; 700", "Set the resolution of the Menu Camera (if created with OpenBodyCams)"); RandomSuitMenu = ConfigSetup.MakeGeneric<bool>(config, "Menu", "Random Suit Menu Item", false, "Create a random suit menu item to pick a random suit from the terminal"); MainMenuKWs = ConfigSetup.MakeGeneric<string>(config, "Menu", "Main Keywords", "suits, suits menu, skin", "Comma separated list of keywords used to open the main menu of the suitsTerminal\nIf this item is blank, it will default to \"suits\"\nNOTE: Can only be changed between lobbies while in-game"); SuitsListingKWs = ConfigSetup.MakeGeneric<string>(config, "Menu", "Listing Keywords", string.Empty, "Comma separated list of keywords used to open the suits listing menu of the suitsTerminal\nLeaving this item blank will result in the keyword not being created.\nNOTE: Can only be changed between lobbies while in-game"); FavMenuKWs = ConfigSetup.MakeGeneric<string>(config, "Menu", "Favorites Keywords", string.Empty, "Comma separated list of keywords used to open the favorites menu of the suitsTerminal\nLeaving this item blank will result in the keyword not being created.\nNOTE: Can only be changed between lobbies while in-game"); } private static void InitControls(ConfigFile config) { MenuUp = ConfigSetup.MakeGeneric<string>(config, "Menu", "Up Control", "UpArrow", "Set key to press to go to previous item on the page"); MenuDown = ConfigSetup.MakeGeneric<string>(config, "Menu", "Down Control", "DownArrow", "Set key to press to go to next item on the page"); MenuLeft = ConfigSetup.MakeGeneric<string>(config, "Menu", "Left Control", "LeftArrow", "Set key to press to go to previous page"); MenuRight = ConfigSetup.MakeGeneric<string>(config, "Menu", "Right Control", "RightArrow", "Set key to press to go to next page"); LeaveMenu = ConfigSetup.MakeGeneric<string>(config, "Menu", "Exit Control", "Backspace", "Set key to press to leave menu or go back to parent menu page"); SelectMenu = ConfigSetup.MakeGeneric<string>(config, "Menu", "Select Control", "Enter", "Set key to press to select the highlighted menu item on the current page"); TogglePiP = ConfigSetup.MakeGeneric<string>(config, "Menu", "Camera Toggle", "F12", "Set key to press to toggle the menu mirror camera on/off"); TogglePiPZoom = ConfigSetup.MakeGeneric<string>(config, "Menu", "Camera Zoom", "Minus", "Set key to press to change the zoom level of the menu mirror camera"); TogglePiPRotation = ConfigSetup.MakeGeneric<string>(config, "Menu", "Camera Rotation", "Equals", "Set key to press to change the rotation step of the menu mirror camera"); TogglePiPHeight = ConfigSetup.MakeGeneric<string>(config, "Menu", "Camera Height", "Backslash", "Set key to press to change the height step of the menu mirror camera"); MenuControls = new List<ConfigEntryBase>(10) { (ConfigEntryBase)(object)MenuUp, (ConfigEntryBase)(object)MenuDown, (ConfigEntryBase)(object)MenuLeft, (ConfigEntryBase)(object)MenuRight, (ConfigEntryBase)(object)LeaveMenu, (ConfigEntryBase)(object)SelectMenu, (ConfigEntryBase)(object)TogglePiP, (ConfigEntryBase)(object)TogglePiPZoom, (ConfigEntryBase)(object)TogglePiPRotation, (ConfigEntryBase)(object)TogglePiPHeight }; } internal static void HandleChangedSetting(object sender, SettingChangedEventArgs changed) { if (changed != null) { if (changed.ChangedSetting == SuitsListingKWs) { Menu.SuitListing.KeywordList = SuitsListingKWs.GetKeywordValues(); } if (changed.ChangedSetting == FavMenuKWs) { Menu.FavListing.KeywordList = FavMenuKWs.GetKeywordValues(); } if (MenuControls.Contains(changed.ChangedSetting)) { Menu.RefreshKeys(); } } } } internal class Patching { [HarmonyPatch(typeof(UnlockableSuit), "Start")] public class SuitStart { private static void Postfix(UnlockableSuit __instance) { __instance.GetSuitAttributes(); RackManager.SuitSpawn(__instance); } } [HarmonyPatch(typeof(StartOfRound), "PositionSuitsOnRack")] public class VoidSuitsPositioning { private static bool Prefix() { if (ModConfig.RackSettings.Value == ModConfig.Removal.DontRemoveAnything) { Loggers.WARNING("suitsTerminal is NOT touching the rack!!!"); return true; } List<SuitAttributes> list = RackManager.AllSuits.FindAll((SuitAttributes x) => x.IsOnRack); foreach (SuitAttributes item in list) { item.IsOnRack = false; } foreach (SuitAttributes allSuit in RackManager.AllSuits) { allSuit.Suit.ResetPosition(); } return false; } } [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public class Chat_Patch { private static void Prefix(HUDManager __instance, ref CallbackContext context) { if (ModConfig.ChatCommands.Value) { PlayerControllerB localPlayer = Plugin.LocalPlayer; if (((CallbackContext)(ref context)).performed && !((Object)(object)localPlayer == (Object)null) && localPlayer.isTypingChat && !localPlayer.isPlayerDead) { string text = __instance.chatTextField.text.Trim(); Loggers.LogMessage("Testing message [" + text + "] for command."); HandleChatMessage(text); } } } private static string[] GetArgs(string command) { return command.Split(' '); } internal static void HandleChatMessage(string command) { if (command.StartsWith("!suits")) { string[] args = GetArgs(command); if (args.Length == 1) { string text = Plugin.ChatListing(6, 1); HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t " + text, "", -1, false); } else if (args.Length > 1) { string text2 = args[1]; if (int.TryParse(text2, out var result)) { string text3 = Plugin.ChatListing(6, result); HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t " + text3, "", -1, false); } else { HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t Invalid page number format: " + text2, "", -1, false); Loggers.WARNING("Invalid page number format: " + text2); } } } else if (command.StartsWith("!wear")) { string[] args2 = GetArgs(command); if (args2.Length <= 1) { HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t No suit specified...", "", -1, false); return; } string text4 = args2[1]; if (int.TryParse(text4, out var result2)) { if (result2 >= 0 && result2 < RackManager.AllSuits.Count) { SuitAttributes suitAttributes = RackManager.AllSuits[result2]; Loggers.LogDebug("wear command"); suitAttributes.WearSuit(); } else { HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t Invalid suit number: " + text4, "", -1, false); Loggers.WARNING("Invalid suit number: " + text4); } } else { HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t Invalid suit number format: " + text4, "", -1, false); Loggers.WARNING("Invalid suit number format: " + text4); } } else if (command.StartsWith("!clear")) { string text5 = ((TMP_Text)HUDManager.Instance.chatText).text; int length = ((TMP_Text)HUDManager.Instance.chatText).text.Length; text5.Substring(length, text5.Length - length); HUDManager.Instance.ChatMessageHistory.Clear(); } else if (command.StartsWith("!random")) { int num = Plugin.Rand.Next(RackManager.AllSuits.Count); SuitAttributes suitAttributes2 = RackManager.AllSuits[num]; suitAttributes2.WearSuit(); HUDManager.Instance.AddChatMessage($"[suitsTerminal]:\t Rolled random number [ {num} ]", "", -1, false); HUDManager.Instance.AddChatMessage("[suitsTerminal]:\t Changing suit to " + suitAttributes2.Name + "!", "", -1, false); } } } } internal class PictureInPicture { internal static bool PiPCreated; internal static Camera PlayerCam; internal static RenderTexture CamTexture; internal static int HeightStep; internal static int ZoomStep; internal static int RotateStep; internal static ShadowCastingMode ShadowDefault; internal static int ModelLayerDefault; internal static bool PipActive { get { if ((Object)(object)Plugin.Terminal.terminalImage.texture == (Object)null) { return false; } return ((Behaviour)Plugin.Terminal.terminalImage).enabled; } } private static void SetTerminalImageOpacity(float opacity) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((Graphic)Plugin.Terminal.terminalImage).color = new Color(1f, 1f, 1f, opacity); } private static void SetTerminalImage(bool toDefault, bool centered) { //IL_00b3: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!toDefault) { ((Behaviour)Plugin.Terminal.terminalImage).enabled = true; if (centered) { SetRectDimesionsAndPos(((Graphic)Plugin.Terminal.terminalImage).rectTransform, new Vector2(225f, 190f), new Vector2(-10f, -4f)); } else { SetRectDimesionsAndPos(((Graphic)Plugin.Terminal.terminalImage).rectTransform, new Vector2(225f, 190f), new Vector2(75f, -2f)); } SetTerminalImageOpacity(0.9f); } else { ((Behaviour)Plugin.Terminal.terminalImage).enabled = false; SetRectDimesionsAndPos(((Graphic)Plugin.Terminal.terminalImage).rectTransform, new Vector2(400f, 300f), new Vector2(0f, 0.0001f)); SetTerminalImageOpacity(1f); } } private static void SetRectDimesionsAndPos(RectTransform rectTransform, Vector2 sizeDelta, Vector2 anchorPos) { //IL_0001: 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) rectTransform.sizeDelta = sizeDelta; rectTransform.anchoredPosition = anchorPos; } internal static void RotateCameraAroundPlayer(Transform playerTransform, Transform cameraTransform) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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) Quaternion val = Quaternion.LookRotation(-playerTransform.right, playerTransform.up); Quaternion rotation = val * cameraTransform.rotation; cameraTransform.rotation = rotation; Vector3 val2 = cameraTransform.position - playerTransform.position; Vector3 position = playerTransform.position + val * val2; cameraTransform.position = position; } internal static void ChangeCamZoom(Camera camera, ref int currentStep) { float[] array = new float[4] { 120f, 60f, 80f, 100f }; currentStep++; if (currentStep >= array.Length) { currentStep = 0; } camera.fieldOfView = array[currentStep]; } internal static void MoveCamera(Transform cameraTransform, ref int currentStep) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[5] { 0f, 0.2f, -2.2f, -1.2f, -0.7f }; currentStep++; if (currentStep >= array.Length) { currentStep = 0; } float y = ((Component)Plugin.Terminal.terminalImage).transform.position.y + array[currentStep]; Vector3 position = cameraTransform.position; position.y = y; cameraTransform.position = position; } internal static void TogglePicture(bool state, bool centered = false) { //IL_019e: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.CamStyle.Value == ModConfig.PiP.Disabled || PipActive == state) { return; } if (!state) { Menu.SuitsMenu.MenuNode.displayTexture = null; } SetTerminalImage(!state, centered); Loggers.LogDebug($"TogglePiP: {state}"); if (Plugin.instance.OpenBodyCamsMod && ModConfig.CamStyle.Value == ModConfig.PiP.OpenBodyCams) { Loggers.LogDebug($"OpenBodyCams detected, using OBC for Mirror (state:{state})"); OpenBodyCamFuncs.OpenBodyCamsMirrorStatus(state, ModConfig.ObcResolution.Value, 0.1f, false, ref CamStuff.ObcCameraHolder); if (!state) { return; } Camera cam = OpenBodyCamFuncs.GetCam(OpenBodyCamFuncs.TerminalMirrorCam); cam.fieldOfView = 100f; Loggers.LogDebug($"isActive [ Cam ] - {((Behaviour)cam).isActiveAndEnabled}"); Menu.SuitsMenu.MenuNode.displayTexture = OpenBodyCamFuncs.GetTexture(OpenBodyCamFuncs.TerminalMirrorCam); } else { if ((Object)(object)PlayerCam == (Object)null) { PlayerCam = CamStuff.HomebrewCam(ref CamTexture, ref CamStuff.MyCameraHolder); ((Object)CamTexture).name = "suitsTerminal_CamText"; } CamStuff.CamInitMirror(CamStuff.MyCameraHolder, PlayerCam, 0.1f, false); CamStuff.HomebrewCameraState(state, PlayerCam); if (state) { PlayerCam.fieldOfView = 100f; Menu.SuitsMenu.MenuNode.displayTexture = (Texture)(object)PlayerCam.targetTexture; } if (!Plugin.instance.ModelReplacement) { if (state) { ((Renderer)Plugin.LocalPlayer.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)0; Plugin.Log.LogInfo((object)"Showing PlayerModel to player (player should be in terminal)"); } else { ((Renderer)Plugin.LocalPlayer.thisPlayerModel).shadowCastingMode = ShadowDefault; Plugin.Log.LogInfo((object)"Hiding PlayerModel from player (PiP disabled or leaving suits menu)"); } } } Loggers.LogDebug($"isActive [ PipActive ] - {PipActive}"); } } } namespace suitsTerminal.Interfaces { [InjectInterface(typeof(UnlockableSuit))] public interface IUnlockableSuit { [HandleErrors(/*Could not decode attribute arguments.*/)] SuitAttributes SuitsTerminalAttributes { get; set; } [HandleErrors(/*Could not decode attribute arguments.*/)] void Start(); } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] [ExcludeFromCodeCoverage] internal sealed class ConstantExpectedAttribute : Attribute { public object? Min { get; set; } public object? Max { get; set; } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTar