Decompiled source of KainRogueProtocol v3.0.3

BepInEx/plugins/KainRogueProtocol/KainRogueProtocol.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.Versioning;
using System.Text;
using AIGraph;
using Agents;
using AssetShards;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using ChainedPuzzles;
using CullingSystem;
using Enemies;
using GTFO.API;
using GameData;
using Gear;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections;
using Il2CppSystem.Collections.Generic;
using Il2CppSystem.Reflection;
using KainRogueProtocol.Core;
using KainRogueProtocol.Corruption;
using KainRogueProtocol.Data;
using KainRogueProtocol.DataPatches;
using KainRogueProtocol.Effects;
using KainRogueProtocol.Events;
using KainRogueProtocol.Fixes.EnemyPopulationCap;
using KainRogueProtocol.Localization;
using KainRogueProtocol.Modifiers;
using KainRogueProtocol.Networking;
using KainRogueProtocol.Patches;
using KainRogueProtocol.Runtime;
using KainRogueProtocol.Runtime.ActiveSkills;
using KainRogueProtocol.Runtime.Contexts;
using KainRogueProtocol.Runtime.Dash;
using KainRogueProtocol.Runtime.Services;
using KainRogueProtocol.Triggers;
using KainRogueProtocol.UI;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using ModifierAPI;
using Player;
using SNetwork;
using TMPro;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace KainRogueProtocol.UI
{
	public sealed class ActiveSkillHud
	{
		private const int ConceptWidth = 620;

		private const int ConceptHeight = 132;

		private const float ConceptScale = 0.45f;

		private const int SegmentCount = 64;

		private const float ProgressX = 78f;

		private const float ProgressY = 97f;

		private const float ProgressWidth = 302f;

		private const float ProgressHeight = 1.8f;

		private static readonly Vector2 RelativeAnchor = new Vector2(0.17f, 0.145f);

		private static readonly Vector2 PanelSize = new Vector2(279f, 59.399998f);

		private static readonly Color ReadyRed = new Color(1f, 0.15f, 0.12f, 1f);

		private static readonly Color ReadyRedSoft = new Color(1f, 0.12f, 0.1f, 0.42f);

		private static readonly Color CooldownGray = new Color(0.64f, 0.68f, 0.68f, 0.88f);

		private static readonly Color LockedAmber = new Color(0.95f, 0.55f, 0.12f, 0.9f);

		private static readonly Color InactiveSegmentColor = new Color(0.07f, 0.07f, 0.07f, 0.58f);

		private static Sprite? s_backgroundSprite;

		private static Sprite? s_circleSprite;

		private readonly GameObject _root;

		private readonly Image _background;

		private Image _topLine;

		private Image _topGlow;

		private Image _bottomTrack;

		private Image _bottomFill;

		private Image _keyOuter;

		private Image _keyFrame;

		private Image _keyBacking;

		private Image _coreBack;

		private Image _coreHalo;

		private Image _coreRim;

		private Image _coreInner;

		private Image _statusFrame;

		private Image _statusBacking;

		private readonly Image[] _segments = (Image[])(object)new Image[64];

		private Text _keyText;

		private Text _titleText;

		private Text _iconText;

		private Text _stateText;

		private Text _captionText;

		private readonly Func<ActiveSkillHudStatus, KeyCode> _activeKeyProvider;

		private bool _visible = true;

		private string _lastSkillId = string.Empty;

		private string _lastKeyLabel = string.Empty;

		private string _lastStateText = string.Empty;

		private string _lastCaptionText = string.Empty;

		private float _lastFill = -1f;

		private float _nextUpdateAt;

		public ActiveSkillHud(Transform parent, Func<ActiveSkillHudStatus, KeyCode>? activeKeyProvider = null)
		{
			//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_008c: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			_activeKeyProvider = activeKeyProvider ?? ((Func<ActiveSkillHudStatus, KeyCode>)((ActiveSkillHudStatus _) => (KeyCode)103));
			_root = UiFactory.CreateRect("KRP.ActiveSkillHud", parent, RelativeAnchor, RelativeAnchor, PanelSize, Vector2.zero);
			_root.GetComponent<RectTransform>().pivot = new Vector2(0f, 0.5f);
			_background = _root.AddComponent<Image>();
			_background.sprite = EnsureBackgroundSprite();
			((Graphic)_background).color = Color.white;
			((Graphic)_background).raycastTarget = false;
			CreateKeyCap();
			CreateTitle();
			CreateStateLines();
			CreateCooldownCore();
			CreateStateBox();
			CreateCaption();
			_root.SetActive(false);
		}

		public void Tick()
		{
			if (!(Time.unscaledTime < _nextUpdateAt))
			{
				_nextUpdateAt = Time.unscaledTime + 0.06f;
				if (!_visible || !IsExpeditionInLevel() || !TryResolveStatus(Time.time, out var status))
				{
					SetRootActive(active: false);
					return;
				}
				SetRootActive(active: true);
				UpdateVisuals(status);
			}
		}

		public void SetVisible(bool visible)
		{
			_visible = visible;
			if (!visible)
			{
				SetRootActive(active: false);
			}
		}

		private void CreateKeyCap()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			_keyOuter = UiFactory.CreateImage("ActiveSkillKeyOuter", _root.transform, new Color(0.82f, 0.86f, 0.82f, 0.11f));
			SetConceptRect((Component)(object)_keyOuter, 42f, 36f, 56f, 52f);
			_keyFrame = UiFactory.CreateImage("ActiveSkillKeyFrame", _root.transform, new Color(1f, 0.14f, 0.12f, 0.22f));
			SetConceptRect((Component)(object)_keyFrame, 45f, 39f, 50f, 46f);
			_keyBacking = UiFactory.CreateImage("ActiveSkillKeyBacking", _root.transform, new Color(0.025f, 0.028f, 0.028f, 0.96f));
			SetConceptRect((Component)(object)_keyBacking, 49f, 43f, 42f, 38f);
			_keyText = UiFactory.CreateText("ActiveSkillKey", _root.transform, "G", ScaleFont(27f), (TextAnchor)4, Color.white);
			_keyText.fontStyle = (FontStyle)1;
			_keyText.resizeTextForBestFit = true;
			_keyText.resizeTextMinSize = ScaleFont(13f);
			_keyText.resizeTextMaxSize = ScaleFont(27f);
			AddReadableTextEffect(_keyText, 0.84f, Scale(1.2f));
			SetConceptRect((Component)(object)_keyText, 49f, 42f, 42f, 40f);
		}

		private void CreateTitle()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			_titleText = UiFactory.CreateText("ActiveSkillTitle", _root.transform, string.Empty, ScaleFont(24f), (TextAnchor)3, Color.white);
			_titleText.fontStyle = (FontStyle)1;
			_titleText.resizeTextForBestFit = true;
			_titleText.resizeTextMinSize = ScaleFont(12f);
			_titleText.resizeTextMaxSize = ScaleFont(24f);
			AddReadableTextEffect(_titleText, 0.84f, Scale(1.25f));
			SetConceptRect((Component)(object)_titleText, 121f, 40f, 238f, 44f);
		}

		private void CreateStateLines()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			_topLine = UiFactory.CreateImage("ActiveSkillTopLine", _root.transform, ReadyRed);
			SetConceptRect((Component)(object)_topLine, 78f, 21f, 300f, 1.6f);
			_topGlow = UiFactory.CreateImage("ActiveSkillTopGlow", _root.transform, ReadyRedSoft);
			SetConceptRect((Component)(object)_topGlow, 78f, 18.5f, 300f, 5f);
			_bottomTrack = UiFactory.CreateImage("ActiveSkillBottomTrack", _root.transform, new Color(0.3f, 0.32f, 0.32f, 0.34f));
			SetConceptRect((Component)(object)_bottomTrack, 78f, 97f, 302f, 1.8f);
			_bottomFill = UiFactory.CreateImage("ActiveSkillBottomFill", _root.transform, ReadyRed);
			SetConceptRectLeftPivot((Component)(object)_bottomFill, 78f, 97f, 0f, 1.8f);
		}

		private void CreateCooldownCore()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: 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_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = ConceptPoint(404f, 61f);
			Vector2 val2 = default(Vector2);
			for (int i = 0; i < 64; i++)
			{
				float num = (float)i / 64f * 360f;
				float num2 = num * (MathF.PI / 180f);
				((Vector2)(ref val2))..ctor(Mathf.Sin(num2), Mathf.Cos(num2));
				Image val3 = UiFactory.CreateImage($"ActiveSkillCoreSegment_{i:00}", _root.transform, InactiveSegmentColor);
				RectTransform component = ((Component)val3).GetComponent<RectTransform>();
				component.anchorMin = new Vector2(0f, 0.5f);
				component.anchorMax = new Vector2(0f, 0.5f);
				component.pivot = new Vector2(0.5f, 0.5f);
				component.sizeDelta = new Vector2(Scale(2.4f), Scale(12.4f));
				component.anchoredPosition = val + val2 * Scale(40.6f);
				((Transform)component).localRotation = Quaternion.Euler(0f, 0f, 0f - num);
				_segments[i] = val3;
			}
			_coreBack = UiFactory.CreateImage("ActiveSkillCoreBack", _root.transform, new Color(0.025f, 0.022f, 0.022f, 0.96f));
			_coreBack.sprite = EnsureCircleSprite();
			SetConceptRect((Component)(object)_coreBack, 366f, 23f, 76f, 76f);
			_coreHalo = UiFactory.CreateImage("ActiveSkillCoreHalo", _root.transform, new Color(1f, 0.12f, 0.1f, 0.09f));
			_coreHalo.sprite = EnsureCircleSprite();
			SetConceptRect((Component)(object)_coreHalo, 371f, 28f, 66f, 66f);
			_coreRim = UiFactory.CreateImage("ActiveSkillCoreRim", _root.transform, new Color(1f, 0.18f, 0.16f, 0.24f));
			_coreRim.sprite = EnsureCircleSprite();
			SetConceptRect((Component)(object)_coreRim, 375f, 32f, 58f, 58f);
			_coreInner = UiFactory.CreateImage("ActiveSkillCoreInner", _root.transform, new Color(0.08f, 0.015f, 0.014f, 0.96f));
			_coreInner.sprite = EnsureCircleSprite();
			SetConceptRect((Component)(object)_coreInner, 382f, 39f, 44f, 44f);
			_iconText = UiFactory.CreateText("ActiveSkillCoreIcon", _root.transform, "⚡", ScaleFont(31f), (TextAnchor)4, ReadyRed);
			_iconText.fontStyle = (FontStyle)1;
			_iconText.resizeTextForBestFit = true;
			_iconText.resizeTextMinSize = ScaleFont(16f);
			_iconText.resizeTextMaxSize = ScaleFont(31f);
			AddReadableTextEffect(_iconText, 0.82f, Scale(0.95f));
			SetConceptRect((Component)(object)_iconText, 382f, 38f, 44f, 46f);
		}

		private void CreateStateBox()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			_statusFrame = UiFactory.CreateImage("ActiveSkillStateFrame", _root.transform, new Color(1f, 0.14f, 0.12f, 0.18f));
			SetConceptRect((Component)(object)_statusFrame, 485f, 43f, 80f, 38f);
			_statusBacking = UiFactory.CreateImage("ActiveSkillStateBacking", _root.transform, new Color(0.03f, 0.032f, 0.032f, 0.88f));
			SetConceptRect((Component)(object)_statusBacking, 490f, 47f, 70f, 30f);
			_stateText = UiFactory.CreateText("ActiveSkillState", _root.transform, string.Empty, ScaleFont(18f), (TextAnchor)4, ReadyRed);
			_stateText.fontStyle = (FontStyle)1;
			_stateText.resizeTextForBestFit = true;
			_stateText.resizeTextMinSize = ScaleFont(10f);
			_stateText.resizeTextMaxSize = ScaleFont(18f);
			AddReadableTextEffect(_stateText, 0.8f, Scale(0.9f));
			SetConceptRect((Component)(object)_stateText, 491f, 47f, 68f, 30f);
		}

		private void CreateCaption()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			_captionText = UiFactory.CreateText("ActiveSkillCaption", _root.transform, string.Empty, ScaleFont(10f), (TextAnchor)4, ReadyRed);
			_captionText.fontStyle = (FontStyle)1;
			_captionText.resizeTextForBestFit = true;
			_captionText.resizeTextMinSize = ScaleFont(7f);
			_captionText.resizeTextMaxSize = ScaleFont(10f);
			AddReadableTextEffect(_captionText, 0.55f, Scale(0.65f));
			SetConceptRect((Component)(object)_captionText, 174f, 109f, 222f, 16f);
		}

		private void UpdateVisuals(ActiveSkillHudStatus status)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: 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_04b0: Unknown result type (might be due to invalid IL or missing references)
			Color val = ResolveAccent(status);
			float num = ResolveFill(status);
			string text = FormatStateText(status);
			string text2 = FormatCaptionText(status);
			string text3 = FormatKeyLabel(_activeKeyProvider(status));
			bool num2 = _lastSkillId != status.SkillId;
			if (num2)
			{
				_lastSkillId = status.SkillId;
				_titleText.text = status.SkillName;
			}
			if (_lastKeyLabel != text3)
			{
				_lastKeyLabel = text3;
				_keyText.text = text3;
			}
			if (_lastStateText != text)
			{
				_lastStateText = text;
				_stateText.text = text;
			}
			if (_lastCaptionText != text2)
			{
				_lastCaptionText = text2;
				_captionText.text = text2;
			}
			bool flag = status.IsReady || status.IsActive;
			((Graphic)_background).color = (Color)(status.IsLocked ? new Color(1f, 0.9f, 0.75f, 0.88f) : Color.white);
			((Graphic)_topLine).color = val;
			((Graphic)_topGlow).color = WithAlpha(val, (status.IsReady || status.IsActive) ? 0.34f : 0.14f);
			((Graphic)_bottomTrack).color = (status.IsLocked ? new Color(0.36f, 0.24f, 0.12f, 0.42f) : new Color(0.28f, 0.3f, 0.3f, 0.34f));
			((Graphic)_keyText).color = (Color)(flag ? Color.white : new Color(0.66f, 0.7f, 0.7f, 0.88f));
			((Graphic)_titleText).color = (Color)(flag ? Color.white : new Color(0.72f, 0.75f, 0.75f, 0.88f));
			((Graphic)_stateText).color = val;
			((Graphic)_captionText).color = val;
			((Graphic)_keyOuter).color = (Color)(flag ? WithAlpha(val, 0.1f) : new Color(0.72f, 0.76f, 0.74f, 0.07f));
			((Graphic)_keyFrame).color = (Color)((flag || status.IsLocked) ? WithAlpha(val, 0.22f) : new Color(0.62f, 0.66f, 0.64f, 0.14f));
			((Graphic)_statusFrame).color = (Color)((flag || status.IsLocked) ? WithAlpha(val, 0.18f) : new Color(0.62f, 0.66f, 0.64f, 0.12f));
			((Graphic)_statusBacking).color = (status.IsLocked ? new Color(0.08f, 0.045f, 0.012f, 0.9f) : new Color(0.03f, 0.032f, 0.032f, 0.88f));
			((Graphic)_keyBacking).color = (flag ? new Color(0.026f, 0.028f, 0.028f, 0.96f) : new Color(0.018f, 0.02f, 0.02f, 0.88f));
			((Graphic)_coreBack).color = (flag ? new Color(0.026f, 0.022f, 0.022f, 0.96f) : new Color(0.02f, 0.02f, 0.02f, 0.9f));
			((Graphic)_coreHalo).color = (Color)((flag || status.IsLocked) ? WithAlpha(val, status.IsActive ? 0.16f : 0.1f) : new Color(0.1f, 0.1f, 0.1f, 0.05f));
			((Graphic)_coreRim).color = (Color)((flag || status.IsLocked) ? WithAlpha(val, 0.24f) : new Color(0.55f, 0.58f, 0.58f, 0.11f));
			((Graphic)_coreInner).color = (status.IsLocked ? new Color(0.08f, 0.045f, 0.012f, 0.96f) : (flag ? new Color(0.09f, 0.012f, 0.012f, 0.96f) : new Color(0.032f, 0.034f, 0.034f, 0.94f)));
			((Graphic)_iconText).color = val;
			if (num2 || Mathf.Abs(num - _lastFill) > 0.003f || flag)
			{
				_lastFill = num;
				UpdateProgress(num, val, status);
			}
		}

		private void UpdateProgress(float fill, Color accent, ActiveSkillHudStatus status)
		{
			//IL_0028: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_0085: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp01(fill);
			((Component)_bottomFill).GetComponent<RectTransform>().sizeDelta = new Vector2(Scale(302f) * num, Scale(1.8f));
			((Graphic)_bottomFill).color = accent;
			int num2 = Mathf.FloorToInt(num * 64f + 0.0001f);
			if (status.IsReady)
			{
				num2 = 64;
			}
			for (int i = 0; i < _segments.Length; i++)
			{
				Color color = (Color)((i >= num2) ? ((i % 8 == 0) ? new Color(0.16f, 0.16f, 0.15f, 0.46f) : InactiveSegmentColor) : ((i % 8 == 0) ? Color.Lerp(accent, Color.white, 0.16f) : accent));
				if (status.IsLocked && i < num2)
				{
					color = Color.Lerp(LockedAmber, Color.black, 0.25f);
				}
				((Graphic)_segments[i]).color = color;
			}
		}

		private static bool TryResolveStatus(float now, out ActiveSkillHudStatus status)
		{
			status = default(ActiveSkillHudStatus);
			if (RogueDashRuntime.TryGetHudStatus(now, out var status2))
			{
				status = status2;
			}
			if (RogueTempHealthPulseRuntime.TryGetHudStatus(now, out var status3) && ShouldReplace(status, status3))
			{
				status = status3;
			}
			if (RogueFireCoverageRuntime.TryGetHudStatus(now, out var status4) && ShouldReplace(status, status4))
			{
				status = status4;
			}
			if (RogueEscapePlanRuntime.TryGetHudStatus(now, out var status5) && ShouldReplace(status, status5))
			{
				status = status5;
			}
			if (RogueSilentInfiltrationRuntime.TryGetHudStatus(now, out var status6) && ShouldReplace(status, status6))
			{
				status = status6;
			}
			if (RogueDimensionalAnchorRuntime.TryGetHudStatus(now, out var status7) && ShouldReplace(status, status7))
			{
				status = status7;
			}
			if (RogueElementalActiveSkillRuntime.TryGetHudStatus(now, out var status8) && ShouldReplace(status, status8))
			{
				status = status8;
			}
			if (RogueDecoyProtocolRuntime.TryGetHudStatus(now, out var status9) && ShouldReplace(status, status9))
			{
				status = status9;
			}
			if (RogueFocusStanceRuntime.TryGetHudStatus(now, out var status10) && ShouldReplace(status, status10))
			{
				status = status10;
			}
			if (ToolCardRuntime.TryGetEngineeringMiracleHudStatus(now, out var status11) && ShouldReplace(status, status11))
			{
				status = status11;
			}
			return status.HasValue;
		}

		private static bool ShouldReplace(ActiveSkillHudStatus current, ActiveSkillHudStatus candidate)
		{
			if (!current.HasValue)
			{
				return true;
			}
			if (candidate.DisplayPriority != current.DisplayPriority)
			{
				return candidate.DisplayPriority > current.DisplayPriority;
			}
			if (!candidate.IsActive && !candidate.IsReady && !candidate.IsLocked)
			{
				float num = candidate.CooldownRemaining - current.CooldownRemaining;
				if (Mathf.Abs(num) > 0.05f)
				{
					return num < 0f;
				}
			}
			return candidate.SkillOrder < current.SkillOrder;
		}

		private static float ResolveFill(ActiveSkillHudStatus status)
		{
			if (status.IsActive)
			{
				return Mathf.Clamp01(status.ActiveRemaining / Mathf.Max(0.1f, status.ActiveTotal));
			}
			if (status.IsReady)
			{
				return 1f;
			}
			return Mathf.Clamp01(1f - status.CooldownRemaining / Mathf.Max(0.1f, status.CooldownTotal));
		}

		private static Color ResolveAccent(ActiveSkillHudStatus status)
		{
			//IL_0009: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (status.IsLocked)
			{
				return LockedAmber;
			}
			if (!status.IsReady && !status.IsActive)
			{
				return CooldownGray;
			}
			float num = 0.5f + Mathf.Sin(Time.unscaledTime * (status.IsActive ? 7.4f : 4.8f)) * 0.5f;
			return Color.Lerp(ReadyRed, Color.white, num * 0.12f);
		}

		private static string FormatStateText(ActiveSkillHudStatus status)
		{
			if (!string.IsNullOrWhiteSpace(status.StateText))
			{
				return status.StateText;
			}
			if (status.IsLocked)
			{
				return "0/1";
			}
			if (status.IsReady)
			{
				return "1/1";
			}
			if (status.IsActive)
			{
				return $"{status.ActiveRemaining:00.0}s";
			}
			return $"{status.CooldownRemaining:00.0}s";
		}

		private static string FormatCaptionText(ActiveSkillHudStatus status)
		{
			if (status.IsLocked)
			{
				return RogueLocalization.Pick("[ REQUIREMENTS NOT MET ]", "[ 条件未满足 ]");
			}
			if (status.IsReady)
			{
				return RogueLocalization.Pick("[ SKILL READY ]", "[ 技能就绪 ]");
			}
			if (status.IsActive)
			{
				return RogueLocalization.Pick("[ ACTIVE ]", "[ 生效中 ]");
			}
			return RogueLocalization.Pick("[ ON COOLDOWN ]", "[ 冷却中 ]");
		}

		private unsafe static string FormatKeyLabel(KeyCode key)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected I4, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected I4, but got Unknown
			//IL_005b: 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_0073: Expected I4, but got Unknown
			if ((int)key >= 97 && (int)key <= 122)
			{
				return ((object)(*(KeyCode*)(&key))/*cast due to .constrained prefix*/).ToString();
			}
			if ((int)key >= 48 && (int)key <= 57)
			{
				return (key - 48).ToString();
			}
			if ((int)key != 32)
			{
				return (key - 303) switch
				{
					1 => "LSH", 
					0 => "RSH", 
					3 => "LCTRL", 
					2 => "RCTRL", 
					5 => "LALT", 
					4 => "RALT", 
					_ => (key - 323) switch
					{
						0 => "M1", 
						1 => "M2", 
						2 => "M3", 
						_ => ((object)(*(KeyCode*)(&key))/*cast due to .constrained prefix*/).ToString().ToUpperInvariant(), 
					}, 
				};
			}
			return "SPC";
		}

		private static Sprite EnsureBackgroundSprite()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_backgroundSprite != (Object)null)
			{
				return s_backgroundSprite;
			}
			Texture2D val = new Texture2D(620, 132, (TextureFormat)4, false);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			((Texture)val).filterMode = (FilterMode)1;
			Color color = default(Color);
			((Color)(ref color))..ctor(0f, 0f, 0f, 0f);
			for (int i = 0; i < 132; i++)
			{
				for (int j = 0; j < 620; j++)
				{
					if (!IsInsideCapsule(j, i))
					{
						SetConceptPixel(val, j, i, color);
						continue;
					}
					float num = Mathf.Clamp01(((float)j - 22f) / 560f);
					float num2 = (0f - Mathf.Clamp01(Mathf.Abs((float)i - 59f) / 58f)) * 0.018f;
					float num3 = Mathf.Sin((float)i * 1.45f) * 0.004f;
					float num4 = ((float)((j * 13 + i * 29) & 0xF) - 7.5f) * 0.0009f;
					Color color2 = Color.Lerp(new Color(0.01f, 0.012f, 0.012f, 0.86f), new Color(0.034f, 0.032f, 0.03f, 0.84f), num);
					float num5 = num2 + num3 + num4;
					color2.r += num5;
					color2.g += num5;
					color2.b += num5;
					SetConceptPixel(val, j, i, color2);
				}
			}
			DrawBackgroundDetails(val);
			val.Apply(false, true);
			s_backgroundSprite = Sprite.Create(val, new Rect(0f, 0f, 620f, 132f), new Vector2(0.5f, 0.5f), 100f);
			return s_backgroundSprite;
		}

		private static Sprite EnsureCircleSprite()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			if ((Object)(object)s_circleSprite != (Object)null)
			{
				return s_circleSprite;
			}
			Texture2D val = new Texture2D(96, 96, (TextureFormat)4, false);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			((Texture)val).filterMode = (FilterMode)1;
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(47.5f, 47.5f);
			float num = 46.079998f;
			for (int i = 0; i < 96; i++)
			{
				for (int j = 0; j < 96; j++)
				{
					float num2 = Vector2.Distance(new Vector2((float)j, (float)i), val2);
					float num3 = Mathf.Clamp01(num - num2 + 1f);
					val.SetPixel(j, i, new Color(1f, 1f, 1f, num3));
				}
			}
			val.Apply(false, true);
			s_circleSprite = Sprite.Create(val, new Rect(0f, 0f, 96f, 96f), new Vector2(0.5f, 0.5f), 100f);
			return s_circleSprite;
		}

		private static void DrawBackgroundDetails(Texture2D texture)
		{
			//IL_0078: 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_00a4: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_041a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.74f, 0.74f, 0.7f, 0.16f);
			Color color2 = default(Color);
			((Color)(ref color2))..ctor(0.74f, 0.74f, 0.7f, 0.1f);
			Color color3 = default(Color);
			((Color)(ref color3))..ctor(1f, 0.12f, 0.1f, 0.13f);
			Color color4 = default(Color);
			((Color)(ref color4))..ctor(1f, 0.12f, 0.1f, 0.34f);
			DrawLine(texture, 54, 16, 535, 16, color, 1);
			DrawLine(texture, 535, 16, 590, 58, color2, 1);
			DrawLine(texture, 590, 58, 535, 102, color2, 1);
			DrawLine(texture, 535, 102, 54, 102, color, 1);
			DrawLine(texture, 54, 102, 18, 72, color2, 1);
			DrawLine(texture, 18, 72, 18, 43, color2, 1);
			DrawLine(texture, 18, 43, 54, 16, color2, 1);
			DrawLine(texture, 78, 21, 378, 21, new Color(1f, 0.12f, 0.1f, 0.11f), 3);
			DrawLine(texture, 78, 21, 378, 21, color4, 1);
			DrawLine(texture, 78, 98, 380, 98, color3, 1);
			DrawLine(texture, 28, 74, 54, 96, new Color(1f, 0.12f, 0.1f, 0.08f), 1);
			DrawLine(texture, 458, 21, 535, 21, new Color(0.92f, 0.92f, 0.88f, 0.07f), 1);
			DrawLine(texture, 457, 98, 535, 98, new Color(0f, 0f, 0f, 0.16f), 1);
			DrawRectOutline(texture, 45, 39, 50, 46, new Color(1f, 0.12f, 0.1f, 0.08f));
			DrawRectOutline(texture, 485, 43, 80, 38, new Color(1f, 0.12f, 0.1f, 0.07f));
			DrawLine(texture, 111, 38, 342, 38, new Color(0.92f, 0.92f, 0.88f, 0.045f), 1);
			DrawLine(texture, 111, 86, 328, 86, new Color(0f, 0f, 0f, 0.22f), 1);
			DrawLine(texture, 116, 44, 116, 78, new Color(1f, 0.12f, 0.1f, 0.055f), 1);
			DrawLine(texture, 354, 35, 380, 35, new Color(1f, 0.12f, 0.1f, 0.07f), 1);
			DrawLine(texture, 354, 88, 380, 88, new Color(1f, 0.12f, 0.1f, 0.055f), 1);
			for (int i = 134; i <= 318; i += 23)
			{
				DrawLine(texture, i, 91, i + 8, 91, new Color(0.88f, 0.88f, 0.82f, 0.045f), 1);
			}
			for (int j = 500; j <= 544; j += 11)
			{
				DrawLine(texture, j, 31, j + 4, 31, new Color(0.95f, 0.95f, 0.9f, 0.045f), 1);
				DrawLine(texture, j, 91, j + 4, 91, new Color(1f, 0.12f, 0.1f, 0.05f), 1);
			}
			DrawLine(texture, 52, 113, 182, 113, new Color(1f, 0.12f, 0.1f, 0.14f), 1);
			DrawLine(texture, 185, 113, 214, 113, new Color(0.88f, 0.88f, 0.82f, 0.06f), 1);
			DrawLine(texture, 404, 106, 404, 121, new Color(1f, 0.12f, 0.1f, 0.09f), 1);
			DrawLine(texture, 396, 113, 412, 113, new Color(1f, 0.12f, 0.1f, 0.08f), 1);
		}

		private static void DrawRectOutline(Texture2D texture, int x, int y, int width, int height, Color color)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			DrawLine(texture, x, y, x + width, y, color, 1);
			DrawLine(texture, x + width, y, x + width, y + height, color, 1);
			DrawLine(texture, x + width, y + height, x, y + height, color, 1);
			DrawLine(texture, x, y + height, x, y, color, 1);
		}

		private static bool IsInsideCapsule(int x, int y)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//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_004a: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_008c: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			if (y < 14 || y > 104)
			{
				return false;
			}
			Vector2[] array = (Vector2[])(object)new Vector2[8]
			{
				new Vector2(54f, 14f),
				new Vector2(535f, 14f),
				new Vector2(592f, 57f),
				new Vector2(592f, 60f),
				new Vector2(535f, 104f),
				new Vector2(54f, 104f),
				new Vector2(18f, 73f),
				new Vector2(18f, 43f)
			};
			bool flag = false;
			int num = 0;
			int num2 = array.Length - 1;
			while (num < array.Length)
			{
				if (array[num].y > (float)y != array[num2].y > (float)y && (float)x < (array[num2].x - array[num].x) * ((float)y - array[num].y) / (array[num2].y - array[num].y) + array[num].x)
				{
					flag = !flag;
				}
				num2 = num++;
			}
			return flag;
		}

		private static void DrawLine(Texture2D texture, int x0, int y0, int x1, int y1, Color color, int thickness)
		{
			//IL_001e: 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)
			int num = Mathf.Max(Mathf.Abs(x1 - x0), Mathf.Abs(y1 - y0));
			if (num <= 0)
			{
				BlendConceptPixel(texture, x0, y0, color);
				return;
			}
			int num2 = Mathf.Max(0, thickness / 2);
			for (int i = 0; i <= num; i++)
			{
				float num3 = (float)i / (float)num;
				int num4 = Mathf.RoundToInt(Mathf.Lerp((float)x0, (float)x1, num3));
				int num5 = Mathf.RoundToInt(Mathf.Lerp((float)y0, (float)y1, num3));
				for (int j = -num2; j <= num2; j++)
				{
					for (int k = -num2; k <= num2; k++)
					{
						BlendConceptPixel(texture, num4 + k, num5 + j, color);
					}
				}
			}
		}

		private static void SetConceptRect(Component component, float x, float y, float width, float height)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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)
			RectTransform component2 = component.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0.5f);
			component2.anchorMax = new Vector2(0f, 0.5f);
			component2.pivot = new Vector2(0.5f, 0.5f);
			component2.sizeDelta = new Vector2(Scale(width), Scale(height));
			component2.anchoredPosition = ConceptPoint(x + width * 0.5f, y + height * 0.5f);
		}

		private static void SetConceptRectLeftPivot(Component component, float x, float y, float width, float height)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component2 = component.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0.5f);
			component2.anchorMax = new Vector2(0f, 0.5f);
			component2.pivot = new Vector2(0f, 0.5f);
			component2.sizeDelta = new Vector2(Scale(width), Scale(height));
			component2.anchoredPosition = ConceptPoint(x, y + height * 0.5f);
		}

		private static Vector2 ConceptPoint(float x, float y)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(Scale(x), PanelSize.y * 0.5f - Scale(y));
		}

		private static float Scale(float value)
		{
			return value * 0.45f;
		}

		private static int ScaleFont(float value)
		{
			return Mathf.Max(6, Mathf.RoundToInt(Scale(value)));
		}

		private static Color WithAlpha(Color color, float alpha)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			return new Color(color.r, color.g, color.b, alpha);
		}

		private static void SetConceptPixel(Texture2D texture, int x, int y, Color color)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (x >= 0 && x < 620 && y >= 0 && y < 132)
			{
				texture.SetPixel(x, 131 - y, color);
			}
		}

		private static void BlendConceptPixel(Texture2D texture, int x, int y, Color source)
		{
			//IL_002d: 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_0033: 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_0044: 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_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_0079: 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_0090: 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)
			//IL_009d: 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_00af: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (x >= 0 && x < 620 && y >= 0 && y < 132 && IsInsideCapsule(x, y))
			{
				int num = 131 - y;
				Color pixel = texture.GetPixel(x, num);
				float num2 = source.a + pixel.a * (1f - source.a);
				if (num2 <= 0.0001f)
				{
					texture.SetPixel(x, num, Color.clear);
					return;
				}
				Color val = default(Color);
				((Color)(ref val))..ctor((source.r * source.a + pixel.r * pixel.a * (1f - source.a)) / num2, (source.g * source.a + pixel.g * pixel.a * (1f - source.a)) / num2, (source.b * source.a + pixel.b * pixel.a * (1f - source.a)) / num2, num2);
				texture.SetPixel(x, num, val);
			}
		}

		private static bool IsExpeditionInLevel()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			try
			{
				return GameStateManager.IsInExpedition && (int)GameStateManager.CurrentStateName == 10;
			}
			catch
			{
				return false;
			}
		}

		private void SetRootActive(bool active)
		{
			if (_root.activeSelf != active)
			{
				_root.SetActive(active);
			}
		}

		private static void AddReadableTextEffect(Text text, float alpha, float offset)
		{
			//IL_0022: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			Outline obj = ((Component)text).gameObject.AddComponent<Outline>();
			((Shadow)obj).effectColor = new Color(0f, 0f, 0f, alpha * 0.72f);
			float num = Mathf.Clamp(offset * 0.65f, 0.35f, 0.8f);
			((Shadow)obj).effectDistance = new Vector2(num, 0f - num);
			Shadow obj2 = ((Component)text).gameObject.AddComponent<Shadow>();
			obj2.effectColor = new Color(0f, 0f, 0f, alpha);
			obj2.effectDistance = new Vector2(offset, 0f - offset);
		}
	}
	public readonly struct ActiveSkillHudStatus
	{
		public string SkillId { get; }

		public string SkillName { get; }

		public string StateText { get; }

		public bool IsReady { get; }

		public bool IsActive { get; }

		public bool IsLocked { get; }

		public float CooldownRemaining { get; }

		public float CooldownTotal { get; }

		public float ActiveRemaining { get; }

		public float ActiveTotal { get; }

		public Color AccentColor { get; }

		public int SkillOrder { get; }

		public bool HasValue => !string.IsNullOrEmpty(SkillId);

		public int DisplayPriority
		{
			get
			{
				if (!IsActive)
				{
					if (!IsReady)
					{
						return (!IsLocked) ? 1 : 0;
					}
					return 2;
				}
				return 3;
			}
		}

		public ActiveSkillHudStatus(string skillId, string skillName, string stateText, bool isReady, bool isActive, bool isLocked, float cooldownRemaining, float cooldownTotal, float activeRemaining, float activeTotal, Color accentColor, int skillOrder)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			SkillId = skillId;
			SkillName = skillName;
			StateText = stateText;
			IsReady = isReady;
			IsActive = isActive;
			IsLocked = isLocked;
			CooldownRemaining = Mathf.Max(0f, cooldownRemaining);
			CooldownTotal = Mathf.Max(0.1f, cooldownTotal);
			ActiveRemaining = Mathf.Max(0f, activeRemaining);
			ActiveTotal = Mathf.Max(0.1f, activeTotal);
			AccentColor = accentColor;
			SkillOrder = skillOrder;
		}
	}
	public sealed class BuffBar
	{
		private readonly GameObject _panel;

		private readonly Text _text;

		private readonly Image _accent;

		public BuffBar(Transform parent)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_00a1: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			_panel = UiFactory.CreatePanel("BuffBar", parent, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(680f, 38f), new Vector2(0f, -42f));
			_accent = UiFactory.CreateImage("BuffAccent", _panel.transform, UiFactory.MutedTextColor);
			UiFactory.SetRect((Component)(object)_accent, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(4f, 24f), new Vector2(18f, 0f));
			_text = UiFactory.CreateText("BuffBarText", _panel.transform, RogueLocalization.ActiveCardsStatus(0), 16, (TextAnchor)4, UiFactory.MutedTextColor);
			UiFactory.Stretch((Component)(object)_text, 30f, 4f, 12f, 4f);
		}

		public void Refresh(RogueState state)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (state.SelectedCards.Count == 0)
			{
				((Graphic)_accent).color = UiFactory.MutedTextColor;
				((Graphic)_text).color = UiFactory.MutedTextColor;
				_text.text = RogueLocalization.ActiveCardsStatus(0);
				return;
			}
			((Graphic)_accent).color = UiFactory.AccentColor;
			((Graphic)_text).color = UiFactory.TextColor;
			string text = string.Join("  +  ", state.SelectedCards.Select((RogueCard card) => RogueLocalization.UpperForCurrentLanguage(card.DisplayName())));
			_text.text = "KRP / " + text;
		}

		public void SetVisible(bool visible)
		{
			_panel.SetActive(visible);
		}
	}
	public sealed class CardPoolPanel
	{
		private const int Columns = 4;

		private const float CellWidth = 344f;

		private const float CellHeight = 184f;

		private const float EntryWidth = 320f;

		private const float EntryHeight = 156f;

		private const float ViewportWidth = 1440f;

		private const float ViewportHeight = 610f;

		private const float TopPadding = 23f;

		private const float ScrollStep = 96f;

		private readonly GameObject _panel;

		private readonly RectTransform _contentRoot;

		private readonly Image _scrollTrack;

		private readonly Image _scrollThumb;

		private readonly Text _headerText;

		private readonly Text _promptText;

		private readonly List<GameObject> _entries = new List<GameObject>();

		private RogueCard[] _cards = Array.Empty<RogueCard>();

		private CorruptionCard[] _corruptionCards = Array.Empty<CorruptionCard>();

		private readonly HashSet<string> _selectedCorruptionIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

		private Action<RogueCard>? _onSelected;

		private Func<CorruptionCard, bool, bool>? _onCorruptionToggled;

		private bool _isCorruptionMode;

		private bool _isVisible;

		private float _scrollOffset;

		private float _maxScrollOffset;

		public bool IsVisible => _isVisible;

		public int CardViewCount => _entries.Count;

		public CardPoolPanel(Transform parent)
		{
			//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_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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: 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_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: 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_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: 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_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			_panel = UiFactory.CreateRect("DevelopmentCardPoolPanel", parent, Vector2.zero, Vector2.one, Vector2.zero, Vector2.zero);
			UiFactory.Stretch((Component)(object)UiFactory.CreateImage("CardPoolDimmer", _panel.transform, new Color(0f, 0.005f, 0.006f, 0.9f)), 0f, 0f, 0f, 0f);
			GameObject val = UiFactory.CreatePanel("CardPoolFrame", _panel.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(1540f, 840f), new Vector2(0f, -20f));
			((Graphic)val.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.72f);
			_headerText = UiFactory.CreateText("CardPoolHeader", val.transform, RogueLocalization.Pick("<color=#8FDCFF>Kain</color> ROGUE PROTOCOL / DEV CARD POOL", "<color=#8FDCFF>Kain</color> ROGUE PROTOCOL / 开发卡池"), 27, (TextAnchor)3, UiFactory.AccentColor);
			_headerText.fontStyle = (FontStyle)1;
			UiFactory.SetRect((Component)(object)_headerText, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-80f, 48f), new Vector2(40f, -44f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateImage("CardPoolRule", val.transform, UiFactory.LineColor), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-80f, 2f), new Vector2(40f, -78f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("CardPoolSub", val.transform, RogueLocalization.Pick("Dev test tool: click any card to add it to the current run. Scroll to browse, press ESC to close.", "开发测试工具:点击任意卡牌立即加入当前运行状态。滚轮浏览,按 ESC 关闭。"), 15, (TextAnchor)3, UiFactory.MutedTextColor), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-80f, 28f), new Vector2(40f, -105f));
			GameObject val2 = UiFactory.CreateRect("CardPoolGridViewport", val.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(1440f, 610f), new Vector2(0f, -42f));
			val2.AddComponent<RectMask2D>();
			GameObject val3 = UiFactory.CreateRect("CardPoolGridContent", val2.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(1440f, 610f), Vector2.zero);
			_contentRoot = val3.GetComponent<RectTransform>();
			_contentRoot.pivot = new Vector2(0.5f, 1f);
			_scrollTrack = UiFactory.CreateImage("CardPoolScrollTrack", val.transform, new Color(0.12f, 0.2f, 0.18f, 0.28f));
			UiFactory.SetRect((Component)(object)_scrollTrack, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(3f, 610f), new Vector2(-40f, -42f));
			_scrollThumb = UiFactory.CreateImage("CardPoolScrollThumb", ((Component)_scrollTrack).transform, UiFactory.AccentColor);
			((Graphic)_scrollThumb).color = new Color(UiFactory.AccentColor.r, UiFactory.AccentColor.g, UiFactory.AccentColor.b, 0.78f);
			UiFactory.SetRect((Component)(object)_scrollThumb, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(7f, 120f), Vector2.zero);
			_promptText = UiFactory.CreateText("CardPoolPrompt", val.transform, RogueLocalization.Pick("Hotkeys: ~ open panel / F8 persistent UI / F7 random reward", "快捷键 ~ 打开本面板 / F8 常驻 UI / F7 随机三选一"), 14, (TextAnchor)4, UiFactory.TextColor);
			_promptText.text = "Hotkeys: KAIN sequence opens panel / F8 persistent UI / F7 random reward";
			UiFactory.SetRect((Component)(object)_promptText, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(-80f, 34f), new Vector2(40f, 34f));
			_panel.SetActive(false);
		}

		public void Show(RogueCard[] cards, Action<RogueCard> onSelected)
		{
			_isCorruptionMode = false;
			_cards = cards;
			_corruptionCards = Array.Empty<CorruptionCard>();
			_onSelected = onSelected;
			_onCorruptionToggled = null;
			_selectedCorruptionIds.Clear();
			_headerText.text = RogueLocalization.Pick("<color=#8FDCFF>Kain</color> ROGUE PROTOCOL / DEV CARD POOL", "<color=#8FDCFF>Kain</color> ROGUE PROTOCOL / DEV CARD POOL");
			_scrollOffset = 0f;
			RebuildEntries();
			_panel.SetActive(true);
			_isVisible = true;
		}

		public void ShowCorruptions(CorruptionCard[] cards, IEnumerable<string> selectedIds, Func<CorruptionCard, bool, bool> onToggled)
		{
			_isCorruptionMode = true;
			_cards = Array.Empty<RogueCard>();
			_corruptionCards = cards;
			_onSelected = null;
			_onCorruptionToggled = onToggled;
			_selectedCorruptionIds.Clear();
			foreach (string selectedId in selectedIds)
			{
				if (!string.IsNullOrWhiteSpace(selectedId))
				{
					_selectedCorruptionIds.Add(selectedId);
				}
			}
			_headerText.text = RogueLocalization.Pick("<color=#FF5B5B>Kain</color> ROGUE PROTOCOL / CORRUPTION POOL", "<color=#FF5B5B>Kain</color> ROGUE PROTOCOL / CORRUPTION POOL");
			_scrollOffset = 0f;
			RebuildEntries();
			_panel.SetActive(true);
			_isVisible = true;
		}

		public void Tick()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (!_isVisible)
			{
				return;
			}
			if (Input.GetKeyDown((KeyCode)27))
			{
				Close();
				return;
			}
			float num = Input.mouseScrollDelta.y;
			if (Mathf.Abs(num) <= 0.001f)
			{
				num = Input.GetAxis("Mouse ScrollWheel") * 10f;
			}
			if (Mathf.Abs(num) > 0.001f && _maxScrollOffset > 0f)
			{
				_scrollOffset = Mathf.Clamp(_scrollOffset - num * 96f, 0f, _maxScrollOffset);
				ApplyScrollPosition();
			}
		}

		private void RebuildEntries()
		{
			//IL_0138: 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)
			foreach (GameObject entry in _entries)
			{
				Object.Destroy((Object)(object)entry);
			}
			_entries.Clear();
			int num = (_isCorruptionMode ? _corruptionCards.Length : _cards.Length);
			int num2 = Mathf.CeilToInt((float)num / 4f);
			float num3 = Mathf.Max(610f, 23f + (float)num2 * 184f);
			_contentRoot.SetSizeWithCurrentAnchors((Axis)0, 1440f);
			_contentRoot.SetSizeWithCurrentAnchors((Axis)1, num3);
			_maxScrollOffset = Mathf.Max(0f, num3 - 610f);
			_scrollOffset = Mathf.Clamp(_scrollOffset, 0f, _maxScrollOffset);
			for (int i = 0; i < num; i++)
			{
				int num4 = i % 4;
				int num5 = i / 4;
				float num6 = -516f + (float)num4 * 344f;
				float num7 = -101f - (float)num5 * 184f;
				if (_isCorruptionMode)
				{
					CreateCorruptionEntry(_corruptionCards[i], i, new Vector2(num6, num7));
				}
				else
				{
					CreateEntry(_cards[i], i, new Vector2(num6, num7));
				}
			}
			ApplyScrollPosition();
			if (_isCorruptionMode)
			{
				_promptText.text = ((_maxScrollOffset > 0f) ? RogueLocalization.Format("Loaded {0} corruptions. Scroll to browse, click to toggle for this run, press ESC to close.", "Loaded {0} corruptions. Scroll to browse, click to toggle for this run, press ESC to close.", num) : RogueLocalization.Format("Loaded {0} corruptions. Click to toggle for this run, press ESC to close.", "Loaded {0} corruptions. Click to toggle for this run, press ESC to close.", num));
			}
			else
			{
				_promptText.text = ((_maxScrollOffset > 0f) ? RogueLocalization.Format("Loaded {0} cards. Scroll to browse, click to select, press ESC to close.", "已载入 {0} 张卡。滚轮滚动浏览,点击选择,按 ESC 关闭。", _cards.Length) : RogueLocalization.Format("Loaded {0} cards. Click any card to select, press ESC to close.", "已载入 {0} 张卡。点击任意卡牌立即选择,按 ESC 关闭。", _cards.Length));
			}
		}

		private void CreateEntry(RogueCard card, int index, Vector2 position)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_007b: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: 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_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: 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_0280: 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_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			GameObject entry = UiFactory.CreateCard($"CardPoolEntry_{index + 1}", (Transform)(object)_contentRoot);
			UiFactory.SetRect((Component)(object)entry.GetComponent<RectTransform>(), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(320f, 156f), position);
			((Graphic)entry.GetComponent<Image>()).color = new Color(0.024f, 0.038f, 0.035f, 0.95f);
			_entries.Add(entry);
			Color rarityColor = RogueUiAssetLibrary.RarityPrimaryColor(card.Rarity);
			float glowStrength = RogueUiAssetLibrary.RarityGlowStrength(card.Rarity);
			int rank = RogueUiAssetLibrary.RarityRank(card.Rarity);
			Image[] edgeGlows = CreateEntryEdgeGlows(entry.transform);
			Image[] particles = CreateEntryPerimeterParticles(entry.transform, index);
			SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.1f + glowStrength * 0.3f), rank);
			SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.12f + glowStrength * 0.36f), rank, index);
			UiFactory.SetRect((Component)(object)UiFactory.CreateImage("Accent", entry.transform, rarityColor), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, (float)(4 + rank)), new Vector2(0f, -2f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("Index", entry.transform, $"{index + 1:00}", 14, (TextAnchor)3, UiFactory.AccentColor), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(44f, 24f), new Vector2(34f, -24f));
			RogueUiAssetLibrary.BindRarityModule(UiFactory.CreateRect("RarityModuleSlot", entry.transform, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(46f, 46f), new Vector2(-42f, -40f)).transform, card.Rarity, out Image baseImage, out Image rarityGlow, out Image rarityAccent);
			UiFactory.Stretch((Component)(object)baseImage, 0f, 0f, 0f, 0f);
			UiFactory.Stretch((Component)(object)rarityGlow, -6f, -6f, -6f, -6f);
			UiFactory.Stretch((Component)(object)rarityAccent, 0f, 0f, 0f, 0f);
			Text obj = UiFactory.CreateText("Title", entry.transform, card.DisplayName(), 18, (TextAnchor)3, UiFactory.TextColor);
			obj.resizeTextForBestFit = true;
			obj.resizeTextMinSize = 12;
			obj.resizeTextMaxSize = 18;
			UiFactory.SetRect((Component)(object)obj, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-112f, 28f), new Vector2(84f, -24f));
			Text obj2 = UiFactory.CreateText("Description", entry.transform, card.DisplayDescription(), 12, (TextAnchor)0, UiFactory.TextColor);
			obj2.resizeTextForBestFit = true;
			obj2.resizeTextMinSize = 9;
			obj2.resizeTextMaxSize = 12;
			UiFactory.SetRect((Component)(object)obj2, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-34f, 58f), new Vector2(17f, -88f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("Tags", entry.transform, card.DisplayCompactTags(3), 10, (TextAnchor)3, UiFactory.MutedTextColor), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(-34f, 22f), new Vector2(17f, 18f));
			((UnityEvent)entry.AddComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				Select(card);
			}));
			EventTrigger trigger = entry.AddComponent<EventTrigger>();
			AddTrigger(trigger, (EventTriggerType)0, delegate
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//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)
				entry.transform.localScale = Vector3.one * 1.018f;
				SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.24f + glowStrength * 0.45f), rank);
				SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.22f + glowStrength * 0.48f), rank, index);
				RogueUiAssetLibrary.SetRarityModuleState(rarityGlow, rarityAccent, highlighted: true, selected: false);
			});
			AddTrigger(trigger, (EventTriggerType)1, delegate
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				entry.transform.localScale = Vector3.one;
				SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.1f + glowStrength * 0.3f), rank);
				SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.12f + glowStrength * 0.36f), rank, index);
				RogueUiAssetLibrary.SetRarityModuleState(rarityGlow, rarityAccent, highlighted: false, selected: false);
			});
		}

		private void Select(RogueCard card)
		{
			Close();
			_onSelected?.Invoke(card);
		}

		private void CreateCorruptionEntry(CorruptionCard card, int index, Vector2 position)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: 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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: 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_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			GameObject entry = UiFactory.CreateCard($"CorruptionPoolEntry_{index + 1}", (Transform)(object)_contentRoot);
			UiFactory.SetRect((Component)(object)entry.GetComponent<RectTransform>(), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(320f, 156f), position);
			bool flag = _selectedCorruptionIds.Contains(card.Id);
			((Graphic)entry.GetComponent<Image>()).color = (flag ? new Color(0.085f, 0.028f, 0.028f, 0.98f) : new Color(0.032f, 0.025f, 0.026f, 0.95f));
			_entries.Add(entry);
			string rarity = CorruptionRarity(card);
			Color rarityColor = (flag ? UiFactory.DangerColor : RogueUiAssetLibrary.RarityPrimaryColor(rarity));
			float glowStrength = (flag ? 0.88f : RogueUiAssetLibrary.RarityGlowStrength(rarity));
			int rank = (flag ? 4 : RogueUiAssetLibrary.RarityRank(rarity));
			Image[] edgeGlows = CreateEntryEdgeGlows(entry.transform);
			Image[] particles = CreateEntryPerimeterParticles(entry.transform, index);
			SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.16f + glowStrength * 0.34f), rank);
			SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.15f + glowStrength * 0.38f), rank, index);
			UiFactory.SetRect((Component)(object)UiFactory.CreateImage("Accent", entry.transform, rarityColor), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, (float)(flag ? 8 : (4 + rank))), new Vector2(0f, -2f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("Index", entry.transform, $"{index + 1:00}", 14, (TextAnchor)3, flag ? UiFactory.DangerColor : UiFactory.AccentColor), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(44f, 24f), new Vector2(34f, -24f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("State", entry.transform, flag ? "ACTIVE" : "AVAILABLE", 11, (TextAnchor)5, flag ? UiFactory.DangerColor : UiFactory.MutedTextColor), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(92f, 22f), new Vector2(-28f, -22f));
			Text obj = UiFactory.CreateText("Title", entry.transform, card.DisplayName(), 18, (TextAnchor)3, UiFactory.TextColor);
			obj.resizeTextForBestFit = true;
			obj.resizeTextMinSize = 12;
			obj.resizeTextMaxSize = 18;
			UiFactory.SetRect((Component)(object)obj, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-126f, 28f), new Vector2(84f, -24f));
			Text obj2 = UiFactory.CreateText("Description", entry.transform, card.DisplayDescription(), 12, (TextAnchor)0, UiFactory.TextColor);
			obj2.resizeTextForBestFit = true;
			obj2.resizeTextMinSize = 9;
			obj2.resizeTextMaxSize = 12;
			UiFactory.SetRect((Component)(object)obj2, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-34f, 58f), new Vector2(17f, -88f));
			UiFactory.SetRect((Component)(object)UiFactory.CreateText("Tags", entry.transform, $"{card.Tier} / THREAT {card.ThreatScore}", 10, (TextAnchor)3, UiFactory.MutedTextColor), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(-34f, 22f), new Vector2(17f, 18f));
			((UnityEvent)entry.AddComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				ToggleCorruption(card);
			}));
			EventTrigger trigger = entry.AddComponent<EventTrigger>();
			AddTrigger(trigger, (EventTriggerType)0, delegate
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//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)
				entry.transform.localScale = Vector3.one * 1.018f;
				SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.3f + glowStrength * 0.45f), rank);
				SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.25f + glowStrength * 0.48f), rank, index);
			});
			AddTrigger(trigger, (EventTriggerType)1, delegate
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				entry.transform.localScale = Vector3.one;
				SetEntryEdgeGlowColors(edgeGlows, rarityColor, Mathf.Clamp01(0.16f + glowStrength * 0.34f), rank);
				SetEntryParticleColors(particles, rarityColor, Mathf.Clamp01(0.15f + glowStrength * 0.38f), rank, index);
			});
		}

		private void ToggleCorruption(CorruptionCard card)
		{
			bool flag = !_selectedCorruptionIds.Contains(card.Id);
			if (!flag && _selectedCorruptionIds.Count <= 1)
			{
				_promptText.text = RogueLocalization.Pick("At least one corruption must remain selected for this run.", "At least one corruption must remain selected for this run.");
				return;
			}
			Func<CorruptionCard, bool, bool>? onCorruptionToggled = _onCorruptionToggled;
			if (onCorruptionToggled == null || !onCorruptionToggled(card, flag))
			{
				_promptText.text = RogueLocalization.Pick("Corruption selection was not accepted by host authority.", "Corruption selection was not accepted by host authority.");
				return;
			}
			if (flag)
			{
				_selectedCorruptionIds.Add(card.Id);
			}
			else
			{
				_selectedCorruptionIds.Remove(card.Id);
			}
			RebuildEntries();
		}

		public void Close()
		{
			_panel.SetActive(false);
			_isVisible = false;
		}

		private void ApplyScrollPosition()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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)
			_contentRoot.anchoredPosition = new Vector2(0f, _scrollOffset);
			bool flag = _maxScrollOffset > 0f;
			((Component)_scrollTrack).gameObject.SetActive(flag);
			if (flag)
			{
				Rect rect = _contentRoot.rect;
				float num = Mathf.Max(610f, ((Rect)(ref rect)).height);
				float num2 = Mathf.Clamp(610f / num * 610f, 74f, 610f);
				float num3 = Mathf.Max(0f, 610f - num2);
				float num4 = ((_maxScrollOffset <= 0f) ? 0f : (_scrollOffset / _maxScrollOffset));
				RectTransform rectTransform = ((Graphic)_scrollThumb).rectTransform;
				rectTransform.SetSizeWithCurrentAnchors((Axis)0, 7f);
				rectTransform.SetSizeWithCurrentAnchors((Axis)1, num2);
				rectTransform.anchoredPosition = new Vector2(0f, (0f - num4) * num3);
			}
		}

		private static void AddTrigger(EventTrigger trigger, EventTriggerType type, Action<BaseEventData> callback)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			Entry val = new Entry
			{
				eventID = type
			};
			((UnityEvent<BaseEventData>)(object)val.callback).AddListener(UnityAction<BaseEventData>.op_Implicit(callback));
			trigger.triggers.Add(val);
		}

		private static string DisplayRarity(string rarity)
		{
			return RogueLocalization.DisplayRarity(rarity);
		}

		private static string CorruptionRarity(CorruptionCard card)
		{
			if (card.ThreatScore < 3)
			{
				if (card.ThreatScore < 2)
				{
					return "rare";
				}
				return "epic";
			}
			return "legendary";
		}

		private static Color WithAlpha(Color color, float alpha)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			color.a = alpha;
			return color;
		}

		private static Image[] CreateEntryEdgeGlows(Transform parent)
		{
			//IL_001a: 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_003f: 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_005d: 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_0097: 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_00b5: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			Image val = UiFactory.CreateImage("RarityEntryEdgeTop", parent, new Color(1f, 1f, 1f, 0f));
			UiFactory.SetRect((Component)(object)val, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(16f, 4f), new Vector2(0f, 2f));
			Image val2 = UiFactory.CreateImage("RarityEntryEdgeBottom", parent, new Color(1f, 1f, 1f, 0f));
			UiFactory.SetRect((Component)(object)val2, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(16f, 4f), new Vector2(0f, -2f));
			Image val3 = UiFactory.CreateImage("RarityEntryEdgeLeft", parent, new Color(1f, 1f, 1f, 0f));
			UiFactory.SetRect((Component)(object)val3, new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(4f, 16f), new Vector2(-2f, 0f));
			Image val4 = UiFactory.CreateImage("RarityEntryEdgeRight", parent, new Color(1f, 1f, 1f, 0f));
			UiFactory.SetRect((Component)(object)val4, new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(4f, 16f), new Vector2(2f, 0f));
			return (Image[])(object)new Image[4] { val, val2, val3, val4 };
		}

		private static Image[] CreateEntryPerimeterParticles(Transform parent, int entryIndex)
		{
			//IL_0034: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			Image[] array = (Image[])(object)new Image[14];
			Vector2 val2 = default(Vector2);
			for (int i = 0; i < 14; i++)
			{
				Image val = UiFactory.CreateImage($"RarityEntryParticle_{i:00}", parent, new Color(1f, 1f, 1f, 0f));
				RectTransform rectTransform = ((Graphic)val).rectTransform;
				int num = i % 4;
				float num2 = Mathf.Repeat((float)i * 0.29f + (float)entryIndex * 0.07f, 1f);
				float num3 = 4f + (float)(i % 3) * 2f;
				switch (num)
				{
				case 0:
					((Vector2)(ref val2))..ctor(num2, 1f);
					rectTransform.anchorMax = val2;
					rectTransform.anchorMin = val2;
					rectTransform.anchoredPosition = new Vector2(0f, num3);
					break;
				case 1:
					((Vector2)(ref val2))..ctor(1f, num2);
					rectTransform.anchorMax = val2;
					rectTransform.anchorMin = val2;
					rectTransform.anchoredPosition = new Vector2(num3, 0f);
					break;
				case 2:
					((Vector2)(ref val2))..ctor(1f - num2, 0f);
					rectTransform.anchorMax = val2;
					rectTransform.anchorMin = val2;
					rectTransform.anchoredPosition = new Vector2(0f, 0f - num3);
					break;
				default:
					((Vector2)(ref val2))..ctor(0f, 1f - num2);
					rectTransform.anchorMax = val2;
					rectTransform.anchorMin = val2;
					rectTransform.anchoredPosition = new Vector2(0f - num3, 0f);
					break;
				}
				rectTransform.pivot = new Vector2(0.5f, 0.5f);
				rectTransform.sizeDelta = new Vector2(3f, 3f);
				array[i] = val;
			}
			return array;
		}

		private static void SetEntryEdgeGlowColors(Image[] edgeGlows, Color color, float alpha, int rank)
		{
			//IL_0009: 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)
			for (int i = 0; i < edgeGlows.Length; i++)
			{
				((Graphic)edgeGlows[i]).color = WithAlpha(color, (rank <= 0) ? 0f : alpha);
			}
		}

		private static void SetEntryParticleColors(Image[] particles, Color color, float alpha, int rank, int entryIndex)
		{
			//IL_0062: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			int num = rank switch
			{
				1 => 4, 
				2 => 7, 
				3 => 10, 
				4 => particles.Length, 
				_ => 0, 
			};
			for (int i = 0; i < particles.Length; i++)
			{
				float num2 = 0.45f + Mathf.Sin(Time.time * 2.5f + (float)i * 0.9f + (float)entryIndex) * 0.55f;
				((Graphic)particles[i]).color = WithAlpha(color, (i < num) ? Mathf.Clamp01(alpha * num2) : 0f);
				float num3 = 2.2f + (float)rank * 0.45f + num2 * 1.4f;
				((Graphic)particles[i]).rectTransform.sizeDelta = new Vector2(num3, num3);
			}
		}
	}
	public sealed class ConditionalCardStatusPanel
	{
		private sealed class RowView
		{
			public GameObject Root { get; }

			public Image Rarity { get; }

			public Text Title { get; }

			public Text Status { get; }

			public RowView(GameObject root, Image rarity, Text title, Text status)
			{
				Root = root;
				Rarity = rarity;
				Title = title;
				Status = status;
			}
		}

		private static readonly HashSet<string> ActiveSkillEffectTypes = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Dash", "TempHealthPulse", "FireCoverage", "EscapePlan", "DecoyProtocol", "FocusStance", "PurifyingFlame", "SilentInfiltration", "DimensionalAnchor" };

		private static readonly HashSet<int> ConditionalCardIds = new HashSet<int>
		{
			100302, 100304, 100305, 100306, 100309, 100310, 100313, 100314, 100315, 100316,
			100318, 100320, 100322, 100323, 100327, 100328, 100361, 100372
		};

		private readonly GameObject _panel;

		private readonly List<RowView> _rows = new List<RowView>();

		private RogueCard[] _cards = Array.Empty<RogueCard>();

		private int _lastVersion = -1;

		private float _nextTextUpdateAt;

		private int _visibleCardCount;

		private bool _visible = true;

		public int CardViewCount => _visibleCardCount;

		public ConditionalCardStatusPanel(Transform parent)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_0068: 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)
			_panel = UiFactory.CreateRect("KRP.ConditionalCardStatusPanel", parent, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(390f, 520f), new Vector2(28f, -82f));
			_panel.GetComponent<RectTransform>().pivot = new Vector2(0f, 0.5f);
			_panel.SetActive(true);
		}

		public void Refresh(RogueState state)
		{
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if (_lastVersion == state.Version)
			{
				return;
			}
			_lastVersion = state.Version;
			_cards = state.SelectedCards.Where((RogueCard card) => ConditionalCardIds.Contains(card.PersistentID) && !IsActiveSkillCard(card)).ToArray();
			EnsureRows(_cards.Length);
			int num = 0;
			for (int num2 = 0; num2 < _rows.Count; num2++)
			{
				if (num2 < _cards.Length)
				{
					BindStatic(_rows[num2], _cards[num2], num2);
					bool flag = ShouldDisplayCard(_cards[num2], Time.time);
					_rows[num2].Root.SetActive(flag);
					if (flag)
					{
						_rows[num2].Root.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, (float)(-num * 48));
						num++;
					}
				}
				else
				{
					_rows[num2].Root.SetActive(false);
				}
			}
			_visibleCardCount = num;
			_panel.SetActive(_visible && _visibleCardCount > 0);
			_nextTextUpdateAt = 0f;
		}

		public void Tick()
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			if (!_visible || _cards.Length == 0 || Time.unscaledTime < _nextTextUpdateAt)
			{
				return;
			}
			_nextTextUpdateAt = Time.unscaledTime + 0.25f;
			int num = 0;
			for (int i = 0; i < _cards.Length && i < _rows.Count; i++)
			{
				RogueCard card = _cards[i];
				bool flag = ShouldDisplayCard(card, Time.time);
				_rows[i].Root.SetActive(flag);
				if (flag)
				{
					_rows[i].Root.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, (float)(-num * 48));
					_rows[i].Status.text = BuildStatusText(card, Time.time);
					num++;
				}
			}
			_visibleCardCount = num;
			_panel.SetActive(_visible && _visibleCardCount > 0);
		}

		public void SetVisible(bool visible)
		{
			_visible = visible;
			_panel.SetActive(visible && _cards.Length != 0);
		}

		private void EnsureRows(int count)
		{
			while (_rows.Count < count)
			{
				_rows.Add(CreateRow(_rows.Count));
			}
		}

		private RowView CreateRow(int index)
		{
			//IL_0032: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_00aa: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: 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_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = UiFactory.CreateCard($"ConditionalCard_{index:00}", _panel.transform);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 1f);
			component.anchorMax = new Vector2(0f, 1f);
			component.pivot = new Vector2(0f, 1f);
			component.sizeDelta = new Vector2(350f, 42f);
			component.anchoredPosition = new Vector2(0f, (float)(-index * 48));
			((Graphic)val.GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.08f);
			Outline component2 = val.GetComponent<Outline>();
			if ((Object)(object)component2 != (Object)null)
			{
				((Shadow)component2).effectColor = new Color(0.7f, 0.9f, 0.82f, 0.08f);
				((Shadow)component2).effectDistance = new Vector2(1f, -1f);
			}
			Image val2 = UiFactory.CreateImage("Rarity", val.transform, UiFactory.MutedTextColor);
			UiFactory.SetRect((Component)(object)val2, new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(2f, -8f), new Vector2(6f, 0f));
			((Graphic)val2).raycastTarget = false;
			Text val3 = UiFactory.CreateText("Title", val.transform, string.Empty, 13, (TextAnchor)3, new Color(0.9f, 0.97f, 0.92f, 0.94f));
			val3.resizeTextForBestFit = true;
			val3.resizeTextMinSize = 9;
			val3.resizeTextMaxSize = 13;
			AddReadableTextEffect(val3, 0.82f);
			UiFactory.SetRect((Component)(object)val3, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(-28f, 21f), new Vector2(18f, -13f));
			Text val4 = UiFactory.CreateText("Status", val.transform, string.Empty, 11, (TextAnchor)3, new Color(0.62f, 0.88f, 0.8f, 0.88f));
			val4.resizeTextForBestFit = true;
			val4.resizeTextMinSize = 8;
			val4.resizeTextMaxSize = 11;
			AddReadableTextEffect(val4, 0.72f);
			UiFactory.SetRect((Component)(object)val4, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(-28f, 19f), new Vector2(18f, 9f));
			val.SetActive(false);
			return new RowView(val, val2, val3, val4);
		}

		private static void BindStatic(RowView row, RogueCard card, int index)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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)
			row.Root.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, (float)(-index * 48));
			Color color = RogueUiAssetLibrary.RarityPrimaryColor(card.Rarity);
			color.a = 0.72f;
			((Graphic)row.Rarity).color = color;
			row.Title.text = card.DisplayName();
			row.Status.text = BuildStatusText(card, Time.time);
		}

		private static void AddReadableTextEffect(Text text, float alpha)
		{
			//IL_001c: 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)
			Shadow obj = ((Component)text).gameObject.AddComponent<Shadow>();
			obj.effectColor = new Color(0f, 0f, 0f, alpha);
			obj.effectDistance = new Vector2(1.5f, -1.5f);
		}

		private static string BuildStatusText(RogueCard card, float now)
		{
			return card.PersistentID switch
			{
				100302 => RogueGameplayRuntime.GetStableFormationStatusText(now), 
				100304 => RogueGameplayRuntime.GetChamberPrimeStatusText(now), 
				100305 => RogueGameplayRuntime.GetBulletTaxStatusText(), 
				100306 => RogueGameplayRuntime.GetSettlementProtocolStatusText(), 
				100309 => RogueGameplayRuntime.GetTrackingCalibrationStatusText(), 
				100310 => RogueGameplayRuntime.GetSoulSiphonStatusText(), 
				100313 => RogueGameplayRuntime.GetPrecisionRecycleStatusText(), 
				100314 => RogueGameplayRuntime.GetDataBackflowStatusText(), 
				100315 => RogueGameplayRuntime.GetCrossfireStatusText(), 
				100316 => RogueGameplayRuntime.GetStressResponseStatusText(now), 
				100318 => RogueGameplayRuntime.GetBufferPaddingStatusText(now), 
				100320 => RogueGameplayRuntime.GetChronicTherapyStatusText(now), 
				100322 => RogueGameplayRuntime.GetEtherealizationStatusText(now), 
				100323 => RogueGameplayRuntime.GetSilentProtocolStatusText(), 
				100327 => RogueGameplayRuntime.GetEmergencyEvasionStatusText(now), 
				100328 => RogueGameplayRuntime.GetSkilledHandsStatusText(now), 
				100361 => RogueGameplayRuntime.GetCatalyticReactionStatusText(), 
				100372 => ThirdWaveCardRuntime.GetDeepRootedStatusText(), 
				100367 => ToolCardRuntime.GetEngineeri