Decompiled source of CardMagnifier v0.2.1

CardMagnifier.dll

Decompiled 3 months ago
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 <NewGUI>b__70_0()
			{
			}

			internal void <NewGUI>b__70_1()
			{
			}

			internal void <NewGUI>b__70_2()
			{
			}

			internal void <PresetsMenu>b__71_1()
			{
				CardZoomDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <PresetsMenu>b__71_2()
			{
				CardZoomDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <CardZoomSetting>b__72_11()
			{
				CardZoomDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <CardZoomSetting>b__72_12()
			{
				CardZoomDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <CardBarSetting>b__73_4()
			{
				CardBarPreviewDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <CardBarSetting>b__73_5()
			{
				CardBarPreviewDemoMode = false;
				SyncOptionsMenus();
			}

			internal void <Start>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<string, List<Toggle>> TogglesToSync = new Dictionary<string, List<Toggle>>();

		internal static Dictionary<string, List<Slider>> SlidersToSync = new Dictionary<string, List<Slider>>();

		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<Slider>();
			}
			if (!SlidersToSync.Keys.Contains("ZoomPointXOffset"))
			{
				SlidersToSync["ZoomPointXOffset"] = new List<Slider>();
			}
			if (!SlidersToSync.Keys.Contains("ZoomPointYOffset"))
			{
				SlidersToSync["ZoomPointYOffset"] = new List<Slider>();
			}
			if (!SlidersToSync.Keys.Contains("ZoomScale"))
			{
				SlidersToSync["ZoomScale"] = new List<Slider>();
			}
			if (!TogglesToSync.Keys.Contains("ZoomToAbsoluteSize"))
			{
				TogglesToSync["ZoomToAbsoluteSize"] = new List<Toggle>();
			}
			if (!TogglesToSync.Keys.Contains("ReorientCard"))
			{
				TogglesToSync["ReorientCard"] = new List<Toggle>();
			}
			if (!SlidersToSync.Keys.Contains("ZoomTime"))
			{
				SlidersToSync["ZoomTime"] = new List<Slider>();
			}
			if (!TogglesToSync.Keys.Contains("DecreaseDiscardMotions"))
			{
				TogglesToSync["DecreaseDiscardMotions"] = new List<Toggle>();
			}
			if (!TogglesToSync.Keys.Contains("DisableCardBobbingEffect"))
			{
				TogglesToSync["DisableCardBobbingEffect"] = new List<Toggle>();
			}
			if (!TogglesToSync.Keys.Contains("DisableCardFlippingEffect"))
			{
				TogglesToSync["DisableCardFlippingEffect"] = new List<Toggle>();
			}
			if (!SlidersToSync.Keys.Contains("CardBarPreviewXOveride"))
			{
				SlidersToSync["CardBarPreviewXOveride"] = new List<Slider>();
			}
			if (!SlidersToSync.Keys.Contains("CardBarPreviewYOveride"))
			{
				SlidersToSync["CardBarPreviewYOveride"] = new List<Slider>();
			}
			if (!SlidersToSync.Keys.Contains("CardBarPreviewScaleOveride"))
			{
				SlidersToSync["CardBarPreviewScaleOveride"] = new List<Slider>();
			}
		}

		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("<b>Card Magnifier Options</b>", 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<GoBack>(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<Button>().onClick;
			object obj2 = <>c.<>9__71_2;
			if (obj2 == null)
			{
				UnityAction val3 = delegate
				{
					CardZoomDemoMode = false;
					SyncOptionsMenus();
				};
				<>c.<>9__71_2 = val3;
				obj2 = (object)val3;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj2);
			static void ToggleDemo()
			{
				CardZoomDemoMode = !CardZoomDemoMode;
			}
		}

		private static void CardZoomSetting(GameObject menu)
		{
			//IL_0078: 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_0171: 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_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_043d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Expected O, but got Unknown
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0548: Expected O, but got Unknown
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_058c: Expected O, but got Unknown
			TextMeshProUGUI val2 = default(TextMeshProUGUI);
			MenuHandler.CreateText("Card Zoom Setting", menu, ref val2, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText(" ", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			float cardToZoomPointFactor = CardToZoomPointFactor;
			UnityAction<float> obj = CardToZoomPointFactorChanged;
			Color? val3 = hardChangeColor;
			Slider item = default(Slider);
			MenuHandler.CreateSlider("Card-to-ZoomPoint Position", menu, 30, 0f, 1f, cardToZoomPointFactor, obj, ref item, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["CardToZoomPointFactor"].Add(item);
			MenuHandler.CreateText("ZoomPoint Position:", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			float zoomPointXOffset = ZoomPointXOffset;
			UnityAction<float> obj2 = ZoomPointXOffsetChanged;
			val3 = hardChangeColor;
			Slider item2 = default(Slider);
			MenuHandler.CreateSlider("X From Center", menu, 30, -50f, 50f, zoomPointXOffset, obj2, ref item2, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["ZoomPointXOffset"].Add(item2);
			float zoomPointYOffset = ZoomPointYOffset;
			UnityAction<float> obj3 = ZoomPointYOffsetChanged;
			val3 = hardChangeColor;
			Slider item3 = default(Slider);
			MenuHandler.CreateSlider("Y From Center", menu, 30, -25f, 25f, zoomPointYOffset, obj3, ref item3, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["ZoomPointYOffset"].Add(item3);
			MenuHandler.CreateText(" ", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			float zoomScale = ZoomScale;
			UnityAction<float> obj4 = ZoomScaleChanged;
			val3 = easyChangeColor;
			Slider item4 = default(Slider);
			MenuHandler.CreateSlider("Card Zoom Scale", menu, 30, 0.5f, 5f, zoomScale, obj4, ref item4, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["ZoomScale"].Add(item4);
			Toggle component = MenuHandler.CreateToggle(ZoomToAbsoluteSize, "Zoom Card to Fixed Size", menu, (UnityAction<bool>)ZoomToAbsoluteSizeChanged, 20, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null).GetComponent<Toggle>();
			TogglesToSync["ZoomToAbsoluteSize"].Add(component);
			Toggle component2 = MenuHandler.CreateToggle(ReorientCard, "Reorient Zoomed Card Upright", menu, (UnityAction<bool>)ReorientCardChanged, 20, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null).GetComponent<Toggle>();
			TogglesToSync["ReorientCard"].Add(component2);
			MenuHandler.CreateText(" ", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			float zoomTime = ZoomTime;
			UnityAction<float> obj5 = ZoomTimeChanged;
			val3 = easyChangeColor;
			Slider item5 = default(Slider);
			MenuHandler.CreateSlider("Card Zoom Animation Time", menu, 30, 0.001f, 1f, zoomTime, obj5, ref item5, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["ZoomTime"].Add(item5);
			Toggle component3 = MenuHandler.CreateToggle(DecreaseDiscardMotions, "Decrease Discard Card Motions", menu, (UnityAction<bool>)DecreaseDiscardMotionsChanged, 20, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null).GetComponent<Toggle>();
			TogglesToSync["DecreaseDiscardMotions"].Add(component3);
			Toggle component4 = MenuHandler.CreateToggle(DisableCardBobbingEffect, "Disable Card Bobbing when Highlighted", menu, (UnityAction<bool>)DisableCardBobbingEffectChanged, 20, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null).GetComponent<Toggle>();
			TogglesToSync["DisableCardBobbingEffect"].Add(component4);
			Toggle component5 = MenuHandler.CreateToggle(DisableCardFlippingEffect, "Disable Card Flipping when Revealed", menu, (UnityAction<bool>)DisableCardFlippingEffectChanged, 20, true, (Color?)easyChangeColor, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null).GetComponent<Toggle>();
			TogglesToSync["DisableCardFlippingEffect"].Add(component5);
			MenuHandler.CreateText(" ", menu, ref val2, 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 val2, 20, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText(" ", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			UnityEvent goBackEvent = menu.GetComponentInChildren<GoBack>(true).goBackEvent;
			object obj6 = <>c.<>9__72_11;
			if (obj6 == null)
			{
				UnityAction val4 = delegate
				{
					CardZoomDemoMode = false;
					SyncOptionsMenus();
				};
				<>c.<>9__72_11 = val4;
				obj6 = (object)val4;
			}
			goBackEvent.AddListener((UnityAction)obj6);
			ButtonClickedEvent onClick = ((Component)menu.transform.Find("Group/Back")).gameObject.GetComponent<Button>().onClick;
			object obj7 = <>c.<>9__72_12;
			if (obj7 == null)
			{
				UnityAction val5 = delegate
				{
					CardZoomDemoMode = false;
					SyncOptionsMenus();
				};
				<>c.<>9__72_12 = val5;
				obj7 = (object)val5;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj7);
			static void CardToZoomPointFactorChanged(float val)
			{
				CardToZoomPointFactor = val;
				UpdateAndRefreshCardZoom();
			}
			static void DecreaseDiscardMotionsChanged(bool val)
			{
				DecreaseDiscardMotions = val;
				UpdateAndRefreshCardZoom();
			}
			static void DisableCardBobbingEffectChanged(bool val)
			{
				DisableCardBobbingEffect = val;
				UpdateAndRefreshCardZoom();
			}
			static void DisableCardFlippingEffectChanged(bool val)
			{
				DisableCardFlippingEffect = val;
				UpdateAndRefreshCardZoom();
			}
			static void ReorientCardChanged(bool val)
			{
				ReorientCard = val;
				UpdateAndRefreshCardZoom();
			}
			static void ToggleDemo()
			{
				CardZoomDemoMode = !CardZoomDemoMode;
			}
			static void ZoomPointXOffsetChanged(float val)
			{
				ZoomPointXOffset = val;
				UpdateAndRefreshCardZoom();
			}
			static void ZoomPointYOffsetChanged(float val)
			{
				ZoomPointYOffset = val;
				UpdateAndRefreshCardZoom();
			}
			static void ZoomScaleChanged(float val)
			{
				ZoomScale = val;
				UpdateAndRefreshCardZoom();
			}
			static void ZoomTimeChanged(float val)
			{
				ZoomTime = val;
				UpdateAndRefreshCardZoom();
			}
			static void ZoomToAbsoluteSizeChanged(bool val)
			{
				ZoomToAbsoluteSize = val;
				UpdateAndRefreshCardZoom();
			}
		}

		private static void CardBarSetting(GameObject menu)
		{
			//IL_009f: 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_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Expected O, but got Unknown
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Expected O, but got Unknown
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Expected O, but got Unknown
			TextMeshProUGUI val2 = default(TextMeshProUGUI);
			MenuHandler.CreateText("CardBar Preview Setting", menu, ref val2, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText(" ", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("Preview Position:", menu, ref val2, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			float cardBarPreviewXOveride = CardBarPreviewXOveride;
			UnityAction<float> obj = CardBarPreviewXOverideChanged;
			Color? val3 = hardChangeColor;
			Slider item = default(Slider);
			MenuHandler.CreateSlider("X From Center", menu, 30, -50f, 50f, cardBarPreviewXOveride, obj, ref item, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["CardBarPreviewXOveride"].Add(item);
			float cardBarPreviewYOveride = CardBarPreviewYOveride;
			UnityAction<float> obj2 = CardBarPreviewYOverideChanged;
			val3 = hardChangeColor;
			Slider item2 = default(Slider);
			MenuHandler.CreateSlider("Y From Center", menu, 30, -50f, 50f, cardBarPreviewYOveride, obj2, ref item2, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["CardBarPreviewYOveride"].Add(item2);
			float cardBarPreviewScaleOveride = CardBarPreviewScaleOveride;
			UnityAction<float> obj3 = CardBarPreviewScaleOverideChanged;
			val3 = hardChangeColor;
			Slider item3 = default(Slider);
			MenuHandler.CreateSlider("CardBar Preview Size", menu, 30, 0.5f, 5f, cardBarPreviewScaleOveride, obj3, ref item3, false, (Color?)null, (Direction)0, true, val3, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			SlidersToSync["CardBarPreviewScaleOveride"].Add(item3);
			MenuHandler.CreateText(" ", menu, ref val2, 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);
			UnityEvent goBackEvent = menu.GetComponentInChildren<GoBack>(true).goBackEvent;
			object obj4 = <>c.<>9__73_4;
			if (obj4 == null)
			{
				UnityAction val4 = delegate
				{
					CardBarPreviewDemoMode = false;
					SyncOptionsMenus();
				};
				<>c.<>9__73_4 = val4;
				obj4 = (object)val4;
			}
			goBackEvent.AddListener((UnityAction)obj4);
			ButtonClickedEvent onClick = ((Component)menu.transform.Find("Group/Back")).gameObject.GetComponent<Button>().onClick;
			object obj5 = <>c.<>9__73_5;
			if (obj5 == null)
			{
				UnityAction val5 = delegate
				{
					CardBarPreviewDemoMode = false;
					SyncOptionsMenus();
				};
				<>c.<>9__73_5 = val5;
				obj5 = (object)val5;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj5);
			static void CardBarPreviewScaleOverideChanged(float val)
			{
				CardBarPreviewScaleOveride = val;
				UpdateAndRefreshCardBar();
			}
			static void CardBarPreviewXOverideChanged(float val)
			{
				CardBarPreviewXOveride = val;
				UpdateAndRefreshCardBar();
			}
			static void CardBarPreviewYOverideChanged(float val)
			{
				CardBarPreviewYOveride = val;
				UpdateAndRefreshCardBar();
			}
			static void ToggleDemo()
			{
				CardBarPreviewDemoMode = !CardBarPreviewDemoMode;
			}
		}

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.pudassassin.rounds.CardMagnifier");
			val.PatchAll();
		}

		private void Start()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			Unbound.RegisterClientSideMod("com.pudassassin.rounds.CardMagnifier");
			Unbound.RegisterCredits("Card Magnifier", new string[3] { "Pudassassin, Creator of GearUp Cards", "Willuwontu (coding guide)", "[Root] (UX testing and suggestion)" }, new string[1] { "github" }, new string[1] { "https://github.com/Pudassassin/CardMagnifier" });
			object obj = <>c.<>9__75_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
				};
				<>c.<>9__75_0 = val;
				obj = (object)val;
			}
			Unbound.RegisterMenu("Card Magnifier", (UnityAction)obj, (Action<GameObject>)NewGUI, (GameObject)null, true);
			GameModeManager.AddHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickStart);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)OnPointStart);
			((Component)this).gameObject.AddComponent<CardEnlargerDemo>();
		}

		public void Update()
		{
			CardBarPreviewRescaler.UpdateCurrentZoom();
		}

		public IEnumerator OnPlayerPickStart(IGameModeHandler gm)
		{
			CardEnlarger.UpdateConfigs();
			CardEnlarger.mapEmbiggenerScale = 1f;
			CardEnlarger.SetCameraPosCardPick();
			CardEnlarger.isCardPickPhase = true;
			if ((Object)(object)timerUI == (Object)null && PickTimerSearchCount > 0)
			{
				GameObject[] gameObjects = Resources.FindObjectsOfTypeAll(typeof(GameObject)) as GameObject[];
				GameObject[] array = gameObjects;
				foreach (GameObject item in array)
				{
					if (((Object)item).name == "TimerUI(Clone)")
					{
						timerUI = item;
						Debug.Log((object)"[CardMagnifier] Found TimerUI(Clone)");
						timerUI.transform.localPosition = new Vector3(0f, -390f, 0f);
						PickTimerSearchCount = 0;
						break;
					}
				}
				PickTimerSearchCount--;
			}
			else if ((Object)(object)timerUI != (Object)null)
			{
				timerUI.transform.localPosition = timerUIPos;
			}
			yield break;
		}

		public IEnumerator OnPointStart(IGameModeHandler gm)
		{
			CardEnlarger.SetCameraPosGameplay();
			yield break;
		}
	}
}
namespace CardMagnifier.Patches
{
	[HarmonyPatch(typeof(CardBar))]
	internal class CardBar_Patch
	{
		[HarmonyPostfix]
		[HarmonyPriority(0)]
		[HarmonyPatch("OnHover")]
		private static void OverrideCardBarPreviewTransform(GameObject ___currentCard)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			Transform val = ___currentCard.transform.Find("CardBase(Clone)/Canvas");
			if ((Object)(object)val != (Object)null)
			{
				Canvas component = ((Component)val).GetComponent<Canvas>();
				if ((Object)(object)component != (Object)null)
				{
					if ((int)component.renderMode != 2)
					{
						Debug.LogWarning((object)"[Card Magnifier] CardBar preview card is not in WorldSpace");
						return;
					}
				}
				else
				{
					Debug.LogWarning((object)"[Card Magnifier] Cannot check new CardBar preview card! (component)");
				}
			}
			else
			{
				Debug.LogWarning((object)"[Card Magnifier] Cannot check new CardBar preview card! (object)");
			}
			___currentCard.AddComponent<CardBarPreviewRescaler>();
		}
	}
	[HarmonyPatch(typeof(CardInfo))]
	internal class CardInfo_Patch
	{
		public static GameObject selectedCard;

		[HarmonyPrefix]
		[HarmonyPriority(0)]
		[HarmonyPatch("RPCA_ChangeSelected")]
		private static void AddCardEnlarger(CardInfo __instance, bool setSelected)
		{
			if (setSelected)
			{
				selectedCard = ((Component)((Component)__instance).transform.root).gameObject;
				CardEnlarger component = selectedCard.GetComponent<CardEnlarger>();
				if ((Object)(object)component == (Object)null)
				{
					component = selectedCard.AddComponent<CardEnlarger>();
					component.EnableCardZoom();
				}
			}
		}
	}
	[HarmonyPatch(typeof(CardChoice))]
	internal class CardChoice_Patch
	{
		[HarmonyPrefix]
		[HarmonyPriority(0)]
		[HarmonyPatch("IDoEndPick")]
		private static bool RemoveComponentToPickedCard(ref List<GameObject> ___spawnedCards, GameObject pickedCard, int theInt)
		{
			CardEnlarger componentInChildren = ((Component)pickedCard.transform).GetComponentInChildren<CardEnlarger>();
			foreach (GameObject ___spawnedCard in ___spawnedCards)
			{
				if ((Object)(object)___spawnedCard == (Object)(object)pickedCard)
				{
					if ((Object)(object)componentInChildren != (Object)null)
					{
						componentInChildren.SetCardPicked();
					}
					continue;
				}
				CardEnlarger componentInChildren2 = ((Component)___spawnedCard.transform).GetComponentInChildren<CardEnlarger>();
				if ((Object)(object)componentInChildren2 != (Object)null)
				{
					componentInChildren2.setCardDiscarded();
				}
			}
			CardEnlarger.isCardPickPhase = false;
			return true;
		}
	}
}
namespace CardMagnifier.MonoBehaviors
{
	public class CardEnlarger : MonoBehaviour
	{
		public static List<string> BlacklistedCards = new List<string> { "__CMR__Jack" };

		public static Vector2Int defaultResolution = new Vector2Int(1920, 1080);

		public static Vector2Int currentResolution;

		public static float resolutionScalingFactor = 0.8f;

		public const float defaultCameraOrthoSize = 20f;

		public static float cameraOrthoSizeCardPick;

		public static float cameraOrthoSizeGameplay;

		public static float currentCameraOrthoSize;

		public static float screenResolutionScale = 1f;

		public static float mapEmbiggenerScale = 1f;

		public static float defaultScaleShake_TargetScale = 1.15f;

		public static float configPosInterpolateFactor = 1f;

		public static Vector3 configZoomToPos = new Vector3(0f, 4f, -10f);

		public static bool configZoomAbsoluteEnable = true;

		public static float configZoomScale = 1.35f;

		public static bool configReorientCardEnable = true;

		public static Vector3 configZoomRotation = Vector3.zero;

		public static float configInterpolateTime = 0.01f;

		public Vector3 cardZoomToPos;

		public Vector3 cardPreviousPos;

		public Vector3 cardPreviousRotation;

		public Vector3 cardZoomToScale;

		public Vector3 cardPreviousScale;

		public static bool configDisableDiscardEffect = false;

		public static bool configDisableCardBobbingEffect = false;

		public static bool configDisableCardFlippingEffect = false;

		public static Vector3 configCardBarPreviewPosition = new Vector3(25f, 0f, -10f);

		public static float configCardBarPreviewScale = 1.35f;

		public static float initialXSpeedMin = -2f;

		public static float initialXSpeedMax = 2f;

		public static float initialYSpeedMin = 7.5f;

		public static float initialYSpeedMax = 5f;

		public static float initialYTorqueMin = -180f;

		public static float initialYTorqueMax = 180f;

		public static float initialZTorqueMin = -45f;

		public static float initialZTorqueMax = 45f;

		public static float GravityMin = 7.5f;

		public static float GravityMax = 10f;

		public static float DeltaTimeScale = 2.5f;

		public Vector3 randomizedVelocity = Vector3.zero;

		public Vector3 randomizedTorque = Vector3.zero;

		public float randomizedGravity = 0f;

		public bool isCardDiscarded = false;

		public Vector3 tPosition;

		public Vector3 tRotation;

		public static Vector3 finalCardPos = new Vector3(0f, -9f, 0f);

		public static float timeToVanish = 0.2f;

		public float vanishTimer = 0f;

		public Vector3 vanishingCardPos;

		public Vector3 vanishingCardScale;

		public const float processTickTime = 0f;

		public float processTimer = 0f;

		public float interpolateTimer = 0f;

		public bool zoomEffectEnabled = false;

		public bool discardEffectEnable = false;

		public bool pickedEffectEnable = false;

		public bool cardIsHighLighted = false;

		public bool cardPrevStateSaved = false;

		public static bool isCardPickPhase = false;

		private CardVisuals cardVisuals = null;

		private GameObject cardBaseParent = null;

		public ScaleShake scaleShake = null;

		private bool cardLifeExtended = false;

		public static float cardLifeTimeAdd = 0f;

		public float cardLifeExtendedTime = 0f;

		public static float realTimeToRemove = 1.5f;

		public static void UpdateConfigs()
		{
			configPosInterpolateFactor = CardMagnifier.CardToZoomPointFactor;
			configZoomToPos.x = CardMagnifier.ZoomPointXOffset;
			configZoomToPos.y = CardMagnifier.ZoomPointYOffset;
			configZoomScale = CardMagnifier.ZoomScale;
			configZoomAbsoluteEnable = CardMagnifier.ZoomToAbsoluteSize;
			configReorientCardEnable = CardMagnifier.ReorientCard;
			configInterpolateTime = CardMagnifier.ZoomTime;
			configDisableDiscardEffect = CardMagnifier.DecreaseDiscardMotions;
			configDisableCardBobbingEffect = CardMagnifier.DisableCardBobbingEffect;
			configDisableCardFlippingEffect = CardMagnifier.DisableCardFlippingEffect;
			configCardBarPreviewPosition.x = CardMagnifier.CardBarPreviewXOveride;
			configCardBarPreviewPosition.y = CardMagnifier.CardBarPreviewYOveride;
			configCardBarPreviewScale = CardMagnifier.CardBarPreviewScaleOveride;
		}

		public void Awake()
		{
		}

		public void Start()
		{
			cardVisuals = ((Component)((Component)this).transform).GetComponentInChildren<CardVisuals>();
			scaleShake = ((Component)((Component)this).transform).GetComponentInChildren<ScaleShake>();
			cardBaseParent = ((Component)((Component)this).transform).gameObject;
			Action<bool> toggleSelectionAction = GetToggleSelectionAction();
			cardVisuals.toggleSelectionAction = (Action<bool>)Delegate.Combine(cardVisuals.toggleSelectionAction, toggleSelectionAction);
		}

		public void Update()
		{
			currentCameraOrthoSize = MainCam.instance.cam.orthographicSize;
			if ((Object)(object)cardVisuals == (Object)null)
			{
				cardVisuals = ((Component)((Component)this).transform).GetComponentInChildren<CardVisuals>();
			}
			if ((Object)(object)scaleShake == (Object)null)
			{
				scaleShake = ((Component)((Component)this).transform).GetComponentInChildren<ScaleShake>();
			}
			if (configDisableCardBobbingEffect)
			{
				ScaleShake componentInChildren = ((Component)this).gameObject.GetComponentInChildren<ScaleShake>();
				((Behaviour)componentInChildren).enabled = false;
			}
		}

		public void LateUpdate()
		{
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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_0054: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_023c: 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_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			if (CheckCardIsBlacklisted())
			{
				return;
			}
			if (zoomEffectEnabled)
			{
				if (cardIsHighLighted)
				{
					interpolateTimer += TimeHandler.deltaTime;
					if (configDisableCardBobbingEffect)
					{
						((Component)cardVisuals).transform.localScale = Vector3.one * 1.15f;
					}
					else
					{
						scaleShake.targetScale = 1.15f;
					}
					if (configDisableCardFlippingEffect)
					{
						Transform val = ((Component)cardVisuals).transform.Find("Canvas");
						Vector3 localEulerAngles = val.localEulerAngles;
						val.localEulerAngles = new Vector3(localEulerAngles.x, 0f, localEulerAngles.z);
						RectTransform component = ((Component)val).gameObject.GetComponent<RectTransform>();
						localEulerAngles = ((Transform)component).localEulerAngles;
						((Transform)component).localEulerAngles = new Vector3(localEulerAngles.x, 0f, -1f * localEulerAngles.z);
					}
				}
				else
				{
					interpolateTimer -= TimeHandler.deltaTime;
					if (configDisableCardBobbingEffect)
					{
						((Component)this).transform.localScale = Vector3.one * 0.9f;
					}
					scaleShake.targetScale = 0.9f;
				}
				interpolateTimer = Mathf.Clamp(interpolateTimer, 0f, configInterpolateTime);
				SetCardZoom();
			}
			else if (pickedEffectEnable)
			{
				vanishTimer += TimeHandler.deltaTime;
				cardBaseParent.transform.localPosition = Vector3.Lerp(vanishingCardPos, finalCardPos, vanishTimer / timeToVanish);
				cardBaseParent.transform.localScale = Vector3.Lerp(vanishingCardScale, Vector3.zero, vanishTimer / timeToVanish);
			}
			else
			{
				if (!discardEffectEnable || configDisableDiscardEffect)
				{
					return;
				}
				if (!cardIsHighLighted)
				{
					Transform transform = cardBaseParent.transform;
					transform.position += randomizedVelocity * TimeHandler.deltaTime * DeltaTimeScale;
					Transform transform2 = cardBaseParent.transform;
					transform2.localEulerAngles += randomizedTorque * TimeHandler.deltaTime * DeltaTimeScale;
					randomizedVelocity.y -= randomizedGravity * TimeHandler.deltaTime * DeltaTimeScale;
				}
				if (!cardLifeExtended)
				{
					RemoveAfterSeconds component2 = cardBaseParent.GetComponent<RemoveAfterSeconds>();
					if ((Object)(object)component2 != (Object)null)
					{
						component2.seconds += cardLifeTimeAdd;
						cardLifeExtended = true;
						cardLifeExtendedTime = Time.time;
					}
				}
				else if (Time.time > cardLifeExtendedTime + realTimeToRemove)
				{
					Object.Destroy((Object)(object)cardBaseParent);
				}
			}
		}

		public bool CheckIsInTheCardDraw()
		{
			List<GameObject> list = (List<GameObject>)Traverse.Create((object)CardChoice.instance).Field("spawnedCards").GetValue();
			if (list == null)
			{
				return false;
			}
			if (list.Count == 0)
			{
				return false;
			}
			if (list.Contains(cardBaseParent))
			{
				return true;
			}
			return false;
		}

		public void SetupCardEnlarger()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			if (!cardPrevStateSaved)
			{
				cardPreviousPos = cardBaseParent.transform.position;
				cardPreviousRotation = cardBaseParent.transform.localEulerAngles;
				cardPreviousScale = cardBaseParent.transform.localScale;
				currentResolution = new Vector2Int(MainCam.instance.cam.pixelWidth, MainCam.instance.cam.pixelHeight);
				SetResolutionScale();
				cardZoomToPos = Vector3.Lerp(cardPreviousPos, configZoomToPos, configPosInterpolateFactor) * screenResolutionScale;
				if (configZoomAbsoluteEnable)
				{
					cardZoomToScale = Vector3.one * configZoomScale * screenResolutionScale;
				}
				else
				{
					cardZoomToScale = cardPreviousScale * configZoomScale;
				}
				cardPrevStateSaved = true;
			}
		}

		private void SetCardZoom()
		{
			//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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_00ae: 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)
			float num;
			if (configInterpolateTime <= 0f)
			{
				num = 1f;
			}
			else
			{
				num = interpolateTimer / configInterpolateTime;
				num = BinomialToLerpMapping(Mathf.Clamp01(num));
			}
			float num2 = currentCameraOrthoSize / 20f;
			cardBaseParent.transform.localPosition = Vector3.Lerp(cardPreviousPos, cardZoomToPos, num);
			cardBaseParent.transform.localScale = Vector3.Lerp(cardPreviousScale, cardZoomToScale * num2, num);
			if (configReorientCardEnable)
			{
				cardBaseParent.transform.localEulerAngles = V3RotationalLerp(cardPreviousRotation, configZoomRotation, num);
			}
		}

		private Vector3 V3RotationalLerp(Vector3 start, Vector3 end, float t)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp01(t);
			return new Vector3(Mathf.LerpAngle(start.x, end.x, num), Mathf.LerpAngle(start.y, end.y, num), Mathf.LerpAngle(start.z, end.z, num));
		}

		private float BinomialToLerpMapping(float x)
		{
			float num = Mathf.Clamp01(x);
			return -1f * num * num + 2f * num;
		}

		public void SetupRandomizedCardDiscard()
		{
			//IL_0049: 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_0077: 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_008d: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			if (!isCardDiscarded)
			{
				randomizedGravity = Random.Range(GravityMin, GravityMax);
				randomizedVelocity = new Vector3(Random.Range(initialXSpeedMin, initialXSpeedMax), Random.Range(initialYSpeedMin, initialYSpeedMax), 0f);
				randomizedTorque = new Vector3(0f, Random.Range(initialYTorqueMin, initialYTorqueMax), Random.Range(initialZTorqueMin, initialZTorqueMax));
				tPosition = cardBaseParent.transform.position;
				tRotation = cardBaseParent.transform.localEulerAngles;
				isCardDiscarded = true;
			}
		}

		public bool CheckCardIsBlacklisted()
		{
			foreach (string blacklistedCard in BlacklistedCards)
			{
				if (((Object)cardBaseParent).name.Equals(blacklistedCard))
				{
					return true;
				}
			}
			return false;
		}

		public Action<bool> GetToggleSelectionAction()
		{
			return delegate(bool highLightState)
			{
				if (zoomEffectEnabled)
				{
					if ((Object)(object)cardBaseParent == (Object)null)
					{
						cardBaseParent = ((Component)((Component)this).transform.parent).gameObject;
					}
					else
					{
						SetupCardEnlarger();
						cardIsHighLighted = highLightState;
					}
				}
			};
		}

		public void EnableCardZoom()
		{
			if ((Object)(object)cardBaseParent == (Object)null)
			{
				cardBaseParent = ((Component)this).gameObject;
			}
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 5, (Action)delegate
			{
				zoomEffectEnabled = true;
				pickedEffectEnable = false;
				discardEffectEnable = false;
				SetupCardEnlarger();
				if ((Object)(object)cardVisuals != (Object)null && cardVisuals.isSelected)
				{
					cardIsHighLighted = true;
				}
			});
		}

		public void SetCardPicked()
		{
			//IL_0022: 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_0038: 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)
			zoomEffectEnabled = false;
			pickedEffectEnable = true;
			discardEffectEnable = false;
			vanishingCardPos = cardBaseParent.transform.localPosition;
			vanishingCardScale = cardBaseParent.transform.localScale;
		}

		public void setCardDiscarded()
		{
			if (!pickedEffectEnable)
			{
				zoomEffectEnabled = false;
				discardEffectEnable = true;
				SetupRandomizedCardDiscard();
			}
		}

		public void OnDestroy()
		{
		}

		public void ResetTimer()
		{
			interpolateTimer = 0f;
		}

		public void DemoOveride()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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)
			cardBaseParent.transform.position = CardEnlargerDemo.demoCardStartPos;
			cardBaseParent.transform.localEulerAngles = new Vector3(0f, 0f, CardEnlargerDemo.demoCardEdgeTilt * cardBaseParent.transform.position.x);
			cardBaseParent.transform.localScale = CardEnlargerDemo.demoCardStartScale;
			((Component)cardVisuals).transform.localScale = Vector3.one * 0.9f;
			cardPrevStateSaved = false;
			SetupCardEnlarger();
			cardIsHighLighted = true;
			ResetTimer();
		}

		public static void SetResolutionScale()
		{
			screenResolutionScale = Mathf.Min((float)((Vector2Int)(ref currentResolution)).x / (float)((Vector2Int)(ref defaultResolution)).x, (float)((Vector2Int)(ref currentResolution)).y / (float)((Vector2Int)(ref defaultResolution)).y);
			screenResolutionScale = 1f + (screenResolutionScale - 1f) * resolutionScalingFactor;
		}

		public static void SetCameraPosCardPick()
		{
			Camera component = GameObject.Find("SpotlightCam").GetComponent<Camera>();
			if ((Object)(object)component != (Object)null)
			{
				cameraOrthoSizeCardPick = component.orthographicSize;
			}
		}

		public static void SetCameraPosGameplay()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			Camera component = GameObject.Find("MainCamera").GetComponent<Camera>();
			if ((Object)(object)component != (Object)null)
			{
				cameraOrthoSizeGameplay = component.orthographicSize;
				currentResolution = new Vector2Int(component.pixelWidth, component.pixelHeight);
				mapEmbiggenerScale = cameraOrthoSizeGameplay / cameraOrthoSizeCardPick;
				SetResolutionScale();
			}
		}
	}
	public class CardEnlargerDemo : MonoBehaviour
	{
		public static CardInfo demoCardInfo;

		public static GameObject demoCardObject;

		public static GameObject demoStartPosObj;

		public static GameObject demoZoomPointObj;

		public static float demoCardEdgeTilt = -0.42857143f;

		public static Vector3 demoCardStartPos = new Vector3(-31.5f, 0.0185f, -5f);

		public static Vector3 demoCardStartRotation = Vector3.zero;

		public static Vector3 demoCardStartScale = Vector3.one * 0.6f;

		public static bool isDemoCardZoomMode = false;

		public static bool isDemoCardBarPreviewMode = false;

		public static bool demoCardIsDragged = false;

		public static Vector3 dragDisplacement = Vector3.zero;

		public static Vector3 dragStart;

		public static float demoCardScale = 0.9f;

		public const float RealtimeToRefresh = 0.1f;

		public static float RealtimeLastRefreshed;

		public void Update()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_0089: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: 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_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: 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_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			isDemoCardZoomMode = CardMagnifier.CardZoomDemoMode;
			isDemoCardBarPreviewMode = CardMagnifier.CardBarPreviewDemoMode;
			if (isDemoCardZoomMode)
			{
				if ((Object)(object)demoCardObject == (Object)null)
				{
					DemoCardZoomInstantiate();
				}
				if (Input.GetMouseButtonDown(1) && !demoCardIsDragged)
				{
					dragStart = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition);
					demoCardIsDragged = true;
				}
				else if (Input.GetMouseButtonUp(1) && demoCardIsDragged)
				{
					demoCardStartPos += dragDisplacement;
					demoCardStartRotation = new Vector3(0f, 0f, demoCardEdgeTilt * demoCardStartPos.x);
					DemoCardZoomRefresh();
					demoCardIsDragged = false;
				}
				if (Input.GetKeyDown((KeyCode)268))
				{
					demoCardScale = 0.9f;
					demoCardStartScale = Vector3.one * demoCardScale;
					demoStartPosObj.transform.localScale = demoCardStartScale;
					DemoCardZoomRefresh();
				}
				else if (Input.GetKeyDown((KeyCode)270))
				{
					demoCardScale += 0.05f;
					demoCardScale = Mathf.Clamp(demoCardScale, 0.25f, 2f);
					demoCardStartScale = Vector3.one * demoCardScale;
					demoStartPosObj.transform.localScale = demoCardStartScale;
					DemoCardZoomRefresh();
				}
				else if (Input.GetKeyDown((KeyCode)269))
				{
					demoCardScale -= 0.05f;
					demoCardScale = Mathf.Clamp(demoCardScale, 0.25f, 2f);
					demoCardStartScale = Vector3.one * demoCardScale;
					demoStartPosObj.transform.localScale = demoCardStartScale;
					DemoCardZoomRefresh();
				}
				if (demoCardIsDragged)
				{
					dragDisplacement = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition) - dragStart;
					dragDisplacement.z = 0f;
					demoStartPosObj.transform.position = demoCardStartPos + dragDisplacement;
					demoStartPosObj.transform.localEulerAngles = new Vector3(0f, 0f, demoCardEdgeTilt * (demoCardStartPos.x + dragDisplacement.x));
				}
			}
			else if (isDemoCardBarPreviewMode)
			{
				if ((Object)(object)demoCardObject == (Object)null)
				{
					DemoCardBarInstantiate();
				}
			}
			else
			{
				if ((Object)(object)demoCardObject != (Object)null)
				{
					Object.Destroy((Object)(object)demoCardObject);
				}
				if ((Object)(object)demoStartPosObj != (Object)null)
				{
					Object.Destroy((Object)(object)demoStartPosObj);
				}
			}
		}

		public void DemoCardZoomInstantiate()
		{
			//IL_0026: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			demoCardInfo = GetRandomCardInfo();
			SpawnPreviewCard(demoCardInfo);
			demoCardObject.transform.position = demoCardStartPos;
			demoCardObject.transform.localEulerAngles = new Vector3(0f, 0f, demoCardEdgeTilt * demoCardObject.transform.position.x);
			demoCardObject.transform.localScale = demoCardStartScale;
			CardEnlarger.currentResolution = new Vector2Int(MainCam.instance.cam.pixelWidth, MainCam.instance.cam.pixelHeight);
			CardEnlarger.SetResolutionScale();
			if ((Object)(object)demoStartPosObj != (Object)null)
			{
				Object.Destroy((Object)(object)demoStartPosObj);
			}
			else
			{
				demoStartPosObj = Object.Instantiate<GameObject>(demoCardObject);
			}
			CardEnlarger cardEnlarger = demoCardObject.AddComponent<CardEnlarger>();
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 2, (Action)delegate
			{
				cardEnlarger.EnableCardZoom();
				cardEnlarger.DemoOveride();
			});
		}

		public void DemoCardBarInstantiate()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_0058: 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)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			demoCardInfo = GetRandomCardInfo();
			SpawnPreviewCard(demoCardInfo);
			CardEnlarger.currentResolution = new Vector2Int(MainCam.instance.cam.pixelWidth, MainCam.instance.cam.pixelHeight);
			CardEnlarger.SetResolutionScale();
			demoCardObject.transform.position = CardEnlarger.configCardBarPreviewPosition * CardEnlarger.screenResolutionScale;
			demoCardObject.transform.localEulerAngles = Vector3.zero;
			demoCardObject.transform.localScale = Vector3.one * CardEnlarger.configCardBarPreviewScale * CardEnlarger.screenResolutionScale;
		}

		public static CardInfo GetRandomCardInfo()
		{
			int num = Mathf.RoundToInt(Random.Range(0f, (float)CardChoice.instance.cards.Length));
			num = Mathf.Clamp(num, 0, CardChoice.instance.cards.Length - 1);
			return CardChoice.instance.cards[num];
		}

		public static void SpawnPreviewCard(CardInfo cardInfo)
		{
			//IL_0023: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)demoCardObject != (Object)null)
			{
				Object.Destroy((Object)(object)demoCardObject);
			}
			demoCardObject = CardChoice.instance.AddCardVisual(cardInfo, Vector3.zero);
			Collider2D[] componentsInChildren = ((Component)demoCardObject.transform.root).GetComponentsInChildren<Collider2D>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				((Behaviour)componentsInChildren[i]).enabled = false;
			}
			demoCardObject.GetComponentInChildren<Canvas>().sortingLayerName = "MostFront";
			((Behaviour)demoCardObject.GetComponentInChildren<GraphicRaycaster>()).enabled = false;
			((Behaviour)demoCardObject.GetComponentInChildren<SetScaleToZero>()).enabled = false;
			((Component)demoCardObject.GetComponentInChildren<SetScaleToZero>()).transform.localScale = Vector3.one * 1.15f;
		}

		public static void DemoCardZoomRefresh()
		{
			if (Time.time > RealtimeLastRefreshed + 0.1f)
			{
				RealtimeLastRefreshed = Time.time;
				CardEnlarger.UpdateConfigs();
				if (isDemoCardZoomMode)
				{
					CardEnlarger component = demoCardObject.GetComponent<CardEnlarger>();
					component.DemoOveride();
				}
			}
		}

		public static void DemoCardBarPreviewRefresh()
		{
			//IL_0041: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (Time.time > RealtimeLastRefreshed + 0.1f)
			{
				RealtimeLastRefreshed = Time.time;
				CardEnlarger.UpdateConfigs();
				if (isDemoCardBarPreviewMode)
				{
					demoCardObject.transform.position = CardEnlarger.configCardBarPreviewPosition;
					demoCardObject.transform.localEulerAngles = Vector3.zero;
					demoCardObject.transform.localScale = Vector3.one * CardEnlarger.configCardBarPreviewScale * CardEnlarger.screenResolutionScale;
				}
			}
		}
	}
	public class CardBarPreviewRescaler : MonoBehaviour
	{
		public static Camera gameCamera = null;

		public static float currentOrthoSize = 20f;

		public float rescale = 1f;

		public float targetScaleCheck = 1f;

		public void Awake()
		{
			RescalePreview();
		}

		public void Update()
		{
			RescalePreview();
		}

		public void RescalePreview()
		{
			//IL_0023: 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_0044: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			rescale = currentOrthoSize / 20f * CardEnlarger.screenResolutionScale;
			((Component)this).gameObject.transform.position = CardEnlarger.configCardBarPreviewPosition * rescale;
			((Component)this).gameObject.transform.localScale = Vector3.one * CardEnlarger.configCardBarPreviewScale * rescale;
			targetScaleCheck = ((Component)this).gameObject.GetComponentInChildren<ScaleShake>().targetScale / CardEnlarger.defaultScaleShake_TargetScale;
			Transform transform = ((Component)this).gameObject.transform;
			transform.localScale /= targetScaleCheck;
		}

		public static void UpdateCurrentZoom()
		{
			if ((Object)(object)gameCamera == (Object)null)
			{
				GameObject val = GameObject.Find("SpotlightCam");
				if (!((Object)(object)val != (Object)null))
				{
					currentOrthoSize = 20f;
					return;
				}
				gameCamera = val.GetComponent<Camera>();
				if ((Object)(object)gameCamera == (Object)null)
				{
					currentOrthoSize = 20f;
					return;
				}
			}
			currentOrthoSize = gameCamera.orthographicSize;
		}
	}
}