Decompiled source of Kruegerslist v1.0.0
plugins/Kruegerslist/SoDKruegerslist.dll
Decompiled 17 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SoDKruegerslist")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("SoDKruegerslist")] [assembly: AssemblyTitle("SoDKruegerslist")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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 SoDKruegerslist { [BepInPlugin("sm3gm.sod.kruegerslist", "Kruegerslist", "1.0.0")] public sealed class Plugin : BasePlugin { public const string VER = "1.0.0"; internal static ManualLogSource L; internal static ConfigEntry<float> SellShare; internal static ConfigEntry<JobMode> Jobs; internal static ConfigEntry<bool> ShowNotPosted; internal static ConfigEntry<bool> ShowEnded; internal static ConfigEntry<float> PrintTilt; internal static ConfigEntry<float> SaleTilt; internal static ConfigEntry<bool> FitIcons; internal static ConfigEntry<Theme.Colour> Colours; internal static bool Convenient { get { if (Jobs.Value != JobMode.Convenient) { if (Jobs.Value == JobMode.Auto) { return ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey("sm3gm.sod.nomoresidejobhassle"); } return false; } return true; } } public override void Load() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown new Harmony("sm3gm.sod.kruegerslist").PatchAll(typeof(OwnCruncherFix)); L = ((BasePlugin)this).Log; SellShare = ((BasePlugin)this).Config.Bind<float>("Apartments", "SellShare", 0.8f, "Share of the price you get when you sell one of your apartments (0.8 = 80%)."); FitIcons = ((BasePlugin)this).Config.Bind<bool>("Desktop", "FitIcons", true, "Shrink the cruncher desktop icons when added apps need a third row, so every name stays on screen."); Colours = ((BasePlugin)this).Config.Bind<Theme.Colour>("Look", "Colours", Theme.Colour.Game, "Colour of the app screen, so it stands apart from the other apps: Game (unchanged), Red, Amber, Violet, Blue or White. Text never gets darker than the game's own."); PrintTilt = ((BasePlugin)this).Config.Bind<float>("Print", "TiltDegrees", -90f, "How far printed job notices are tipped over so they lie flat (try 90 if they lie face down)."); SaleTilt = ((BasePlugin)this).Config.Bind<float>("Print", "SaleNoteTiltDegrees", 90f, "The same for printed apartment sale notes, which are built the other way round."); ShowEnded = ((BasePlugin)this).Config.Bind<bool>("Jobs", "ShowEndedAndFailed", false, "Also list jobs that have ended or failed."); ShowNotPosted = ((BasePlugin)this).Config.Bind<bool>("Jobs", "ShowNotPostedYet", false, "Also list jobs the game has not posted yet (spoilers)."); Jobs = ((BasePlugin)this).Config.Bind<JobMode>("Jobs", "Mode", JobMode.Auto, "Classic: jobs are listed with where to find the notice; you still call or meet the poster yourself. Convenient: accept jobs from the cruncher and see the target's clues first. Auto: Convenient when No More Sidejob Hassle is installed, otherwise Classic."); ClassInjector.RegisterTypeInIl2Cpp<KruegerApp>(); ((BasePlugin)this).AddComponent<Installer>(); ManualLogSource l = L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Kruegerslist "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded"); } l.LogInfo(val); } } [HarmonyPatch(typeof(ComputerOSMultiSelect), "SpawnList")] internal static class OwnCruncherFix { private static void Prefix(ComputerOSMultiSelect __instance, out List<NewAddress>? __state) { __state = null; try { if ((Object)(object)((Component)__instance).GetComponentInParent<KruegerApp>() == (Object)null) { return; } Player instance = Player.Instance; List<NewAddress> val = ((instance != null) ? instance.apartmentsOwned : null); if (val != null && val.Count != 0) { __state = new List<NewAddress>(); Enumerator<NewAddress> enumerator = val.GetEnumerator(); while (enumerator.MoveNext()) { NewAddress current = enumerator.Current; __state.Add(current); } val.Clear(); } } catch { } } private static Exception? Finalizer(Exception? __exception, List<NewAddress>? __state) { if (__state != null) { try { List<NewAddress> apartmentsOwned = Player.Instance.apartmentsOwned; foreach (NewAddress item in __state) { if (!apartmentsOwned.Contains(item)) { apartmentsOwned.Add(item); } } } catch { } } return __exception; } } public class Installer : MonoBehaviour { private float next; private bool done; internal static CruncherAppPreset? Preset; private static readonly HashSet<int> fitted = new HashSet<int>(); private static readonly Dictionary<int, (Vector2, Vector2)> baseCell = new Dictionary<int, (Vector2, Vector2)>(); internal static string TitlePath = ""; internal static string SearchPath = ""; public Installer(IntPtr ptr) : base(ptr) { } private void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown if (Time.unscaledTime < next) { return; } next = Time.unscaledTime + 0.5f; try { SessionData instance = SessionData.Instance; if (!((Object)(object)instance == (Object)null) && instance.startedGame) { if (!done) { done = true; Install(); } KruegerApp.PlotPending(); NameIcons(); FitDesktops(); } } catch (Exception ex) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] install failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } l.LogWarning(val); } } private static void NameIcons() { if ((SoCustomComparison)(object)Preset == (SoCustomComparison)null) { return; } foreach (DesktopIconController item in Object.FindObjectsOfType<DesktopIconController>()) { if ((SoCustomComparison)(object)item.preset != (SoCustomComparison)null && ((Object)item.preset).name == "Kruegerslist" && (Object)(object)item.iconText != (Object)null && ((TMP_Text)item.iconText).text != "Kruegerslist") { ((TMP_Text)item.iconText).text = "Kruegerslist"; } } } private static void FitDesktops() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0210: 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_0220: 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_01db: 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_02a7: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.FitIcons.Value) { return; } bool flag = default(bool); foreach (DesktopApp item2 in Object.FindObjectsOfType<DesktopApp>()) { List<DesktopIconController> spawnedIcons = item2.spawnedIcons; if (spawnedIcons == null || spawnedIcons.Count <= 8 || (Object)(object)spawnedIcons[0] == (Object)null) { continue; } Transform parent = ((Component)spawnedIcons[0]).transform.parent; if ((Object)(object)parent == (Object)null) { continue; } int item = ((Object)parent).GetInstanceID() * 31 + spawnedIcons.Count; if (fitted.Contains(item)) { continue; } fitted.Add(item); GridLayoutGroup component = ((Component)parent).GetComponent<GridLayoutGroup>(); int num = (((Object)(object)component != (Object)null && (int)component.constraint == 1) ? component.constraintCount : 4); int num2 = (spawnedIcons.Count + num - 1) / num; float num3 = Mathf.Min(1f, 2.15f / (float)num2); ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(45, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] desktop has "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(spawnedIcons.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" icons, "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" rows, grid="); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((Object)(object)component != (Object)null) ? (((object)component.cellSize/*cast due to .constrained prefix*/).ToString() + "/" + ((object)component.spacing/*cast due to .constrained prefix*/).ToString()) : "none"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", scale "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num3, "0.00"); } l.LogInfo(val); Enumerator<DesktopIconController> enumerator2; if ((Object)(object)component != (Object)null) { if (!baseCell.ContainsKey(((Object)component).GetInstanceID())) { baseCell[((Object)component).GetInstanceID()] = (component.cellSize, component.spacing); } var (val2, val3) = baseCell[((Object)component).GetInstanceID()]; component.cellSize = val2 * num3; component.spacing = val3 * num3; enumerator2 = spawnedIcons.GetEnumerator(); while (enumerator2.MoveNext()) { DesktopIconController current = enumerator2.Current; if ((Object)(object)current != (Object)null) { ((Component)current).transform.localScale = Vector3.one * num3; } } continue; } float num4 = float.MinValue; float num5 = 0f; int num6 = 0; enumerator2 = spawnedIcons.GetEnumerator(); while (enumerator2.MoveNext()) { DesktopIconController current2 = enumerator2.Current; if ((Object)(object)current2 != (Object)null) { Vector3 localPosition = ((Component)current2).transform.localPosition; num4 = Mathf.Max(num4, localPosition.y); num5 += localPosition.x; num6++; } } num5 /= (float)Mathf.Max(1, num6); enumerator2 = spawnedIcons.GetEnumerator(); while (enumerator2.MoveNext()) { DesktopIconController current3 = enumerator2.Current; if (!((Object)(object)current3 == (Object)null)) { Transform transform = ((Component)current3).transform; Vector3 localPosition2 = transform.localPosition; transform.localPosition = new Vector3(num5 + (localPosition2.x - num5) * num3, num4 + (localPosition2.y - num4) * num3, localPosition2.z); transform.localScale = Vector3.one * num3; } } } } private static void Install() { //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown Il2CppArrayBase<CruncherAppPreset> val = Resources.FindObjectsOfTypeAll<CruncherAppPreset>(); bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2; foreach (CruncherAppPreset item in val) { string text = ((item.appContent != null && item.appContent.Count > 0 && (Object)(object)item.appContent[0] != (Object)null) ? string.Join("/", ((IEnumerable<Component>)item.appContent[0].GetComponents<Component>()).Select((Component c) => ((MemberInfo)((Object)c).GetIl2CppType()).Name)) : "none"); ManualLogSource l = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] app preset "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)item).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(text); } l.LogInfo(val2); } CruncherAppPreset val3 = null; foreach (CruncherAppPreset item2 in val) { if (item2.appContent != null && item2.appContent.Count > 0 && (Object)(object)item2.appContent[0] != (Object)null && (Object)(object)item2.appContent[0].GetComponent<DatabaseApp>() != (Object)null) { val3 = item2; break; } } if ((SoCustomComparison)(object)val3 == (SoCustomComparison)null) { Plugin.L.LogWarning((object)"[KL] no citizen database app to copy"); return; } GameObject obj = val3.appContent[0]; DatabaseApp component = obj.GetComponent<DatabaseApp>(); Transform transform = obj.transform; TextMeshProUGUI titleText = component.titleText; TitlePath = PathOf(transform, (titleText != null) ? ((TMP_Text)titleText).transform : null); Transform transform2 = obj.transform; TextMeshProUGUI searchText = component.searchText; SearchPath = PathOf(transform2, (searchText != null) ? ((TMP_Text)searchText).transform : null); GameObject val4 = new GameObject("KruegerslistHolder"); val4.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val4); GameObject val5 = Object.Instantiate<GameObject>(obj, val4.transform); val5.SetActive(true); ((Object)val5).name = "Kruegerslist"; Object.DestroyImmediate((Object)(object)val5.GetComponent<DatabaseApp>()); val5.AddComponent<KruegerApp>(); CruncherAppPreset val6 = Object.Instantiate<CruncherAppPreset>(val3); ((Object)val6).name = "Kruegerslist"; val6.appContent = new List<GameObject>(); val6.appContent.Add(val5); val6.alwaysInstalled = true; try { val6.desktopIcon = Icon.Make(); } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val7 = new BepInExWarningLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val7).AppendLiteral("[KL] icon failed: "); ((BepInExLogInterpolatedStringHandler)val7).AppendFormatted<string>(ex.Message); } l2.LogWarning(val7); } val6.companyOnly = false; val6.onlyIfOwner = false; val6.onlyIfResidential = false; val6.salesRecordsOnly = false; val6.onlyIfCorporateSabotageSkill = false; val6.installationConditions = new List<AppAccess>(); val6.onlyInAddresses = new List<AddressPreset>(); Object.DontDestroyOnLoad((Object)(object)val6); Preset = val6; int num = 0; foreach (InteractablePreset item3 in Resources.FindObjectsOfTypeAll<InteractablePreset>()) { if (item3.additionalApps == null || !((Object)item3).name.Contains("Cruncher")) { continue; } bool flag2 = false; Enumerator<CruncherAppPreset> enumerator3 = item3.additionalApps.GetEnumerator(); while (enumerator3.MoveNext()) { CruncherAppPreset current4 = enumerator3.Current; if (!((SoCustomComparison)(object)current4 == (SoCustomComparison)null)) { _ = ((Object)current4).name == ((Object)val3).name; if (((Object)current4).name == "Kruegerslist") { flag2 = true; } } } if (!flag2) { item3.additionalApps.Insert(Math.Max(0, item3.additionalApps.Count - 2), val6); num++; ManualLogSource l3 = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] added to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)item3).name); } l3.LogInfo(val2); } } ManualLogSource l4 = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(68, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] installed from "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val3).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" into "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" cruncher types; title at '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(TitlePath); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("', search at '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(SearchPath); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'"); } l4.LogInfo(val2); } private static string PathOf(Transform root, Transform? t) { List<string> list = new List<string>(); while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)root) { list.Insert(0, ((Object)t).name); t = t.parent; } return string.Join("/", list); } } internal sealed class Listing { public string Line = ""; public int Price; public string Building = ""; public string Details = ""; public string ActLabel = ""; public Func<string>? Act; public NewGameLocation? Map; public NewGameLocation? Photo; public Func<ComputerController?, string>? Print; public string PrintLabel = "Print"; public bool PrintRedraws; } public enum JobMode { Auto, Classic, Convenient } public static class Theme { public enum Colour { Game, Red, Amber, Violet, Blue, White } private static readonly Dictionary<IntPtr, Color> applied = new Dictionary<IntPtr, Color>(); private static readonly HashSet<string> logged = new HashSet<string>(); private static float Hue(Colour c) { return c switch { Colour.Red => 0.985f, Colour.Amber => 0.09f, Colour.Violet => 0.8f, Colour.Blue => 0.6f, _ => -1f, }; } private static float Lum(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) return 0.2126f * c.r + 0.7152f * c.g + 0.0722f * c.b; } internal static Color Map(Color orig, Colour theme) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0045: 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_0058: 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_0063: 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_0088: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(orig, ref num, ref num2, ref num3); if (num2 < 0.12f || num3 < 0.04f) { return orig; } Color val = default(Color); ((Color)(ref val))..ctor(num3, num3, num3, orig.a); if (theme == Colour.White) { return val; } Color val2 = Color.HSVToRGB(Hue(theme), num2, num3); val2.a = orig.a; float num4 = Lum(orig); if (Lum(val2) >= num4) { return val2; } float num5 = 0f; float num6 = 1f; for (int i = 0; i < 12; i++) { float num7 = (num5 + num6) / 2f; if (Lum(Color.Lerp(val2, val, num7)) >= num4) { num6 = num7; } else { num5 = num7; } } return Color.Lerp(val2, val, num6); } internal static void Apply(Component root) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0062: 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_009f: 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_00ec: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) Colour value = Plugin.Colours.Value; if (value == Colour.Game) { return; } float num = default(float); float num2 = default(float); float num3 = default(float); bool flag = default(bool); foreach (Graphic componentsInChild in root.GetComponentsInChildren<Graphic>(true)) { if ((Object)(object)componentsInChild == (Object)null || (Object)(object)((Il2CppObjectBase)componentsInChild).TryCast<RawImage>() != (Object)null) { continue; } Color color = componentsInChild.color; if (applied.TryGetValue(((Il2CppObjectBase)componentsInChild).Pointer, out var value2) && value2 == color) { continue; } Color.RGBToHSV(color, ref num, ref num2, ref num3); Color val = (componentsInChild.color = ((value != Colour.White && num2 < 0.05f && num3 > 0.95f && (Object)(object)((Il2CppObjectBase)componentsInChild).TryCast<Image>() != (Object)null) ? (Color.Lerp(Color.white, Color.HSVToRGB(Hue(value), 1f, 1f), 0.13f) * new Color(1f, 1f, 1f, color.a)) : Map(color, value))); applied[((Il2CppObjectBase)componentsInChild).Pointer] = val; string text = ColorUtility.ToHtmlStringRGBA(color); if (logged.Count < 40 && logged.Add(text)) { ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(21, 4, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] colour "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((MemberInfo)((Object)componentsInChild).GetIl2CppType()).Name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)componentsInChild).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": #"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" -> #"); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ColorUtility.ToHtmlStringRGBA(val)); } l.LogInfo(val3); } } } } internal enum View { Menu, Apartments, Mine, Jobs, Help, Lost } public class KruegerApp : CruncherAppContent { private enum Sort { Newest, PriceLow, PriceHigh, Name, Number, Building } private const string Back = "< BACK"; private bool set; private ComputerOSMultiSelect? list; private TextMeshProUGUI? details; private TextMeshProUGUI? title; private TextMeshProUGUI? header; private TextMeshProUGUI? actText; private GameObject? actButton; private GameObject? searchButton; private GameObject? keyboard; private TextMeshProUGUI? searchText; private GameObject? mapButton; private GameObject? printButton; private TextMeshProUGUI? printText; private TextMeshProUGUI? mapText; private RawImage? photo; private string query = ""; private bool searching; private View view; private Listing? current; private readonly Dictionary<string, Listing> byLine = new Dictionary<string, Listing>(); private readonly Dictionary<string, View> menu = new Dictionary<string, View>(); private string shown = ""; private Vector3 holdPos; private Quaternion holdRot; private float holdUntil; internal static NewGameLocation? pendingRoute; private List<OSMultiOption>? lastOpts; private float redrawAt = -1f; private static bool loggedFlat; private bool coloursOff; private static Sort sort; public KruegerApp(IntPtr ptr) : base(ptr) { } public override void Setup(ComputerController cc) { ((CruncherAppContent)this).controller = cc; DoSetup(); } public override void OnSetup() { DoSetup(); } private void Start() { if (!set) { if ((Object)(object)((CruncherAppContent)this).controller == (Object)null) { ((CruncherAppContent)this).controller = ((Component)this).GetComponentInParent<ComputerController>(); } DoSetup(); } } private void OnDisable() { try { if (view != View.Menu) { Seen.MarkAll(view, byLine.Values.Select((Listing x) => x.Line)); } } catch { } } internal static void PlotPending() { //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown NewGameLocation val = pendingRoute; if ((Object)(object)val == (Object)null) { return; } try { if ((Object)(object)Player.Instance != (Object)null && Player.Instance.computerInteractable != null) { return; } } catch { return; } pendingRoute = null; bool flag2 = default(bool); try { MapController instance = MapController.Instance; NewAddress thisAsAddress = val.thisAsAddress; if ((Object)(object)thisAsAddress != (Object)null) { instance.PlotPlayerRoute(thisAsAddress); } else { instance.PlotPlayerRoute(val); } bool flag = instance.playerRoute != null; if (!flag && (Object)(object)thisAsAddress != (Object)null) { instance.PlotPlayerRoute(val); flag = instance.playerRoute != null; } ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(43, 2, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] route to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" after leaving the computer: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(flag ? "plotted" : "NOT plotted"); } l.LogInfo(val2); } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] route failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message); } l2.LogWarning(val3); } } private void HoldPlayer() { //IL_002e: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0067: 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_00ab: 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) if (Time.unscaledTime > holdUntil) { return; } Player instance = Player.Instance; if ((Object)(object)instance == (Object)null || instance.computerInteractable == null) { return; } Transform transform = ((Component)instance).transform; if (!(Vector3.Distance(transform.position, holdPos) < 0.05f)) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(32, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] player moved "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(Vector3.Distance(transform.position, holdPos), "0.00"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", putting back"); } l.LogInfo(val); CharacterController component = ((Component)instance).GetComponent<CharacterController>(); if ((Object)(object)component != (Object)null) { ((Collider)component).enabled = false; } transform.position = holdPos; transform.rotation = holdRot; if ((Object)(object)component != (Object)null) { ((Collider)component).enabled = true; } } } private static List<OSMultiOption> Copy(List<OSMultiOption> src) { List<OSMultiOption> val = new List<OSMultiOption>(); Enumerator<OSMultiOption> enumerator = src.GetEnumerator(); while (enumerator.MoveNext()) { OSMultiOption val2 = enumerator.Current; val.Add(val2); } return val; } private void LogLayout(int lines) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) try { RectTransform elementParent = list.elementParent; RectTransform val = (((Object)(object)list.elementPrefab != (Object)null) ? list.elementPrefab.GetComponent<RectTransform>() : null); int num = (((Object)(object)elementParent != (Object)null) ? ((Transform)elementParent).childCount : (-1)); int num2 = 0; int num3 = 0; while ((Object)(object)elementParent != (Object)null && num3 < num) { if (((Component)((Transform)elementParent).GetChild(num3)).gameObject.activeSelf) { num2++; } num3++; } ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(67, 5, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] layout: all "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(list.allOptions?.Count ?? (-1)); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", box children "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" active), apps on this cruncher "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(((Component)this).GetComponentsInParent<KruegerApp>(true).Length); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("/"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(((Object)(object)((Component)this).transform.root != (Object)null) ? ((Component)((Component)this).transform.root).GetComponentsInChildren<KruegerApp>(true).Length : (-1)); } l.LogInfo(val2); ManualLogSource l2 = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(73, 7, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] layout: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(lines); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" lines, "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(list.options?.Count ?? 0); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" drawn, page "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(list.page); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", per page "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(list.maxPerPage); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", box "); BepInExInfoLogInterpolatedStringHandler obj = val2; object obj2; Rect rect; if (!((Object)(object)elementParent != (Object)null)) { obj2 = "?"; } else { rect = elementParent.rect; obj2 = ((object)((Rect)(ref rect)).size/*cast due to .constrained prefix*/).ToString(); } ((BepInExLogInterpolatedStringHandler)obj).AppendFormatted<string>((string)obj2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", line "); BepInExInfoLogInterpolatedStringHandler obj3 = val2; object obj4; if (!((Object)(object)val != (Object)null)) { obj4 = "?"; } else { rect = val.rect; obj4 = ((object)((Rect)(ref rect)).size/*cast due to .constrained prefix*/).ToString(); } ((BepInExLogInterpolatedStringHandler)obj3).AppendFormatted<string>((string)obj4); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", screen scale "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Vector3>(((Component)this).transform.lossyScale); } l2.LogInfo(val2); } catch (Exception ex) { Plugin.L.LogInfo((object)("[KL] layout log: " + ex.Message)); } } private void Redraw() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown if (redrawAt < 0f || Time.unscaledTime < redrawAt || (Object)(object)list == (Object)null || lastOpts == null) { return; } redrawAt = -1f; int num = ((list.options != null) ? list.options.Count : 0); if (num < Math.Min(lastOpts.Count, 4)) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(48, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] only "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" of "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(lastOpts.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" lines fit at first, drawing again"); } l.LogInfo(val); int page = list.page; list.UpdateElements(Copy(lastOpts)); list.page = page; LogLayout(lastOpts.Count); } } private void KeepPrintFlat() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007c: 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) Interactable last = Printer.last; if (last == null || Time.unscaledTime > Printer.holdUntil) { return; } try { InteractableController controller = last.controller; Transform val = ((controller != null) ? ((Component)controller).transform : null); if ((Object)(object)val == (Object)null || !(Quaternion.Angle(val.rotation, Printer.lastRot) > 1f)) { return; } if (!loggedFlat) { loggedFlat = true; ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] print turned to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Vector3>(val.eulerAngles); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", putting it flat at "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Vector3>(((Quaternion)(ref Printer.lastRot)).eulerAngles); } l.LogInfo(val2); } val.rotation = Printer.lastRot; last.wEuler = ((Quaternion)(ref Printer.lastRot)).eulerAngles; } catch { } } private void LateUpdate() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (coloursOff) { return; } try { Theme.Apply((Component)(object)this); } catch (Exception ex) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] colours failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } l.LogWarning(val); coloursOff = true; } } private void Update() { //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown HoldPlayer(); KeepPrintFlat(); Redraw(); if ((Object)(object)title != (Object)null && ((TMP_Text)title).text != "Kruegerslist") { ((TMP_Text)title).text = "Kruegerslist"; } if ((Object)(object)actText != (Object)null && current != null && ((TMP_Text)actText).text != current.ActLabel) { ((TMP_Text)actText).text = current.ActLabel; } if ((Object)(object)mapText != (Object)null && ((TMP_Text)mapText).text != "Show on map") { ((TMP_Text)mapText).text = "Show on map"; } string text = current?.PrintLabel ?? "Print"; if ((Object)(object)printText != (Object)null && ((TMP_Text)printText).text != text) { ((TMP_Text)printText).text = text; } string text2 = (searching ? "Done" : ((query.Length > 0) ? "Search*" : "Search")); if ((Object)(object)searchText != (Object)null && ((TMP_Text)searchText).text != text2) { ((TMP_Text)searchText).text = text2; } if ((Object)(object)list == (Object)null) { return; } bool flag = default(bool); try { ComputerOSMultiSelectElement selected = list.selected; object obj; if (selected == null) { obj = null; } else { OSMultiOption option = selected.option; obj = ((option != null) ? option.text : null); } if (obj == null) { obj = ""; } string text3 = (string)obj; if (text3 == shown) { return; } shown = text3; ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(16, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] selected \""); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text3); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\""); } l.LogInfo(val); Listing value2; if (text3 == "< BACK") { Seen.MarkAll(view, byLine.Values.Select((Listing x) => x.Line)); query = ""; SetSearching(on: false); Show(View.Menu); } else if (text3.StartsWith("SORT:")) { sort = (Sort)((int)(sort + 1) % 6); Show(view); } else if (view == View.Menu) { if (menu.TryGetValue(text3, out var value)) { Show(value); } } else if (byLine.TryGetValue(text3, out value2)) { SetSearching(on: false); Select(value2); Seen.MarkAll(view, new string[1] { value2.Line }); } } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] update failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } l2.LogWarning(val2); list = null; } } private void DoSetup() { //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Expected O, but got Unknown //IL_00a2: 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_00ba: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Expected O, but got Unknown //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) if (set) { return; } set = true; Plugin.L.LogInfo((object)"[KL] app opened"); try { ComputerOSUIComponent val = ((IEnumerable<ComputerOSUIComponent>)((Component)this).GetComponentsInChildren<ComputerOSUIComponent>(true)).FirstOrDefault((Func<ComputerOSUIComponent, bool>)delegate(ComputerOSUIComponent c) { TextMeshProUGUI componentInChildren = ((Component)c).GetComponentInChildren<TextMeshProUGUI>(true); return componentInChildren != null && ((TMP_Text)componentInChildren).text?.Trim().Equals("exit", StringComparison.OrdinalIgnoreCase) == true; }); if ((Object)(object)((val != null) ? val.button : null) != (Object)null) { RectTransform val2 = ((Il2CppObjectBase)((Component)val).transform).Cast<RectTransform>(); actButton = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Transform)val2).parent); ((Object)actButton).name = "KruegerAction"; RectTransform component = actButton.GetComponent<RectTransform>(); component.anchorMin = val2.anchorMin; component.anchorMax = val2.anchorMax; component.pivot = val2.pivot; component.sizeDelta = val2.sizeDelta; ((Transform)component).localScale = ((Transform)val2).localScale; Vector2 anchoredPosition = val2.anchoredPosition; Rect rect = val2.rect; component.anchoredPosition = anchoredPosition - new Vector2(((Rect)(ref rect)).width * 1.08f, 0f); actText = actButton.GetComponentInChildren<TextMeshProUGUI>(true); ComputerOSUIComponent component2 = actButton.GetComponent<ComputerOSUIComponent>(); Button val3 = ((component2 != null) ? component2.button : null); if ((Object)(object)val3 != (Object)null) { val3.onClick = new ButtonClickedEvent(); ((UnityEvent)val3.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { DoAction(); })); } actButton.SetActive(false); searchButton = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Transform)val2).parent); ((Object)searchButton).name = "KruegerSearch"; RectTransform component3 = searchButton.GetComponent<RectTransform>(); component3.anchorMin = val2.anchorMin; component3.anchorMax = val2.anchorMax; component3.pivot = val2.pivot; component3.sizeDelta = val2.sizeDelta; ((Transform)component3).localScale = ((Transform)val2).localScale; Vector2 anchoredPosition2 = val2.anchoredPosition; rect = val2.rect; component3.anchoredPosition = anchoredPosition2 - new Vector2(((Rect)(ref rect)).width * 2.16f, 0f); searchText = searchButton.GetComponentInChildren<TextMeshProUGUI>(true); ComputerOSUIComponent component4 = searchButton.GetComponent<ComputerOSUIComponent>(); Button val4 = ((component4 != null) ? component4.button : null); if ((Object)(object)val4 != (Object)null) { val4.onClick = new ButtonClickedEvent(); ((UnityEvent)val4.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { SetSearching(!searching); })); } searchButton.SetActive(false); val.button.onClick = new ButtonClickedEvent(); ((UnityEvent)val.button.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { ((CruncherAppContent)this).controller.OnAppExit(); })); } Transform obj = ((Component)this).transform.Find(Installer.TitlePath); title = ((obj != null) ? ((Component)obj).GetComponent<TextMeshProUGUI>() : null); Transform obj2 = ((Component)this).transform.Find(Installer.SearchPath); header = ((obj2 != null) ? ((Component)obj2).GetComponent<TextMeshProUGUI>() : null); Transform? obj3 = Find(((Component)this).transform, "OnscreenKeyboard"); RectTransform val5 = ((obj3 != null) ? ((Il2CppObjectBase)obj3).TryCast<RectTransform>() : null); if ((Object)(object)val5 != (Object)null && (Object)(object)header != (Object)null) { GameObject val6 = Object.Instantiate<GameObject>(((Component)header).gameObject, ((Transform)val5).parent); ((Object)val6).name = "KruegerDetails"; val6.SetActive(true); RectTransform component5 = val6.GetComponent<RectTransform>(); component5.anchorMin = val5.anchorMin; component5.anchorMax = val5.anchorMax; component5.pivot = val5.pivot; component5.sizeDelta = val5.sizeDelta; component5.anchoredPosition = val5.anchoredPosition; ((Transform)component5).localScale = ((Transform)val5).localScale; details = val6.GetComponent<TextMeshProUGUI>(); ((TMP_Text)details).enableWordWrapping = true; ((TMP_Text)details).enableAutoSizing = true; ((TMP_Text)details).fontSizeMax = ((TMP_Text)header).fontSize * 0.8f; ((TMP_Text)details).fontSizeMin = ((TMP_Text)header).fontSize * 0.3f; ((TMP_Text)details).alignment = (TextAlignmentOptions)257; MakeMapButton(); MakePhoto(); ((Component)val5).gameObject.SetActive(false); keyboard = ((Component)val5).gameObject; BindKeys(val5); } Hide("PrintButton"); list = ((Component)this).GetComponentInChildren<ComputerOSMultiSelect>(true); Show(View.Menu); } catch (Exception ex) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val7 = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val7).AppendLiteral("[KL] setup failed: "); ((BepInExLogInterpolatedStringHandler)val7).AppendFormatted<Exception>(ex); } l.LogWarning(val7); } } private void Show(View v) { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Expected O, but got Unknown //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Expected O, but got Unknown //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Expected O, but got Unknown if ((Object)(object)this.list == (Object)null) { return; } view = v; byLine.Clear(); menu.Clear(); Select(null); List<OSMultiOption> val = new List<OSMultiOption>(); if (v == View.Menu) { (string, View, int)[] array = new(string, View, int)[4] { ("APARTMENTS FOR SALE", View.Apartments, Listings.Apartments().Count), ("MY APARTMENTS", View.Mine, Listings.Mine().Count), ("JOBS", View.Jobs, Listings.Jobs().Count), ("LOST AND FOUND", View.Lost, Listings.Lost().Count) }; for (int i = 0; i < array.Length; i++) { (string, View, int) tuple = array[i]; string item = tuple.Item1; View item2 = tuple.Item2; int item3 = tuple.Item3; string text = $"{item} ({item3})"; menu[text] = item2; val.Add(new OSMultiOption { text = text }); } if ((Object)(object)header != (Object)null) { ((TMP_Text)header).text = Masthead(); } if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = "Pick a list."; } } else { val.Add(new OSMultiOption { text = "< BACK" }); val.Add(new OSMultiOption { text = SortLine() }); List<Listing> list = v switch { View.Apartments => Listings.Apartments(), View.Mine => Listings.Mine(), View.Jobs => Listings.Jobs(), View.Help => Listings.Help(), _ => Listings.Lost(), }; if (query.Length > 0) { list = list.Where((Listing listing2) => (listing2.Line + " " + listing2.Details).IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0).ToList(); } list = sort switch { Sort.PriceLow => list.OrderBy((Listing listing2) => listing2.Price).ToList(), Sort.PriceHigh => list.OrderByDescending((Listing listing2) => listing2.Price).ToList(), Sort.Name => list.OrderBy((Listing listing2) => listing2.Line).ToList(), Sort.Number => (from listing2 in list orderby Number(listing2.Line), listing2.Line select listing2).ToList(), Sort.Building => (from listing2 in list orderby listing2.Building, Number(listing2.Line) select listing2).ToList(), _ => list, }; foreach (Listing item4 in list) { string text2 = (Seen.IsNew(v, item4.Line) ? "NEW " : "") + item4.Line; int num = 2; while (byLine.ContainsKey(text2) || text2 == "< BACK") { text2 = $"{item4.Line} ({num})"; num++; } byLine[text2] = item4; val.Add(new OSMultiOption { text = text2 }); } if ((Object)(object)header != (Object)null) { TextMeshProUGUI val2 = header; ((TMP_Text)val2).text = v switch { View.Apartments => "Apartments for sale", View.Mine => "My apartments", View.Jobs => "Jobs", View.Help => "Help wanted", _ => "Lost and found", } + $" ({list.Count})" + ((searching || query.Length > 0) ? (" search: " + query + "_") : ""); } if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = ((list.Count == 0) ? "Nothing listed right now." : "Select a listing."); } } if ((Object)(object)searchButton != (Object)null) { searchButton.SetActive(v != View.Menu); } this.list.page = 0; this.list.usePages = true; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3; if (this.list.maxPerPage != 4) { ManualLogSource l = Plugin.L; val3 = new BepInExInfoLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] lines per page was "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(this.list.maxPerPage); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(", set to 4"); } l.LogInfo(val3); this.list.maxPerPage = 4; } lastOpts = Copy(val); try { this.list.UpdateElements(Copy(val)); } catch (Exception ex) { Plugin.L.LogWarning((object)("[KL] drawing the list failed: " + ex)); } LogLayout(val.Count); redrawAt = Time.unscaledTime + 0.3f; ComputerOSMultiSelectElement selected = this.list.selected; object obj; if (selected == null) { obj = null; } else { OSMultiOption option = selected.option; obj = ((option != null) ? option.text : null); } if (obj == null) { obj = ""; } shown = (string)obj; ManualLogSource l2 = Plugin.L; val3 = new BepInExInfoLogInterpolatedStringHandler(21, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] showing "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<View>(v); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(val.Count); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" lines"); } l2.LogInfo(val3); } private void MakeMapButton() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0120: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_016b: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Expected O, but got Unknown ComputerOSUIComponent val = ((IEnumerable<ComputerOSUIComponent>)((Component)this).GetComponentsInChildren<ComputerOSUIComponent>(true)).FirstOrDefault((Func<ComputerOSUIComponent, bool>)delegate(ComputerOSUIComponent c) { if (((Object)c).name != "KruegerAction" && ((Object)c).name != "KruegerSearch") { TextMeshProUGUI componentInChildren = ((Component)c).GetComponentInChildren<TextMeshProUGUI>(true); if (componentInChildren == null) { return false; } return ((TMP_Text)componentInChildren).text?.Trim().Equals("exit", StringComparison.OrdinalIgnoreCase) == true; } return false; }); if ((Object)(object)val == (Object)null || (Object)(object)details == (Object)null) { return; } RectTransform val2 = ((Il2CppObjectBase)((Component)val).transform).Cast<RectTransform>(); RectTransform val3 = ((Il2CppObjectBase)((TMP_Text)details).transform).Cast<RectTransform>(); mapButton = Object.Instantiate<GameObject>(((Component)val).gameObject, (Transform)(object)val3); ((Object)mapButton).name = "KruegerMap"; RectTransform component = mapButton.GetComponent<RectTransform>(); float num = ((Transform)val2).lossyScale.x / Mathf.Max(((Transform)val3).lossyScale.x, 0.0001f); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(1f, 0f); component.pivot = val4; Vector2 anchorMin = (component.anchorMax = val4); component.anchorMin = anchorMin; ((Transform)component).localScale = Vector3.one; Rect rect = val2.rect; float num2 = ((Rect)(ref rect)).width * 1.6f; rect = val2.rect; component.sizeDelta = new Vector2(num2, ((Rect)(ref rect)).height) * num; component.anchoredPosition = Vector2.zero; mapText = mapButton.GetComponentInChildren<TextMeshProUGUI>(true); ComputerOSUIComponent component2 = mapButton.GetComponent<ComputerOSUIComponent>(); Button val6 = ((component2 != null) ? component2.button : null); if ((Object)(object)val6 != (Object)null) { val6.onClick = new ButtonClickedEvent(); ((UnityEvent)val6.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { ShowOnMap(); })); } mapButton.SetActive(false); printButton = Object.Instantiate<GameObject>(mapButton, (Transform)(object)val3); ((Object)printButton).name = "KruegerPrint"; RectTransform component3 = printButton.GetComponent<RectTransform>(); component3.anchoredPosition = new Vector2((0f - component.sizeDelta.x) * 1.08f, 0f); component3.sizeDelta = new Vector2(component.sizeDelta.x * 0.6f, component.sizeDelta.y); printText = printButton.GetComponentInChildren<TextMeshProUGUI>(true); if ((Object)(object)printText != (Object)null) { ((TMP_Text)printText).enableAutoSizing = true; ((TMP_Text)printText).fontSizeMax = ((TMP_Text)printText).fontSize; ((TMP_Text)printText).fontSizeMin = ((TMP_Text)printText).fontSize * 0.5f; ((TMP_Text)printText).enableWordWrapping = false; } ComputerOSUIComponent component4 = printButton.GetComponent<ComputerOSUIComponent>(); Button val7 = ((component4 != null) ? component4.button : null); if ((Object)(object)val7 != (Object)null) { val7.onClick = new ButtonClickedEvent(); ((UnityEvent)val7.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { PrintCurrent(); })); } printButton.SetActive(false); } private void PrintCurrent() { //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown bool flag = default(bool); try { if (current?.Print == null) { return; } if (current.PrintRedraws) { ComputerOSMultiSelect? obj = list; int page = ((obj != null) ? obj.page : 0); ComputerOSMultiSelect? obj2 = list; object obj3; if (obj2 == null) { obj3 = null; } else { ComputerOSMultiSelectElement selected = obj2.selected; if (selected == null) { obj3 = null; } else { OSMultiOption option = selected.option; obj3 = ((option != null) ? option.text : null); } } if (obj3 == null) { obj3 = ""; } string text = (string)obj3; int at = -1; if (lastOpts != null) { for (int i = 0; i < lastOpts.Count; i++) { if (lastOpts[i].text == text) { at = i; break; } } } string text2 = current.Print(((CruncherAppContent)this).controller); ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(7, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(current.PrintLabel); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text2); } l.LogInfo(val); Show(view); KeepPlace(page, at); if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = text2; } } else { string text3 = current.Print(((CruncherAppContent)this).controller); ManualLogSource l2 = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(12, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] print: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text3); } l2.LogInfo(val); if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = current.Details + "\n" + text3; } } } catch (Exception ex) { ManualLogSource l3 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] print failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } l3.LogWarning(val2); } } private void MakePhoto() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)details == (Object)null)) { RectTransform val = ((Il2CppObjectBase)((TMP_Text)details).transform).Cast<RectTransform>(); GameObject val2 = new GameObject("KruegerPhoto"); RectTransform obj = val2.AddComponent<RectTransform>(); ((Transform)obj).SetParent((Transform)(object)val, false); obj.anchorMin = new Vector2(0.62f, 0.25f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(1f, 1f); Vector2 offsetMin = (obj.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; photo = val2.AddComponent<RawImage>(); val2.SetActive(false); } } private void ShowOnMap() { //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_014e: 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) bool flag = default(bool); try { NewGameLocation val = current?.Map; BepInExInfoLogInterpolatedStringHandler val2; if ((Object)(object)val == (Object)null) { ManualLogSource l = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(33, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] show on map: no place for '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(current?.Line); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'"); } l.LogInfo(val2); if ((Object)(object)details != (Object)null && current != null) { ((TMP_Text)details).text = current.Details + "\nNo place to show on the map for this listing yet."; } return; } Player instance = Player.Instance; Transform val3 = ((instance != null) ? ((Component)instance).transform : null); if ((Object)(object)val3 != (Object)null) { holdPos = val3.position; holdRot = val3.rotation; holdUntil = Time.unscaledTime + 1.5f; } pendingRoute = val; ManualLogSource l2 = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] route to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val).name); } l2.LogInfo(val2); string text = PinToCase(val); if ((Object)(object)val3 != (Object)null) { ManualLogSource l3 = Plugin.L; val2 = new BepInExInfoLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] moved after pin: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(Vector3.Distance(val3.position, holdPos), "0.00"); } l3.LogInfo(val2); } if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = current.Details + "\nRoute set on your map." + text; } } catch (Exception ex) { ManualLogSource l4 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(17, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("[KL] map failed: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message); } l4.LogWarning(val4); } } internal static string PinToCase(NewGameLocation loc) { //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) bool flag2 = default(bool); try { CasePanelController instance = CasePanelController.Instance; Case val = ((instance != null) ? instance.activeCase : null); EvidenceLocation evidenceEntry = loc.evidenceEntry; if ((Object)(object)instance == (Object)null || evidenceEntry == null) { return ""; } if (val == null) { return " Open a case on your board to also get a pin for autotravel."; } try { ((Evidence)evidenceEntry).AddDiscovery((Discovery)7); } catch { } try { ((Evidence)evidenceEntry).AddOrSetCustomName((DataKey)0, ((Object)loc).name); } catch { } List<DataKey> val2 = new List<DataKey>(); val2.Add((DataKey)14); val2.Add((DataKey)0); val2.Add((DataKey)36); bool flag = false; try { flag = (Object)(object)((Evidence)evidenceEntry).GetPinned(val2) != (Object)null; } catch { } if (!flag) { instance.PinToCasePanel(val, (Evidence)(object)evidenceEntry, val2, false, FreeSpot(val), false); } ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(10, 3, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(flag ? "already pinned" : "pinned"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(((Object)loc).name); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" to "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(val.name); } l.LogInfo(val3); return flag ? (" It is already pinned on " + val.name + ".") : (" Pinned to " + val.name + " for autotravel."); } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(17, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("[KL] pin failed: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message); } l2.LogWarning(val4); return ""; } } private static Vector2 FreeSpot(Case c) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f1: 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_0126: Unknown result type (might be due to invalid IL or missing references) List<Vector2> list = new List<Vector2>(); try { Enumerator<CaseElement> enumerator = c.caseElements.GetEnumerator(); while (enumerator.MoveNext()) { CaseElement val = enumerator.Current; if (val != null) { list.Add(val.v); } } } catch { } if (list.Count == 0) { return Vector2.zero; } Vector2 val2 = Vector2.zero; foreach (Vector2 item in list) { val2 += item; } val2 /= (float)list.Count; for (int i = 1; i < 12; i++) { for (int j = 0; j < i * 8; j++) { float num = (float)j * MathF.PI * 2f / (float)(i * 8); Vector2 val4 = val2 + new Vector2(Mathf.Cos(num), Mathf.Sin(num)) * 260f * (float)i; bool flag = true; foreach (Vector2 item2 in list) { if (Vector2.Distance(item2, val4) < 260f) { flag = false; break; } } if (flag) { return val4; } } } return val2 + new Vector2(3120f, 0f); } private static int Number(string line) { int num = 0; int i; for (i = 0; i < line.Length && char.IsDigit(line[i]); i++) { num = num * 10 + (line[i] - 48); } if (i != 0) { return num; } return int.MaxValue; } private static string SortLine() { return "SORT: " + sort switch { Sort.PriceLow => "price, low to high", Sort.PriceHigh => "price, high to low", Sort.Name => "name", Sort.Number => "number", Sort.Building => "building", _ => "as listed", } + " (click to change)"; } private static string Masthead() { try { SessionData instance = SessionData.Instance; string arg = instance.CurrentLongDateString(true, true, true, true, true, true, false, false); int num = (int)(instance.gameTime / 24f) + 1; return $"THE KRUEGERSLIST No. {num} {arg}"; } catch { return "THE KRUEGERSLIST"; } } private void SetSearching(bool on) { if (!((Object)(object)keyboard == (Object)null) && !((Object)(object)details == (Object)null) && on != searching) { searching = on; keyboard.SetActive(on); ((Component)details).gameObject.SetActive(!on); if ((Object)(object)header != (Object)null && view != View.Menu) { Show(view); } } } private void BindKeys(RectTransform kb) { //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown int num = 0; foreach (ComputerOSUIComponent componentsInChild in ((Component)kb).GetComponentsInChildren<ComputerOSUIComponent>(true)) { TextMeshProUGUI componentInChildren = ((Component)componentsInChild).GetComponentInChildren<TextMeshProUGUI>(true); string t = ((componentInChildren == null) ? null : ((TMP_Text)componentInChildren).text?.Trim()) ?? ""; if ((Object)(object)componentsInChild.button == (Object)null || t.Length == 0) { continue; } Action a = ((t == "<") ? ((Action)delegate { if (query.Length > 0) { string text = query; query = text.Substring(0, text.Length - 1); } }) : (t.Contains("[") ? ((Action)delegate { query += " "; }) : ((t.Length == 1 && char.IsLetterOrDigit(t[0])) ? ((Action)delegate { query += t; }) : null))); if (a != null) { componentsInChild.button.onClick = new ButtonClickedEvent(); ((UnityEvent)componentsInChild.button.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { a(); Show(view); })); num++; } } ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" keys bound to search"); } l.LogInfo(val2); } private void Select(Listing? l) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0106: 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_011f: Unknown result type (might be due to invalid IL or missing references) current = l; if (l != null && (Object)(object)details != (Object)null) { ((TMP_Text)details).text = l.Details; } Texture2D val = null; try { object obj; if (l == null) { obj = null; } else { NewGameLocation? obj2 = l.Photo; obj = ((obj2 != null) ? obj2.evidenceEntry : null); } if (obj != null) { val = ((Evidence)l.Photo.evidenceEntry).GetPhoto(Toolbox.Instance.allDataKeys); } } catch (Exception ex) { ManualLogSource l2 = Plugin.L; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] photo failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message); } l2.LogWarning(val2); } if ((Object)(object)photo != (Object)null) { photo.texture = (Texture)(object)val; ((Component)photo).gameObject.SetActive((Object)(object)val != (Object)null); } if ((Object)(object)details != (Object)null) { TextMeshProUGUI? obj3 = details; float num; if (!((Object)(object)val != (Object)null)) { num = 0f; } else { Rect rect = ((TMP_Text)details).rectTransform.rect; num = ((Rect)(ref rect)).width * 0.4f; } ((TMP_Text)obj3).margin = new Vector4(0f, 0f, num, 0f); } bool flag2 = (Object)(object)l?.Map != (Object)null; if ((Object)(object)mapButton != (Object)null && mapButton.activeSelf != flag2) { mapButton.SetActive(flag2); } bool flag3 = l?.Print != null; if ((Object)(object)printButton != (Object)null && printButton.activeSelf != flag3) { printButton.SetActive(flag3); } bool flag4 = l != null && l.Act != null && l.ActLabel.Length > 0; if ((Object)(object)actButton != (Object)null && actButton.activeSelf != flag4) { actButton.SetActive(flag4); } if (flag4 && (Object)(object)actText != (Object)null) { ((TMP_Text)actText).text = l.ActLabel; } } private void DoAction() { //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown bool flag = default(bool); try { if (current?.Act == null) { return; } ComputerOSMultiSelect? obj = list; int page = ((obj != null) ? obj.page : 0); ComputerOSMultiSelect? obj2 = list; object obj3; if (obj2 == null) { obj3 = null; } else { ComputerOSMultiSelectElement selected = obj2.selected; if (selected == null) { obj3 = null; } else { OSMultiOption option = selected.option; obj3 = ((option != null) ? option.text : null); } } if (obj3 == null) { obj3 = ""; } string text = (string)obj3; int at = -1; if (lastOpts != null) { for (int i = 0; i < lastOpts.Count; i++) { if (lastOpts[i].text == text) { at = i; break; } } } string text2 = current.Act(); ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(14, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] action "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(current.ActLabel); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text2); } l.LogInfo(val); View v = view; Show(v); KeepPlace(page, at); if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = text2; } } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] action failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } l2.LogWarning(val2); if ((Object)(object)details != (Object)null) { ((TMP_Text)details).text = "That did not work."; } } } private void KeepPlace(int page, int at) { //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown bool flag = default(bool); try { if ((Object)(object)list == (Object)null || lastOpts == null || lastOpts.Count == 0 || at < 0) { return; } int num = Math.Max(1, list.maxPerPage); int num2 = (lastOpts.Count + num - 1) / num; int num3 = Math.Max(0, Math.Min(page, num2 - 1)); if (num3 != list.page) { list.page = num3; list.SpawnList(); } string text = lastOpts[Math.Min(at, lastOpts.Count - 1)].text; if (list.options != null) { for (int i = 0; i < list.options.Count; i++) { ComputerOSMultiSelectElement val = list.options[i]; object obj; if (val == null) { obj = null; } else { OSMultiOption option = val.option; obj = ((option != null) ? option.text : null); } if (!((string?)obj != text)) { list.SetSelected(val); shown = text; if (byLine.TryGetValue(text, out var value)) { Select(value); } break; } } } ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(35, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[KL] kept place: page "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num3 + 1); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" of "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num2); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(", line \""); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\""); } l.LogInfo(val2); } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[KL] keeping the place failed: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message); } l2.LogWarning(val3); } } private void Hide(string name) { Transform val = Find(((Component)this).transform, name); if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(false); } } private static Transform? Find(Transform t, string name) { if (((Object)t).name == name) { return t; } for (int i = 0; i < t.childCount; i++) { Transform val = Find(t.GetChild(i), name); if ((Object)(object)val != (Object)null) { return val; } } return null; } } internal static class Printer { internal static Interactable? last; internal static Quaternion lastRot; internal static float holdUntil; private static string? Busy(ComputerController? c) { if ((Object)(object)c == (Object)null) { return null; } try { Interactable printedDocument = c.printedDocument; if (printedDocument == null) { return null; } if (last != null && ((Il2CppObjectBase)printedDocument).Pointer == ((Il2CppObjectBase)last).Pointer) { try { printedDocument.SafeDelete(false); } catch { } c.printedDocument = null; return null; } return "Take the last printout from the printer first."; } catch { } return null; } private static void Place(ComputerController? c, float tilt, out Vector3 pos, out Vector3 euler) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //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) Transform val = ((c != null) ? c.printerParent : null); if ((Object)(object)val != (Object)null) { pos = val.position; Quaternion val2 = (((Object)(object)c.ic != (Object)null) ? ((Component)c.ic).transform.rotation : val.rotation); Quaternion val3 = val2 * Quaternion.Euler(tilt, 0f, 0f); euler = ((Quaternion)(ref val3)).eulerAngles; } else { Transform transform = ((Component)Player.Instance).transform; pos = transform.position + transform.forward * 0.6f + Vector3.up * 0.9f; euler = transform.eulerAngles; } } private static string Done(ComputerController? c, Interactable? made, string what) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (made == null) { return "The printer jammed."; } if ((Object)(object)c != (Object)null) { try { c.printedDocument = made; c.printTimer = 1f; } catch { } last = made; lastRot = Quaternion.Euler(made.wEuler); holdUntil = Time.unscaledTime + 6f; } ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(17, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[KL] printed "); InteractablePreset preset = made.preset; ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>((preset != null) ? ((Object)preset).name : null); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" at "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Vector3>(made.wPos); } l.LogInfo(val); return "Printed: " + what + ". Take it from the printer."; } internal static string Out(ComputerController? c, InteractablePreset? preset, Human? owner, PassedVarType type, float value, string what) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((SoCustomComparison)(object)preset == (SoCustomComparison)null) { return "Nothing to print for this ad."; } string text = Busy(c); if (text != null) { return text; } Place(c, Plugin.SaleTilt.Value, out var pos, out var euler); List<Passed> val = new List<Passed>(); val.Add(new Passed(type, value, (string)null)); return Done(c, InteractableCreator.Instance.CreateWorldInteractable(preset, owner, owner, (Human)null, pos, euler, val, (Object)null, ""), what); } internal static string Copy(ComputerController? c, Interactable src, string what) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown string text = Busy(c); if (text != null) { return text; } Place(c, Plugin.PrintTilt.Value, out var pos, out var euler); List<Passed> val = new List<Passed>(); if (src.pv != null) { Enumerator<Passed> enumerator = src.pv.GetEnumerator(); while (enumerator.MoveNext()) { Passed current = enumerator.Current; val.Add(new Passed(current.varType, current.value, current.str)); } } Interactable made = InteractableCreator.Instance.CreateWorldInteractable(src.preset, src.belongsTo, src.writer, src.reciever, pos, euler, val, src.objectRef, src.dds ?? ""); return Done(c, made, what); } } internal static class Seen { private static HashSet<string>? set; private static string FilePath => Path.Combine(Paths.ConfigPath, "sm3gm.sod.kruegerslist.seen.txt"); private static HashSet<string> Set { get { if (set != null) { return set; } set = new HashSet<string>(); try { if (File.Exists(FilePath)) { string[] array = File.ReadAllLines(FilePath); foreach (string item in array) { set.Add(item); } } } catch { } return set; } } private static string Key(View v, string line) { int num = line.IndexOf(" ["); return $"{v}|{((num > 0) ? line.Substring(0, num) : line)}"; } internal static bool IsNew(View v, string line) { if (!Set.Contains($"{v}|*")) { return false; } return !Set.Contains(Key(v, line)); } internal static void MarkAll(View v, IEnumerable<string> lines) { try { Set.Add($"{v}|*"); foreach (string line in lines) { Set.Add(Key(v, line)); } IEnumerable<string> enumerable2; if (Set.Count <= 5000) { IEnumerable<string> enumerable = Set; enumerable2 = enumerable; } else { enumerable2 = Set.Skip(Set.Count - 5000); } IEnumerable<string> contents = enumerable2; File.WriteAllLines(FilePath, contents); } catch (Exception ex) { Plugin.L.LogWarning((object)("[KL] could not save seen ads: " + ex.Message)); } } } internal static class Listings { private static string Cur { get { CityControls instance = CityControls.Instance; return ((instance != null) ? instance.cityCurrency : null) ?? "$"; } } internal static List<Listing> Apartments() { //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown List<Listing> list = new List<Listing>(); try { GameplayController instance = GameplayController.Instance; if (((instance != null) ? instance.forSale : null) == null) { return list; } Enumerator<NewAddress> enumerator = instance.forSale.GetEnumerator(); while (enumerator.MoveNext()) { NewAddress current = enumerator.Current; if (!((Object)(object)current == (Object)null)) { NewAddress addr = current; int price = ((NewGameLocation)add