using System; using System.Collections.Generic; using System.Diagnostics; 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.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("GovernmentDatabaseRework")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ea1649261c0fab9ed9de9ec6167599568b30696a")] [assembly: AssemblyProduct("GovernmentDatabaseRework")] [assembly: AssemblyTitle("GovernmentDatabaseRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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 GovernmentDatabaseRework { internal sealed class DirectoryEntry { internal Human Citizen; internal string Display; internal string SortKey; internal string MatchKey; } internal sealed class AppState { internal DatabaseApp App; internal ComputerOSMultiSelect List; internal RectTransform DataDisplay; internal RectTransform ActorEntry; internal RawImage Headshot; internal TextMeshProUGUI InfoText; internal RectTransform FingerprintCard; internal RawImage FingerprintImage; internal TextMeshProUGUI FingerprintLabel; internal TextMeshProUGUI PageLabel; internal RectTransform ElementParent; internal float RowHeight = 0.06f; internal readonly List Rows = new List(); internal List CurrentOptions; internal bool Rendering; internal TextMeshProUGUI PreviewPageLabel; internal int PreviewPage; internal int PreviewPageCount = 1; internal readonly List OwnedButtons = new List(); internal bool LayoutApplied; internal int EntriesPerPage = 4; internal List Pool; internal List Matches; internal int PageIndex; internal int LastResultCount; internal string LastSearch; internal List PrintKeys; internal string PrintKeysDescription; internal bool LoggedFirstPreview; internal int FingerprintsLogged; internal int Reveals; internal bool LoggedRevealCap; internal int LoggedRowCount = -1; internal int LastChildCount = -1; internal Texture LastPhoto; internal int LastPhotoHumanId = int.MinValue; internal int LastPreviewHumanId = int.MinValue; internal bool LastPreviewWasEmpty; } internal static class AppRegistry { private static readonly Dictionary ByApp = new Dictionary(); private static readonly Dictionary ByList = new Dictionary(); private static readonly Dictionary ButtonActions = new Dictionary(); internal static void RegisterButton(AppState state, ComputerOSUIComponent component, Action action) { if (state != null && !((Object)(object)component == (Object)null) && action != null) { IntPtr pointer = ((Il2CppObjectBase)component).Pointer; ButtonActions[pointer] = action; state.OwnedButtons.Add(pointer); } } internal static Action ActionForButton(ComputerOSUIComponent component) { if ((Object)(object)component == (Object)null || ButtonActions.Count == 0) { return null; } Action value; return ButtonActions.TryGetValue(((Il2CppObjectBase)component).Pointer, out value) ? value : null; } internal static AppState GetOrCreate(DatabaseApp app) { if ((Object)(object)app == (Object)null) { return null; } IntPtr pointer = ((Il2CppObjectBase)app).Pointer; if (ByApp.TryGetValue(pointer, out var value)) { return value; } AppState appState = new AppState { App = app, List = app.list }; ByApp[pointer] = appState; if ((Object)(object)appState.List != (Object)null) { ByList[((Il2CppObjectBase)appState.List).Pointer] = appState; } return appState; } internal static AppState Get(DatabaseApp app) { if ((Object)(object)app == (Object)null) { return null; } AppState value; return ByApp.TryGetValue(((Il2CppObjectBase)app).Pointer, out value) ? value : null; } internal static AppState ForList(ComputerOSMultiSelect list) { if ((Object)(object)list == (Object)null) { return null; } AppState value; return ByList.TryGetValue(((Il2CppObjectBase)list).Pointer, out value) ? value : null; } internal static void Remove(DatabaseApp app) { if ((Object)(object)app == (Object)null) { return; } IntPtr pointer = ((Il2CppObjectBase)app).Pointer; if (!ByApp.TryGetValue(pointer, out var value)) { return; } ByApp.Remove(pointer); if ((Object)(object)value.List != (Object)null) { ByList.Remove(((Il2CppObjectBase)value.List).Pointer); } foreach (IntPtr ownedButton in value.OwnedButtons) { ButtonActions.Remove(ownedButton); } value.OwnedButtons.Clear(); } } internal static class ListingConfig { internal static ConfigEntry Enabled; internal static ConfigEntry SurnameFirst; internal static ConfigEntry MinimumSearchLength; internal static ConfigEntry MatchAnywhereInName; internal static ConfigEntry EmptySearchHint; internal static void Bind(ConfigFile config) { Enabled = config.Bind("Listing", "Enabled", true, "Master switch for the browsing rework. When false the databases go back to the vanilla behaviour of showing nothing until you have typed two letters."); SurnameFirst = config.Bind("Listing", "SurnameFirst", true, "List and sort citizens as \"Surname, Firstname\", the way a government register reads. Turn this off to sort and display by full name instead."); MinimumSearchLength = config.Bind("Listing", "MinimumSearchLength", 0, "How many characters must be typed before the list is filtered. 0 means the whole database is browsable from the moment the app opens, which is the point of this mod. Vanilla was 2."); MatchAnywhereInName = config.Bind("Listing", "MatchAnywhereInName", true, "When filtering, match the typed characters anywhere in the name (vanilla behaviour). Turn this off to match only names that start with what you typed, which suits an alphabetical list better."); EmptySearchHint = config.Bind("Listing", "EmptySearchHint", "ALL RECORDS - TYPE TO FILTER", "Text shown on the search line while nothing has been typed."); } } internal static class LayoutConfig { internal static ConfigEntry TwoColumnLayout; internal static ConfigEntry HideOnscreenKeyboard; internal static ConfigEntry KeyboardHeight; internal static ConfigEntry EntriesPerPage; internal static void Bind(ConfigFile config) { TwoColumnLayout = config.Bind("Layout", "TwoColumnLayout", true, "Split the app into a list on the left and a live profile on the right. When false the screen keeps its vanilla single-column shape and only the list contents change."); HideOnscreenKeyboard = config.Bind("Layout", "HideOnscreenKeyboard", false, "Hide the app's on-screen keyboard and give the space to the list, which fits noticeably more names per page. You can still type on a real keyboard; leave this off if you play on a controller."); KeyboardHeight = config.Bind("Layout", "KeyboardHeight", 0.135f, "Height of the on-screen keyboard strip, in the cruncher screen's own units (the whole screen is roughly 1.0 tall). Vanilla is 0.28. Shorter keys mean more rows of names."); EntriesPerPage = config.Bind("Layout", "EntriesPerPage", 0, "Names per page. 0 auto-fits as many as the list area can show without overflowing, which is what you want. A value larger than fits will be clamped down."); } } internal static class PreviewConfig { internal static ConfigEntry ShowPreview; internal static ConfigEntry ShowPhoto; internal static ConfigEntry ShowNameHeader; internal static ConfigEntry FontScale; internal static ConfigEntry HideUnknownFields; internal static ConfigEntry FingerprintInCorner; internal static ConfigEntry RevealFingerprintOnPreview; internal static ConfigEntry MaxRevealsPerSession; internal static void Bind(ConfigFile config) { FontScale = config.Bind("Preview", "FontScale", 0.9f, "How much larger the profile text is than the size the screen was authored at. The profile spills onto extra pages rather than shrinking, so a bigger number here costs pages, not legibility."); FingerprintInCorner = config.Bind("Preview", "FingerprintInCorner", true, "Lift the fingerprint identifier out of the list of fields and set it in the top right corner, opposite the photo, the way the printed record carries it. It stays shown even when the record has no answer for it, because the corner is part of the form."); RevealFingerprintOnPreview = config.Bind("Preview", "RevealFingerprintOnPreview", true, "Looking a record up puts that citizen's prints on file, the same way meeting their print in the world would: the game hands out the next identifier in its sequence and the record keeps it for good. Turn this off and the card only shows prints you already had. Note that with this on, paging through the register files everyone you stop on, which spends the sequence quickly."); MaxRevealsPerSession = config.Bind("Preview", "MaxRevealsPerSession", 500, "A ceiling on how many identifiers one session may hand out. This is a runaway guard rather than a balance setting - it exists so a fault can never sit there allocating forever."); HideUnknownFields = config.Bind("Preview", "HideUnknownFields", true, "Leave out the rows the record has no answer for. The game lists every field a citizen could have and marks the unknown ones with a question mark, which is most of a full-screen wall of text carrying no information."); ShowPreview = config.Bind("Preview", "ShowPreview", true, "Show the selected citizen's profile on the right-hand side before you print it. The information shown is generated from the same evidence entry and the same data keys the printout uses."); ShowPhoto = config.Bind("Preview", "ShowPhoto", true, "Include the citizen's photo in the preview. Turn this off if the photo is missing, slow, or you would rather have the extra room for text."); ShowNameHeader = config.Bind("Preview", "ShowNameHeader", true, "Print the citizen's name as a heading above the profile body. Turn this off if the body already leads with the name."); } } internal static class DebugConfig { internal static ConfigEntry VerboseLogging; internal static void Bind(ConfigFile config) { VerboseLogging = config.Bind("Debug", "VerboseLogging", false, "Log every list rebuild and every preview render. Noisy; only for diagnosing."); } } [HarmonyPatch(typeof(DatabaseApp), "OnSetup")] internal static class DatabaseAppOnSetupPatch { private static void Postfix(DatabaseApp __instance) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown if (!ListingConfig.Enabled.Value) { return; } try { AppState orCreate = AppRegistry.GetOrCreate(__instance); if (orCreate != null) { orCreate.FingerprintsLogged = 0; DatabaseLayout.Apply(__instance, orCreate); DatabaseListing.Invalidate(orCreate); __instance.UpdateSearch(); DatabasePreview.Show(__instance); } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(39, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Setting up the database app failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); } } } [HarmonyPatch(typeof(DatabaseApp), "UpdateSearch")] internal static class DatabaseAppUpdateSearchPatch { private static bool Prefix(DatabaseApp __instance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown if (!ListingConfig.Enabled.Value) { return true; } try { return !DatabaseListing.Rebuild(__instance); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(67, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Rebuilding the list failed, falling back to "); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("the vanilla search: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); return true; } } } [HarmonyPatch(typeof(DatabaseApp), "UpdateSelected")] internal static class DatabaseAppUpdateSelectedPatch { private static void Postfix(DatabaseApp __instance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown if (!ListingConfig.Enabled.Value || !PreviewConfig.ShowPreview.Value) { return; } try { DatabasePreview.Show(__instance); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(41, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Rendering the profile preview failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); } } } [HarmonyPatch(typeof(DatabaseApp), "OnDestroy")] internal static class DatabaseAppOnDestroyPatch { private static void Postfix(DatabaseApp __instance) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown try { AppRegistry.Remove(__instance); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(32, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Cleaning up app state threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } } [HarmonyPatch(typeof(ComputerOSUIComponent), "OnLeftClick")] internal static class ComputerOSUIComponentOnLeftClickPatch { private static void Postfix(ComputerOSUIComponent __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown try { AppRegistry.ActionForButton(__instance)?.Invoke(); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] A button action failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); } } } [HarmonyPatch(typeof(ComputerOSMultiSelect), "NextPage")] internal static class ComputerOSMultiSelectNextPagePatch { private static bool Prefix(ComputerOSMultiSelect __instance, int newPage) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown try { AppState appState = AppRegistry.ForList(__instance); if (appState == null) { return true; } DatabaseListing.TurnPage(appState, newPage); return false; } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(33, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Turning the list page failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } logger.LogError(val); return false; } } } [HarmonyPatch(typeof(DatabaseApp), "Update")] internal static class DatabaseAppUpdatePatch { private static void Postfix(DatabaseApp __instance) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown if (!ListingConfig.Enabled.Value) { return; } try { AppState appState = AppRegistry.Get(__instance); if (appState != null && !((Object)(object)appState.ElementParent == (Object)null)) { int childCount = ((Transform)appState.ElementParent).childCount; if (childCount != appState.LastChildCount) { appState.LastChildCount = childCount; DatabaseLayout.LayOutRows(appState); } } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(21, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Row upkeep threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } } [HarmonyPatch(typeof(ComputerOSMultiSelect), "SpawnList")] internal static class ComputerOSMultiSelectSpawnListPatch { private static void Postfix(ComputerOSMultiSelect __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown try { AppState appState = AppRegistry.ForList(__instance); if (appState != null && !appState.Rendering) { if (appState.CurrentOptions != null) { DatabaseLayout.RenderRows(appState, appState.CurrentOptions); } DatabaseLayout.UpdatePageLabel(appState); } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(29, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Page label refresh threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } } internal static class DatabaseLayout { private const float ContentTop = -0.08f; private const float ContentHeight = 0.7f; private const float LeftMargin = 0.02f; private const float ColumnGap = 0.02f; private const float ListColumnWidth = 0.42f; private const float PreviewColumnX = 0.46f; private const float PreviewColumnWidth = 0.52f; private const float KeyboardWidth = 0.92f; private const float VanillaKeyboardHeight = 0.28f; private const float SearchLineHeight = 0.055f; private const float NavRowHeight = 0.05f; private const float NavButtonWidth = 0.07f; private const float PrintRowHeight = 0.08f; private const float PhotoSize = 0.128f; private const float FingerprintLabelHeight = 0.055f; private const float DefaultElementHeight = 0.06f; private static readonly Vector2 TopLeft = new Vector2(0f, 1f); private static readonly Vector2 TopRight = new Vector2(1f, 1f); private static readonly Vector2 BottomRight = new Vector2(1f, 0f); internal static void Apply(DatabaseApp app, AppState state) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Expected O, but got Unknown if (state.LayoutApplied) { return; } state.LayoutApplied = true; RectTransform val = As((Object)(object)((Component)app).transform); bool flag = default(bool); if ((Object)(object)val == (Object)null) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(59, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("] App root has no RectTransform; leaving the layout alone."); } logger.LogWarning(val2); return; } RectTransform val3 = Child((Transform)(object)val, "SearchDisplay"); RectTransform val4 = Child((Transform)(object)val, "DataDisplay"); RectTransform val5 = (((Object)(object)val3 != (Object)null) ? Child((Transform)(object)val3, "Results") : null); RectTransform val6 = (((Object)(object)val5 != (Object)null) ? Child((Transform)(object)val5, "ElementParent") : null); RectTransform val7 = (((Object)(object)val5 != (Object)null) ? Child((Transform)(object)val5, "ScrollUpButton") : null); RectTransform val8 = (((Object)(object)val5 != (Object)null) ? Child((Transform)(object)val5, "ScrollDownButton") : null); RectTransform val9 = (((Object)(object)val3 != (Object)null) ? Child((Transform)(object)val3, "OnscreenKeyboard") : null); ManualLogSource logger2 = Plugin.Logger; BepInExInfoLogInterpolatedStringHandler val10 = new BepInExInfoLogInterpolatedStringHandler(74, 9, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("] Laying out "); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(app.citizenPool); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" app: "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("search="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val3)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" data="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val4)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" results="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val5)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("elements="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val6)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" prev="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val7)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("next="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val8)); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" keyboard="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(Found((Object)(object)val9)); } logger2.LogInfo(val10); if ((Object)(object)val3 == (Object)null || (Object)(object)val5 == (Object)null || (Object)(object)val6 == (Object)null) { Plugin.Logger.LogWarning((object)"[CalebScott.GovernmentDatabaseRework] The app prefab is not the shape this mod expects, so the screen keeps its vanilla layout. Browsing still works."); state.EntriesPerPage = (((Object)(object)app.list != (Object)null) ? app.list.maxPerPage : 4); return; } float num = (LayoutConfig.HideOnscreenKeyboard.Value ? 0f : Mathf.Clamp(LayoutConfig.KeyboardHeight.Value, 0.06f, 0.4f)); float num2 = 0.7f - ((num > 0f) ? (num + 0.02f) : 0f); MoveKeyboard(val, val9, num); Place(val3, TopLeft, TopLeft, TopLeft, new Vector2(0.02f, -0.08f), new Vector2(0.42f, num2)); float num3 = num2 - 0.055f - 0.005f; Place(val5, TopLeft, TopRight, new Vector2(0.5f, 1f), new Vector2(0f, -0.055f), new Vector2(-0.04f, num3)); float num4 = num3 - 0.05f - 0.01f; Place(val6, TopLeft, TopLeft, TopLeft, new Vector2(0.015f, -0.005f), new Vector2(0.35f, num4)); state.ElementParent = val6; state.EntriesPerPage = EntriesThatFit(app, num4); state.RowHeight = num4 / (float)state.EntriesPerPage; BuildListPageNavigation(state, val5, val7, val8, app); if (LayoutConfig.TwoColumnLayout.Value && (Object)(object)val4 != (Object)null) { BuildPreviewPanel(state, val4, num2, app, val7, val8); } else if ((Object)(object)val4 == (Object)null) { Plugin.Logger.LogWarning((object)"[CalebScott.GovernmentDatabaseRework] No DataDisplay panel on this app prefab; the profile preview is unavailable."); } ManualLogSource logger3 = Plugin.Logger; val10 = new BepInExInfoLogInterpolatedStringHandler(72, 7, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("] Layout done: column="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(num2, "0.###"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("keyboard="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(num, "0.###"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" listArea="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(num4, "0.###"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("perPage="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(state.EntriesPerPage); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" rowHeight="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(state.RowHeight, "0.####"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("preview="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(((Object)(object)state.InfoText != (Object)null) ? "on" : "off"); } logger3.LogInfo(val10); } internal static void LayOutRows(AppState state) { //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) if (state == null || (Object)(object)state.ElementParent == (Object)null) { return; } bool flag = default(bool); try { int num = 0; int childCount = ((Transform)state.ElementParent).childCount; for (int i = 0; i < childCount; i++) { Transform child = ((Transform)state.ElementParent).GetChild(i); if (!((Object)(object)child == (Object)null) && ((Component)child).gameObject.activeSelf) { RectTransform val = As((Object)(object)child); if (!((Object)(object)val == (Object)null)) { Place(val, TopLeft, TopRight, new Vector2(0.5f, 1f), new Vector2(0f, (float)(-num) * state.RowHeight), new Vector2(0f, state.RowHeight)); num++; } } } if (num != state.LoggedRowCount) { state.LoggedRowCount = num; ManualLogSource logger = Plugin.Logger; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(106, 7, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("] Row layout: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" row(s) placed of "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(childCount); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" child object(s), widget tracks "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((Object)(object)state.List != (Object)null && state.List.options != null) ? state.List.options.Count : (-1)); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", "); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("page holds "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(state.EntriesPerPage); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", each "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(state.RowHeight, "0.####"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" tall "); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("in a box "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(state.ElementParent.sizeDelta.y, "0.####"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" tall."); } logger.LogInfo(val2); } } catch (Exception ex) { ManualLogSource logger2 = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(30, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("] Laying out the rows threw: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logger2.LogWarning(val3); } } internal static void RenderRows(AppState state, List options) { //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Expected O, but got Unknown ComputerOSMultiSelect list = state.List; if ((Object)(object)list == (Object)null || (Object)(object)state.ElementParent == (Object)null || options == null) { return; } bool flag2 = default(bool); try { state.Rows.RemoveAll((ComputerOSMultiSelectElement row) => !IsAlive(row, state.ElementParent)); GameObject elementPrefab = list.elementPrefab; int count = options.Count; while (state.Rows.Count < count && (Object)(object)elementPrefab != (Object)null) { GameObject val = Clone(elementPrefab, state.ElementParent, "DatabaseListEntry"); ComputerOSMultiSelectElement val2 = (((Object)(object)val != (Object)null) ? val.GetComponent() : null); if ((Object)(object)val2 == (Object)null) { if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } Plugin.Logger.LogWarning((object)"[CalebScott.GovernmentDatabaseRework] The row prefab has no list-element component; cannot build the page."); break; } state.Rows.Add(val2); } for (int num = 0; num < state.Rows.Count; num++) { bool flag = num < count; ((Component)state.Rows[num]).gameObject.SetActive(flag); if (!flag) { continue; } try { state.Rows[num].Setup(options[num], list); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(26, 3, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("] Setting up row "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(num); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" threw: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); } logger.LogWarning(val3); } } if (list.options != null) { list.options.Clear(); for (int num2 = 0; num2 < state.Rows.Count && num2 < count; num2++) { list.options.Add(state.Rows[num2]); } } LayOutRows(state); } catch (Exception ex2) { ManualLogSource logger2 = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(27, 2, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("] Drawing the page threw: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex2.Message); } logger2.LogWarning(val3); } } private static bool IsAlive(ComputerOSMultiSelectElement row, RectTransform parent) { try { if ((Object)(object)row == (Object)null) { return false; } GameObject gameObject = ((Component)row).gameObject; if ((Object)(object)gameObject == (Object)null) { return false; } Transform transform = gameObject.transform; return (Object)(object)transform != (Object)null && (Object)(object)transform.parent != (Object)null && ((Il2CppObjectBase)transform.parent).Pointer == ((Il2CppObjectBase)parent).Pointer; } catch (Exception) { return false; } } private static void MoveKeyboard(RectTransform root, RectTransform keyboard, float height) { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e5: 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) if ((Object)(object)keyboard == (Object)null) { return; } if (height <= 0f) { ((Component)keyboard).gameObject.SetActive(false); return; } float num = keyboard.sizeDelta.y; if (num <= 0f) { num = 0.28f; } ((Transform)keyboard).SetParent((Transform)(object)root, false); Place(keyboard, TopLeft, TopLeft, TopLeft, new Vector2(0.02f, -0.78f + height), new Vector2(0.92f, height)); try { GridLayoutGroup component = ((Component)keyboard).GetComponent(); if ((Object)(object)component != (Object)null) { float num2 = height / num; Vector2 cellSize = component.cellSize; component.cellSize = new Vector2(cellSize.x, cellSize.y * num2); Vector2 spacing = component.spacing; component.spacing = new Vector2(spacing.x, spacing.y * num2); } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(40, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Could not rescale the keyboard grid: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } private static void BuildListPageNavigation(AppState state, RectTransform results, RectTransform prevButton, RectTransform nextButton, DatabaseApp app) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prevButton != (Object)null) { Place(prevButton, Vector2.zero, Vector2.zero, Vector2.zero, new Vector2(0.005f, 0.005f), new Vector2(0.07f, 0.05f)); TurnArrow(prevButton); } if ((Object)(object)nextButton != (Object)null) { Place(nextButton, BottomRight, BottomRight, BottomRight, new Vector2(-0.005f, 0.005f), new Vector2(0.07f, 0.05f)); TurnArrow(nextButton); } state.PageLabel = CloneLabel(app.searchText, results, "PageIndicator"); if (!((Object)(object)state.PageLabel == (Object)null)) { Place(As((Object)(object)((TMP_Text)state.PageLabel).transform), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 0.005f), new Vector2(0.22f, 0.05f)); TrySet(delegate { ((TMP_Text)state.PageLabel).alignment = (TextAlignmentOptions)514; }); KeepOnOneLine(state.PageLabel); ((TMP_Text)state.PageLabel).text = string.Empty; } } private static void BuildPreviewPanel(AppState state, RectTransform data, float columnHeight, DatabaseApp app, RectTransform prevSource, RectTransform nextSource) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) ((Component)data).gameObject.SetActive(true); Place(data, TopLeft, TopLeft, TopLeft, new Vector2(0.46f, -0.08f), new Vector2(0.52f, columnHeight)); state.DataDisplay = data; state.ActorEntry = Child((Transform)(object)data, "ActorEntry"); state.InfoText = ChildComponent((Transform)(object)data, "InformationText"); bool flag = PreviewConfig.ShowPhoto.Value && (Object)(object)state.ActorEntry != (Object)null; bool flag2 = PreviewConfig.FingerprintInCorner.Value && (Object)(object)state.ActorEntry != (Object)null && DatabasePreview.CarriesFingerprints(app); if ((Object)(object)state.ActorEntry != (Object)null) { if (flag) { Place(state.ActorEntry, TopLeft, TopLeft, TopLeft, new Vector2(0.014f, -0.012f), new Vector2(0.128f, 0.128f)); RectTransform val = Child((Transform)(object)state.ActorEntry, "ActorHeadshot"); if ((Object)(object)val != (Object)null) { val.sizeDelta = new Vector2(0.11264001f, 0.11264001f); state.Headshot = ((Component)val).GetComponent(); } } else { ((Component)state.ActorEntry).gameObject.SetActive(false); } } if ((Object)(object)state.InfoText != (Object)null) { float num = 0.14f + (flag2 ? 0.055f : 0f) + 0.012f; float num2 = ((flag || flag2) ? num : 0.014f); float infoHeight = Mathf.Max(0.08f, columnHeight - num2 - 0.08f); Place(As((Object)(object)((TMP_Text)state.InfoText).transform), TopLeft, TopRight, new Vector2(0.5f, 1f), new Vector2(0f, 0f - num2), new Vector2(-0.03f, infoHeight)); TrySet(delegate { ((TMP_Text)state.InfoText).alignment = (TextAlignmentOptions)257; }); TrySet(delegate { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown float num3 = (((TMP_Text)state.InfoText).enableAutoSizing ? ((TMP_Text)state.InfoText).fontSizeMax : ((TMP_Text)state.InfoText).fontSize); if (num3 <= 0f) { num3 = ((TMP_Text)state.InfoText).fontSize; } ((TMP_Text)state.InfoText).enableAutoSizing = false; ((TMP_Text)state.InfoText).fontSize = num3 * Mathf.Clamp(PreviewConfig.FontScale.Value, 0.5f, 6f); ((TMP_Text)state.InfoText).overflowMode = (TextOverflowModes)5; ((TMP_Text)state.InfoText).pageToDisplay = 1; ManualLogSource logger = Plugin.Logger; bool flag3 = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(51, 4, ref flag3); if (flag3) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("] Preview text set at "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((TMP_Text)state.InfoText).fontSize, "0.####"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("(authored "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(num3, "0.####"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(") in a box "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(infoHeight, "0.###"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" tall."); } logger.LogInfo(val2); }); if (flag2) { BuildFingerprintCorner(state, data); } BuildPreviewPageNavigation(state, data, app, prevSource, nextSource); } else { Plugin.Logger.LogWarning((object)"[CalebScott.GovernmentDatabaseRework] DataDisplay has no InformationText; the profile preview will stay blank."); } MovePrintButton(app, data); } private static void BuildFingerprintCorner(AppState state, RectTransform data) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)state.ActorEntry == (Object)null) { return; } GameObject val = Clone(((Component)state.ActorEntry).gameObject, data, "FingerprintCard"); state.FingerprintCard = (((Object)(object)val != (Object)null) ? As((Object)(object)val.transform) : null); if ((Object)(object)state.FingerprintCard == (Object)null) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("] Could not build the fingerprint card."); } logger.LogWarning(val2); return; } Place(state.FingerprintCard, TopRight, TopRight, TopRight, new Vector2(-0.014f, -0.012f), new Vector2(0.128f, 0.128f)); RectTransform val3 = Child((Transform)(object)state.FingerprintCard, "ActorHeadshot"); if ((Object)(object)val3 != (Object)null) { ((Object)val3).name = "FingerprintImage"; val3.sizeDelta = new Vector2(0.11264001f, 0.11264001f); state.FingerprintImage = ((Component)val3).GetComponent(); } state.FingerprintLabel = CloneLabel(state.InfoText, data, "FingerprintInitials"); if (!((Object)(object)state.FingerprintLabel == (Object)null)) { Place(As((Object)(object)((TMP_Text)state.FingerprintLabel).transform), TopRight, TopRight, TopRight, new Vector2(-0.014f, -0.14f), new Vector2(0.128f, 0.055f)); TrySet(delegate { ((TMP_Text)state.FingerprintLabel).alignment = (TextAlignmentOptions)258; ((TMP_Text)state.FingerprintLabel).enableAutoSizing = false; ((TMP_Text)state.FingerprintLabel).overflowMode = (TextOverflowModes)3; ((TMP_Text)state.FingerprintLabel).fontSize = ((TMP_Text)state.InfoText).fontSize; }); ((TMP_Text)state.FingerprintLabel).text = string.Empty; } } private static void BuildPreviewPageNavigation(AppState state, RectTransform data, DatabaseApp app, RectTransform prevSource, RectTransform nextSource) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CloneButton(prevSource, data, "PreviewPageBack"); if ((Object)(object)val != (Object)null) { Place(val, Vector2.zero, Vector2.zero, Vector2.zero, new Vector2(0.012f, 0.014f), new Vector2(0.06f, 0.06f)); Bind(state, val, delegate { DatabasePreview.TurnPage(state, -1); }); } RectTransform val2 = CloneButton(nextSource, data, "PreviewPageForward"); if ((Object)(object)val2 != (Object)null) { Place(val2, Vector2.zero, Vector2.zero, Vector2.zero, new Vector2(0.207f, 0.014f), new Vector2(0.06f, 0.06f)); Bind(state, val2, delegate { DatabasePreview.TurnPage(state, 1); }); } state.PreviewPageLabel = CloneLabel(app.searchText, data, "PreviewPageIndicator"); if (!((Object)(object)state.PreviewPageLabel == (Object)null)) { Place(As((Object)(object)((TMP_Text)state.PreviewPageLabel).transform), Vector2.zero, Vector2.zero, Vector2.zero, new Vector2(0.072f, 0.014f), new Vector2(0.135f, 0.06f)); TrySet(delegate { ((TMP_Text)state.PreviewPageLabel).alignment = (TextAlignmentOptions)514; }); KeepOnOneLine(state.PreviewPageLabel); ((TMP_Text)state.PreviewPageLabel).text = string.Empty; } } private static void MovePrintButton(DatabaseApp app, RectTransform data) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown RectTransform printButton = app.printButton; if ((Object)(object)printButton == (Object)null) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] No print button on this app; leaving it be."); } logger.LogWarning(val); return; } RectTransform val2 = null; Transform parent = ((Transform)printButton).parent; if ((Object)(object)parent != (Object)null) { Transform val3 = parent.Find("PrintButtonBG"); val2 = (((Object)(object)val3 != (Object)null) ? As((Object)(object)val3) : null); } Action action = delegate(RectTransform rect) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) ((Transform)rect).SetParent((Transform)(object)data, false); Place(rect, BottomRight, BottomRight, BottomRight, new Vector2(-0.014f, 0.014f), new Vector2(0.19f, 0.07f)); }; if ((Object)(object)val2 != (Object)null) { action(val2); } action(printButton); } internal static void UpdatePageLabel(AppState state) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown if (state == null || (Object)(object)state.PageLabel == (Object)null) { return; } try { int value = DatabaseListing.PageCount(state); ((TMP_Text)state.PageLabel).text = ((state.LastResultCount == 0) ? "NONE" : $"{state.PageIndex + 1}/{value}"); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(28, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] Page label update threw: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } logger.LogWarning(val); } } private static int EntriesThatFit(DatabaseApp app, float listAreaHeight) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) float num = 0.06f; bool flag = default(bool); try { GameObject val = (((Object)(object)app.list != (Object)null) ? app.list.elementPrefab : null); RectTransform val2 = (((Object)(object)val != (Object)null) ? As((Object)(object)val.transform) : null); if ((Object)(object)val2 != (Object)null && val2.sizeDelta.y > 0.001f) { num = val2.sizeDelta.y; } } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(55, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("] Could not measure the list row prefab "); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("); assuming "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(0.06f); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("."); } logger.LogWarning(val3); } int num2 = Mathf.Max(1, Mathf.FloorToInt(listAreaHeight / num)); int value = LayoutConfig.EntriesPerPage.Value; if (value > 0 && value <= num2) { return value; } if (value > num2) { ManualLogSource logger2 = Plugin.Logger; BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(56, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted("CalebScott.GovernmentDatabaseRework"); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("] EntriesPerPage "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(value); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" would overflow the "); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("list area; using "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted(num2); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("."); } logger2.LogInfo(val4); } return num2; } private static void Bind(AppState state, RectTransform buttonRect, Action handler) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown try { Button component = ((Component)buttonRect).GetComponent