using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BingoAPI.Conditions; using BingoAPI.Events; using BingoAPI.Goals; using BingoAPI.Helpers; using BingoAPI.Models; using BingoAPI.Models.Settings; using BingoAPI.Networking; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Silksong.BingoSync.Configurations; using Silksong.BingoSync.Data; using Silksong.BingoSync.Exceptions; using Silksong.BingoSync.Extensions; using Silksong.BingoSync.Helpers; using Silksong.BingoSync.Patches; using Silksong.BingoSync.UI.Components; using Silksong.BingoSync.UI.Constants; using Silksong.BingoSync.UI.Containers; using Silksong.BingoSync.UI.Items; using Silksong.BingoSync.UI.Menus; using Silksong.ModMenu.Elements; using Silksong.ModMenu.Plugin; using Silksong.ModMenu.Screens; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("WarperSan")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Connects Silksong to BingoSync, letting you play bingo directly in-game")] [assembly: AssemblyFileVersion("1.2.1.0")] [assembly: AssemblyInformationalVersion("1.2.1+ba48522cc26b3a1d273431498be59bf018289fee")] [assembly: AssemblyProduct("Silksong.BingoSync")] [assembly: AssemblyTitle("Silksong.BingoSync")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/WarperSan/Silksong.BingoSync")] [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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Silksong.BingoSync { internal class Controller : IDisposable { public delegate void CardCallback(Card? card); public GoalPool Pool = new GoalPool(); public readonly EventDispatcher Events; private readonly Session _session; private Card? _card; private Task? _runningCardUpdate; private readonly GoalTracker _tracker; public Team Team => _session.Team; public bool IsConnected => _session.IsInRoom; public event CardCallback? OnCardUpdated; public Controller() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown Events = new EventDispatcher(); SubscribeToEvents(Events); _tracker = new GoalTracker(); _tracker.OnGoalMarked += new GoalChangedCallback(OnGoalMarked); _tracker.OnGoalCleared += new GoalChangedCallback(OnGoalCleared); _session = new Session(Events); } private void SubscribeToEvents(EventDispatcher events) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown events.OnSelfConnected += new ConnectionCallback(OnConnected); events.OnSelfSquareMarked += new MarkCallback(OnSquareMarked); events.OnOtherSquareMarked += new MarkCallback(OnSquareMarked); events.OnSelfSquareCleared += new ClearCallback(OnSquareCleared); events.OnOtherSquareCleared += new ClearCallback(OnSquareCleared); events.OnSelfCardGenerated += new GenerateCallback(OnCardGenerated); events.OnOtherCardGenerated += new GenerateCallback(OnCardGenerated); } private void UnsubscribeFromEvents(EventDispatcher events) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown events.OnSelfConnected -= new ConnectionCallback(OnConnected); events.OnSelfSquareMarked -= new MarkCallback(OnSquareMarked); events.OnOtherSquareMarked -= new MarkCallback(OnSquareMarked); events.OnSelfSquareCleared -= new ClearCallback(OnSquareCleared); events.OnOtherSquareCleared -= new ClearCallback(OnSquareCleared); events.OnSelfCardGenerated -= new GenerateCallback(OnCardGenerated); events.OnOtherCardGenerated -= new GenerateCallback(OnCardGenerated); } private void OnConnected(Player player) { UpdateCard(); } private void OnGoalMarked(Goal goal) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_card == null) { return; } int[] array = _card.FindByGoal(goal); int[] array2 = array; foreach (int num in array2) { if (!_card.IsMarkedBy(num, _session.Team)) { _session.MarkSquare(num, default(CancellationToken)); } } } private void OnGoalCleared(Goal goal) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_card == null) { return; } int[] array = _card.FindByGoal(goal); int[] array2 = array; foreach (int num in array2) { if (_card.IsMarkedBy(num, _session.Team)) { _session.ClearSquare(num, default(CancellationToken)); } } } private void OnSquareMarked(Player player, Square square, Team team) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) Card? card = _card; if (card != null) { card.Mark(square.Slot.Index, team); } this.OnCardUpdated?.Invoke(_card); } private void OnSquareCleared(Player player, Square square, Team team) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) Card? card = _card; if (card != null) { card.Unmark(square.Slot.Index, team); } this.OnCardUpdated?.Invoke(_card); } private void OnCardGenerated(Player player, bool isHidden) { UpdateCard(); } public Task Join(JoinRoomSettings settings) { return _session.JoinRoom(settings, default(CancellationToken)); } public Task Exit() { return _session.LeaveRoom(default(CancellationToken)); } public Task SetTeam(Team team) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _session.ChangeTeam(team, default(CancellationToken)); } private void UpdateCard() { if (_runningCardUpdate != null && !_runningCardUpdate.IsCompleted) { Log.Warning("An update of 'Card' is already pending."); return; } _runningCardUpdate = Task.Run(() => _session.GetCard(Pool, default(CancellationToken))); _runningCardUpdate.ContinueWith(delegate(Task task) { Card result = task.Result; _tracker.Clear(); if (result != null) { Goal[] allGoals = result.GetAllGoals(); foreach (Goal val in allGoals) { _tracker.TryAdd(val); } } _card = result; this.OnCardUpdated?.Invoke(_card); }); } public void Evaluate() { _tracker.Evaluate(); } public void Dispose() { UnsubscribeFromEvents(Events); _session.Dispose(); } } internal static class ConfigMenu { public static AbstractMenuScreen Create(Configuration configuration) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown AbstractMenuScreen[] array = (AbstractMenuScreen[])(object)new AbstractMenuScreen[4] { CreateGeneralConfig(configuration.General), CreateJoinConfig(configuration.Join), CreateBoardConfig(configuration.Board), CreateExperimentalConfig(configuration.Experimental) }; PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit(Plugin.Name), 8); AbstractMenuScreen[] array2 = array; foreach (AbstractMenuScreen val2 in array2) { TextButton val3 = new TextButton(val2); val.Add((MenuElement)(object)val3); } return (AbstractMenuScreen)(object)val.Build(); } private static AbstractMenuScreen CreateGeneralConfig(GeneralConfig config) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("General"), 8); MenuElement val2 = default(MenuElement); if (ConfigEntryFactory.GenerateBoolElement((ConfigEntryBase)(object)config.UseAdvancedTeams, ref val2)) { val.Add(val2); } return (AbstractMenuScreen)(object)val.Build(); } private static AbstractMenuScreen CreateJoinConfig(JoinConfig config) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("Join"), 8); MenuElement val2 = default(MenuElement); if (ConfigEntryFactory.GenerateStringElement((ConfigEntryBase)(object)config.Nickname, ref val2)) { val.Add(val2); } MenuElement val3 = default(MenuElement); if (ConfigEntryFactory.GenerateKeyCodeElement((ConfigEntryBase)(object)config.ToggleUI, ref val3)) { val.Add(val3); } return (AbstractMenuScreen)(object)val.Build(); } private static AbstractMenuScreen CreateBoardConfig(BoardConfig config) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("Board"), 8); MenuElement val2 = default(MenuElement); if (ConfigEntryFactory.GenerateKeyCodeElement((ConfigEntryBase)(object)config.ToggleUI, ref val2)) { val.Add(val2); } return (AbstractMenuScreen)(object)val.Build(); } private static AbstractMenuScreen CreateExperimentalConfig(ExperimentalConfig config) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit("Experimental"), 8); TextLabel val2 = new TextLabel(LocalizedText.op_Implicit("Theses settings are experimental and can cause performance issues")); ((Graphic)val2.Text).color = Color.yellow; val2.Text.fontSize = 30; val.Add((MenuElement)(object)val2); MenuElement val3 = default(MenuElement); if (ConfigEntryFactory.GenerateBoolElement((ConfigEntryBase)(object)config.EvaluateOnHeroUpdate, ref val3)) { val.Add(val3); } return (AbstractMenuScreen)(object)val.Build(); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("dev.warpersan.silksong.bingosync", "Silksong.BingoSync", "1.2.1")] public class Plugin : BaseUnityPlugin, IModMenuCustomMenu, IModMenuInterface { internal static readonly Controller Controller = new Controller(); public const string Id = "dev.warpersan.silksong.bingosync"; public static string Name => "Silksong.BingoSync"; public static string Version => "1.2.1"; public AbstractMenuScreen BuildCustomMenu() { return ConfigMenu.Create(Configuration.SafeInstance); } private void Awake() { Log.Logger = Log.LogCore; Configuration.Load(((BaseUnityPlugin)this).Config); Patch.ApplyAll(); Log.Info("dev.warpersan.silksong.bingosync v" + Version + " has loaded!"); } private void Start() { ConditionAttribute.AddAll(); string absolutePath = Silksong.BingoSync.Helpers.Path.GetAbsolutePath("Goals/"); GoalPool val = GoalLoader.LoadPoolFromFolder(absolutePath); List list = new List(); foreach (Goal item in val) { list.Add(new { name = item.Name }); } Log.Info(JsonConvert.SerializeObject((object)list)); Controller.Pool = val; Log.Info($"Loaded '{val.Count}' goals."); } } } namespace Silksong.BingoSync.UI.Menus { internal class ConnectionMenu : MonoBehaviour { private enum State { Offline, Connecting, Online, Disconnecting } private State _state; private CanvasGroup? _canvasGroup; private Button? _actionButton; private JoinForm? _joinForm; private TeamPicker? _teamPicker; private void SetOnline() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) _state = State.Online; _joinForm?.DisableInputs(); if ((Object)(object)_teamPicker != (Object)null) { _teamPicker.EnableInputs(); _teamPicker.SetTeam(Plugin.Controller.Team); } } private void SetOffline() { _state = State.Offline; _joinForm?.EnableInputs(); if ((Object)(object)_teamPicker != (Object)null) { _teamPicker.DisableInputs(); _teamPicker.SetTeam((Team)0); } } private void OnActionClicked() { State state = _state; if ((state == State.Connecting || state == State.Disconnecting) ? true : false) { Log.Warning($"State '{_state}' has no action assigned."); } else if (_state == State.Offline) { JoinRoom(); } else if (_state == State.Online) { LeaveRoom(); } } private void OnTeamSelected(Team team) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (_state != State.Online) { Log.Warning("Cannot change team without being online."); } else { ChangeTeam(team); } } private void ToggleVisibility() { if (!((Object)(object)_canvasGroup == (Object)null)) { bool flag = _canvasGroup.alpha > 0f; _canvasGroup.alpha = (flag ? 0f : 1f); } } private void Update() { switch (_state) { case State.Offline: _actionButton?.SetText("Join"); break; case State.Connecting: _actionButton?.SetText("Connecting..."); break; case State.Online: _actionButton?.SetText("Leave"); break; case State.Disconnecting: _actionButton?.SetText("Disconnecting..."); break; default: throw new ArgumentOutOfRangeException(); } } private async Task JoinRoom() { if (_state != State.Offline) { throw new InvalidOperationException(); } if ((Object)(object)_joinForm == (Object)null) { throw new NullReferenceException("No 'JoinForm' assigned."); } _joinForm.DisableInputs(); JoinRoomSettings settings = _joinForm.GetSettings(); try { _state = State.Connecting; if (!(await Plugin.Controller.Join(settings))) { SetOffline(); Log.Error("Failed to join the room '" + settings.Code + "'."); } else { SetOnline(); } } catch (Exception arg) { SetOffline(); Log.Error($"Error while joining the room '{settings.Code}': {arg}"); } } private async Task LeaveRoom() { if (_state != State.Online) { throw new InvalidOperationException(); } _teamPicker?.DisableInputs(); try { _state = State.Disconnecting; if (!(await Plugin.Controller.Exit())) { SetOnline(); Log.Error("Failed to exit the room."); } else { SetOffline(); } } catch (Exception arg) { SetOnline(); Log.Error($"Error while joining the room: {arg}"); } } private async Task ChangeTeam(Team team) { //IL_0016: 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) if (_state != State.Online) { throw new InvalidOperationException(); } Controller controller = Plugin.Controller; if (controller == null) { throw new NullReferenceException("No 'Controller' assigned."); } if ((Object)(object)_teamPicker == (Object)null) { throw new NullReferenceException("No 'TeamPicker' assigned."); } _teamPicker.DisableInputs(); try { if (!(await controller.SetTeam(team))) { Log.Error("Failed to change team."); } } catch (Exception arg) { Log.Error($"Error while joining the room: {arg}"); } _teamPicker.SetTeam(controller.Team); _teamPicker.EnableInputs(); } public static ConnectionMenu Create(JoinRoomSettings settings) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //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_003b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ConnectionMenu"); ConnectionMenu connectionMenu = val.AddComponent(); RectTransform val2 = val.AddComponent(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; VerticalLayoutGroup val3 = val.AddComponent(); ((HorizontalOrVerticalLayoutGroup)val3).spacing = 10f; ((LayoutGroup)val3).childAlignment = (TextAnchor)7; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = false; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandHeight = false; connectionMenu._canvasGroup = val.AddComponent(); JoinForm joinForm = JoinForm.Create(); ((Component)joinForm).transform.SetParent(((Component)val3).transform, false); joinForm.SetSettings(settings); connectionMenu._joinForm = joinForm; TeamPicker teamPicker = TeamPicker.Create(connectionMenu.OnTeamSelected); ((Component)teamPicker).transform.SetParent(((Component)val3).transform, false); connectionMenu._teamPicker = teamPicker; Button button = Button.Create(connectionMenu.OnActionClicked); ((Component)button).transform.SetParent(val.transform, false); connectionMenu._actionButton = button; CallOnInput callOnInput = val.AddComponent(); callOnInput.SetInput(Configuration.SafeInstance.Join.ToggleUI, connectionMenu.ToggleVisibility); connectionMenu.SetOffline(); return connectionMenu; } } } namespace Silksong.BingoSync.UI.Items { internal class BingoCell : MonoBehaviour { private Text? _text; private Dictionary? _teamMarks; public void SetSquare(Goal goal, Team teams) { //IL_0040: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Text? text = _text; if (text != null) { text.text = goal.Name; } if (_teamMarks == null) { return; } foreach (KeyValuePair teamMark in _teamMarks) { teamMark.Deconstruct(out var key, out var value); Team val = key; Image val2 = value; bool active = ((Enum)teams).HasFlag((Enum)(object)val); ((Component)val2).gameObject.SetActive(active); } } public void AddTeam(Team team) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (_teamMarks != null && _teamMarks.TryGetValue(team, out Image value)) { ((Component)value).gameObject.SetActive(true); } } public void RemoveTeam(Team team) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (_teamMarks != null && _teamMarks.TryGetValue(team, out Image value)) { ((Component)value).gameObject.SetActive(false); } } public static BingoCell Create() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00b1: Expected O, but got Unknown //IL_00d0: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0179: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BingoCell"); val.AddComponent(); BingoCell bingoCell = val.AddComponent(); GameObject val2 = new GameObject("Background"); val2.transform.SetParent(val.transform, false); Image val3 = val2.AddComponent(); ((Graphic)val3).color = new Color(0.1f, 0.1f, 0.1f, 1f); VerticalLayoutGroup val4 = val2.AddComponent(); ((LayoutGroup)val4).childAlignment = (TextAnchor)4; Dictionary dictionary = new Dictionary(); foreach (Team value in Enum.GetValues(typeof(Team))) { if ((int)value != 0) { GameObject val6 = new GameObject(((object)value/*cast due to .constrained prefix*/).ToString()); val6.transform.SetParent(((Component)val4).transform, false); Image val7 = val6.AddComponent(); ((Graphic)val7).color = Colors.GetColor(value); dictionary.Add(value, val7); } } GameObject val8 = new GameObject("Darkener"); val8.transform.SetParent(val.transform, false); Image val9 = val8.AddComponent(); ((Graphic)val9).color = new Color(0f, 0f, 0f, 0.4f); GameObject val10 = new GameObject("Text"); val10.transform.SetParent(val.transform, false); RectTransform val11 = val10.AddComponent(); val11.anchorMin = Vector2.zero; val11.anchorMax = Vector2.one; val11.offsetMin = Vector2.one * 5f; val11.offsetMax = -Vector2.one * 5f; Text val12 = val10.AddComponent(); val12.fontSize = 12; val12.text = "OwO"; val12.alignment = (TextAnchor)3; ((Graphic)val12).color = Color.white; val12.font = Fonts.Normal; bingoCell._text = val12; bingoCell._teamMarks = dictionary; return bingoCell; } } internal class TeamPickerButton : MonoBehaviour { private Outline? _outline; private Action? _onClick; public Team Team { get; private set; } public void Select() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_outline != (Object)null) { ((Shadow)_outline).effectColor = Color.white; } } public void Unselect() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_outline != (Object)null) { ((Shadow)_outline).effectColor = Team.GetColor(); } } private void OnClick() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) _onClick?.Invoke(Team); } public static TeamPickerButton Create(Team team, Action onClick) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0071: 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_008e: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TeamPickerButton"); val.AddComponent(); TeamPickerButton teamPickerButton = val.AddComponent(); teamPickerButton.Team = team; teamPickerButton._onClick = onClick; Image val2 = val.AddComponent(); Color black = Color.black; black.a = 0.6f; ((Graphic)val2).color = black; Button val3 = val.AddComponent