using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using CardMagnifier.MonoBehaviors; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnboundLib; using UnboundLib.GameModes; using UnboundLib.Utils.UI; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CardMagnifier")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CardMagnifier")] [assembly: AssemblyTitle("CardMagnifier")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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; } } } namespace CardMagnifier { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.pudassassin.rounds.CardMagnifier", "Card Magnifier", "0.2.1")] [BepInProcess("Rounds.exe")] public class CardMagnifier : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__70_0; public static UnityAction <>9__70_1; public static UnityAction <>9__70_2; public static UnityAction <>9__71_1; public static UnityAction <>9__71_2; public static UnityAction <>9__72_11; public static UnityAction <>9__72_12; public static UnityAction <>9__73_4; public static UnityAction <>9__73_5; public static UnityAction <>9__75_0; internal void b__70_0() { } internal void b__70_1() { } internal void b__70_2() { } internal void b__71_1() { CardZoomDemoMode = false; SyncOptionsMenus(); } internal void b__71_2() { CardZoomDemoMode = false; SyncOptionsMenus(); } internal void b__72_11() { CardZoomDemoMode = false; SyncOptionsMenus(); } internal void b__72_12() { CardZoomDemoMode = false; SyncOptionsMenus(); } internal void b__73_4() { CardBarPreviewDemoMode = false; SyncOptionsMenus(); } internal void b__73_5() { CardBarPreviewDemoMode = false; SyncOptionsMenus(); } internal void b__75_0() { } } public const string ModId = "com.pudassassin.rounds.CardMagnifier"; public const string ModName = "Card Magnifier"; public const string Version = "0.2.1"; public const string CompatibilityModName = "CardMagnifier"; public static GameObject timerUI = null; public static Vector3 timerUIPos = new Vector3(-200f, -400f, 0f); private static Color easyChangeColor = new Color(0.521f, 1f, 0.521f, 1f); private static Color hardChangeColor = new Color(1f, 0.521f, 0.521f, 1f); public const float RealtimeToRefresh = 0.05f; public static float RealtimeLastRefreshed; public static bool CardZoomDemoMode = false; public static bool CardBarPreviewDemoMode = false; public static int PickTimerSearchCount = 5; internal static Dictionary> TogglesToSync = new Dictionary>(); internal static Dictionary> SlidersToSync = new Dictionary>(); public static float CardToZoomPointFactor { get { return GetFloat("CardToZoomPointFactor", 0.6f); } set { SetFloat("CardToZoomPointFactor", value); } } public static float ZoomPointXOffset { get { return GetFloat("ZoomPointXOffset"); } set { SetFloat("ZoomPointXOffset", value); } } public static float ZoomPointYOffset { get { return GetFloat("ZoomPointYOffset", -8f); } set { SetFloat("ZoomPointYOffset", value); } } public static float ZoomScale { get { return GetFloat("ZoomScale", 1.35f); } set { SetFloat("ZoomScale", value); } } public static bool ZoomToAbsoluteSize { get { return GetBool("ZoomToAbsoluteSize", defaultValue: true); } set { SetBool("ZoomToAbsoluteSize", value); } } public static bool ReorientCard { get { return GetBool("ReorientCard"); } set { SetBool("ReorientCard", value); } } public static float ZoomTime { get { return GetFloat("ZoomTime", 0.3f); } set { SetFloat("ZoomTime", value); } } public static bool DecreaseDiscardMotions { get { return GetBool("DecreaseDiscardMotions"); } set { SetBool("DecreaseDiscardMotions", value); } } public static bool DisableCardBobbingEffect { get { return GetBool("DisableCardBobbingEffect"); } set { SetBool("DisableCardBobbingEffect", value); } } public static bool DisableCardFlippingEffect { get { return GetBool("DisableCardFlippingEffect"); } set { SetBool("DisableCardFlippingEffect", value); } } public static float CardBarPreviewXOveride { get { return GetFloat("CardBarPreviewXOveride", 25f); } set { SetFloat("CardBarPreviewXOveride", value); } } public static float CardBarPreviewYOveride { get { return GetFloat("CardBarPreviewYOveride"); } set { SetFloat("CardBarPreviewYOveride", value); } } public static float CardBarPreviewScaleOveride { get { return GetFloat("CardBarPreviewScaleOveride", 1.35f); } set { SetFloat("CardBarPreviewScaleOveride", value); } } internal static string ConfigKey(string name) { return "CardMagnifier_" + name.ToLower(); } internal static bool GetBool(string name, bool defaultValue = false) { return PlayerPrefs.GetInt(ConfigKey(name), defaultValue ? 1 : 0) == 1; } internal static void SetBool(string name, bool value) { PlayerPrefs.SetInt(ConfigKey(name), value ? 1 : 0); } internal static int GetInt(string name, int defaultValue = 0) { return PlayerPrefs.GetInt(ConfigKey(name), defaultValue); } internal static void SetInt(string name, int value) { PlayerPrefs.SetInt(ConfigKey(name), value); } internal static float GetFloat(string name, float defaultValue = 0f) { return PlayerPrefs.GetFloat(ConfigKey(name), defaultValue); } internal static void SetFloat(string name, float value) { PlayerPrefs.SetFloat(ConfigKey(name), value); } private static void VanillaPlusPreset() { CardToZoomPointFactor = 0.6f; ZoomPointXOffset = 0f; ZoomPointYOffset = -8f; ZoomScale = 1.35f; ZoomToAbsoluteSize = true; ReorientCard = false; ZoomTime = 0.2f; DecreaseDiscardMotions = false; DisableCardBobbingEffect = false; DisableCardFlippingEffect = false; CardEnlargerDemo.DemoCardZoomRefresh(); } private static void FancyZoomPreset() { CardToZoomPointFactor = 1f; ZoomPointXOffset = 0f; ZoomPointYOffset = 3.25f; ZoomScale = 1.4f; ZoomToAbsoluteSize = true; ReorientCard = true; ZoomTime = 0.3f; DecreaseDiscardMotions = false; DisableCardBobbingEffect = false; DisableCardFlippingEffect = false; CardEnlargerDemo.DemoCardZoomRefresh(); } private static void InstantZoomPreset() { CardToZoomPointFactor = 1f; ZoomPointXOffset = 0f; ZoomPointYOffset = 3.25f; ZoomScale = 1.4f; ZoomToAbsoluteSize = true; ReorientCard = true; ZoomTime = 0.001f; DecreaseDiscardMotions = false; DisableCardBobbingEffect = false; DisableCardFlippingEffect = false; CardEnlargerDemo.DemoCardZoomRefresh(); } private static void ReduceMotionOverride() { ZoomTime = 0.001f; DecreaseDiscardMotions = true; DisableCardBobbingEffect = true; DisableCardFlippingEffect = true; CardEnlargerDemo.DemoCardZoomRefresh(); } private static void InitializeOptionsDictionaries() { if (!SlidersToSync.Keys.Contains("CardToZoomPointFactor")) { SlidersToSync["CardToZoomPointFactor"] = new List(); } if (!SlidersToSync.Keys.Contains("ZoomPointXOffset")) { SlidersToSync["ZoomPointXOffset"] = new List(); } if (!SlidersToSync.Keys.Contains("ZoomPointYOffset")) { SlidersToSync["ZoomPointYOffset"] = new List(); } if (!SlidersToSync.Keys.Contains("ZoomScale")) { SlidersToSync["ZoomScale"] = new List(); } if (!TogglesToSync.Keys.Contains("ZoomToAbsoluteSize")) { TogglesToSync["ZoomToAbsoluteSize"] = new List(); } if (!TogglesToSync.Keys.Contains("ReorientCard")) { TogglesToSync["ReorientCard"] = new List(); } if (!SlidersToSync.Keys.Contains("ZoomTime")) { SlidersToSync["ZoomTime"] = new List(); } if (!TogglesToSync.Keys.Contains("DecreaseDiscardMotions")) { TogglesToSync["DecreaseDiscardMotions"] = new List(); } if (!TogglesToSync.Keys.Contains("DisableCardBobbingEffect")) { TogglesToSync["DisableCardBobbingEffect"] = new List(); } if (!TogglesToSync.Keys.Contains("DisableCardFlippingEffect")) { TogglesToSync["DisableCardFlippingEffect"] = new List(); } if (!SlidersToSync.Keys.Contains("CardBarPreviewXOveride")) { SlidersToSync["CardBarPreviewXOveride"] = new List(); } if (!SlidersToSync.Keys.Contains("CardBarPreviewYOveride")) { SlidersToSync["CardBarPreviewYOveride"] = new List(); } if (!SlidersToSync.Keys.Contains("CardBarPreviewScaleOveride")) { SlidersToSync["CardBarPreviewScaleOveride"] = new List(); } } private static void SyncOptionsMenus(int recurse = 3) { foreach (Slider item in SlidersToSync["CardToZoomPointFactor"]) { item.value = CardToZoomPointFactor; } foreach (Slider item2 in SlidersToSync["ZoomPointXOffset"]) { item2.value = ZoomPointXOffset; } foreach (Slider item3 in SlidersToSync["ZoomPointYOffset"]) { item3.value = ZoomPointYOffset; } foreach (Slider item4 in SlidersToSync["ZoomScale"]) { item4.value = ZoomScale; } foreach (Toggle item5 in TogglesToSync["ZoomToAbsoluteSize"]) { item5.isOn = ZoomToAbsoluteSize; } foreach (Toggle item6 in TogglesToSync["ReorientCard"]) { item6.isOn = ReorientCard; } foreach (Slider item7 in SlidersToSync["ZoomTime"]) { item7.value = ZoomTime; } foreach (Toggle item8 in TogglesToSync["DecreaseDiscardMotions"]) { item8.isOn = DecreaseDiscardMotions; } foreach (Toggle item9 in TogglesToSync["DisableCardBobbingEffect"]) { item9.isOn = DisableCardBobbingEffect; } foreach (Toggle item10 in TogglesToSync["DisableCardFlippingEffect"]) { item10.isOn = DisableCardFlippingEffect; } foreach (Slider item11 in SlidersToSync["CardBarPreviewXOveride"]) { item11.value = CardBarPreviewXOveride; } foreach (Slider item12 in SlidersToSync["CardBarPreviewYOveride"]) { item12.value = CardBarPreviewYOveride; } foreach (Slider item13 in SlidersToSync["CardBarPreviewScaleOveride"]) { item13.value = CardBarPreviewScaleOveride; } if (recurse > 0) { SyncOptionsMenus(recurse - 1); } } private static bool RefreshCheck() { if (Time.time > RealtimeLastRefreshed + 0.05f) { RealtimeLastRefreshed = Time.time; return true; } return false; } private static void UpdateAndRefreshCardZoom() { if (RefreshCheck()) { CardEnlargerDemo.DemoCardZoomRefresh(); } } private static void UpdateAndRefreshCardBar() { if (RefreshCheck()) { CardEnlargerDemo.DemoCardBarPreviewRefresh(); } } private static void NewGUI(GameObject menu) { //IL_006e: 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_0079: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown InitializeOptionsDictionaries(); TextMeshProUGUI val = default(TextMeshProUGUI); MenuHandler.CreateText("Card Magnifier Options", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText(" ", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); object obj = <>c.<>9__70_0; if (obj == null) { UnityAction val2 = delegate { }; <>c.<>9__70_0 = val2; obj = (object)val2; } GameObject menu2 = MenuHandler.CreateMenu("Presets", (UnityAction)obj, menu, 60, true, true, ((Component)menu.transform.parent).gameObject, true, -1); PresetsMenu(menu2); object obj2 = <>c.<>9__70_1; if (obj2 == null) { UnityAction val3 = delegate { }; <>c.<>9__70_1 = val3; obj2 = (object)val3; } GameObject menu3 = MenuHandler.CreateMenu("Card Zoom Setting", (UnityAction)obj2, menu, 60, true, true, ((Component)menu.transform.parent).gameObject, true, -1); CardZoomSetting(menu3); object obj3 = <>c.<>9__70_2; if (obj3 == null) { UnityAction val4 = delegate { }; <>c.<>9__70_2 = val4; obj3 = (object)val4; } GameObject menu4 = MenuHandler.CreateMenu("CardBar Preview Setting", (UnityAction)obj3, menu, 60, true, true, ((Component)menu.transform.parent).gameObject, true, -1); CardBarSetting(menu4); MenuHandler.CreateText(" ", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); } private static void PresetsMenu(GameObject menu) { //IL_000e: 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_0030: Expected O, but got Unknown //IL_003e: 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_0060: Expected O, but got Unknown //IL_006e: 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_0090: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Expected O, but got Unknown MenuHandler.CreateButton("Vanilla+", menu, new UnityAction(VanillaPlusPreset), 60, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateButton("Fancy Zoom*", menu, new UnityAction(FancyZoomPreset), 60, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateButton("Insta-Zoom!", menu, new UnityAction(InstantZoomPreset), 60, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); TextMeshProUGUI val = default(TextMeshProUGUI); MenuHandler.CreateText("* motion-sickness warning", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText(" ", menu, ref val, 20, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateButton("Reduce Card Motions", menu, new UnityAction(ReduceMotionOverride), 60, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText("(disable motion-sickness inducing motions in the current setting)", menu, ref val, 20, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText(" ", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateButton("Toggle Demo", menu, new UnityAction(ToggleDemo), 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText("RMB-drag to move demo card around, NUMPAD+/- to scale 'starting size', NUMPAD* to reset to default scale.", menu, ref val, 20, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); MenuHandler.CreateText(" ", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); UnityEvent goBackEvent = menu.GetComponentInChildren(true).goBackEvent; object obj = <>c.<>9__71_1; if (obj == null) { UnityAction val2 = delegate { CardZoomDemoMode = false; SyncOptionsMenus(); }; <>c.<>9__71_1 = val2; obj = (object)val2; } goBackEvent.AddListener((UnityAction)obj); ButtonClickedEvent onClick = ((Component)menu.transform.Find("Group/Back")).gameObject.GetComponent