using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using RoundsTheGathering.Data; using RoundsTheGathering.GameIntegration; using RoundsTheGathering.Networking; using RoundsTheGathering.UI; using TMPro; using UnboundLib; using UnboundLib.GameModes; using UnboundLib.Networking; using UnboundLib.Utils; using UnboundLib.Utils.UI; 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("RoundsTheGathering")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+661a91535814621160b5d94d61679bade4fe1c2d")] [assembly: AssemblyProduct("Deck picking ability for ROUNDS (like MAGIC)")] [assembly: AssemblyTitle("RoundsTheGathering")] [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 RoundsTheGathering { public static class CardPrerequisiteRegistry { private static readonly Dictionary _prerequisites = new Dictionary(); public static int Count => _prerequisites.Count; public static void RegisterPrerequisite(string cardName, string requiredCardName) { if (!string.IsNullOrEmpty(cardName) && !string.IsNullOrEmpty(requiredCardName)) { _prerequisites[cardName] = requiredCardName; } } public static bool HasPrerequisite(string cardName) { if (!string.IsNullOrEmpty(cardName)) { return _prerequisites.ContainsKey(cardName); } return false; } public static string GetPrerequisite(string cardName) { if (string.IsNullOrEmpty(cardName) || !_prerequisites.TryGetValue(cardName, out var value)) { return null; } return value; } public static bool IsUnlocked(string cardName, ICollection ownedCardNames) { string prerequisite = GetPrerequisite(cardName); if (string.IsNullOrEmpty(prerequisite)) { return true; } return ownedCardNames?.Contains(prerequisite) ?? false; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("RoundsTheGathering", "Deck picking ability for ROUNDS (like MAGIC)", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private void Awake() { //IL_001a: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; RTGLog.Section("Plugin Awake"); new Harmony("RoundsTheGathering").PatchAll(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); GameObject val = new GameObject("RTG_UIRoot"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); val.AddComponent(); val.AddComponent(); RTGLog.Line("Plugin RoundsTheGathering loaded."); } } internal static class RTGLog { private const string Sep = "====================="; public static void Section(string title) { Plugin.Logger.LogInfo((object)"====================="); Plugin.Logger.LogInfo((object)("[RTG] " + title)); Plugin.Logger.LogInfo((object)"====================="); } public static void Line(string message) { Plugin.Logger.LogInfo((object)("[RTG] " + message)); } public static void Warn(string message) { Plugin.Logger.LogWarning((object)("[RTG] " + message)); } public static void Error(string message) { Plugin.Logger.LogError((object)("[RTG] " + message)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "RoundsTheGathering"; public const string PLUGIN_NAME = "Deck picking ability for ROUNDS (like MAGIC)"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace RoundsTheGathering.UI { public class CreateDeckScreen : MonoBehaviour { public static CreateDeckScreen instance; private Canvas _canvas; private TMP_InputField _nameField; private TMP_InputField _maxSizeField; private Button _createBtn; private TextMeshProUGUI _errorText; private void Awake() { instance = this; BuildUI(); } private void BuildUI() { //IL_0040: 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_006a: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_01aa: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0295: 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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: 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_0334: 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_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Expected O, but got Unknown //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown _canvas = UIHelper.CreateFullscreenCanvas("RTG_CreateDeckScreen", 210); UIHelper.CreateDimmedBackground(((Component)_canvas).transform); Transform transform = ((Component)_canvas).transform; Vector2 anchorMin = new Vector2(0.28f, 0.12f); Vector2 anchorMax = new Vector2(0.72f, 0.88f); Color? bg = new Color(0.08f, 0.08f, 0.12f, 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.88f), Vector2.one), "TitleText", "Create New Deck", 34, (TextAlignmentOptions)514); UIHelper.CreateText((Transform)(object)UIHelper.CreatePanel((Transform)(object)parent, "NameLabel", new Vector2(0.05f, 0.74f), new Vector2(0.95f, 0.82f)), "Lbl", "Deck Name", 22, (TextAlignmentOptions)4097); _nameField = UIHelper.CreateInputField((Transform)(object)parent, "NameField", "Enter deck name...", Vector2.zero, Vector2.zero, 22, (ContentType)0); RectTransform component = ((Component)_nameField).GetComponent(); component.anchorMin = new Vector2(0.05f, 0.61f); component.anchorMax = new Vector2(0.95f, 0.73f); Vector2 offsetMin = (component.offsetMax = Vector2.zero); component.offsetMin = offsetMin; ((UnityEvent)(object)_nameField.onValueChanged).AddListener((UnityAction)delegate { Validate(); }); UIHelper.CreateText((Transform)(object)UIHelper.CreatePanel((Transform)(object)parent, "SizeLabel", new Vector2(0.05f, 0.48f), new Vector2(0.95f, 0.57f)), "Lbl", "Max Deck Size (default 50)", 22, (TextAlignmentOptions)4097); _maxSizeField = UIHelper.CreateInputField((Transform)(object)parent, "MaxSizeField", "50", Vector2.zero, Vector2.zero, 22, (ContentType)2); RectTransform component2 = ((Component)_maxSizeField).GetComponent(); component2.anchorMin = new Vector2(0.05f, 0.35f); component2.anchorMax = new Vector2(0.95f, 0.47f); offsetMin = (component2.offsetMax = Vector2.zero); component2.offsetMin = offsetMin; _maxSizeField.text = "50"; ((UnityEvent)(object)_maxSizeField.onValueChanged).AddListener((UnityAction)delegate { Validate(); }); RectTransform parent2 = UIHelper.CreatePanel((Transform)(object)parent, "ErrorPanel", new Vector2(0.05f, 0.26f), new Vector2(0.95f, 0.34f)); _errorText = UIHelper.CreateText((Transform)(object)parent2, "ErrorText", "", 18, (TextAlignmentOptions)514, (Color?)new Color(1f, 0.35f, 0.35f)); _createBtn = AnchorButton(parent, "CreateBtn", "Create Deck!", new Vector2(0.12f, 0.12f), new Vector2(0.88f, 0.24f), new Color(0.15f, 0.5f, 0.15f), 26); ((UnityEvent)_createBtn.onClick).AddListener(new UnityAction(OnCreateClicked)); ((UnityEvent)AnchorButton(parent, "BackBtn", "Back", new Vector2(0.05f, 0.02f), new Vector2(0.4f, 0.1f), new Color(0.3f, 0.3f, 0.3f), 20).onClick).AddListener(new UnityAction(OnBackClicked)); Validate(); ((Component)_canvas).gameObject.SetActive(false); } private 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_005b: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) 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