using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; 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.Logging; using HarmonyLib; using InfoOverhaul.Compat; using InfoOverhaul.Delta; using InfoOverhaul.Stats; using InfoOverhaul.UI; using Microsoft.CodeAnalysis; using TMPro; using UnboundLib.GameModes; using UnboundLib.Utils; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")] [assembly: AssemblyCompany("InfoOverhaul")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+146ac727a7fc6b83f382d57f53cce40478349c58")] [assembly: AssemblyProduct("Info Overhaul")] [assembly: AssemblyTitle("InfoOverhaul")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 InfoOverhaul { internal static class IOLog { private static ManualLogSource _logger; internal static void Init(ManualLogSource logger) { _logger = logger; } internal static void Section(string title) { ManualLogSource logger = _logger; if (logger != null) { logger.LogInfo((object)("── " + title + " ──")); } } internal static void Line(string message) { ManualLogSource logger = _logger; if (logger != null) { logger.LogInfo((object)message); } } internal static void Warn(string message) { ManualLogSource logger = _logger; if (logger != null) { logger.LogWarning((object)message); } } internal static void Error(string message) { ManualLogSource logger = _logger; if (logger != null) { logger.LogError((object)message); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("InfoOverhaul", "Info Overhaul", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; IOLog.Init(Logger); IOLog.Section("Plugin Awake"); new Harmony("InfoOverhaul").PatchAll(); StatTemplateDeltaRegistrar.Init(); MfmTier2Compat.Init(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); IOLog.Line("Plugin InfoOverhaul loaded."); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "InfoOverhaul"; public const string PLUGIN_NAME = "Info Overhaul"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace InfoOverhaul.UI { public class CardDeltaPreviewOverlay : MonoBehaviour { [CompilerGenerated] private sealed class d__20 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public CardDeltaPreviewOverlay <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; CardDeltaPreviewOverlay cardDeltaPreviewOverlay = <>4__this; if (num != 0) { return false; } <>1__state = -1; cardDeltaPreviewOverlay.OnPickSequenceEnded(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static CardDeltaPreviewOverlay instance; private static readonly FieldInfo SpawnedCardsField = AccessTools.Field(typeof(CardChoice), "spawnedCards"); private static readonly FieldInfo SelectedCardField = AccessTools.Field(typeof(CardChoice), "currentlySelectedCard"); private const int RowsPerCol = 3; private const int MaxCols = 5; private Canvas _canvas; private TextMeshProUGUI _headerText; private TextMeshProUGUI[] _colTexts; private bool _pickSequenceActive; private void Awake() { instance = this; BuildUI(); GameModeManager.AddHook("PickEnd", (Func)OnPickSequenceEnd); IOLog.Section("CardDeltaPreviewOverlay initialized"); } private void BuildUI() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) _canvas = UIHelper.CreateFullscreenCanvas("IO_CardDeltaPreview", 55); Transform transform = ((Component)_canvas).transform; Vector2 anchorMin = new Vector2(0.18f, 0.085f); Vector2 anchorMax = new Vector2(0.82f, 0.22f); Color? bg = new Color(0.04f, 0.06f, 0.1f, 0.92f); RectTransform parent = UIHelper.CreatePanel(transform, "DeltaPanel", anchorMin, anchorMax, default(Vector2), default(Vector2), bg); RectTransform parent2 = UIHelper.CreatePanel((Transform)(object)parent, "Header", new Vector2(0.01f, 0.72f), new Vector2(0.99f, 0.98f)); _headerText = UIHelper.CreateText((Transform)(object)parent2, "HeaderText", "Card preview", 20, (TextAlignmentOptions)4097, (Color?)new Color(0.75f, 0.85f, 1f)); _colTexts = (TextMeshProUGUI[])(object)new TextMeshProUGUI[5]; float num = 0.2f; for (int i = 0; i < 5; i++) { float num2 = (float)i * num + 0.01f; float num3 = (float)(i + 1) * num - 0.01f; RectTransform parent3 = UIHelper.CreatePanel((Transform)(object)parent, $"Col{i}", new Vector2(num2, 0.02f), new Vector2(num3, 0.7f)); _colTexts[i] = UIHelper.CreateText((Transform)(object)parent3, "Text", string.Empty, 17, (TextAlignmentOptions)257, (Color?)new Color(0.92f, 0.94f, 1f)); ((TMP_Text)_colTexts[i]).richText = true; } ((Component)_canvas).gameObject.SetActive(false); } public void OnPickSequenceStarted() { if ((Object)(object)GetLocalHumanPlayer() == (Object)null) { SetVisible(visible: false); return; } _pickSequenceActive = true; SetVisible(visible: true); Refresh(); } public void OnPickSequenceEnded() { _pickSequenceActive = false; SetVisible(visible: false); } private void Update() { if (_pickSequenceActive && !((Object)(object)_canvas == (Object)null) && ((Component)_canvas).gameObject.activeSelf) { if (!IsGameActive()) { OnPickSequenceEnded(); } else { Refresh(); } } } private static bool IsGameActive() { if ((Object)(object)GameManager.instance == (Object)null) { return false; } if (!GameManager.instance.isPlaying) { return false; } if ((Object)(object)PlayerManager.instance == (Object)null) { return false; } if (PlayerManager.instance.players == null || PlayerManager.instance.players.Count == 0) { return false; } return true; } private void Refresh() { Player localHumanPlayer = GetLocalHumanPlayer(); if ((Object)(object)localHumanPlayer == (Object)null) { SetVisible(visible: false); return; } if (!TryGetHighlightedCard(out var card)) { ((TMP_Text)_headerText).text = "Card preview"; SetColumns(null); ((TMP_Text)_colTexts[0]).text = "—"; return; } ((TMP_Text)_headerText).text = "If selecting " + card.cardName + ":"; if (!CardDeltaRegistry.TryGetDeltas(localHumanPlayer, card, out var deltas)) { SetColumns(null); ((TMP_Text)_colTexts[0]).text = "N/A"; } else if (deltas.Count == 0) { SetColumns(null); ((TMP_Text)_colTexts[0]).text = "No stat changes"; } else { SetColumns(deltas); } } private void SetColumns(IReadOnlyList deltas) { if (deltas == null) { for (int i = 0; i < 5; i++) { ((TMP_Text)_colTexts[i]).text = string.Empty; ((Component)_colTexts[i]).gameObject.SetActive(i == 0); } return; } int num = Mathf.Clamp(Mathf.CeilToInt((float)deltas.Count / 3f), 1, 5); for (int j = 0; j < 5; j++) { bool flag = j < num; ((Component)_colTexts[j]).gameObject.SetActive(flag); if (!flag) { continue; } StringBuilder stringBuilder = new StringBuilder(); int num2 = j * 3; int num3 = Mathf.Min(num2 + 3, deltas.Count); for (int k = num2; k < num3; k++) { if (k > num2) { stringBuilder.AppendLine(); } stringBuilder.Append(deltas[k].FormatRichText()); } ((TMP_Text)_colTexts[j]).text = stringBuilder.ToString(); } } private static bool TryGetHighlightedCard(out CardInfo card) { card = null; CardChoice val = CardChoice.instance; if ((Object)(object)val == (Object)null || !val.IsPicking || SpawnedCardsField == null || SelectedCardField == null) { return false; } if (!(SpawnedCardsField.GetValue(val) is List list) || list.Count == 0) { return false; } int num = (int)SelectedCardField.GetValue(val); num = Mathf.Clamp(num, 0, list.Count - 1); GameObject val2 = list[num]; if ((Object)(object)val2 == (Object)null) { return false; } card = val2.GetComponent(); if ((Object)(object)card == (Object)null) { card = val2.GetComponentInChildren(); } return (Object)(object)card != (Object)null; } private static Player GetLocalHumanPlayer() { if ((Object)(object)PlayerManager.instance == (Object)null) { return null; } foreach (Player player in PlayerManager.instance.players) { if ((Object)(object)player == (Object)null) { continue; } PlayerAPI component = ((Component)player).GetComponent(); if (component == null || !((Behaviour)component).enabled) { object value = AccessTools.Field(typeof(CharacterData), "view").GetValue(player.data); if (value == null) { return player; } if ((bool)AccessTools.Property(value.GetType(), "IsMine").GetValue(value, null)) { return player; } } } return null; } private void SetVisible(bool visible) { if ((Object)(object)_canvas != (Object)null) { ((Component)_canvas).gameObject.SetActive(visible); } } [IteratorStateMachine(typeof(d__20))] private IEnumerator OnPickSequenceEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } } public class PickStatsController : MonoBehaviour { [CompilerGenerated] private sealed class d__14 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PickStatsController <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; PickStatsController pickStatsController = <>4__this; if (num != 0) { return false; } <>1__state = -1; IOLog.Line("Pick sequence ended — auto-closing stats window."); pickStatsController.EndPickPhase("HookPickEnd"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; IOLog.Line($"Single player pick ended (picker={currentPickerID}); keeping stats UI up until pick sequence ends."); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static PickStatsController instance; public static bool isPickPhase; public static int currentPickerID = -1; private Canvas _canvas; private StatsPopup _popup; private GameObject _showStatsBtnGo; private void Awake() { instance = this; BuildUI(); GameModeManager.AddHook("PlayerPickEnd", (Func)OnPlayerPickEnd); GameModeManager.AddHook("PickEnd", (Func)OnPickSequenceEnd); IOLog.Section("PickStatsController initialized"); } private void BuildUI() { //IL_0036: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown _canvas = UIHelper.CreateFullscreenCanvas("IO_PickStatsCanvas", 160); RectTransform component = ((Component)_canvas).GetComponent(); Button val = UIHelper.AnchorButton(component, "ShowStatsBtn", "Show Stats", new Vector2(0.02f, 0.02f), new Vector2(0.16f, 0.08f), new Color(0.18f, 0.35f, 0.55f, 1f), 24); ((UnityEvent)val.onClick).AddListener(new UnityAction(TogglePopup)); _showStatsBtnGo = ((Component)val).gameObject; _popup = StatsPopup.Create((Transform)(object)component); ((Component)_canvas).gameObject.SetActive(false); } public void BeginPickPhase(int pickerID, string source) { if (pickerID >= 0) { if ((Object)(object)GetLocalHumanPlayer() == (Object)null) { HideAll(); IOLog.Line($"Pick phase for player {pickerID} (source={source}) — no local human, UI hidden."); return; } currentPickerID = pickerID; isPickPhase = true; ((Component)_canvas).gameObject.SetActive(true); _showStatsBtnGo.SetActive(true); CardDeltaPreviewOverlay.instance?.OnPickSequenceStarted(); IOLog.Line($"Pick phase active — picker={pickerID}, showing local stats (source={source})."); } } public void EndPickPhase(string source) { IOLog.Line($"Pick phase ended (source={source}), was picker={currentPickerID}"); isPickPhase = false; currentPickerID = -1; CardDeltaPreviewOverlay.instance?.OnPickSequenceEnded(); HideAll(); } private void HideAll() { _popup?.Hide(); if ((Object)(object)_canvas != (Object)null) { ((Component)_canvas).gameObject.SetActive(false); } } private void TogglePopup() { Player localHumanPlayer = GetLocalHumanPlayer(); if (!((Object)(object)localHumanPlayer == (Object)null)) { if (_popup.IsVisible) { _popup.Hide(); } else { _popup.Show(localHumanPlayer); } } } private static Player GetLocalHumanPlayer() { if ((Object)(object)PlayerManager.instance == (Object)null) { return null; } foreach (Player player in PlayerManager.instance.players) { if ((Object)(object)player == (Object)null) { continue; } PlayerAPI component = ((Component)player).GetComponent(); if (component == null || !((Behaviour)component).enabled) { object value = AccessTools.Field(typeof(CharacterData), "view").GetValue(player.data); if (value == null) { return player; } if ((bool)AccessTools.Property(value.GetType(), "IsMine").GetValue(value, null)) { return player; } } } return null; } [IteratorStateMachine(typeof(d__13))] private IEnumerator OnPlayerPickEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0); } [IteratorStateMachine(typeof(d__14))] private IEnumerator OnPickSequenceEnd(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this }; } private void Update() { if ((Object)(object)_canvas != (Object)null && ((Component)_canvas).gameObject.activeSelf && !IsGameActive()) { IOLog.Line("PickStatsController — game no longer active, hiding UI."); EndPickPhase("GameEnded"); } } private static bool IsGameActive() { if ((Object)(object)GameManager.instance == (Object)null) { return false; } if (!GameManager.instance.isPlaying) { return false; } if ((Object)(object)PlayerManager.instance == (Object)null) { return false; } if (PlayerManager.instance.players == null || PlayerManager.instance.players.Count == 0) { return false; } return true; } } internal class StatsPopup : MonoBehaviour { private readonly List _leftLines = new List(); private readonly List _rightLines = new List(); private RectTransform _root; private Player _player; public bool IsVisible => ((Component)this).gameObject.activeSelf; public static StatsPopup Create(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("IO_StatsPopup"); val.transform.SetParent(parent, false); StatsPopup statsPopup = val.AddComponent(); statsPopup.Build(); val.SetActive(false); return statsPopup; } private void Build() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0054: 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_006b: 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) //IL_007d: 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_008e: 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_00b3: 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_00e1: 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_0108: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_0206: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) _root = ((Component)this).gameObject.AddComponent(); _root.anchorMin = Vector2.zero; _root.anchorMax = Vector2.one; RectTransform root = _root; Vector2 offsetMin = (_root.offsetMax = Vector2.zero); root.offsetMin = offsetMin; GameObject val = new GameObject("Backdrop"); val.transform.SetParent(((Component)this).transform, false); RectTransform obj = val.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; offsetMin = (obj.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; ((Graphic)val.AddComponent()).color = new Color(0.02f, 0.02f, 0.05f, 1f); Transform transform = ((Component)this).transform; Vector2 anchorMin = new Vector2(0.12f, 0.08f); Vector2 anchorMax = new Vector2(0.88f, 0.92f); Color? bg = new Color(0.08f, 0.09f, 0.14f, 1f); RectTransform parent = UIHelper.CreatePanel(transform, "Panel", anchorMin, anchorMax, default(Vector2), default(Vector2), bg); UIHelper.CreateText((Transform)(object)UIHelper.CreatePanel((Transform)(object)parent, "Title", new Vector2(0f, 0.9f), Vector2.one), "TitleText", "Player Stats", 36, (TextAlignmentOptions)514); ((UnityEvent)UIHelper.AnchorButton(parent, "CloseBtn", "Close", new Vector2(0.82f, 0.91f), new Vector2(0.98f, 0.99f), new Color(0.45f, 0.12f, 0.12f), 22).onClick).AddListener(new UnityAction(Hide)); RectTransform parent2 = UIHelper.CreatePanel((Transform)(object)parent, "Columns", new Vector2(0.04f, 0.04f), new Vector2(0.96f, 0.88f)); RectTransform parent3 = UIHelper.CreatePanel((Transform)(object)parent2, "LeftColumn", new Vector2(0f, 0f), new Vector2(0.48f, 1f)); RectTransform parent4 = UIHelper.CreatePanel((Transform)(object)parent2, "RightColumn", new Vector2(0.52f, 0f), Vector2.one); BuildColumn(parent3, _leftLines, 12); BuildColumn(parent4, _rightLines, 12); } private static void BuildColumn(RectTransform parent, List sink, int lineCount) { //IL_0036: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0089: Unknown result type (might be due to invalid IL or missing references) float num = 1f / (float)lineCount; for (int i = 0; i < lineCount; i++) { float num2 = 1f - (float)i * num; float num3 = num2 - num; TextMeshProUGUI item = UIHelper.CreateText((Transform)(object)UIHelper.CreatePanel((Transform)(object)parent, $"Line{i}", new Vector2(0f, num3), new Vector2(1f, num2)), "Text", "—", 22, (TextAlignmentOptions)4097, (Color?)new Color(0.92f, 0.94f, 1f)); sink.Add(item); } } public void Show(Player player) { _player = player; ((Component)this).gameObject.SetActive(true); Refresh(); } public void Hide() { ((Component)this).gameObject.SetActive(false); _player = null; } private void Update() { if (IsVisible && !((Object)(object)_player == (Object)null)) { Refresh(); } } private void Refresh() { List stats = StatsReader.Collect(_player); ApplyColumn(_leftLines, stats, 0); ApplyColumn(_rightLines, stats, _leftLines.Count); } private static void ApplyColumn(List labels, List stats, int offset) { for (int i = 0; i < labels.Count; i++) { int num = offset + i; ((TMP_Text)labels[i]).text = ((num < stats.Count) ? stats[num].Text : string.Empty); } } } internal static class UIHelper { public static Canvas CreateFullscreenCanvas(string name, int sortOrder = 100) { //IL_0001: 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_000c: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) GameObject val = new GameObject(name); Object.DontDestroyOnLoad((Object)val); val.SetActive(false); Canvas val2 = val.AddComponent(); val2.renderMode = (RenderMode)0; val2.sortingOrder = sortOrder; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); val.AddComponent(); return val2; } public static RectTransform CreatePanel(Transform parent, string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 offsetMin = default(Vector2), Vector2 offsetMax = default(Vector2), Color? bg = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = anchorMin; obj.anchorMax = anchorMax; obj.offsetMin = offsetMin; obj.offsetMax = offsetMax; if (bg.HasValue) { ((Graphic)val.AddComponent()).color = bg.Value; } return obj; } public static TextMeshProUGUI CreateText(Transform parent, string name, string text, int fontSize = 24, TextAlignmentOptions alignment = 514, Color? color = null) { //IL_0001: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0076: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; TextMeshProUGUI obj2 = val.AddComponent(); ((TMP_Text)obj2).text = text; ((TMP_Text)obj2).fontSize = fontSize; ((TMP_Text)obj2).alignment = alignment; ((Graphic)obj2).color = (Color)(((??)color) ?? Color.white); return obj2; } public static Button AnchorButton(RectTransform parent, string name, string label, Vector2 anchorMin, Vector2 anchorMax, Color bgColor, int fontSize) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_006b: 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) //IL_007e: 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) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent((Transform)(object)parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = anchorMin; obj.anchorMax = anchorMax; Vector2 offsetMin = (obj.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; Image val2 = val.AddComponent(); ((Graphic)val2).color = bgColor; Button obj2 = val.AddComponent