using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using SOD.Common; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("MasterList")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyInformationalVersion("1.0.2+99b7a0c06c94c87a0eec359fe10f514d4099d038")] [assembly: AssemblyProduct("MasterList")] [assembly: AssemblyTitle("MasterList")] [assembly: AssemblyVersion("1.0.2.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 MasterList { [HarmonyPatch(typeof(DatabaseApp), "OnSetup")] internal static class DatabaseApp_OnSetup_Patch { private static readonly List KeepAlive = new List(); [HarmonyPostfix] private static void Postfix(DatabaseApp __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown try { Inject(__instance); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("MLIST button injection failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } private static void Inject(DatabaseApp app) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown if (Plugin.GovernmentDatabaseOnly.Value && (int)app.citizenPool != 0) { return; } RectTransform component = ((Component)app).GetComponent(); if ((Object)(object)component == (Object)null) { Plugin.Log.LogWarning((object)"DatabaseApp has no RectTransform root; cannot add MLIST button."); } else { if ((Object)(object)((Transform)component).Find("MasterListButton") != (Object)null) { return; } Transform val = ((Transform)component).Find("Exit"); RectTransform val2 = (((Object)(object)val != (Object)null) ? ((Il2CppObjectBase)val).TryCast() : null); if ((Object)(object)val2 == (Object)null) { Plugin.Log.LogWarning((object)"Title-bar Exit button not found; cannot add MLIST button."); return; } GameObject val3 = Object.Instantiate(((Component)val2).gameObject, (Transform)(object)component); ((Object)val3).name = "MasterListButton"; val3.SetActive(true); RectTransform component2 = val3.GetComponent(); Vector2 anchoredPosition = val2.anchoredPosition; Rect rect = val2.rect; component2.anchoredPosition = anchoredPosition + new Vector2(0f - (((Rect)(ref rect)).width + 0.01f), 0f); foreach (ComputerAutoTextController componentsInChild in val3.GetComponentsInChildren(true)) { Object.DestroyImmediate((Object)(object)componentsInChild); } TextMeshProUGUI componentInChildren = ((Component)val2).GetComponentInChildren(true); float num = (((Object)(object)componentInChildren != (Object)null) ? ((TMP_Text)componentInChildren).fontSize : 0f); if (num < 0.01f || num > 1f) { num = 0.045f; } foreach (TextMeshProUGUI componentsInChild2 in val3.GetComponentsInChildren(true)) { ((TMP_Text)componentsInChild2).text = "MLIST"; ((TMP_Text)componentsInChild2).enableAutoSizing = false; ((TMP_Text)componentsInChild2).enableWordWrapping = false; ((TMP_Text)componentsInChild2).alignment = (TextAlignmentOptions)514; ((TMP_Text)componentsInChild2).overflowMode = (TextOverflowModes)0; ((TMP_Text)componentsInChild2).fontSize = num; } Button componentInChildren2 = val3.GetComponentInChildren