Decompiled source of Nivalis Phone v1.0.1
NivalisPhone.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Cinemachine; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.IO; using Microsoft.CodeAnalysis; using Nivalis; using Nivalis.Apartment; using Nivalis.Dialogue; using Nivalis.Economy; using Nivalis.GhostSystem; using Nivalis.GhostSystem.Ai; using Nivalis.GhostSystem.CustomerLoop; using Nivalis.InventorySystem; using Nivalis.Locale.UI; using Nivalis.Locale.UI.InGameMenu.Venue.Overview; using Nivalis.Localization; using Nivalis.Navigation; using Nivalis.PhotoMode; using Nivalis.Playables; using Nivalis.Player; using Nivalis.UI; using Nivalis.UI.InGameMenu; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] [assembly: AssemblyCompany("NivalisPhone")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("NivalisPhone")] [assembly: AssemblyTitle("NivalisPhone")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.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 NivalisPhone { internal static class Ads { private class Frame { public Texture Tex; public Rect Uv; } private class Clip { public string Name; public List<Frame> Frames = new List<Frame>(); public float Fps; } private static List<Clip> _clips; private static float _scanAt = -999f; private static RectTransform _root; private static RawImage _img; private static AspectRatioFitter _fit; private static TextMeshProUGUI _count; private static TextMeshProUGUI _brand; private static Image _bar; private static float _left; private static float _total; private static float _clipTime; private static float _lastEnd = -999f; private static float _openTime; private static int _clipIdx; private static int _clipsLeft; private static readonly Random _rng = new Random(); private const float BreakLength = 15f; private const float BetweenBreaks = 150f; private static bool _preview; public static bool Playing { get; private set; } private static List<Clip> Clips() { //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00e3: Invalid comparison between Unknown and I4 //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) if (_clips != null && _clips.Count > 0 && Time.unscaledTime - _scanAt < 120f) { return _clips; } _scanAt = Time.unscaledTime; List<Clip> list = new List<Clip>(); try { foreach (Object item in (Il2CppArrayBase<Object>)(object)Resources.FindObjectsOfTypeAll(Il2CppType.Of<AnimatedSequence>())) { AnimatedSequence val = ((Il2CppObjectBase)item).TryCast<AnimatedSequence>(); if ((Object)(object)val == (Object)null) { continue; } Clip clip = new Clip { Name = ((Object)val).name, Fps = Mathf.Clamp((val.FrameRate > 0) ? val.FrameRate : 12, 2, 60) }; Il2CppReferenceArray<KeyframeData> keyframes = val.keyframes; if (keyframes == null) { continue; } KeyframeSliceOption sliceOption = val.sliceOption; for (int i = 0; i < ((Il2CppArrayBase<KeyframeData>)(object)keyframes).Length; i++) { KeyframeData obj = ((Il2CppArrayBase<KeyframeData>)(object)keyframes)[i]; Texture2D val2 = ((obj != null) ? obj.texture : null); if (!((Object)(object)val2 == (Object)null)) { if ((int)sliceOption == 1) { clip.Frames.Add(new Frame { Tex = (Texture)(object)val2, Uv = new Rect(0f, 0.5f, 1f, 0.5f) }); clip.Frames.Add(new Frame { Tex = (Texture)(object)val2, Uv = new Rect(0f, 0f, 1f, 0.5f) }); } else if ((int)sliceOption == 2) { clip.Frames.Add(new Frame { Tex = (Texture)(object)val2, Uv = new Rect(0f, 0f, 0.5f, 1f) }); clip.Frames.Add(new Frame { Tex = (Texture)(object)val2, Uv = new Rect(0.5f, 0f, 0.5f, 1f) }); } else { clip.Frames.Add(new Frame { Tex = (Texture)(object)val2, Uv = new Rect(0f, 0f, 1f, 1f) }); } } } if (clip.Frames.Count > 0) { list.Add(clip); } } if (list.Count == 0) { foreach (Object item2 in (Il2CppArrayBase<Object>)(object)Resources.FindObjectsOfTypeAll(Il2CppType.Of<Advertisement>())) { Advertisement val3 = ((Il2CppObjectBase)item2).TryCast<Advertisement>(); object obj2; if (val3 == null) { obj2 = null; } else { Material material = val3.material; obj2 = ((material != null) ? material.mainTexture : null); } Texture val4 = (Texture)obj2; if (!((Object)(object)val4 == (Object)null)) { Clip clip2 = new Clip { Name = (val3.companyName ?? ((Object)val3).name), Fps = 0.25f }; clip2.Frames.Add(new Frame { Tex = val4, Uv = new Rect(0f, 0f, 1f, 1f) }); list.Add(clip2); } } } } catch (Exception ex) { Plugin.L.LogWarning((object)("Ad scan failed: " + ex.Message)); } if (list.Count != (_clips?.Count ?? (-1))) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val5 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("[ads] found "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<int>(list.Count); ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral(" ads: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<string>(string.Join(", ", from c in list.Take(8) select $"{c.Name}({c.Frames.Count}f@{c.Fps})")); } l.LogInfo(val5); } _clips = list; return list; } public static void Build(RectTransform scr, float w, float h) { //IL_0006: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) _root = ((Graphic)UiKit.Img((Transform)(object)scr, "AdBreak", Color.black, raycast: true)).rectTransform; UiKit.Stretch(_root, 4f, 4f, 4f, 4f); RectTransform val = UiKit.Rect("Holder", (Transform)(object)_root); UiKit.Stretch(val, 0f, 56f, 0f, 70f); _img = ((Component)UiKit.Rect("Ad", (Transform)(object)val)).gameObject.AddComponent<RawImage>(); ((Graphic)_img).raycastTarget = false; UiKit.Stretch(((Graphic)_img).rectTransform); _fit = ((Component)_img).gameObject.AddComponent<AspectRatioFitter>(); _fit.aspectMode = (AspectMode)3; Image obj = UiKit.Img((Transform)(object)_root, "Top", new Color(0f, 0f, 0f, 0.85f)); UiKit.PlaceTL(((Graphic)obj).rectTransform, 0f, 0f, w, 52f); Image obj2 = UiKit.Img(((Component)obj).transform, "Tag", UiKit.Gold); UiKit.PlaceTL(((Graphic)obj2).rectTransform, 12f, 13f, 46f, 26f); UiKit.Stretch(((TMP_Text)UiKit.Text(((Component)obj2).transform, "AD", 15f, UiKit.Ink, (TextAlignmentOptions)514, (FontStyles)1)).rectTransform); _brand = UiKit.Text(((Component)obj).transform, "", 14f, UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)1); UiKit.PlaceTL(((TMP_Text)_brand).rectTransform, 68f, 8f, w - 80f, 38f); ((TMP_Text)_brand).enableWordWrapping = false; ((TMP_Text)_brand).enableAutoSizing = true; ((TMP_Text)_brand).fontSizeMin = 9f; ((TMP_Text)_brand).fontSizeMax = 14f; Image obj3 = UiKit.Img((Transform)(object)_root, "Bottom", new Color(0f, 0f, 0f, 0.85f)); RectTransform rectTransform = ((Graphic)obj3).rectTransform; rectTransform.anchorMin = new Vector2(0f, 0f); rectTransform.anchorMax = new Vector2(1f, 0f); rectTransform.pivot = new Vector2(0.5f, 0f); rectTransform.sizeDelta = new Vector2(0f, 70f); _count = UiKit.Text(((Component)obj3).transform, "", 15f, UiKit.TextMain, (TextAlignmentOptions)514, (FontStyles)1); UiKit.Stretch(((TMP_Text)_count).rectTransform, 10f, 10f, 10f, 16f); Image obj4 = UiKit.Img(((Component)obj3).transform, "Track", UiKit.Track); RectTransform rectTransform2 = ((Graphic)obj4).rectTransform; rectTransform2.anchorMin = new Vector2(0f, 0f); rectTransform2.anchorMax = new Vector2(1f, 0f); rectTransform2.pivot = new Vector2(0.5f, 0f); rectTransform2.sizeDelta = new Vector2(-24f, 6f); rectTransform2.anchoredPosition = new Vector2(0f, 10f); _bar = UiKit.Img(((Component)obj4).transform, "Fill", UiKit.Gold); RectTransform rectTransform3 = ((Graphic)_bar).rectTransform; rectTransform3.anchorMin = Vector2.zero; rectTransform3.anchorMax = new Vector2(0f, 1f); Vector2 offsetMin = (rectTransform3.offsetMax = Vector2.zero); rectTransform3.offsetMin = offsetMin; ((Component)_root).gameObject.SetActive(false); } public static void Reset() { _root = null; } public static void Preview() { if (!Playing) { _preview = true; Start(); } } private static void Start() { List<Clip> list = Clips(); Playing = true; _total = (_left = 15f); _clipsLeft = Mathf.Max(1, list.Count); NextClip(); Plugin.L.LogInfo((object)(_preview ? "[ads] ad preview started" : "[ads] ad break started (bill overdue)")); } private static void NextClip() { List<Clip> list = Clips(); _clipTime = 0f; _clipIdx = ((list.Count == 0) ? (-1) : _rng.Next(list.Count)); } public static void Tick(bool phoneOpen, bool inCall) { //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } if (!phoneOpen) { _openTime = 0f; if (((Component)_root).gameObject.activeSelf) { ((Component)_root).gameObject.SetActive(false); } return; } if (!Playing) { if (!Bill.Overdue || inCall) { if (((Component)_root).gameObject.activeSelf) { ((Component)_root).gameObject.SetActive(false); } return; } _openTime += Time.unscaledDeltaTime; bool num = _openTime < 0.5f && Time.unscaledTime - _lastEnd > 40f; bool flag = Time.unscaledTime - _lastEnd > 150f; if (!(num || flag)) { return; } Start(); } if (inCall) { if (((Component)_root).gameObject.activeSelf) { ((Component)_root).gameObject.SetActive(false); } return; } ((Component)_root).gameObject.SetActive(true); ((Transform)_root).SetAsLastSibling(); _left -= Time.unscaledDeltaTime; _clipTime += Time.unscaledDeltaTime; List<Clip> list = Clips(); if (_clipIdx >= 0 && _clipIdx < list.Count) { Clip clip = list[_clipIdx]; int num2 = (int)(_clipTime * clip.Fps); if (num2 >= clip.Frames.Count) { if (_clipTime > 4f) { NextClip(); num2 = 0; } else { num2 %= clip.Frames.Count; } } if (_clipIdx >= 0 && _clipIdx < list.Count) { clip = list[_clipIdx]; Frame frame = clip.Frames[Mathf.Clamp(num2, 0, clip.Frames.Count - 1)]; if ((Object)(object)_img.texture != (Object)(object)frame.Tex) { _img.texture = frame.Tex; } _img.uvRect = frame.Uv; float aspectRatio = (float)frame.Tex.width * ((Rect)(ref frame.Uv)).width / Mathf.Max(1f, (float)frame.Tex.height * ((Rect)(ref frame.Uv)).height); _fit.aspectRatio = aspectRatio; ((Graphic)_img).color = Color.white; ((TMP_Text)_brand).text = $"{Pretty(clip.Name)} <color={UiKit.DimHex}>· sponsored by {"XENO"}</color>"; } } else { _img.texture = null; ((Graphic)_img).color = new Color(0f, 0f, 0f, 0f); ((TMP_Text)_brand).text = "XENO <color=" + UiKit.DimHex + ">· pay your bill to remove ads</color>"; } ((TMP_Text)_count).text = (_preview ? $"AD PREVIEW · ends in {Mathf.CeilToInt(Mathf.Max(0f, _left))}\n<size=80%><color={UiKit.DimHex}>This is what plays when your bill is overdue</color></size>" : $"PHONE BILL OVERDUE · ad ends in {Mathf.CeilToInt(Mathf.Max(0f, _left))}\n<size=80%><color={UiKit.DimHex}>Pay ${Bill.Owed:N0} in the {"XENO"} app to stop ads</color></size>"); ((Graphic)_bar).rectTransform.anchorMax = new Vector2(Mathf.Clamp01(1f - _left / _total), 1f); if (_left <= 0f) { Playing = false; _preview = false; _lastEnd = Time.unscaledTime; ((Component)_root).gameObject.SetActive(false); Plugin.L.LogInfo((object)"[ads] ad break over"); } } private static string Pretty(string n) { if (string.IsNullOrEmpty(n)) { return "ADVERT"; } n = n.Replace("_", " ").Replace("AnimatedSequence", "").Replace("Ad ", "") .Trim(); return n.ToUpper(); } public static void StopIfPaid() { if (Playing && !_preview && !Bill.Overdue) { Playing = false; _lastEnd = Time.unscaledTime; if ((Object)(object)_root != (Object)null) { ((Component)_root).gameObject.SetActive(false); } } } } internal static class LevelCapture { public static List<(string text, float have, float need)> Entries; [HarmonyPatch(typeof(VenueOverviewTabLevelingSection), "CreateTodoEntry", new Type[] { typeof(string), typeof(int), typeof(int) })] [HarmonyPostfix] private static void IntEntry(string text, int progress, int goal) { Entries?.Add((text, progress, goal)); } [HarmonyPatch(typeof(VenueOverviewTabLevelingSection), "CreateTodoEntry", new Type[] { typeof(string), typeof(float), typeof(float) })] [HarmonyPostfix] private static void FloatEntry(string text, float progress, float goal) { Entries?.Add((text, progress, goal)); } } internal static class Apps { internal class QuestInfo { public RuntimeQuest Rq; public Quest Quest; public string Guid; public string Title; public string Owner; public string Dist; public int Num; public bool GamePinned; public readonly List<(string label, string value, string desc)> Lines = new List<(string, string, string)>(); } internal class RankRow { public string Id; public string Name; public float Points; public float Income; public int Total; public bool Me; } private static VenueOverviewTabLevelingSection _levelUi; private static VenueOverviewTabStaffSection _staffUi; private static readonly Dictionary<nint, (float value, float time)> _happyCache = new Dictionary<nint, (float, float)>(); private static bool _happyLogged; private static bool _moneyLogged; private static VenueOverviewTabFinancesSectionSummaryIncome _financeUi; private static float _financeRetry; private static List<RankRow> _rankCache; private static float _rankTime = -10f; internal static RectTransform Card(RectTransform parent, Action onClick, bool highlight = false) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00aa: 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) Image val = UiKit.Img((Transform)(object)parent, "Card", highlight ? UiKit.CardHi : UiKit.Card, onClick != null); RectTransform rectTransform = ((Graphic)val).rectTransform; UiKit.VLayout(((Component)rectTransform).gameObject, 14, 12, 10, 12, 6f); Image obj = UiKit.Img((Transform)(object)rectTransform, "Stripe", highlight ? UiKit.Gold : UiKit.GoldDim); RectTransform rectTransform2 = ((Graphic)obj).rectTransform; rectTransform2.anchorMin = new Vector2(0f, 0f); rectTransform2.anchorMax = new Vector2(0f, 1f); rectTransform2.pivot = new Vector2(0f, 0.5f); rectTransform2.sizeDelta = new Vector2(3f, 0f); rectTransform2.anchoredPosition = Vector2.zero; ((Component)obj).gameObject.AddComponent<LayoutElement>().ignoreLayout = true; if (onClick != null) { UiKit.MakeButton(((Component)rectTransform).gameObject, (Graphic)(object)val, onClick); } return rectTransform; } public static void Note(RectTransform parent, string text) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) UiKit.Text((Transform)(object)Card(parent, null), text, 17f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); } internal static RectTransform Row(Transform parent, float spacing = 8f) { RectTransform obj = UiKit.Rect("Row", parent); UiKit.HLayout(((Component)obj).gameObject, spacing); return obj; } internal static void Diamond(Transform parent, string label, float size, bool filled) { //IL_0031: 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_006e: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) RectTransform val = UiKit.Rect("Diamond", parent); UiKit.Size(((Component)val).gameObject, size + 8f, size + 8f); Image obj = UiKit.Img((Transform)(object)val, "Outer", UiKit.Gold); ((Graphic)obj).rectTransform.sizeDelta = new Vector2(size * 0.72f, size * 0.72f); ((Transform)((Graphic)obj).rectTransform).localEulerAngles = new Vector3(0f, 0f, 45f); if (!filled) { Image obj2 = UiKit.Img((Transform)(object)val, "Inner", UiKit.Inner); ((Graphic)obj2).rectTransform.sizeDelta = new Vector2(size * 0.72f - 4f, size * 0.72f - 4f); ((Transform)((Graphic)obj2).rectTransform).localEulerAngles = new Vector3(0f, 0f, 45f); } if (!string.IsNullOrEmpty(label)) { UiKit.Stretch(((TMP_Text)UiKit.Text((Transform)(object)val, label, size * 0.42f, filled ? UiKit.Ink : UiKit.Gold, (TextAlignmentOptions)514, (FontStyles)1)).rectTransform); } } private static string Clean(string s) { if (string.IsNullOrWhiteSpace(s)) { return null; } s = Regex.Replace(s, "\\[[^\\]]*\\]", "").Trim(); if (s.Length != 0) { return s; } return null; } private static string ValueText(Object v) { if (v == null) { return null; } try { if (v.GetIl2CppType().FullName == "System.Boolean") { return null; } string text = v.ToString(); if (string.IsNullOrWhiteSpace(text) || text == "True" || text == "False") { return null; } return Progress(text); } catch { return null; } } internal static string Progress(string s) { if (string.IsNullOrWhiteSpace(s)) { return null; } s = s.Trim(); Match match = Regex.Match(s, "^\\(?\\s*(-?\\d+(?:\\.\\d+)?)\\s*[,/]\\s*(-?\\d+(?:\\.\\d+)?)\\s*\\)?$"); if (match.Success) { double num = double.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture); double num2 = double.Parse(match.Groups[2].Value, CultureInfo.InvariantCulture); if (num < 0.0 || num2 <= 0.0 || num2 > 100000.0 || num > num2 * 10.0) { return null; } return $"{num:0.##}/{num2:0.##}"; } if (double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { if (!(result < 0.0) && !(result > 1000000.0)) { return s; } return null; } if (s.StartsWith("(") || s.Contains("E+") || s.Length > 24) { return null; } return s; } public static List<QuestInfo> GatherQuests(Dictionary<nint, ActiveJournalEntryItem> hud) { List<QuestInfo> list = new List<QuestInfo>(); QuestManager val = S.Get<QuestManager>(); if ((Object)(object)val == (Object)null) { return list; } Enumerator<string, RuntimeQuest> enumerator = val._activeQuests.GetEnumerator(); while (enumerator.MoveNext()) { RuntimeQuest rq = enumerator.Current.Value; if (rq == null || (Object)(object)rq.Quest == (Object)null) { continue; } bool flag = true; try { flag = QuestManager.IsQuestDisplayed(rq); } catch { } if (!flag) { continue; } hud.TryGetValue(((Il2CppObjectBase)rq).Pointer, out var item); QuestInfo questInfo = new QuestInfo { Rq = rq, Quest = rq.Quest, GamePinned = Pinned(rq) }; questInfo.Guid = Safe(() => rq.Quest.Guid, null) ?? Safe(() => ((Object)rq.Quest).name, ""); try { questInfo.Num = rq.QuestNumber; } catch { } questInfo.Title = Safe(delegate { ActiveJournalEntryItem obj4 = item; if (obj4 == null) { return (string)null; } TextMeshProUGUI titleText = obj4.TitleText; return (titleText == null) ? null : ((TMP_Text)titleText).text; }, null) ?? Safe(() => rq.Quest.Title, "Quest"); questInfo.Owner = Safe(delegate { Person owner = rq.Quest.Owner; return (owner == null) ? null : owner.DisplayedName; }, null); string text = Safe(delegate { ActiveJournalEntryItem obj4 = item; if (obj4 == null) { return (string)null; } TextMeshProUGUI distance = obj4.distance; return (distance == null) ? null : ((TMP_Text)distance).text; }, null); questInfo.Dist = ((string.IsNullOrWhiteSpace(text) || text.Trim() == "-") ? null : text.Trim()); if ((Object)(object)item != (Object)null && item._lines != null) { for (int num = 0; num < item._lines.Count; num++) { ProgressLineData val2 = item._lines[num]; if (!val2.IsCompleted) { string text2 = Clean(val2.Label); if (text2 != null) { questInfo.Lines.Add((text2, ValueText(val2.Value), Clean(val2.Description))); } } } } if (questInfo.Lines.Count == 0 && rq.ActiveSubQuests != null) { List<SubQuestTrackerPair> activeSubQuests = rq.ActiveSubQuests; for (int num2 = 0; num2 < activeSubQuests.Count; num2++) { SubQuestTrackerPair val3 = activeSubQuests[num2]; SubQuest sq = val3.SubQuest; if (sq == null) { continue; } string text3 = Clean(Safe(() => sq.ProgressText, null)) ?? Clean(Safe(() => sq.GetTitleText(), null)); if (text3 == null) { continue; } string item2 = null; try { ProgressTracker tracker = val3.Tracker; ProgressDisplayInfo val4 = ((tracker != null) ? tracker.CurrentProgress : null); if (val4 != null) { item2 = ValueText(val4.Value); } } catch { } questInfo.Lines.Add((text3, item2, null)); } } questInfo.Rq = rq; list.Add(questInfo); questInfo.Lines.TrimExcess(); LastUpdate(rq); } return (from q in list orderby Pins.Has(q.Guid) descending, q.GamePinned descending, LastUpdate(q.Rq) descending select q).ToList(); } public static void BuildQuests(PhoneUI ui, RectTransform content, Dictionary<nint, ActiveJournalEntryItem> hud) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_0225: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) List<QuestInfo> list = GatherQuests(hud); if (list.Count == 0) { Note(content, "<color=" + UiKit.DimHex + ">No active quests right now.</color>"); return; } if (Pins.Count == 0) { UiKit.Text((Transform)(object)Card(content, null), $"<color={UiKit.DimHex}>Tip: hit</color> <color={UiKit.GoldHex}>PIN</color> <color={UiKit.DimHex}>to keep a quest on screen while the phone is away.</color>", 14f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); } foreach (QuestInfo item in list) { Quest quest = item.Quest; bool flag = Pins.Has(item.Guid); RectTransform val = Card(content, delegate { ui.CloseAndRun(delegate { InGameMenuUi.Instance.OpenJournalOnQuest(quest); }); }, flag); RectTransform parent = Row((Transform)(object)val); Diamond((Transform)(object)parent, (item.Num > 0) ? item.Num.ToString() : "", 30f, filled: false); RectTransform val2 = UiKit.Rect("Titles", (Transform)(object)parent); UiKit.VLayout(((Component)val2).gameObject, 0, 0, 0, 0, 0f); UiKit.Size(((Component)val2).gameObject, -1f, -1f, 1f); UiKit.Text((Transform)(object)val2, item.Title, 19f, UiKit.Accent, (TextAlignmentOptions)513, (FontStyles)1); string text = item.Owner ?? ""; if (item.Dist != null) { text = ((text.Length > 0) ? (text + " · " + item.Dist) : item.Dist); } if (text.Length > 0) { UiKit.Text((Transform)(object)val2, text, 14f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)0); } Color val3 = Pins.ColorOf(item.Guid); Image val4 = UiKit.Img((Transform)(object)parent, "Pin", flag ? val3 : UiKit.Cell, raycast: true); UiKit.Size(((Component)val4).gameObject, 58f, 26f); TextMeshProUGUI obj = UiKit.Text(((Component)val4).transform, flag ? $"PIN {Pins.Index(item.Guid) + 1}" : ((Pins.Count >= 3) ? "FULL" : "PIN"), 11f, flag ? UiKit.Ink : ((Pins.Count >= 3) ? UiKit.TextDim : UiKit.Gold), (TextAlignmentOptions)514, (FontStyles)1); UiKit.Stretch(((TMP_Text)obj).rectTransform); ((TMP_Text)obj).characterSpacing = 1f; string guid = item.Guid; UiKit.MakeButton(((Component)val4).gameObject, (Graphic)(object)val4, delegate { Pins.Toggle(guid); ui.RefreshNow(); }); foreach (var (label, value, desc) in item.Lines) { Objective((Transform)(object)val, label, value, desc); } if (item.Lines.Count == 0) { UiKit.Text((Transform)(object)val, "Check the journal for the next step", 15f, UiKit.TextDim, (TextAlignmentOptions)257, (FontStyles)0); } } } private static void Objective(Transform card, string label, string value, string desc) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(label)) { RectTransform val = Row(card); ((LayoutGroup)((Component)val).GetComponent<HorizontalLayoutGroup>()).childAlignment = (TextAnchor)0; UiKit.Size(((Component)UiKit.Rect("Pad", (Transform)(object)val)).gameObject, 4f, 4f); RectTransform obj = UiKit.Rect("Bullet", (Transform)(object)val); UiKit.Size(((Component)obj).gameObject, 12f, 20f); Image obj2 = UiKit.Img((Transform)(object)obj, "D", UiKit.GoldDim); ((Graphic)obj2).rectTransform.sizeDelta = new Vector2(8f, 8f); ((Graphic)obj2).rectTransform.anchoredPosition = new Vector2(0f, 0f); ((Transform)((Graphic)obj2).rectTransform).localEulerAngles = new Vector3(0f, 0f, 45f); RectTransform val2 = UiKit.Rect("T", (Transform)(object)val); UiKit.VLayout(((Component)val2).gameObject, 0, 0, 0, 0, 0f); UiKit.Size(((Component)val2).gameObject, -1f, -1f, 1f); UiKit.Text((Transform)(object)val2, label, 16f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); if (!string.IsNullOrEmpty(desc) && desc != label) { UiKit.Text((Transform)(object)val2, desc, 13f, UiKit.TextDim, (TextAlignmentOptions)257, (FontStyles)0); } if (!string.IsNullOrEmpty(value)) { UiKit.Size(((Component)UiKit.Text((Transform)(object)val, value, 16f, UiKit.Gold, (TextAlignmentOptions)260, (FontStyles)1)).gameObject, 52f); } } } private static bool Pinned(RuntimeQuest q) { try { return q.Pinned; } catch { return false; } } private static int LastUpdate(RuntimeQuest q) { try { return q.LastUpdateTime; } catch { return 0; } } public static void BuildVenues(PhoneUI ui, RectTransform content) { //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Expected O, but got Unknown //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) VenueManager val = S.Get<VenueManager>(); int today = TimeOfDayManager.GameplayGameDay; Il2CppReferenceArray<Venue> venues = val._venues; float num = ((Plugin.MoneyDivisor.Value <= 0f) ? 1f : Plugin.MoneyDivisor.Value); float num2 = 0f; float num3 = 0f; float num4 = 0f; List<(Venue, VenueAreaGhost, float, float, float)> list = new List<(Venue, VenueAreaGhost, float, float, float)>(); bool flag2 = default(bool); for (int i = 0; i < ((Il2CppArrayBase<Venue>)(object)venues).Length; i++) { Venue v = ((Il2CppArrayBase<Venue>)(object)venues)[i]; if ((Object)(object)v == (Object)null) { continue; } bool flag = false; try { flag = ((BaseProperty)v).PlayerOwned; } catch { } if (!flag) { continue; } VenueAreaGhost rt = null; try { rt = val.GetRuntimeData(v); } catch { } float num5 = 0f; float num6 = 0f; float num7 = 0f; VenueAreaGhost obj3 = rt; if (((obj3 != null) ? obj3.Finances : null) != null) { VenueFinances f = rt.Finances; int num8 = today - DaysSinceMonday(); num5 = (float)Profit(v, f, today) / num; for (int j = 0; j <= today; j++) { float num9 = (float)Profit(v, f, j) / num; num7 += num9; if (j >= num8) { num6 += num9; } } if (!_moneyLogged) { ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(65, 8, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[money] "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(Safe(() => ((BaseProperty)v).GetName(), "?")); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" day "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(today); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": game-ui="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(SafeInt(delegate { VenueOverviewTabFinancesSectionSummaryIncome obj7 = FinanceUi(); return (obj7 == null) ? (-1) : obj7.GetProfitsForDay(v, today); })); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" finances="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(SafeInt(() => f.GetProfitsForDay(today))); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" calc="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(SafeInt(() => f.CalculateProfitsForDay(today))); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" income="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(SafeFloat(() => rt.DayIncome(today))); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" clean="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(SafeFloat(() => rt.DayCleanIncome(today))); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" weekStart="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num8); } l.LogInfo(val2); } } num2 += num5; num3 += num6; num4 += num7; list.Add((v, rt, num5, num6, num7)); } _moneyLogged = true; if (list.Count == 0) { Note(content, "<color=" + UiKit.DimHex + ">You don't own any venues yet.</color>"); return; } RectTransform obj4 = Card(content, null, highlight: true); ((TMP_Text)UiKit.Text((Transform)(object)obj4, "ALL VENUES", 14f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)1)).characterSpacing = 2f; MoneyCells((Transform)(object)obj4, num2, num3, num4); foreach (var item4 in list.OrderByDescending<(Venue, VenueAreaGhost, float, float, float), float>(((Venue v, VenueAreaGhost rt, float t, float w, float l) x) => x.l)) { Venue v2 = item4.Item1; VenueAreaGhost rt2 = item4.Item2; float item = item4.Item3; float item2 = item4.Item4; float item3 = item4.Item5; Venue venue = v2; RectTransform val3 = Card(content, delegate { ui.CloseAndRun(delegate { InGameMenuUi instance = InGameMenuUi.Instance; instance.OpenOnTab((InGameMenuTab)7); try { instance.venueSelectionPanel.SelectVenue(venue); } catch { } }); }); RectTransform parent = Row((Transform)(object)val3); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent, Safe(() => ((BaseProperty)v2).GetName(), "Venue").ToUpper(), 20f, UiKit.Accent, (TextAlignmentOptions)513, (FontStyles)1)).gameObject, -1f, -1f, 1f); int num10 = ((rt2 != null) ? SafeInt(() => rt2.CurrentLevel) : 0); if (num10 > 0) { UiKit.Size(((Component)UiKit.Text((Transform)(object)parent, $"LVL {num10}", 14f, UiKit.TextDim, (TextAlignmentOptions)516, (FontStyles)1)).gameObject, 46f); } bool flag3 = rt2 != null && SafeBool(() => ((ObjectVariable<bool>)(object)rt2.IsOpen).Value); Image obj5 = UiKit.Img((Transform)(object)parent, "Pill", flag3 ? UiKit.PillOn : UiKit.PillOff); UiKit.Size(((Component)obj5).gameObject, 62f, 20f); UiKit.Stretch(((TMP_Text)UiKit.Text(((Component)obj5).transform, flag3 ? "OPEN" : "CLOSED", 12f, flag3 ? UiKit.Green : UiKit.TextDim, (TextAlignmentOptions)514, (FontStyles)1)).rectTransform); if (rt2 != null) { float num11 = SafeFloat(() => rt2.AvgReviewScore()); int value = SafeInt(() => ((ObjectCollection<Review>)(object)rt2.Reviews).Count); RectTransform parent2 = Row((Transform)(object)val3, 6f); UiKit.Stars((Transform)(object)parent2, num11, 17f); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent2, $"{num11:0.0} <color={UiKit.DimHex}>({value} reviews)</color>", 14f, UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)0)).gameObject, -1f, -1f, 1f); } try { Shop.Restock restock = Shop.GetRestock().FirstOrDefault((Shop.Restock r) => (Object)(object)r.Venue != (Object)null && ((Il2CppObjectBase)r.Venue).Pointer == ((Il2CppObjectBase)v2).Pointer); if (restock != null) { UiKit.Text((Transform)(object)val3, restock.Managed ? $"<color={UiKit.GoldHex}><b>LOW STOCK</b></color> <color={UiKit.DimHex}>your manager will restock ({restock.Items.Count} low)</color>" : $"<color={UiKit.RedHex}><b>NEEDS RESTOCK</b></color> <color={UiKit.DimHex}>{restock.Items.Count} ingredient{((restock.Items.Count == 1) ? "" : "s")} low, no manager here</color>", 14f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); } } catch { } MoneyCells((Transform)(object)val3, item, item2, item3); if (rt2 != null) { LevelSection((Transform)(object)val3, rt2, v2); } if (rt2 != null) { StaffRow((Transform)(object)val3, rt2); } } } private static void MoneyCells(Transform card, float t, float w, float l) { RectTransform row = Row(card, 5f); Cell((Transform)(object)row, "TODAY", t, colorize: true); Cell((Transform)(object)row, "THIS WEEK", w, colorize: false); Cell((Transform)(object)row, "LIFETIME", l, colorize: false); } private static void Cell(Transform row, string label, float value, bool colorize) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0088: 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_007a: Unknown result type (might be due to invalid IL or missing references) Image obj = UiKit.Img(row, "Cell", UiKit.Cell); UiKit.VLayout(((Component)obj).gameObject, 6, 6, 5, 6, 0f); UiKit.Size(((Component)obj).gameObject, -1f, -1f, 1f); ((TMP_Text)UiKit.Text(((Component)obj).transform, label, 11f, UiKit.TextDim, (TextAlignmentOptions)514, (FontStyles)1)).characterSpacing = 2f; TextMeshProUGUI obj2 = UiKit.Text(c: (!colorize) ? UiKit.TextMain : ((value > 0f) ? UiKit.Green : ((value < 0f) ? UiKit.Red : UiKit.TextMain)), parent: ((Component)obj).transform, s: value.ToString("N2"), size: 17f, align: (TextAlignmentOptions)514, style: (FontStyles)1); ((TMP_Text)obj2).enableWordWrapping = false; ((TMP_Text)obj2).enableAutoSizing = true; ((TMP_Text)obj2).fontSizeMin = 11f; ((TMP_Text)obj2).fontSizeMax = 17f; } public static float StaffHappiness(Venue v, VenueAreaGhost rt) { //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Expected O, but got Unknown if ((Object)(object)v == (Object)null) { return -1f; } if (_happyCache.TryGetValue(((Il2CppObjectBase)v).Pointer, out (float, float) value) && Time.unscaledTime - value.Item2 < 5f) { return value.Item1; } float num = -1f; string text = ""; try { if ((Object)(object)_staffUi == (Object)null) { Il2CppReferenceArray<Object> val = Resources.FindObjectsOfTypeAll(Il2CppType.Of<VenueOverviewTabStaffSection>()); if (((Il2CppArrayBase<Object>)(object)val).Length > 0) { _staffUi = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[0]).Cast<VenueOverviewTabStaffSection>(); } } if ((Object)(object)_staffUi != (Object)null) { _staffUi.Show(v); string text2 = (((Object)(object)_staffUi.happinessValue != (Object)null) ? ((TMP_Text)_staffUi.happinessValue).text : null); if (float.TryParse(new string((text2 ?? "").Where((char ch) => char.IsDigit(ch) || ch == '.').ToArray()), NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { num = ((result <= 1.0001f && !(text2 ?? "").Contains("%")) ? (result * 100f) : result); text = "terminal text '" + text2 + "'"; } else if ((Object)(object)_staffUi.happinessFill != (Object)null) { float value2 = _staffUi.happinessFill.value; num = ((value2 <= 1.0001f) ? (value2 * 100f) : value2); text = $"terminal slider {value2}"; } } } catch (Exception ex) { text = "terminal failed: " + ex.Message; } if (num < 0f && rt != null) { try { float num2 = 0f; int num3 = 0; List<Person> val2 = rt.staff?.backingList; if (val2 != null) { for (int num4 = 0; num4 < val2.Count; num4++) { Person p = val2[num4]; float num5 = SafeFloat(() => p.RuntimeData.WorkSatisfaction.Value); num2 += num5; num3++; } } if (num3 > 0) { num = num2 / (float)num3; if (num <= 1.0001f) { num *= 100f; } text = $"average of {num3} staff"; } } catch (Exception ex2) { text = text + " / staff average failed: " + ex2.Message; } } if (!_happyLogged) { _happyLogged = true; ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(24, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[staff] "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(Safe(() => ((BaseProperty)v).GetName(), "?")); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" happiness "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(num, "0"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" via "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(text); } l.LogInfo(val3); } _happyCache[((Il2CppObjectBase)v).Pointer] = (num, Time.unscaledTime); return num; } private static List<(string text, float have, float need)> GameObjectives(Venue v) { try { if ((Object)(object)_levelUi == (Object)null) { Il2CppReferenceArray<Object> val = Resources.FindObjectsOfTypeAll(Il2CppType.Of<VenueOverviewTabLevelingSection>()); if (((Il2CppArrayBase<Object>)(object)val).Length > 0) { _levelUi = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[0]).Cast<VenueOverviewTabLevelingSection>(); } } if ((Object)(object)_levelUi == (Object)null) { return null; } LevelCapture.Entries = new List<(string, float, float)>(); _levelUi.Show(v); return LevelCapture.Entries; } catch (Exception ex) { Plugin.L.LogWarning((object)("Level objectives: " + ex.Message)); return null; } finally { LevelCapture.Entries = null; } } private static void LevelSection(Transform card, VenueAreaGhost rt, Venue v) { //IL_02b7: 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_044a: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0614: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) List<(string, float, float)> list = GameObjectives(v); if (list != null && list.Count > 0) { int num = list.Count<(string, float, float)>(((string text, float have, float need) g) => g.have >= g.need); RectTransform parent = Row(card, 6f); TextMeshProUGUI obj = UiKit.Text((Transform)(object)parent, "NEXT LEVEL", 12f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)1); ((TMP_Text)obj).characterSpacing = 2f; UiKit.Size(((Component)obj).gameObject, -1f, -1f, 1f); UiKit.Text((Transform)(object)parent, (num == list.Count) ? ("<color=" + UiKit.GreenHex + ">READY</color>") : $"{num}/{list.Count}", 12f, UiKit.TextMain, (TextAlignmentOptions)516, (FontStyles)1); { foreach (var item8 in list) { string item = item8.Item1; float item2 = item8.Item2; float item3 = item8.Item3; bool flag = item2 >= item3; string text = ((Mathf.Approximately(item3, Mathf.Round(item3)) && Mathf.Approximately(item2, Mathf.Round(item2))) ? "0" : "0.0"); UiKit.Text(card, Clean(item) ?? "Goal", 14f, flag ? UiKit.TextDim : UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)0); RectTransform parent2 = Row(card); RectTransform obj2 = UiKit.Rect("BarHolder", (Transform)(object)parent2); UiKit.VLayout(((Component)obj2).gameObject, 0, 0, 5, 0, 0f); UiKit.Size(((Component)obj2).gameObject, -1f, -1f, 1f); UiKit.Bar((Transform)(object)obj2, (item3 > 0f) ? (item2 / item3) : 1f, flag ? UiKit.Green : UiKit.Gold, 7f); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent2, item2.ToString(text) + "/" + item3.ToString(text), 14f, flag ? UiKit.Green : UiKit.TextMain, (TextAlignmentOptions)516, (FontStyles)1)).gameObject, 76f); } return; } } VenueLevelData val = null; try { val = rt.NextLevelData; } catch { } if (val == null) { UiKit.Text(card, "<color=" + UiKit.GoldHex + ">MAX LEVEL</color>", 14f, UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)1); return; } List<(string, float, float, string)> list2 = new List<(string, float, float, string)>(); try { if (val.mealsServed != null && val.mealsServed.HasValue) { list2.Add(("Meals served", SafeInt(() => rt.MealsServed), val.mealsServed.Value, "0")); } } catch { } try { if (val.avgReviews != null && val.avgReviews.HasValue) { list2.Add(("Avg rating", SafeFloat(() => rt.AvgReviewScore()), val.avgReviews.Value, "0.0")); } } catch { } try { if (val.numTables != null && val.numTables.HasValue) { list2.Add(("Tables", SafeInt(() => rt.TablesCount(false)), val.numTables.Value, "0")); } } catch { } try { if (val.numStaff != null && val.numStaff.HasValue) { list2.Add(("Staff", SafeInt(() => rt.staff.Count), val.numStaff.Value, "0")); } } catch { } if (list2.Count == 0) { return; } int num2 = list2.Count<(string, float, float, string)>(((string label, float have, float need, string fmt) r) => r.have >= r.need); RectTransform parent3 = Row(card, 6f); TextMeshProUGUI obj8 = UiKit.Text((Transform)(object)parent3, "NEXT LEVEL", 12f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)1); ((TMP_Text)obj8).characterSpacing = 2f; UiKit.Size(((Component)obj8).gameObject, -1f, -1f, 1f); UiKit.Text((Transform)(object)parent3, (num2 == list2.Count) ? ("<color=" + UiKit.GreenHex + ">READY</color>") : $"{num2}/{list2.Count}", 12f, UiKit.TextMain, (TextAlignmentOptions)516, (FontStyles)1); foreach (var item9 in list2) { string item4 = item9.Item1; float item5 = item9.Item2; float item6 = item9.Item3; string item7 = item9.Item4; bool flag2 = item5 >= item6; RectTransform parent4 = Row(card); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent4, item4, 14f, flag2 ? UiKit.TextDim : UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)0)).gameObject, 96f); RectTransform obj9 = UiKit.Rect("BarHolder", (Transform)(object)parent4); UiKit.VLayout(((Component)obj9).gameObject, 0, 0, 6, 0, 0f); UiKit.Size(((Component)obj9).gameObject, -1f, -1f, 1f); UiKit.Bar((Transform)(object)obj9, (item6 > 0f) ? (item5 / item6) : 1f, flag2 ? UiKit.Green : UiKit.Gold, 7f); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent4, Math.Min(item5, item6 * 9.99f).ToString(item7) + "/" + item6.ToString(item7), 14f, flag2 ? UiKit.Green : UiKit.TextMain, (TextAlignmentOptions)516, (FontStyles)1)).gameObject, 70f); } } private static void StaffRow(Transform card, VenueAreaGhost rt) { //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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) int value = SafeInt(() => rt.staff.Count); int value2 = SafeInt(() => rt.StaffLimit); float num = StaffHappiness(rt.Venue, rt); if (num < 0f) { num = SafeFloat(() => rt.DayHappiness); if (num <= 1.01f) { num *= 100f; } } Color val = ((num >= 60f) ? UiKit.Green : ((num >= 35f) ? UiKit.Gold : UiKit.Red)); RectTransform parent = Row(card); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent, $"Staff {value}/{value2}", 14f, UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)0)).gameObject, 96f); RectTransform obj = UiKit.Rect("BarHolder", (Transform)(object)parent); UiKit.VLayout(((Component)obj).gameObject, 0, 0, 6, 0, 0f); UiKit.Size(((Component)obj).gameObject, -1f, -1f, 1f); UiKit.Bar((Transform)(object)obj, num / 100f, val, 7f); UiKit.Size(((Component)UiKit.Text((Transform)(object)parent, $"{num:0}% <size=80%>happy</size>", 14f, val, (TextAlignmentOptions)516, (FontStyles)1)).gameObject, 70f); } private static VenueOverviewTabFinancesSectionSummaryIncome FinanceUi() { if ((Object)(object)_financeUi != (Object)null) { return _financeUi; } if (Time.unscaledTime < _financeRetry) { return null; } _financeRetry = Time.unscaledTime + 30f; try { Il2CppReferenceArray<Object> val = Resources.FindObjectsOfTypeAll(Il2CppType.Of<VenueOverviewTabFinancesSectionSummaryIncome>()); if (((Il2CppArrayBase<Object>)(object)val).Length > 0) { _financeUi = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[0]).Cast<VenueOverviewTabFinancesSectionSummaryIncome>(); } } catch { } return _financeUi; } internal static int ProfitPublic(Venue v, VenueFinances f, int day) { return Profit(v, f, day); } private static int Profit(Venue v, VenueFinances f, int day) { VenueOverviewTabFinancesSectionSummaryIncome val = FinanceUi(); if ((Object)(object)val != (Object)null) { try { return val.GetProfitsForDay(v, day); } catch { } } return SafeInt(() => f.GetProfitsForDay(day)); } private static int DaysSinceMonday() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected I4, but got Unknown try { return (TimeOfDayManager.CurrentDayOfWeek + 6) % 7; } catch { return 6; } } public static void ResetCaches() { _staffUi = null; _happyCache.Clear(); _rankCache = null; _rankTime = -10f; _financeUi = null; _financeRetry = 0f; _levelUi = null; LevelCapture.Entries = null; } public static List<RankRow> Ranking() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) if (_rankCache != null && Time.unscaledTime - _rankTime < 5f) { return _rankCache; } _rankTime = Time.unscaledTime; List<RankRow> list = new List<RankRow>(); List<IPropertyOwner> list2 = new List<IPropertyOwner>(); try { AiOwnerManager obj = S.Get<AiOwnerManager>(); List<IPropertyOwner> val = ((obj != null) ? obj.GetOwnersRank() : null); int num = 0; while (val != null && num < val.Count) { if (val[num] != null) { list2.Add(val[num]); } num++; } } catch { } PlayerManager obj3 = S.Get<PlayerManager>(); Player player = ((obj3 != null) ? obj3.LocalPlayer : null); string me = Safe(delegate { Player obj4 = player; return (obj4 == null) ? null : obj4.OwnerId; }, null); if (player != null && !list2.Any((IPropertyOwner val3) => Safe(() => val3.OwnerId, "") == me)) { list2.Add(new IPropertyOwner(((Il2CppObjectBase)player).Pointer)); } int num2 = SafeInt(() => TimeOfDayManager.GameplayGameDay); foreach (IPropertyOwner o in list2) { RankRow rankRow = new RankRow { Id = Safe(() => o.OwnerId, ""), Name = Safe(() => o.Name, "Owner") }; rankRow.Me = rankRow.Id == me; if (rankRow.Me && (string.IsNullOrEmpty(rankRow.Name) || rankRow.Name == "Owner")) { rankRow.Name = "You"; } try { OwnerRankBreakdown val2 = OwnerRanking.Calculate(o, num2); rankRow.Points = ((OwnerRankBreakdown)(ref val2)).Points; rankRow.Total = ((OwnerRankBreakdown)(ref val2)).Total; rankRow.Income = val2.AverageDayIncome; } catch (Exception ex) { Plugin.L.LogWarning((object)("Rank calc failed for " + rankRow.Name + ": " + ex.Message)); } list.Add(rankRow); } _rankCache = (from r in list orderby r.Points descending, r.Total descending select r).ToList(); return _rankCache; } public static int PlayerPlace(out int count) { List<RankRow> list = Ranking(); count = list.Count; int num = list.FindIndex((RankRow r) => r.Me); if (num < 0) { return 0; } return num + 1; } public static void BuildRank(RectTransform content) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Expected O, but got Unknown //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) List<RankRow> list = Ranking(); if (list.Count == 0) { Note(content, "<color=" + UiKit.DimHex + ">No ranking yet.</color>"); return; } int num = list.FindIndex((RankRow r) => r.Me) + 1; float num2 = ((Plugin.MoneyDivisor.Value <= 0f) ? 1f : Plugin.MoneyDivisor.Value); RectTransform parent = Row((Transform)(object)Card(content, null, highlight: true), 10f); Diamond((Transform)(object)parent, (num > 0) ? num.ToString() : "-", 44f, filled: true); RectTransform val = UiKit.Rect("T", (Transform)(object)parent); UiKit.VLayout(((Component)val).gameObject, 0, 0, 0, 0, 0f); UiKit.Size(((Component)val).gameObject, -1f, -1f, 1f); ((TMP_Text)UiKit.Text((Transform)(object)val, "YOUR RANK", 13f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)1)).characterSpacing = 2f; UiKit.Text((Transform)(object)val, (num > 0) ? $"#{num} <size=70%><color={UiKit.DimHex}>of {list.Count} owners</color></size>" : "Unranked", 24f, UiKit.Gold, (TextAlignmentOptions)513, (FontStyles)1); if (num > 1) { RankRow rankRow = list[num - 2]; RankRow rankRow2 = list[num - 1]; UiKit.Text((Transform)(object)val, $"{Math.Max(0f, rankRow.Points - rankRow2.Points):0} pts to pass {rankRow.Name}", 14f, UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)0); } for (int num3 = 0; num3 < list.Count; num3++) { RankRow rankRow3 = list[num3]; RectTransform rectTransform = ((Graphic)UiKit.Img((Transform)(object)content, "RankRow", rankRow3.Me ? UiKit.CardHi : UiKit.Card)).rectTransform; HorizontalLayoutGroup obj = UiKit.HLayout(((Component)rectTransform).gameObject, 8f); ((LayoutGroup)obj).padding = new RectOffset(10, 12, 7, 7); ((LayoutGroup)obj).childAlignment = (TextAnchor)3; UiKit.Size(((Component)UiKit.Text((Transform)(object)rectTransform, $"{num3 + 1}", 18f, (num3 < 3) ? UiKit.Gold : UiKit.TextDim, (TextAlignmentOptions)514, (FontStyles)1)).gameObject, 28f); RectTransform val2 = UiKit.Rect("N", (Transform)(object)rectTransform); UiKit.VLayout(((Component)val2).gameObject, 0, 0, 0, 0, 0f); UiKit.Size(((Component)val2).gameObject, -1f, -1f, 1f); UiKit.Text((Transform)(object)val2, rankRow3.Me ? (rankRow3.Name + " <size=75%><color=" + UiKit.GreenHex + ">YOU</color></size>") : rankRow3.Name, 16f, rankRow3.Me ? UiKit.Gold : UiKit.TextMain, (TextAlignmentOptions)513, (FontStyles)1); if (rankRow3.Income > 0f) { UiKit.Text((Transform)(object)val2, $"~{rankRow3.Income / num2:N0} / day", 12f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)0); } UiKit.Size(((Component)UiKit.Text((Transform)(object)rectTransform, $"{rankRow3.Points:0} <size=70%><color={UiKit.DimHex}>pts</color></size>", 17f, UiKit.TextMain, (TextAlignmentOptions)516, (FontStyles)1)).gameObject, 84f); } } internal static T Safe<T>(Func<T> f, T fallback) { try { T val = f(); return (val == null) ? fallback : val; } catch { return fallback; } } private static int SafeInt(Func<int> f) { try { return f(); } catch { return 0; } } private static float SafeFloat(Func<float> f) { try { return f(); } catch { return 0f; } } private static bool SafeBool(Func<bool> f) { try { return f(); } catch { return false; } } } internal static class Bill { private class Entry { public int Day; public string Kind; public float Amount; } public const string Carrier = "XENO"; public const string CarrierFull = "XENO INCORPORATED"; private static List<Entry> _log; private static string _owner; private static int _lastAutoPayMinute = -1; private static float Div { get { if (!(Plugin.MoneyDivisor.Value <= 0f)) { return Plugin.MoneyDivisor.Value; } return 1f; } } public static bool Enabled => Plugin.BillEnabled.Value; public static float Weekly => Mathf.Max(0f, Plugin.BillWeekly.Value); private static string FilePath { get { string text = (string.IsNullOrEmpty(_owner) ? "default" : _owner); char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); foreach (char oldChar in invalidFileNameChars) { text = text.Replace(oldChar, '_'); } return Path.Combine(Paths.ConfigPath, "com.auctive.nivalisphone.bill." + text + ".txt"); } } private static int Today { get { try { return TimeOfDayManager.GameplayGameDay; } catch { return 0; } } } private static List<Entry> Log { get { if (_log != null) { return _log; } _log = new List<Entry>(); try { if (File.Exists(FilePath)) { string[] array = File.ReadAllLines(FilePath); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('|'); if (array2.Length >= 3 && int.TryParse(array2[0], out var result)) { float.TryParse(array2[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2); _log.Add(new Entry { Day = result, Kind = array2[1], Amount = result2 }); } } } } catch (Exception ex) { Plugin.L.LogWarning((object)("Bill load failed: " + ex.Message)); } return _log; } } private static int LastBillDay => (from e in Log where e.Kind == "BILL" || e.Kind == "START" select e.Day).DefaultIfEmpty(Today).Max(); public static int NextBillDay => LastBillDay + 7; public static float Owed => Mathf.Max(0f, Log.Where((Entry e) => e.Kind == "BILL").Sum((Entry e) => e.Amount) - Log.Where((Entry e) => e.Kind == "PAID").Sum((Entry e) => e.Amount)); public static bool Overdue { get { if (!Enabled || Owed <= 0.009f) { return false; } int num = OldestUnpaidDay(); if (num >= 0) { return Today >= num + Mathf.Max(0, Plugin.BillGraceDays.Value); } return false; } } public static int DaysUntilAds { get { int num = OldestUnpaidDay(); if (num >= 0) { return Mathf.Max(0, num + Plugin.BillGraceDays.Value - Today); } return -1; } } private static void Save() { try { File.WriteAllLines(FilePath, Log.Select((Entry e) => $"{e.Day}|{e.Kind}|{e.Amount.ToString(CultureInfo.InvariantCulture)}")); } catch (Exception ex) { Plugin.L.LogWarning((object)("Bill save failed: " + ex.Message)); } } public static void OnSaveLoaded() { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown try { PlayerManager obj = S.Get<PlayerManager>(); object owner; if (obj == null) { owner = null; } else { Player localPlayer = obj.LocalPlayer; owner = ((localPlayer != null) ? localPlayer.OwnerId : null); } _owner = (string)owner; } catch { _owner = null; } _log = null; _lastAutoPayMinute = -1; int today = Today; int count = Log.Count; Log.RemoveAll((Entry e) => e.Day > today); if (!Log.Any((Entry e) => e.Kind == "START")) { Log.Insert(0, new Entry { Day = today, Kind = "START", Amount = 0f }); } if (Log.Count != count) { Save(); } ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(53, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[bill] account loaded: owed "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(Owed, "0.##"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", next bill day "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(NextBillDay); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", wallet "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(Wallet(), "0.##"); } l.LogInfo(val); } private static int OldestUnpaidDay() { float num = Log.Where((Entry e) => e.Kind == "PAID").Sum((Entry e) => e.Amount); foreach (Entry item in from e in Log where e.Kind == "BILL" orderby e.Day select e) { if (num >= item.Amount - 0.001f) { num -= item.Amount; continue; } return item.Day; } return -1; } private static PlayerInventory Inv() { try { PlayerManager obj = S.Get<PlayerManager>(); object result; if (obj == null) { result = null; } else { Player localPlayer = obj.LocalPlayer; result = ((localPlayer != null) ? localPlayer.Inventory : null); } return (PlayerInventory)result; } catch { return null; } } public static float Wallet() { try { PlayerInventory val = Inv(); return ((Object)(object)val != (Object)null) ? ((float)val.Money / Div) : (-1f); } catch { return -1f; } } private static bool Take(float amount) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown PlayerInventory val = Inv(); if ((Object)(object)val == (Object)null) { return false; } int num = Mathf.RoundToInt(amount * Div); if (val.Money < num) { return false; } int money = val.Money; try { val.TakeMoney(num); } catch { } if (val.Money == money) { try { val.ChangeMoneyWithoutReceipt(-num); } catch { } } bool flag = val.Money <= money - num + 1; ManualLogSource l = Plugin.L; bool flag2 = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(35, 5, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[bill] charged "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(amount, "0.##"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("): wallet "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(money); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(val.Money); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" ok="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<bool>(flag); } l.LogInfo(val2); return flag; } public static void Tick() { //IL_01b5: 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_00ac: Unknown result type (might be due to invalid IL or missing references) if (!Enabled || _log == null) { return; } int today = Today; bool flag = false; int num = 0; while (today >= NextBillDay && num++ < 8) { Log.Add(new Entry { Day = NextBillDay, Kind = "BILL", Amount = Weekly }); flag = true; Notify.Push("CELL", "XENO BILL", $"${Weekly:N0} for this week from {"XENO INCORPORATED"}. Auto-pay tries your wallet.", UiKit.Gold); } if (flag) { Save(); } if (!(Owed > 0.009f)) { return; } int num2 = 0; try { num2 = today * 1440 + TimeOfDayManager.ClockHour * 60 + TimeOfDayManager.ClockMinute; } catch { } if (!flag && _lastAutoPayMinute >= 0 && num2 - _lastAutoPayMinute < 60) { return; } _lastAutoPayMinute = num2; bool overdue = Overdue; if (TryPay(manual: false)) { if (overdue) { Notify.Push("CELL", "SERVICE RESTORED", "Bill paid. No more ads.", UiKit.Green); } } else if (flag) { Notify.Push("CELL", "AUTO-PAY FAILED", $"Not enough cash. Pay ${Owed:N0} within {Plugin.BillGraceDays.Value} day(s) or ads start.", UiKit.Red); } } public static bool TryPay(bool manual) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) float owed = Owed; if (owed <= 0.009f) { return true; } if (!Take(owed)) { if (manual) { Notify.Push("CELL", "PAYMENT DECLINED", $"You need ${owed:N0}, you have ${Mathf.Max(0f, Wallet()):N0}.", UiKit.Red); } return false; } Log.Add(new Entry { Day = Today, Kind = "PAID", Amount = owed }); Save(); Notify.Push("CELL", "BILL PAID", $"${owed:N0} paid to {"XENO"}.", UiKit.Green); return true; } public static void Build(RectTransform content, PhoneUI ui) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_046c: 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) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) RectTransform parent = Apps.Card(content, null, highlight: true); RectTransform parent2 = Apps.Row((Transform)(object)parent); TextMeshProUGUI obj = UiKit.Text((Transform)(object)parent2, "XENO", 26f, UiKit.Gold, (TextAlignmentOptions)513, (FontStyles)1); ((TMP_Text)obj).characterSpacing = 5f; UiKit.Size(((Component)obj).gameObject, -1f, -1f, 1f); bool overdue = Overdue; Image obj2 = UiKit.Img((Transform)(object)parent2, "Status", (!Enabled) ? UiKit.PillOff : (overdue ? UiKit.Red : UiKit.PillOn)); UiKit.Size(((Component)obj2).gameObject, 112f, 24f); UiKit.Stretch(((TMP_Text)UiKit.Text(((Component)obj2).transform, (!Enabled) ? "BILL OFF" : (overdue ? "ADS ON" : ((Owed > 0f) ? "PAYMENT DUE" : "ACTIVE")), 12f, overdue ? Color.white : UiKit.TextMain, (TextAlignmentOptions)514, (FontStyles)1)).rectTransform); UiKit.Text((Transform)(object)parent, $"<color={UiKit.DimHex}>{"XENO INCORPORATED"} · Unlimited plan · ${Weekly:N0} a week</color>", 13f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); if (!Enabled) { Apps.Note(content, "<color=" + UiKit.DimHex + ">The phone bill is switched off in SETTINGS.</color>"); return; } RectTransform parent3 = Apps.Card(content, null); RectTransform row = Apps.Row((Transform)(object)parent3, 6f); Cell((Transform)(object)row, "YOU OWE", (Owed > 0f) ? $"${Owed:N0}" : "$0", (Owed > 0f) ? UiKit.Red : UiKit.Green); Cell((Transform)(object)row, "NEXT BILL", $"DAY {NextBillDay}", UiKit.TextMain); float num = Wallet(); Cell((Transform)(object)row, "WALLET", (num >= 0f) ? $"${num:N0}" : "?", UiKit.TextMain); if (Owed > 0.009f) { string s = (overdue ? ("<color=" + UiKit.RedHex + "><b>Overdue.</b></color> Ads play on your phone until you pay.") : $"Ads start in <b>{DaysUntilAds} day{((DaysUntilAds == 1) ? "" : "s")}</b> if this isn't paid."); UiKit.Text((Transform)(object)parent3, s, 14f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); Image val = UiKit.Img((Transform)(object)content, "Pay", UiKit.Gold, raycast: true); UiKit.VLayout(((Component)val).gameObject, 12, 12, 12, 12, 0f); ((TMP_Text)UiKit.Text(((Component)val).transform, $"PAY ${Owed:N0} NOW", 18f, UiKit.Ink, (TextAlignmentOptions)514, (FontStyles)1)).characterSpacing = 3f; UiKit.MakeButton(((Component)val).gameObject, (Graphic)(object)val, delegate { TryPay(manual: true); ui.RefreshNow(); }); } else { UiKit.Text((Transform)(object)parent3, "<color=" + UiKit.GreenHex + ">All paid up.</color> Auto-pay takes the next bill from your wallet.", 14f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); } Image val2 = UiKit.Img((Transform)(object)content, "Preview", UiKit.Cell, raycast: true); UiKit.Size(((Component)val2).gameObject, -1f, 32f); UiKit.Stretch(((TMP_Text)UiKit.Text(((Component)val2).transform, "PREVIEW AN AD BREAK", 12f, UiKit.TextDim, (TextAlignmentOptions)514, (FontStyles)1)).rectTransform); UiKit.MakeButton(((Component)val2).gameObject, (Graphic)(object)val2, Ads.Preview); List<Entry> list = Log.Where((Entry e) => e.Kind != "START").Reverse().Take(8) .ToList(); if (list.Count <= 0) { return; } ((TMP_Text)UiKit.Text((Transform)(object)content, "HISTORY", 12f, UiKit.TextDim, (TextAlignmentOptions)513, (FontStyles)1)).characterSpacing = 3f; RectTransform parent4 = Apps.Card(content, null); foreach (Entry item in list) { UiKit.Text((Transform)(object)parent4, (item.Kind == "PAID") ? $"<color={UiKit.GreenHex}>PAID</color> ${item.Amount:N0} <color={UiKit.DimHex}>day {item.Day}</color>" : $"<color={UiKit.GoldHex}>BILL</color> ${item.Amount:N0} <color={UiKit.DimHex}>day {item.Day}</color>", 14f, UiKit.TextMain, (TextAlignmentOptions)257, (FontStyles)0); } } private static void Cell(Transform row, string label, string value, Color c) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) Image obj = UiKit.Img(row, "Cell", UiKit.Cell); UiKit.VLayout(((Component)obj).gameObject, 6, 6, 6, 6, 0f); UiKit.Size(((Component)obj).gameObject, -1f, -1f, 1f); ((TMP_Text)UiKit.Text(((Component)obj).transform, label, 11f, UiKit.TextDim, (TextAlignmentOptions)514, (FontStyles)1)).characterSpacing = 1f; UiKit.Text(((Component)obj).transform, value, 17f, c, (TextAlignmentOptions)514, (FontStyles)1); } } internal static class Call { public static bool Active; public static bool Ended; public static float EndedAt; public static float StartedAt; public static int Version; public static string CallerName = "UNKNOWN"; public static Sprite Portrait; public static readonly List<(bool mine, string who, string text)> Messages = new List<(bool, string, string)>(); public static readonly List<(string text, bool enabled)> Choices = new List<(string, bool)>(); private static DialogueStepDisplayData _step; private static float _stepAt; private static float _lastActionAt; private static int _stepNo; private static int _continuedStep = -1; private static int _pickedStep = -1; private static int _stepTextLen; private static float _clip; private static nint _clipPtr; private static bool _lastMine; public static bool ReplyReady; public static bool ContinueReady; private static int _nudgeStep = -1; private static int _nudgeTry; private static int _nudgeIndex; private static float _nudgeAt; public static bool UseGameBox; public static Action OnHangUp; public static Action OnUseGameBox; private static readonly List<RectTransform> _bars = new List<RectTransform>(); private static TextMeshProUGUI _timer; public static bool Talking { get { if (Active && _step != null && !_lastMine) { return Time.unscaledTime - _stepAt < Mathf.Max(_clip, Mathf.Min((float)_stepTextLen * 0.05f, 8f)); } return false; } } public static void Reset() { Active = false; Ended = false; _step = null; Messages.Clear(); Choices.Clear(); ReplyReady = (ContinueReady = false); UseGameBox = false; CallerName = "UNKNOWN"; Portrait = null; _bars.Clear(); Version++; } public static void FlushVoiceCache(bool all) { //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown try { DialogueUI instance = DialogueUI.Instance; if ((Object)(object)instance == (Object)null) { return; } Dictionary<string, ResourceRequest> voPrefetch = instance.voPrefetch; int num = 0; if (voPrefetch != null) { List<string> list = new List<string>(); Enumerator<string, ResourceRequest> enumerator = voPrefetch.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair<string, ResourceRequest> current = enumerator.Current; bool flag = all; if (!flag) { try { flag = current.Value == null || (((AsyncOperation)current.Value).isDone && current.Value.asset == (Object)null); } catch { flag = true; } } if (flag) { list.Add(current.Key); } } foreach (string item in list) { voPrefetch.Remove(item); num++; } } if (all) { try { instance.voPrefetchNext?.Clear(); } catch { } try { instance.voPrefetchStale?.Clear(); } catch { } try { instance.currentVoClip = null; } catch { } } if (num > 0) { ManualLogSource l = Plugin.L; bool flag2 = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(35, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[call] cleared "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" stale voice line(s)"); } l.LogInfo(val); } } catch (Exception ex) { Plugin.L.LogWarning((object)("Voice cache flush: " + ex.Message)); } } public static void Begin() { FlushVoiceCache(all: false); Active = true; Ended = false; UseGameBox = Plugin.CallMode.Value == "GameBox"; StartedAt = Time.unscaledTime; _lastActionAt = 0f; CallerName = "INCOMING CALL"; Portrait = null; Messages.Clear(); Choices.Clear(); _step = null; ReplyReady = (ContinueReady = false); Plugin.L.LogInfo((object)"[call] started"); Version++; } private static float LineLength() { return Mathf.Max(_clip + 0.4f, Mathf.Min((float)_stepTextLen * 0.035f + 0.8f, 9f)); } public static void Step(DialogueStepDisplayData d) { //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Expected O, but got Unknown if (!Active || d == null) { return; } _step = d; _stepAt = Time.unscaledTime; _stepNo++; _nudgeStep = -1; ReplyReady = (ContinueReady = false); Person who = null; try { who = d.Speaker ?? d.Character; } catch { } string text = Apps.Safe(delegate { Person obj6 = who; return (obj6 == null) ? null : obj6.DisplayedName; }, null); try { Person caller = d.Character; if ((Object)(object)caller != (Object)null) { CallerName = (Apps.Safe(() => caller.DisplayedName, null) ?? CallerName).ToUpper(); if ((Object)(object)Portrait == (Object)null) { Portrait = Apps.Safe(() => caller.Portrait, null); } } } catch { } string text2 = UiKit.Fix(Apps.Safe(() => d.Text, null)); _stepTextLen = text2?.Length ?? 0; _clip = 0f; try { DialogueUI instance = DialogueUI.Instance; AudioClip val = ((instance != null) ? instance.currentVoClip : null); if ((Object)(object)val != (Object)null && ((Il2CppObjectBase)val).Pointer != _clipPtr) { _clipPtr = ((Il2CppObjectBase)val).Pointer; _clip = val.length; } } catch { } bool flag = false; if (!string.IsNullOrWhiteSpace(text2)) { flag = (Object)(object)who == (Object)null || (text?.Equals("You", StringComparison.OrdinalIgnoreCase) ?? false); ValueTuple<bool, string, string> obj4 = ((Messages.Count > 0) ? Messages[Messages.Count - 1] : default((bool, string, string))); if (obj4.Item3 != text2.Trim()) { Messages.Add((flag, text ?? "", text2.Trim())); } } _lastMine = flag; Choices.Clear(); try { List<Choice> choices = d.Choices; if (choices != null) { for (int num = 0; num < choices.Count; num++) { Choice c = choices[num]; if (c != null) { string text3 = Apps.Safe(() => c.Text, null); Choices.Add((string.IsNullOrWhiteSpace(text3) ? "..." : UiKit.Fix(text3).Trim(), Apps.Safe(() => c.Enabled, fallback: true))); } } } } catch { } ManualLogSource l = Plugin.L; bool flag2 = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(34, 5, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[call] step "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(_stepNo); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(flag ? "you" : (text ?? "?")); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>((text2 ?? "").Substring(0, Math.Min(40, (text2 ?? "").Length))); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' choices="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(Choices.Count); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" voice="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<float>(_clip, "0.0"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("s"); } l.LogInfo(val2); Version++; } public static void Poll() { if (!Active || _step == null) { if (ReplyReady || ContinueReady) { ReplyReady = (ContinueReady = false); Version++; } return; } float num = Time.unscaledTime - _stepAt; bool flag = num >= LineLength(); bool flag2 = Choices.Count > 0 && _pickedStep != _stepNo && (AnyGameChoiceClickable() || num > LineLength() + 6f); bool flag3 = Choices.Count == 0 && flag && _continuedStep != _stepNo && _nudgeStep != _stepNo; if (flag2 != ReplyReady || flag3 != ContinueReady) { ReplyReady = flag2; ContinueReady = flag3; Version++; } if (_nudgeStep == _stepNo && Time.unscaledTime - _nudgeAt > 1.5f) { Nudge(); } try { DialogueUI instance = DialogueUI.Instance; AudioClip val = ((instance != null) ? instance.currentVoClip : null); if ((Object)(object)val != (Object)null && ((Il2CppObjectBase)val).Pointer != _clipPtr && Time.unscaledTime - _stepAt < 3f) { _clipPtr = ((Il2CppObjectBase)val).Pointer; _clip = val.length; } } catch { } } private static IEnumerable<(bool, string, string)> Messages_Copy() { foreach (var message in Messages) { yield return message; } } public static void Pick(int index) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown if (_step == null || index < 0 || index >= Choices.Count || !ReplyReady || _pickedStep == _stepNo) { return; } string item = Choices[index].text; _pickedStep = _stepNo; _lastActionAt = Time.unscaledTime; bool flag = PressGameChoice(index); if (!flag && Time.unscaledTime - _stepAt > LineLength() + 6f) { try { _step.ReportChoicePicked(index); flag = true; ManualLogSource l = Plugin.L; bool flag2 = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(39, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[call] reply "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index + 1); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" reported (no game button)"); } l.LogInfo(val); } catch (Exception ex) { Plugin.L.LogWarning((object)("Choice report failed: " + ex.Message)); } } if (flag) { Messages.Add((true, "You", item)); Choices.Clear(); ReplyReady = false; _lastMine = true; _nudgeStep = _stepNo; _nudgeTry = 0; _nudgeAt = Time.unscaledTime; _nudgeIndex = index; Version++; } } private static DialogueChoiceUI GameChoice(int index, bool needClickable) { try { DialogueUI instance = DialogueUI.Instance; List<DialogueChoiceUI> val = ((instance != null) ? instance._choiceInstances : null); if (val == null) { return null; } for (int i = 0; i < val.Count; i++) { DialogueChoiceUI val2 = val[i]; if ((Object)(object)val2 == (Object)null || !((Component)val2).gameObject.activeInHierarchy) { continue; } int num = i; try { num = val2._choiceIndex; } catch { } if (num != index) { continue; } if (needClickable) { bool flag = true; try { flag = val2.Interactable; } catch { } try { if ((Object)(object)val2.button != (Object)null) { flag &= ((Selectable)val2.button).interactable && ((Behaviour)val2.button).isActiveAndEnabled; } } catch { } if (!flag) { return null; } } return val2; } } catch { } return null; } private static bool AnyGameChoiceClickable() { for (int i = 0; i < Choices.Count; i++) { if ((Object)(object)GameChoice(i, needClickable: true) != (Object)null) { return true; } } return false; } private static bool RealClick(Button b) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if ((Object)(object)b == (Object)null) { return false; } try { PointerEventData val = new PointerEventData(EventSystem.current) { button = (InputButton)0 }; b.OnPointerClick(val); return true; } catch (Exception ex) { Plugin.L.LogWarning((object)("Real click failed, invoking: " + ex.Message)); try { ButtonClickedEvent onClick = b.onClick; if (onClick != null) { ((UnityEvent)onClick).Invoke(); } return true; } catch { return false; } } } private static bool PressGameChoice(int index) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown DialogueChoiceUI val = GameChoice(index, needClickable: true); if ((Object)(object)val == (Object)null) { return false; } bool num = RealClick(val.button); if (num) { ManualLogSource l = Plugin.L; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(42, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[call] reply "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(index + 1); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" clicked on the game's button"); } l.LogInfo(val2); } return num; } private static void Nudge() { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown if (!Active) { _nudgeStep = -1; return; } _nudgeTry++; _nudgeAt = Time.unscaledTime; bool flag = default(bool); try { if (_nudgeIndex >= 0 && _nudgeTry <= 3 && (Object)(object)GameChoice(_nudgeIndex, needClickable: false) != (Object)null) { if (PressGameChoice(_nudgeIndex)) { ManualLogSource l = Plugin.L; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[call] retry reply click ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(_nudgeTry); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")"); } l.LogInfo(val); } } else if (_nudgeTry <= 4) { DialogueUI instance = DialogueUI.Instance; if ((Object)(object)instance != (Object)null && RealClick(instance.fullScreenButton)) { Plugin.L.LogInfo((object)"[call] nudge: continue click"); } } else { _nudgeStep = -1; Plugin.L.LogWarning((object)"[call] the game hasn't moved on; offering the game's dialogue box"); Notify.Push("CALL", "WAITING ON THE GAME", "If she's stuck, tap STUCK? to use the game's dialogue box", UiKit.Gold); } } catch (Exception ex) { ManualLogSource l2 = Plugin.L; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[call] nudge failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message); } l2.LogWarning(val2); } } public static void Continue() { if (!ContinueReady || _continuedStep == _stepNo) { return; } _continuedStep = _stepNo; ContinueReady = false; _lastActionAt = Time.unscaledTime; Version++; try { DialogueUI instance = DialogueUI.Instance; if (!((Object)(object)instance == (Object)null)) { Button fullScreenButton = instance.fullScreenButton; if ((Object)(object)fullScreenButton == (Object)null || !RealClick(fullScreenButton)) { instance._HandleNoChoices_b__64_0(); } Plugin.L.LogInfo((object)"[call] continue"); _nudgeStep = _stepNo; _nudgeTry = 3; _nudgeAt = Time.unscaledTime; _nudgeIndex = -1; } } catch (Exception ex) { Plugin.L.LogWarning((object)("Continue failed: " + ex.Message)); } } public static void End() { if (Active) { Active = false; Ended = true; EndedAt = Time.unscaledTime; UseGameBox = false; Plugin.L.LogInfo((object)"[call] ended"); try { NivalisPhone.Messages.Save(CallerName, Portrait, new List<(bool, string, string)>(Messages_Copy())); } catch (Exception ex) { Plugin.L.LogWarning((object)("Saving call failed: " + ex.Message)); } Choices.Clear(); _step = null; _bars.Clear(); Version++; } } public static void HangUp() { Plugin.L.LogInfo((object)"[call] hang up pressed"); if (Active) { try { DialogueUI instance = DialogueUI.Instance; if (instance != null) { ((UIWindow)instance).Close(); } } catch (Exception ex) { Plugin.L.LogWarning((object)("Close dialogue: " + ex.Message)); } if (Active) { End(); } } Ended = false; try { OnHangUp?.Invoke(); } catch { } } public static void Animate() { //IL_00f6: 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_0117: Unknown result type (might be due to invalid IL or missing references) bool talking = Talking; float unscaledTime = Time.unscaledTime; for (int i = 0; i < _bars.Count; i++) { RectTransform val = _bars[i]; if (!((Object)(object)val == (Object)null)) { float num4; if (talking) { float num = Mathf.PerlinNoise((float)i * 0.73f, unscaledTime * 7.5f); float num2 = 0.5f + 0.5f * Mathf.Sin(unscaledTime * 11f + (float)i * 0.9f); float num3 = 1f - Mathf.Abs((float)i - (float)(_bars.Count - 1) / 2f) / (float)_bars.Count; num4 = Mathf.Lerp(6f, 54f, Mathf.Clamp01(num * 0.75f + num2 * 0.35f) * (0.55f + 0.45f * num3)); } else { num4 = 4f + 2f * Mathf.Sin(unscaledTime * 2f + (float)i * 0.5f); } val.sizeDelta = new Vector2(val.sizeDelta.x, Mathf.Lerp(val.sizeDelta.y, num4, 0.35f)); } } if ((Object)(object)_timer != (Object)null) { float num5 = (Ended ? EndedAt : unscaledTime) - StartedAt; ((TMP_Text)_timer).text = $"{(Ended ? "CALL ENDED" : "ON CALL")} {(int)num5 / 60:0}:{(int)num5 % 60:00}"; } } public static void Build(RectTransform content) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_023e: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Un