using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Google2u; using HarmonyLib; using Localization; using Microsoft.CodeAnalysis; using ReLegendQOL.Patches; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("ReLegendQOL")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.13.0.0")] [assembly: AssemblyInformationalVersion("0.13.0")] [assembly: AssemblyProduct("ReLegendQOL")] [assembly: AssemblyTitle("ReLegendQOL")] [assembly: AssemblyVersion("0.13.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ReLegendQOL { internal static class AutoLoot { private static float _nextScan; private static bool _warnedMultiplayer; internal static void Tick() { if (!Plugin.AutoLootEnabled.Value || Time.unscaledTime < _nextScan) { return; } _nextScan = Time.unscaledTime + Mathf.Max(0.05f, Plugin.AutoLootInterval.Value); try { Scan(); } catch (Exception ex) { Plugin.Log.LogError((object)("Auto-loot scan failed: " + ex)); } } private static void Scan() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) GameManager instance = GameManager.instance; PlayerHandler val = (((Object)(object)instance != (Object)null) ? instance.player : null); if ((Object)(object)val == (Object)null) { return; } if (IsMultiplayer()) { if (!_warnedMultiplayer) { _warnedMultiplayer = true; Plugin.Log.LogInfo((object)"Auto-loot is disabled in multiplayer sessions."); } return; } ItemDrop[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { return; } Vector3 position = ((Component)val).transform.position; float num = Mathf.Max(0.5f, Plugin.AutoLootRadius.Value); float num2 = num * num; int minRank = MinRank(); Transform transform = ((Component)val).transform; int num3 = 0; foreach (ItemDrop val2 in array) { if (!Eligible(val2, minRank)) { continue; } Vector3 val3 = ((Component)val2).transform.position - position; val3.y = 0f; if (!(((Vector3)(ref val3)).sqrMagnitude > num2)) { val2.MoveToPlayer(transform); num3++; if (Plugin.AutoLootVerbose.Value) { Item itemSo = val2.itemSo; Plugin.Log.LogInfo((object)("Auto-loot pulled '" + (((Object)(object)itemSo != (Object)null) ? itemSo.itemName : "?") + "' (farmTrash=" + val2.isFarmTrash + ", wildLoot=" + val2.isWildLoot + ", tween=" + val2.itemTween + ")")); } } } if (num3 > 0 && !Plugin.AutoLootVerbose.Value) { Plugin.Log.LogInfo((object)("Auto-loot pulled " + num3 + " item(s).")); } } private static bool Eligible(ItemDrop drop, int minRank) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)drop == (Object)null) { return false; } if (!((Component)drop).gameObject.activeInHierarchy) { return false; } if (!((Behaviour)drop).enabled) { return false; } if (IsAttachedToPlayer(drop)) { return false; } if (drop.isPicked || drop.isUsed) { return false; } if (drop.isMoveTowardTarget) { return false; } if (drop.treasureChest) { return false; } if (drop.isThrowObject || drop.itemThrowing) { return false; } if (drop.itemTween) { return false; } if (drop.isFishFood) { return false; } if (drop.isFarmTrash) { return false; } Item itemSo = drop.itemSo; if ((Object)(object)itemSo == (Object)null) { return false; } if (Rank(itemSo.itemRarity) < minRank) { return false; } return true; } private static bool IsAttachedToPlayer(ItemDrop drop) { try { PlayerHandler val = (((Object)(object)GameManager.instance != (Object)null) ? GameManager.instance.player : null); if ((Object)(object)val == (Object)null) { return false; } Transform root = ((Component)val).transform.root; if ((Object)(object)root == (Object)null) { return false; } return (Object)(object)((Component)drop).transform.root == (Object)(object)root; } catch { return true; } } private static bool IsMultiplayer() { try { MainMenuStat instance = MainMenuStat.instance; return (Object)(object)instance != (Object)null && instance.IsMultiplayerReady; } catch { return true; } } private static int MinRank() { return (Plugin.AutoLootMinRarity.Value ?? "").Trim().ToLowerInvariant() switch { "legendary" => 3, "rare" => 2, "uncommon" => 1, "common" => 0, _ => -1, }; } private static int Rank(ItemRarity r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown return (int)r switch { 3 => 3, 2 => 2, 1 => 1, 0 => 0, _ => -1, }; } } internal class ModEntry { public string Name; public string Version; public string Guid; public bool Instantiated; public string Description; public string WebsiteUrl; public string IconPath; public Texture2D Icon; public bool IconLoadAttempted; public ConfigFile Config; public List BoolSettings = new List(); } internal static class ModRegistry { private static readonly Dictionary IconCache = new Dictionary(); internal static List Snapshot() { List list = new List(); try { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { PluginInfo value = pluginInfo.Value; if (value == null) { continue; } ModEntry modEntry = new ModEntry { Name = pluginInfo.Key, Version = "?", Guid = pluginInfo.Key, Instantiated = ((Object)(object)value.Instance != (Object)null) }; if (value.Metadata != null) { if (!string.IsNullOrEmpty(value.Metadata.Name)) { modEntry.Name = value.Metadata.Name; } if (value.Metadata.Version != null) { modEntry.Version = value.Metadata.Version.ToString(); } } Enrich(modEntry, value); CollectSettings(modEntry, value); list.Add(modEntry); } } catch (Exception ex) { Plugin.Log.LogError((object)("Could not read Chainloader.PluginInfos: " + ex)); } list.Sort((ModEntry a, ModEntry b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase)); return list; } private static void CollectSettings(ModEntry entry, PluginInfo info) { try { if ((Object)(object)info.Instance == (Object)null) { return; } ConfigFile config = info.Instance.Config; if (config == null) { return; } entry.Config = config; List list = new List(); IDictionary silent = Reflect.GetSilent(typeof(ConfigFile), "Entries", config); if (silent != null) { foreach (DictionaryEntry item in silent) { object? value = item.Value; ConfigEntryBase val = (ConfigEntryBase)((value is ConfigEntryBase) ? value : null); if (val != null) { list.Add(val); } } } else { foreach (ConfigDefinition key in config.Keys) { try { ConfigEntryBase val2 = config[key]; if (val2 != null) { list.Add(val2); } } catch { } } } foreach (ConfigEntryBase item2 in list) { if (!(item2.SettingType != typeof(bool))) { entry.BoolSettings.Add(item2); } } entry.BoolSettings.Sort(delegate(ConfigEntryBase a, ConfigEntryBase b) { int num = string.Compare(a.Definition.Section, b.Definition.Section, StringComparison.OrdinalIgnoreCase); return (num != 0) ? num : string.Compare(a.Definition.Key, b.Definition.Key, StringComparison.OrdinalIgnoreCase); }); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read settings for " + entry.Guid + ": " + ex.Message)); } } private static void Enrich(ModEntry entry, PluginInfo info) { try { string text = LocateAssembly(info); if (string.IsNullOrEmpty(text)) { return; } string directoryName = Path.GetDirectoryName(text); string text2 = NormalizeDir(Paths.PluginPath); for (int i = 0; i < 4; i++) { if (string.IsNullOrEmpty(directoryName)) { break; } if (NormalizeDir(directoryName) == text2) { break; } if (EnrichFromFolder(entry, directoryName)) { break; } directoryName = Path.GetDirectoryName(directoryName); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read manifest for " + entry.Guid + ": " + ex.Message)); } } internal static bool EnrichFromFolder(ModEntry entry, string dir) { try { if (string.IsNullOrEmpty(dir)) { return false; } string path = Path.Combine(dir, "manifest.json"); if (!File.Exists(path)) { return false; } ReadManifest(entry, path); string text = Path.Combine(dir, "icon.png"); if (File.Exists(text)) { entry.IconPath = text; } return true; } catch { return false; } } private static string NormalizeDir(string path) { if (string.IsNullOrEmpty(path)) { return ""; } try { return Path.GetFullPath(path).TrimEnd('\\', '/').ToLowerInvariant(); } catch { return path.ToLowerInvariant(); } } private static string LocateAssembly(PluginInfo info) { string property = Reflect.GetProperty(typeof(PluginInfo), "Location", info); if (!string.IsNullOrEmpty(property)) { return property; } if ((Object)(object)info.Instance != (Object)null) { try { return ((object)info.Instance).GetType().Assembly.Location; } catch { } } return null; } private static void ReadManifest(ModEntry entry, string path) { string json = File.ReadAllText(path); string text = JsonString(json, "description"); if (!string.IsNullOrEmpty(text)) { entry.Description = text; } string text2 = JsonString(json, "website_url"); if (!string.IsNullOrEmpty(text2)) { entry.WebsiteUrl = text2; } if (entry.Version == "?") { string text3 = JsonString(json, "version_number"); if (!string.IsNullOrEmpty(text3)) { entry.Version = text3; } } } internal static string JsonString(string json, string key) { if (string.IsNullOrEmpty(json) || string.IsNullOrEmpty(key)) { return null; } string text = "\"" + key + "\""; int num = json.IndexOf(text, StringComparison.Ordinal); if (num < 0) { return null; } int num2 = json.IndexOf(':', num + text.Length); if (num2 < 0) { return null; } int i; for (i = num2 + 1; i < json.Length && char.IsWhiteSpace(json[i]); i++) { } if (i >= json.Length || json[i] != '"') { return null; } i++; StringBuilder stringBuilder = new StringBuilder(); while (i < json.Length) { char c = json[i]; switch (c) { case '\\': { if (i + 1 >= json.Length) { break; } char c2 = json[i + 1]; switch (c2) { case 'n': stringBuilder.Append(' '); break; case 't': stringBuilder.Append(' '); break; case '"': stringBuilder.Append('"'); break; case '\\': stringBuilder.Append('\\'); break; case '/': stringBuilder.Append('/'); break; case 'u': if (i + 5 < json.Length) { if (int.TryParse(json.Substring(i + 2, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var result)) { stringBuilder.Append((char)result); } i += 4; } break; default: stringBuilder.Append(c2); break; case 'r': break; } i += 2; continue; } default: stringBuilder.Append(c); i++; continue; case '"': break; } break; } return stringBuilder.ToString(); } internal static Texture2D LoadIcon(ModEntry entry) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown if (entry == null) { return null; } if ((Object)(object)entry.Icon != (Object)null) { return entry.Icon; } if (entry.IconLoadAttempted) { return null; } entry.IconLoadAttempted = true; if (string.IsNullOrEmpty(entry.IconPath)) { return null; } if (IconCache.TryGetValue(entry.IconPath, out var value) && (Object)(object)value != (Object)null) { entry.Icon = value; return value; } try { byte[] array = File.ReadAllBytes(entry.IconPath); Texture2D val = new Texture2D(256, 256, (TextureFormat)4, false); if (!ImageConversion.LoadImage(val, array)) { Object.Destroy((Object)(object)val); Plugin.Log.LogWarning((object)("Could not decode icon: " + entry.IconPath)); return null; } ((Texture)val).wrapMode = (TextureWrapMode)1; IconCache[entry.IconPath] = val; entry.Icon = val; return val; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not load icon " + entry.IconPath + ": " + ex.Message)); return null; } } internal static int PluginFilesOnDisk() { try { string pluginPath = Paths.PluginPath; if (string.IsNullOrEmpty(pluginPath) || !Directory.Exists(pluginPath)) { return -1; } return Directory.GetFiles(pluginPath, "*.dll", SearchOption.AllDirectories).Length; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not scan the plugins folder: " + ex.Message)); return -1; } } } internal class ModsPanel : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__29_2; internal void b__29_2() { Close(); } } private const float PanelWidth = 1240f; private const float PanelHeight = 700f; private const float CardHeight = 104f; private const float CardGap = 10f; private const float ListTop = 96f; private const float ListBottom = 108f; private const float LeftPaneFraction = 0.56f; private const int MaxCardsPerPage = 3; private static ModsPanel _current; private GameObject _root; private TextMeshProUGUI _summary; private TextMeshProUGUI _pageLabel; private Transform _cardArea; private Transform _settingsArea; private TextMeshProUGUI _settingsHeader; private TMP_FontAsset _font; private readonly List _mods = new List(); private readonly List _cards = new List(); private int _page; private int _selected; internal static bool IsOpen { get { if ((Object)(object)_current != (Object)null && (Object)(object)_current._root != (Object)null) { return _current._root.activeSelf; } return false; } } internal static void Toggle(TMP_FontAsset font) { if (IsOpen) { Close(); } else { Open(font); } } internal static void Open(TMP_FontAsset font) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)_current == (Object)null) { _current = new GameObject("ReLegendQOL_ModsPanel").AddComponent(); _current._font = font; _current.Build(); } if (!((Object)(object)_current._root == (Object)null)) { if ((Object)(object)_current._font == (Object)null) { _current._font = font; } _current._page = 0; _current._selected = 0; _current.Refresh(); _current._root.SetActive(true); } } catch (Exception ex) { Plugin.Log.LogError((object)("Could not open the mods panel: " + ex)); } } internal static void Close() { if ((Object)(object)_current != (Object)null && (Object)(object)_current._root != (Object)null) { _current._root.SetActive(false); } } private void Update() { if (IsOpen) { if (Input.GetKeyDown((KeyCode)27)) { Close(); } else if (Input.GetKeyDown((KeyCode)276)) { ChangePage(-1); } else if (Input.GetKeyDown((KeyCode)275)) { ChangePage(1); } else if (Input.GetKeyDown((KeyCode)273)) { MoveSelection(-1); } else if (Input.GetKeyDown((KeyCode)274)) { MoveSelection(1); } } } private int RowsThatFit() { return Mathf.Clamp(Mathf.FloorToInt((496f + 10f) / 114f), 1, 3); } private int PageCount() { if (_mods.Count == 0) { return 1; } return Mathf.CeilToInt((float)_mods.Count / (float)RowsThatFit()); } private void Build() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_005f: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) _root = new GameObject("Canvas"); _root.transform.SetParent(((Component)this).transform, false); Canvas obj = _root.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 5000; CanvasScaler obj2 = _root.AddComponent(); obj2.uiScaleMode = (ScaleMode)1; obj2.referenceResolution = new Vector2(1920f, 1080f); _root.AddComponent(); Stretch(MakeImage("Dim", _root.transform, new Color(0f, 0f, 0f, 0.78f)).GetComponent()); GameObject val = MakeImage("Panel", _root.transform, new Color(0.09f, 0.08f, 0.11f, 0.98f)); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; component.sizeDelta = new Vector2(1240f, 700f); GameObject obj3 = MakeText("Title", val.transform, 32f, (TextAlignmentOptions)258); RectTransform component2 = obj3.GetComponent(); component2.anchorMin = new Vector2(0f, 1f); component2.anchorMax = new Vector2(1f, 1f); component2.pivot = new Vector2(0.5f, 1f); component2.offsetMin = new Vector2(30f, -62f); component2.offsetMax = new Vector2(-30f, -20f); ((TMP_Text)obj3.GetComponent()).text = "Installed Mods"; GameObject val2 = MakeText("Summary", val.transform, 18f, (TextAlignmentOptions)258); RectTransform component3 = val2.GetComponent(); component3.anchorMin = new Vector2(0f, 1f); component3.anchorMax = new Vector2(1f, 1f); component3.pivot = new Vector2(0.5f, 1f); component3.offsetMin = new Vector2(30f, -92f); component3.offsetMax = new Vector2(-30f, -64f); _summary = val2.GetComponent(); GameObject val3 = new GameObject("Cards"); val3.transform.SetParent(val.transform, false); RectTransform obj4 = val3.AddComponent(); obj4.anchorMin = new Vector2(0f, 0f); obj4.anchorMax = new Vector2(0.56f, 1f); obj4.offsetMin = new Vector2(24f, 108f); obj4.offsetMax = new Vector2(-14f, -96f); _cardArea = val3.transform; RectTransform component4 = MakeImage("Divider", val.transform, new Color(1f, 1f, 1f, 0.14f)).GetComponent(); component4.anchorMin = new Vector2(0.56f, 0f); component4.anchorMax = new Vector2(0.56f, 1f); component4.pivot = new Vector2(0.5f, 0.5f); component4.offsetMin = new Vector2(-1f, 100f); component4.offsetMax = new Vector2(1f, -92f); GameObject val4 = MakeText("SettingsHeader", val.transform, 20f, (TextAlignmentOptions)257); RectTransform component5 = val4.GetComponent(); component5.anchorMin = new Vector2(0.56f, 1f); component5.anchorMax = new Vector2(1f, 1f); component5.pivot = new Vector2(0.5f, 1f); component5.offsetMin = new Vector2(18f, -100f); component5.offsetMax = new Vector2(-24f, -66f); _settingsHeader = val4.GetComponent(); RectTransform component6 = MakeScrollArea("Settings", val.transform, out _settingsArea).GetComponent(); component6.anchorMin = new Vector2(0.56f, 0f); component6.anchorMax = new Vector2(1f, 1f); component6.offsetMin = new Vector2(18f, 108f); component6.offsetMax = new Vector2(-24f, -130f); BuildFooter(val.transform); _root.SetActive(false); } private void BuildFooter(Transform panel) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_002d: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Expected O, but got Unknown RectTransform component = MakeButton("Prev", panel, "<", (UnityAction)delegate { ChangePage(-1); }).GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.pivot = new Vector2(0f, 0f); component.anchoredPosition = new Vector2(24f, 58f); component.sizeDelta = new Vector2(54f, 38f); RectTransform component2 = MakeButton("Next", panel, ">", (UnityAction)delegate { ChangePage(1); }).GetComponent(); component2.anchorMin = new Vector2(0.56f, 0f); component2.anchorMax = new Vector2(0.56f, 0f); component2.pivot = new Vector2(1f, 0f); component2.anchoredPosition = new Vector2(-14f, 58f); component2.sizeDelta = new Vector2(54f, 38f); GameObject val = MakeText("PageLabel", panel, 17f, (TextAlignmentOptions)514); RectTransform component3 = val.GetComponent(); component3.anchorMin = new Vector2(0f, 0f); component3.anchorMax = new Vector2(0.56f, 0f); component3.pivot = new Vector2(0.5f, 0f); component3.offsetMin = new Vector2(84f, 60f); component3.offsetMax = new Vector2(-74f, 94f); _pageLabel = val.GetComponent(); GameObject obj = MakeText("Hint", panel, 15f, (TextAlignmentOptions)513); RectTransform component4 = obj.GetComponent(); component4.anchorMin = new Vector2(0f, 0f); component4.anchorMax = new Vector2(1f, 0f); component4.pivot = new Vector2(0.5f, 0f); component4.offsetMin = new Vector2(26f, 18f); component4.offsetMax = new Vector2(-260f, 48f); ((TMP_Text)obj.GetComponent()).text = "Click a mod to see its settings. Arrows page and change selection. Changes save immediately."; object obj2 = <>c.<>9__29_2; if (obj2 == null) { UnityAction val2 = delegate { Close(); }; <>c.<>9__29_2 = val2; obj2 = (object)val2; } RectTransform component5 = MakeButton("Close", panel, "Close", (UnityAction)obj2).GetComponent(); component5.anchorMin = new Vector2(1f, 0f); component5.anchorMax = new Vector2(1f, 0f); component5.pivot = new Vector2(1f, 0f); component5.anchoredPosition = new Vector2(-24f, 18f); component5.sizeDelta = new Vector2(200f, 40f); } private GameObject MakeScrollArea(string name, Transform parent, out Transform content) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.AddComponent(); ScrollRect obj = val.AddComponent(); obj.horizontal = false; obj.vertical = true; obj.scrollSensitivity = 24f; obj.movementType = (MovementType)2; GameObject val2 = new GameObject("Viewport"); val2.transform.SetParent(val.transform, false); RectTransform val3 = val2.AddComponent(); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.offsetMin = Vector2.zero; val3.offsetMax = new Vector2(-10f, 0f); val2.AddComponent(); GameObject val4 = new GameObject("Content"); val4.transform.SetParent(val2.transform, false); RectTransform val5 = val4.AddComponent(); val5.anchorMin = new Vector2(0f, 1f); val5.anchorMax = new Vector2(1f, 1f); val5.pivot = new Vector2(0.5f, 1f); val5.offsetMin = Vector2.zero; val5.offsetMax = Vector2.zero; val5.sizeDelta = new Vector2(0f, 0f); obj.viewport = val3; obj.content = val5; GameObject val6 = MakeImage("Scrollbar", val.transform, new Color(1f, 1f, 1f, 0.07f)); RectTransform component = val6.GetComponent(); component.anchorMin = new Vector2(1f, 0f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 0.5f); component.offsetMin = new Vector2(-8f, 0f); component.offsetMax = new Vector2(0f, 0f); Scrollbar val7 = val6.AddComponent(); val7.direction = (Direction)2; GameObject val8 = MakeImage("SlidingArea", val6.transform, new Color(0f, 0f, 0f, 0f)); Stretch(val8.GetComponent()); GameObject val9 = MakeImage("Handle", val8.transform, new Color(0.55f, 0.5f, 0.62f, 0.9f)); RectTransform component2 = val9.GetComponent(); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; component2.sizeDelta = Vector2.zero; component2.pivot = new Vector2(0.5f, 0.5f); val7.handleRect = component2; ((Selectable)val7).targetGraphic = (Graphic)(object)val9.GetComponent(); val7.size = 0.25f; obj.verticalScrollbar = val7; obj.verticalScrollbarVisibility = (ScrollbarVisibility)1; content = val4.transform; return val; } private void Refresh() { _mods.Clear(); _mods.AddRange(ModRegistry.Snapshot()); int num = 0; foreach (ModEntry mod in _mods) { if (mod.Instantiated) { num++; } } int num2 = ModRegistry.PluginFilesOnDisk(); string text = "" + num + ((num == 1) ? " mod loaded" : " mods loaded") + ""; if (_mods.Count != num) { text = text + " of " + _mods.Count + " registered"; } if (num2 >= 0 && num2 != _mods.Count) { text = text + " (" + num2 + " .dll files on disk; one assembly can hold several plugins)"; } if ((Object)(object)_summary != (Object)null) { ((TMP_Text)_summary).text = text; } _selected = Mathf.Clamp(_selected, 0, Mathf.Max(0, _mods.Count - 1)); _page = ((_mods.Count != 0) ? (_selected / RowsThatFit()) : 0); RebuildCards(); RebuildSettings(); } private void ChangePage(int delta) { int num = PageCount(); if (num > 1) { int num2 = Mathf.Clamp(_page + delta, 0, num - 1); if (num2 != _page) { _page = num2; RebuildCards(); } } } private void MoveSelection(int delta) { if (_mods.Count != 0) { int num = Mathf.Clamp(_selected + delta, 0, _mods.Count - 1); if (num != _selected) { Select(num); } } } private void Select(int index) { if (index >= 0 && index < _mods.Count) { _selected = index; _page = index / RowsThatFit(); RebuildCards(); RebuildSettings(); } } private void RebuildCards() { if ((Object)(object)_cardArea == (Object)null) { return; } for (int num = _cardArea.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)_cardArea.GetChild(num)).gameObject); } _cards.Clear(); int num2 = RowsThatFit(); int num3 = _page * num2; if ((Object)(object)_pageLabel != (Object)null) { ((TMP_Text)_pageLabel).text = ((_mods.Count == 0) ? "Nothing registered with BepInEx" : ("Page " + (_page + 1) + " / " + PageCount() + " - " + _mods.Count + " total")); } for (int i = 0; i < num2; i++) { int num4 = num3 + i; if (num4 < _mods.Count) { BuildCard(_mods[num4], i, num4); continue; } break; } } private void BuildCard(ModEntry mod, int slot, int index) { //IL_0047: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) Color color = ((index == _selected) ? new Color(0.3f, 0.34f, 0.46f, 0.95f) : new Color(1f, 1f, 1f, 0.06f)); GameObject val = MakeImage("Card" + slot, _cardArea, color); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.offsetMin = new Vector2(0f, 0f - (114f * (float)slot + 104f)); component.offsetMax = new Vector2(0f, 0f - 114f * (float)slot); int captured = index; ((UnityEvent)val.AddComponent