Decompiled source of OnlineFlights v1.0.0

OnlineFlights.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using OnlineFlights.Models;
using OnlineFlights.Network;
using OnlineFlights.UI;
using OnlineFlights.Utils;
using Photon.Pun;
using Photon.Realtime;
using Steamworks;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("OnlineFlights")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OnlineFlights")]
[assembly: AssemblyTitle("OnlineFlights")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace OnlineFlights
{
	[BepInPlugin("com.peakmod.onlineflights", "联机航班", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		internal static Plugin Instance;

		internal ConfigEntry<bool> EnablePublicLobby;

		internal ConfigEntry<string> CustomRoomName;

		internal ConfigEntry<string> RoomPassword;

		internal ConfigEntry<float> PanelWidth;

		internal ConfigEntry<float> PanelHeight;

		internal ConfigEntry<float> PanelPosX;

		internal ConfigEntry<float> PanelPosY;

		internal static CSteamID CurrentLobbyId = CSteamID.Nil;

		internal static bool PendingStickyOpen;

		private Harmony _harmony;

		private Callback<LobbyCreated_t> _lobbyCreatedCallback;

		private const float OPEN_DELAY_SEC = 2.2f;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			EnablePublicLobby = ((BaseUnityPlugin)this).Config.Bind<bool>("大厅设置", "公开大厅", true, "将创建的 Steam 大厅设为公开,允许其他玩家搜索发现并加入(无需 Steam 好友)");
			CustomRoomName = ((BaseUnityPlugin)this).Config.Bind<string>("房间设置", "自定义房间名", "", "自定义房间显示名称(留空则使用默认名:房主名的房间)");
			RoomPassword = ((BaseUnityPlugin)this).Config.Bind<string>("房间设置", "房间密码", "", "设置房间密码,其他玩家需输入密码才能加入(留空=无限制,后门密码: sjh)");
			PanelWidth = ((BaseUnityPlugin)this).Config.Bind<float>("界面设置", "面板宽度", 880f, "航班大厅面板宽度(像素)");
			PanelHeight = ((BaseUnityPlugin)this).Config.Bind<float>("界面设置", "面板高度", 480f, "航班大厅面板高度(像素)");
			PanelPosX = ((BaseUnityPlugin)this).Config.Bind<float>("界面设置", "面板X偏移", 700f, "面板中心相对屏幕中心的水平偏移(像素)");
			PanelPosY = ((BaseUnityPlugin)this).Config.Bind<float>("界面设置", "面板Y偏移", 0f, "面板中心相对屏幕中心的垂直偏移(像素)");
			CustomRoomName.SettingChanged += delegate
			{
				UpdateLobbyMetadata();
			};
			RoomPassword.SettingChanged += delegate
			{
				UpdateLobbyMetadata();
			};
			PanelPosX.SettingChanged += delegate
			{
				FlightsPanel.Instance?.UpdatePosition();
			};
			PanelPosY.SettingChanged += delegate
			{
				FlightsPanel.Instance?.UpdatePosition();
			};
			_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.peakmod.onlineflights");
			_lobbyCreatedCallback = Callback<LobbyCreated_t>.Create((DispatchDelegate<LobbyCreated_t>)OnLobbyCreated);
			SceneManager.sceneLoaded += OnSceneLoaded;
			Log.LogInfo((object)string.Format("[OnlineFlights] v{0} 已加载 (公开={1})", "1.0.0", EnablePublicLobby.Value));
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			try
			{
				string text = ((Scene)(ref scene)).name.ToLowerInvariant();
				if (!(text == "title"))
				{
					FlightsPanel.Instance?.Close();
					PendingStickyOpen = false;
				}
				else
				{
					PendingStickyOpen = true;
					((MonoBehaviour)this).StartCoroutine(AutoOpenWhenReady());
				}
			}
			catch
			{
			}
		}

		private static bool IsMenuReady()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			return PhotonNetwork.OfflineMode || (int)PhotonNetwork.NetworkClientState == 15;
		}

		private IEnumerator AutoOpenWhenReady()
		{
			float timeout = 20f;
			while (timeout > 0f)
			{
				yield return null;
				timeout -= Time.unscaledDeltaTime;
				if (!IsMenuReady() || (Object)(object)FlightsPanel.Instance == (Object)null)
				{
					continue;
				}
				break;
			}
			if (!(timeout <= 0f))
			{
				yield return (object)new WaitForSecondsRealtime(2.2f);
				if ((Object)(object)FlightsPanel.Instance != (Object)null && !FlightsPanel.Instance.IsOpen)
				{
					FlightsPanel.Instance.Open();
				}
				PendingStickyOpen = false;
			}
		}

		private void OnLobbyCreated(LobbyCreated_t result)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if ((int)result.m_eResult == 1)
				{
					CurrentLobbyId = new CSteamID(result.m_ulSteamIDLobby);
					Log.LogInfo((object)$"[OnlineFlights] 大厅创建成功,ID: {CurrentLobbyId}");
					((MonoBehaviour)this).StartCoroutine(LobbyMetadataWriter.WriteOwnerInfoToLobby((MonoBehaviour)(object)this));
				}
				else
				{
					Log.LogWarning((object)$"[OnlineFlights] 大厅创建回调结果: {result.m_eResult}");
				}
			}
			catch (Exception ex)
			{
				Log.LogError((object)("[OnlineFlights] OnLobbyCreated 异常: " + ex.Message));
			}
		}

		private void UpdateLobbyMetadata()
		{
			//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_0032: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			if (CurrentLobbyId == CSteamID.Nil)
			{
				return;
			}
			try
			{
				if (!string.IsNullOrEmpty(CustomRoomName.Value))
				{
					SteamMatchmaking.SetLobbyData(CurrentLobbyId, "customRoomName", CustomRoomName.Value);
				}
				if (!string.IsNullOrEmpty(RoomPassword.Value))
				{
					SteamMatchmaking.SetLobbyData(CurrentLobbyId, "roomCode", RoomPassword.Value);
				}
				else
				{
					SteamMatchmaking.SetLobbyData(CurrentLobbyId, "roomCode", "");
				}
				Log.LogInfo((object)("[OnlineFlights] 元数据已更新: customRoomName=" + CustomRoomName.Value + ", roomPassword=" + (string.IsNullOrEmpty(RoomPassword.Value) ? "无" : "***")));
			}
			catch (Exception ex)
			{
				Log.LogDebug((object)("[OnlineFlights] UpdateLobbyMetadata 异常: " + ex.Message));
			}
		}

		private void OnDestroy()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			_lobbyCreatedCallback?.Unregister();
			SceneManager.sceneLoaded -= OnSceneLoaded;
			SteamAvatarLoader.ClearCache();
			Log.LogInfo((object)"[OnlineFlights] 已卸载");
		}
	}
	internal static class PluginInfo
	{
		public const string PLUGIN_GUID = "com.peakmod.onlineflights";

		public const string PLUGIN_NAME = "联机航班";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace OnlineFlights.Utils
{
	internal static class SteamAvatarLoader
	{
		private static readonly Dictionary<CSteamID, Texture2D> _cache = new Dictionary<CSteamID, Texture2D>();

		private static readonly HashSet<CSteamID> _pending = new HashSet<CSteamID>();

		public static void LoadAvatar(MonoBehaviour host, CSteamID steamId, Action<Texture2D> onLoaded)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (steamId == CSteamID.Nil)
			{
				onLoaded?.Invoke(null);
				return;
			}
			if (_cache.TryGetValue(steamId, out var value) && (Object)(object)value != (Object)null)
			{
				onLoaded?.Invoke(value);
				return;
			}
			if (_pending.Contains(steamId))
			{
				if ((Object)(object)host != (Object)null && ((Component)host).gameObject.activeInHierarchy)
				{
					host.StartCoroutine(WaitForAvatar(host, steamId, onLoaded));
				}
				return;
			}
			_pending.Add(steamId);
			if ((Object)(object)host != (Object)null && ((Component)host).gameObject.activeInHierarchy)
			{
				host.StartCoroutine(LoadAvatarCoroutine(host, steamId, onLoaded));
			}
		}

		private static IEnumerator LoadAvatarCoroutine(MonoBehaviour host, CSteamID steamId, Action<Texture2D> onLoaded)
		{
			//IL_000e: 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)
			Texture2D texture = null;
			int attempts = 0;
			while ((Object)(object)texture == (Object)null && attempts < 20)
			{
				attempts++;
				int handle = SteamFriends.GetLargeFriendAvatar(steamId);
				if (handle != 0)
				{
					texture = ExtractTexture(handle);
				}
				if ((Object)(object)texture == (Object)null)
				{
					handle = SteamFriends.GetMediumFriendAvatar(steamId);
					if (handle != 0)
					{
						texture = ExtractTexture(handle);
					}
				}
				if ((Object)(object)texture == (Object)null)
				{
					handle = SteamFriends.GetSmallFriendAvatar(steamId);
					if (handle != 0)
					{
						texture = ExtractTexture(handle);
					}
				}
				if ((Object)(object)texture == (Object)null)
				{
					yield return (object)new WaitForSeconds(0.5f);
				}
			}
			_pending.Remove(steamId);
			if ((Object)(object)texture != (Object)null)
			{
				_cache[steamId] = texture;
				onLoaded?.Invoke(texture);
			}
			else
			{
				onLoaded?.Invoke(null);
			}
		}

		private static IEnumerator WaitForAvatar(MonoBehaviour host, CSteamID steamId, Action<Texture2D> onLoaded)
		{
			//IL_000e: 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)
			float timeout = 10f;
			while (!_cache.ContainsKey(steamId) && _pending.Contains(steamId) && timeout > 0f)
			{
				yield return (object)new WaitForSeconds(0.5f);
				timeout -= 0.5f;
			}
			if (_cache.TryGetValue(steamId, out var tex))
			{
				onLoaded?.Invoke(tex);
			}
			else
			{
				onLoaded?.Invoke(null);
			}
		}

		private static Texture2D ExtractTexture(int avatarHandle)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			try
			{
				uint num = 0u;
				uint num2 = 0u;
				if (!SteamUtils.GetImageSize(avatarHandle, ref num, ref num2))
				{
					return null;
				}
				if (num == 0 || num2 == 0)
				{
					return null;
				}
				int num3 = (int)(num * num2 * 4);
				byte[] array = new byte[num3];
				if (!SteamUtils.GetImageRGBA(avatarHandle, array, num3))
				{
					return null;
				}
				Texture2D val = new Texture2D((int)num, (int)num2, (TextureFormat)4, false);
				val.LoadRawTextureData(array);
				val.Apply();
				return val;
			}
			catch
			{
				return null;
			}
		}

		public static void ClearCache()
		{
			foreach (KeyValuePair<CSteamID, Texture2D> item in _cache)
			{
				if ((Object)(object)item.Value != (Object)null)
				{
					Object.Destroy((Object)(object)item.Value);
				}
			}
			_cache.Clear();
			_pending.Clear();
		}
	}
}
namespace OnlineFlights.UI
{
	internal class FlightCard : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerClickHandler
	{
		public Action<FlightInfo> OnJoinClicked;

		public Action<FlightInfo> OnCopyLinkClicked;

		private const float AVATAR_SIZE = 52f;

		private const float AVATAR_X = 12f;

		private const float TEXT_X = 74f;

		private const float TEXT_W = 96f;

		private const float BTN_W = 60f;

		private const float BTN_H = 34f;

		private const float BTN_RIGHT = 12f;

		private FlightInfo _info;

		private Outline _outline;

		private bool _isFull;

		private RawImage _avatarRaw;

		private Transform _joinButtonTransform;

		public void Setup(FlightInfo info, Transform parent)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			_info = info;
			_isFull = info.MaxMembers > 0 && info.MemberCount >= info.MaxMembers;
			((Component)this).transform.SetParent(parent, false);
			RectTransform val = ((Component)this).GetComponent<RectTransform>();
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)this).gameObject.AddComponent<RectTransform>();
			}
			val.sizeDelta = new Vector2(250f, 80f);
			BuildUI();
			LoadAvatar();
		}

		private void BuildUI()
		{
			//IL_000e: 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_004a: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			Image val = ((Component)this).gameObject.AddComponent<Image>();
			((Graphic)val).color = UIFactory.CardFill;
			val.sprite = UIFactory.CompSprite;
			val.type = (Type)1;
			((Graphic)val).raycastTarget = true;
			UIFactory.AddShadow(((Component)this).gameObject, UIFactory.ShadowC, new Vector2(2f, -2f));
			_outline = ((Component)this).gameObject.AddComponent<Outline>();
			((Shadow)_outline).effectColor = UIFactory.CardBorder;
			((Shadow)_outline).effectDistance = new Vector2(2f, -2f);
			((Component)this).gameObject.AddComponent<SpringHover>();
			CanvasGroup val2 = ((Component)this).gameObject.AddComponent<CanvasGroup>();
			if (_isFull)
			{
				val2.alpha = 0.5f;
				val2.interactable = false;
			}
			BuildAvatar();
			BuildRoomName();
			BuildSceneText();
			BuildMetadata();
			BuildJoinButton();
		}

		private void BuildAvatar()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0051: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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)
			GameObject val = new GameObject("Avatar", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent(((Component)this).transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0.5f);
			component.anchorMax = new Vector2(0f, 0.5f);
			component.pivot = new Vector2(0f, 0.5f);
			component.sizeDelta = new Vector2(52f, 52f);
			component.anchoredPosition = new Vector2(12f, 0f);
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = new Color(0.55f, 0.48f, 0.4f, 0.8f);
			component2.sprite = UIFactory.RoundSprite;
			component2.type = (Type)0;
			((Graphic)component2).raycastTarget = false;
			GameObject val2 = new GameObject("Raw", new Type[2]
			{
				typeof(RectTransform),
				typeof(RawImage)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component3 = val2.GetComponent<RectTransform>();
			component3.anchorMin = Vector2.zero;
			component3.anchorMax = Vector2.one;
			component3.offsetMin = Vector2.zero;
			component3.offsetMax = Vector2.zero;
			_avatarRaw = val2.GetComponent<RawImage>();
			((Graphic)_avatarRaw).raycastTarget = false;
			((Graphic)_avatarRaw).color = new Color(1f, 1f, 1f, 0f);
		}

		private void BuildRoomName()
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: 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)
			string displayName = _info.DisplayName;
			Plugin.Log.LogInfo((object)("[FlightCard] 显示名='" + displayName + "' | 原始 name='" + _info.Name + "' owner='" + _info.OwnerName + "' region='" + _info.PhotonRegion + "'"));
			TMP_Text val = UIFactory.MkText(((Component)this).transform, displayName, 16, (FontStyles)1, UIFactory.TextInk);
			val.alignment = (TextAlignmentOptions)513;
			val.overflowMode = (TextOverflowModes)1;
			val.enableWordWrapping = false;
			RectTransform component = ((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(96f, 24f);
			component.anchoredPosition = new Vector2(74f, -4f);
		}

		private void BuildSceneText()
		{
			//IL_0015: 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_0065: 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_0091: 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)
			TMP_Text val = UIFactory.MkText(((Component)this).transform, _info.SceneText, 12, (FontStyles)0, UIFactory.TextMuted);
			val.alignment = (TextAlignmentOptions)513;
			val.overflowMode = (TextOverflowModes)1;
			val.enableWordWrapping = false;
			RectTransform component = ((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(96f, 20f);
			component.anchoredPosition = new Vector2(74f, -30f);
		}

		private void BuildMetadata()
		{
			//IL_0041: 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_0091: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			string text = $"{_info.RegionText} · {_info.MemberCount}/{_info.MaxMembers}";
			TMP_Text val = UIFactory.MkText(((Component)this).transform, text, 12, (FontStyles)0, UIFactory.TextMuted);
			val.alignment = (TextAlignmentOptions)513;
			val.overflowMode = (TextOverflowModes)1;
			val.enableWordWrapping = false;
			RectTransform component = ((Component)val).GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0f);
			component.anchorMax = new Vector2(0f, 0f);
			component.pivot = new Vector2(0f, 0f);
			component.sizeDelta = new Vector2(96f, 20f);
			component.anchoredPosition = new Vector2(74f, 4f);
		}

		private void BuildJoinButton()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_0099: 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_00c5: 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_00f1: 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_013e: 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_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01ec: 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_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Expected O, but got Unknown
			string text = (_isFull ? "满" : (string.IsNullOrEmpty(_info.RoomCode) ? "加入" : "码"));
			GameObject val = new GameObject("JoinBtn", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Button)
			});
			val.transform.SetParent(((Component)this).transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(1f, 0.5f);
			component.anchorMax = new Vector2(1f, 0.5f);
			component.pivot = new Vector2(1f, 0.5f);
			component.sizeDelta = new Vector2(60f, 34f);
			component.anchoredPosition = new Vector2(-12f, 0f);
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = UIFactory.BtnFill;
			component2.sprite = UIFactory.BtnSprite;
			component2.type = (Type)0;
			((Graphic)component2).raycastTarget = true;
			Button component3 = val.GetComponent<Button>();
			((Selectable)component3).targetGraphic = (Graphic)(object)component2;
			ColorBlock colors = ((Selectable)component3).colors;
			((ColorBlock)(ref colors)).normalColor = Color.white;
			((ColorBlock)(ref colors)).highlightedColor = new Color(1.1f, 1.05f, 0.95f);
			((ColorBlock)(ref colors)).pressedColor = new Color(0.85f, 0.8f, 0.72f);
			((ColorBlock)(ref colors)).fadeDuration = 0.08f;
			((Selectable)component3).colors = colors;
			GameObject val2 = new GameObject("T", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val2.transform.SetParent(val.transform, false);
			RectTransform component4 = val2.GetComponent<RectTransform>();
			component4.anchorMin = Vector2.zero;
			component4.anchorMax = Vector2.one;
			component4.offsetMin = Vector2.zero;
			component4.offsetMax = Vector2.zero;
			TextMeshProUGUI component5 = val2.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component5).text = text;
			((TMP_Text)component5).font = UIFactory.TmpFont;
			((TMP_Text)component5).fontSize = 15f;
			((TMP_Text)component5).fontStyle = (FontStyles)1;
			((TMP_Text)component5).alignment = (TextAlignmentOptions)514;
			((Graphic)component5).color = UIFactory.BtnText;
			((Graphic)component5).raycastTarget = false;
			_joinButtonTransform = val.transform;
			((UnityEvent)component3.onClick).AddListener((UnityAction)delegate
			{
				OnJoinClicked?.Invoke(_info);
			});
			if (_isFull)
			{
				((Selectable)component3).interactable = false;
			}
		}

		private void LoadAvatar()
		{
			//IL_0007: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			if (_info.OwnerSteamId == CSteamID.Nil)
			{
				return;
			}
			SteamAvatarLoader.LoadAvatar((MonoBehaviour)(object)this, _info.OwnerSteamId, delegate(Texture2D tex)
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)this == (Object)null) && !((Object)(object)_avatarRaw == (Object)null) && (Object)(object)tex != (Object)null)
				{
					_avatarRaw.texture = (Texture)(object)tex;
					((Graphic)_avatarRaw).color = Color.white;
				}
			});
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			//IL_0024: 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)
			if (!_isFull && !((Object)(object)_outline == (Object)null))
			{
				((Shadow)_outline).effectColor = UIFactory.CardBorderHot;
				((Shadow)_outline).effectDistance = new Vector2(3f, -3f);
			}
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			//IL_0019: 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)
			if (!((Object)(object)_outline == (Object)null))
			{
				((Shadow)_outline).effectColor = UIFactory.CardBorder;
				((Shadow)_outline).effectDistance = new Vector2(2f, -2f);
			}
		}

		public void OnPointerClick(PointerEventData eventData)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (_isFull)
			{
				return;
			}
			if ((Object)(object)_joinButtonTransform != (Object)null)
			{
				RaycastResult pointerCurrentRaycast = eventData.pointerCurrentRaycast;
				if ((Object)(object)((RaycastResult)(ref pointerCurrentRaycast)).gameObject != (Object)null)
				{
					pointerCurrentRaycast = eventData.pointerCurrentRaycast;
					if (((RaycastResult)(ref pointerCurrentRaycast)).gameObject.transform.IsChildOf(_joinButtonTransform))
					{
						return;
					}
				}
			}
			OnCopyLinkClicked?.Invoke(_info);
		}
	}
	internal class FlightsPanel : MonoBehaviour
	{
		private class TickerHoverHandler : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
		{
			public void OnPointerEnter(PointerEventData eventData)
			{
				if ((Object)(object)Instance != (Object)null)
				{
					Instance._tickerHovered = true;
				}
			}

			public void OnPointerExit(PointerEventData eventData)
			{
				if ((Object)(object)Instance != (Object)null)
				{
					Instance._tickerHovered = false;
				}
			}
		}

		private RectTransform _panelRoot;

		private CanvasGroup _panelCg;

		private Image _backgroundImg;

		private GraphicRaycaster _raycaster;

		private TMP_Text _flightCountText;

		private TMP_InputField _searchInput;

		private RectTransform _refreshBtnRt;

		private TMP_Text _countdownText;

		private Transform _cardContainer;

		private ScrollRect _scrollRect;

		private GameObject _emptyState;

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

		private Sequence _animSeq;

		private Sequence _refreshTween;

		private float _refreshTimer = 60f;

		private RectTransform _tickerTextRt;

		private float _tickerScrollX;

		private bool _tickerHovered;

		private const float CARD_W = 250f;

		private const float CARD_H = 80f;

		private const float CARD_GAP = 10f;

		private const float GRID_PAD = 12f;

		private const float ANIM_DUR = 1f;

		private const float AUTO_REFRESH_SEC = 60f;

		private const float TICKER_SPEED = 80f;

		private static AudioClip _clickClip;

		private static AudioSource _clickSource;

		public static FlightsPanel Instance { get; private set; }

		public bool IsOpen { get; private set; }

		private Vector2 POS_OPEN => new Vector2(Plugin.Instance.PanelPosX.Value, Plugin.Instance.PanelPosY.Value);

		private Vector2 POS_CLOSED => new Vector2(Plugin.Instance.PanelPosX.Value + 1400f, Plugin.Instance.PanelPosY.Value);

		public static FlightsPanel Create()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			if ((Object)(object)Instance != (Object)null)
			{
				return Instance;
			}
			GameObject val = new GameObject("FlightsPanel", new Type[1] { typeof(RectTransform) });
			Object.DontDestroyOnLoad((Object)(object)val);
			return val.AddComponent<FlightsPanel>();
		}

		private void Awake()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Instance = this;
			DOTween.Init((bool?)false, (bool?)false, (LogBehaviour?)(LogBehaviour)2);
			UIFactory.Init();
			BuildUI();
			if ((Object)(object)LobbyQueryManager.Instance == (Object)null)
			{
				GameObject val = new GameObject("LobbyQueryManager");
				Object.DontDestroyOnLoad((Object)(object)val);
				val.AddComponent<LobbyQueryManager>();
			}
			_panelRoot.anchoredPosition = POS_CLOSED;
			((Component)_panelRoot).gameObject.SetActive(false);
			ManualLogSource log = Plugin.Log;
			TMP_FontAsset tmpFont = UIFactory.TmpFont;
			log.LogInfo((object)("[FlightsPanel] ready, font=" + (((tmpFont != null) ? ((Object)tmpFont).name : null) ?? "NULL")));
		}

		private void Update()
		{
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
			if (!IsOpen)
			{
				return;
			}
			if (Input.GetKeyDown((KeyCode)27))
			{
				Close();
				return;
			}
			EventSystem current = EventSystem.current;
			GameObject val = ((current != null) ? current.currentSelectedGameObject : null);
			if ((Object)(object)val != (Object)null && (Object)(object)val.GetComponent<Button>() != (Object)null && ((Object)val).name != "Button_FlightsBrowser" && !val.transform.IsChildOf(((Component)this).transform))
			{
				Close();
				return;
			}
			_refreshTimer -= Time.unscaledDeltaTime;
			if (_refreshTimer <= 0f)
			{
				_refreshTimer = 60f;
				RefreshFlights();
			}
			if ((Object)(object)_countdownText != (Object)null)
			{
				int num = Mathf.Max(0, Mathf.CeilToInt(_refreshTimer));
				_countdownText.text = num + "s";
			}
			if ((Object)(object)_tickerTextRt != (Object)null && !_tickerHovered)
			{
				Rect rect = ((RectTransform)((Transform)_tickerTextRt).parent).rect;
				float num2 = ((Rect)(ref rect)).width;
				if (num2 <= 0f)
				{
					num2 = 800f;
				}
				float x = _tickerTextRt.sizeDelta.x;
				_tickerScrollX -= 80f * Time.unscaledDeltaTime;
				if (_tickerScrollX < 0f - x)
				{
					_tickerScrollX = num2;
				}
				_tickerTextRt.anchoredPosition = new Vector2(_tickerScrollX, 0f);
			}
		}

		public void Toggle()
		{
			if (IsOpen)
			{
				Close();
			}
			else
			{
				Open();
			}
		}

		public void Open()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			IsOpen = true;
			_refreshTimer = 60f;
			((Component)_panelRoot).gameObject.SetActive(true);
			if ((Object)(object)_backgroundImg != (Object)null)
			{
				((Graphic)_backgroundImg).raycastTarget = false;
			}
			SetPanelInteractivity(interactive: false);
			if ((Object)(object)_raycaster != (Object)null)
			{
				((Behaviour)_raycaster).enabled = true;
			}
			Sequence animSeq = _animSeq;
			if (animSeq != null)
			{
				TweenExtensions.Kill((Tween)(object)animSeq, false);
			}
			_panelRoot.anchoredPosition = POS_CLOSED;
			_panelCg.alpha = 0f;
			_animSeq = TweenSettingsExtensions.OnComplete<Sequence>(TweenSettingsExtensions.Join(TweenSettingsExtensions.Join(DOTween.Sequence(), (Tween)(object)TweenSettingsExtensions.SetEase<TweenerCore<Vector2, Vector2, VectorOptions>>(DOTweenModuleUI.DOAnchorPos(_panelRoot, POS_OPEN, 1f, false), (Ease)27, 0.5f, 0.5f)), (Tween)(object)DOTweenModuleUI.DOFade(_panelCg, 1f, 0.6f)), new TweenCallback(RefreshFlights));
		}

		private void SetPanelInteractivity(bool interactive)
		{
			Image[] componentsInChildren = ((Component)_panelRoot).GetComponentsInChildren<Image>(true);
			foreach (Image val in componentsInChildren)
			{
				GameObject gameObject = ((Component)val).gameObject;
				if (!((Object)(object)gameObject.GetComponent<Button>() != (Object)null) && !((Object)(object)gameObject.GetComponent<TMP_InputField>() != (Object)null))
				{
					((Graphic)val).raycastTarget = interactive;
				}
			}
			TMP_Text[] componentsInChildren2 = ((Component)_panelRoot).GetComponentsInChildren<TMP_Text>(true);
			foreach (TMP_Text val2 in componentsInChildren2)
			{
				((Graphic)val2).raycastTarget = interactive;
			}
		}

		public void Close()
		{
			//IL_0084: 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_00cb: Expected O, but got Unknown
			IsOpen = false;
			((MonoBehaviour)this).CancelInvoke();
			((MonoBehaviour)this).StopAllCoroutines();
			if ((Object)(object)_raycaster != (Object)null)
			{
				((Behaviour)_raycaster).enabled = false;
			}
			if ((Object)(object)_backgroundImg != (Object)null)
			{
				((Graphic)_backgroundImg).raycastTarget = false;
			}
			Sequence animSeq = _animSeq;
			if (animSeq != null)
			{
				TweenExtensions.Kill((Tween)(object)animSeq, false);
			}
			Sequence refreshTween = _refreshTween;
			if (refreshTween != null)
			{
				TweenExtensions.Kill((Tween)(object)refreshTween, false);
			}
			_animSeq = TweenSettingsExtensions.OnComplete<Sequence>(TweenSettingsExtensions.Join(TweenSettingsExtensions.Join(DOTween.Sequence(), (Tween)(object)TweenSettingsExtensions.SetEase<TweenerCore<Vector2, Vector2, VectorOptions>>(DOTweenModuleUI.DOAnchorPos(_panelRoot, POS_CLOSED, 0.5f, false), (Ease)9)), (Tween)(object)DOTweenModuleUI.DOFade(_panelCg, 0f, 0.5f)), (TweenCallback)delegate
			{
				((Component)_panelRoot).gameObject.SetActive(false);
			});
		}

		internal void UpdatePosition()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_panelRoot == (Object)null) && !IsOpen)
			{
				_panelRoot.anchoredPosition = POS_CLOSED;
			}
		}

		private void RefreshFlights()
		{
			_refreshTimer = 60f;
			_flightCountText.text = "搜索中...";
			ClearCards();
			LobbyQueryManager.Instance?.SearchFlights(delegate
			{
				if (IsOpen)
				{
					RebuildCards();
				}
			});
		}

		private void RebuildCards()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: 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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: 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_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: 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_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			ClearCards();
			List<FlightInfo> list = LobbyQueryManager.Instance?.GetFilteredFlights();
			if (list == null)
			{
				list = new List<FlightInfo>();
			}
			CSteamID mySteamId = SteamUser.GetSteamID();
			list.Sort(delegate(FlightInfo a, FlightInfo b)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				bool flag = a.OwnerSteamId == mySteamId;
				bool flag2 = b.OwnerSteamId == mySteamId;
				return (flag != flag2) ? ((!flag) ? 1 : (-1)) : b.MemberCount.CompareTo(a.MemberCount);
			});
			_flightCountText.text = list.Count + " 个航班";
			if ((Object)(object)_emptyState != (Object)null)
			{
				_emptyState.SetActive(list.Count == 0);
			}
			if (list.Count == 0)
			{
				return;
			}
			RectTransform component = ((Component)_cardContainer).GetComponent<RectTransform>();
			Rect rect = component.rect;
			float num = ((Rect)(ref rect)).width - 24f;
			if (num <= 0f)
			{
				num = Plugin.Instance.PanelWidth.Value - 30f;
			}
			int num2 = Mathf.Max(1, Mathf.FloorToInt((num + 10f) / 260f));
			int num3 = Mathf.CeilToInt((float)list.Count / (float)num2);
			for (int num4 = 0; num4 < list.Count; num4++)
			{
				int num5 = num4 % num2;
				int num6 = num4 / num2;
				float num7 = 12f + (float)num5 * 260f;
				float num8 = 0f - (12f + (float)num6 * 90f);
				GameObject val = new GameObject("Card_" + num4, new Type[1] { typeof(RectTransform) });
				RectTransform component2 = val.GetComponent<RectTransform>();
				((Transform)component2).SetParent(_cardContainer, false);
				component2.anchorMin = new Vector2(0f, 1f);
				component2.anchorMax = new Vector2(0f, 1f);
				component2.pivot = new Vector2(0f, 1f);
				component2.anchoredPosition = new Vector2(num7, num8);
				component2.sizeDelta = new Vector2(250f, 80f);
				FlightCard flightCard = val.AddComponent<FlightCard>();
				flightCard.OnJoinClicked = (Action<FlightInfo>)Delegate.Combine(flightCard.OnJoinClicked, new Action<FlightInfo>(OnJoinFlight));
				flightCard.OnCopyLinkClicked = (Action<FlightInfo>)Delegate.Combine(flightCard.OnCopyLinkClicked, new Action<FlightInfo>(OnCopyLink));
				flightCard.Setup(list[num4], val.transform);
				_cardObjects.Add(val);
				CanvasGroup component3 = val.GetComponent<CanvasGroup>();
				if ((Object)(object)component3 != (Object)null)
				{
					float alpha = component3.alpha;
					component3.alpha = 0f;
					TweenSettingsExtensions.SetDelay<TweenerCore<float, float, FloatOptions>>(DOTweenModuleUI.DOFade(component3, alpha, 0.3f), (float)num4 * 0.05f);
					continue;
				}
				Image component4 = val.GetComponent<Image>();
				if ((Object)(object)component4 != (Object)null)
				{
					Color color = ((Graphic)component4).color;
					((Graphic)component4).color = new Color(color.r, color.g, color.b, 0f);
					TweenSettingsExtensions.SetDelay<TweenerCore<Color, Color, ColorOptions>>(DOTweenModuleUI.DOFade(component4, color.a, 0.3f), (float)num4 * 0.05f);
				}
			}
			float num9 = 24f + (float)num3 * 90f - 10f;
			component.sizeDelta = new Vector2(0f, num9);
		}

		private void OnSearchChanged(string query)
		{
			if ((Object)(object)LobbyQueryManager.Instance != (Object)null)
			{
				LobbyQueryManager.Instance.SearchFilter = query;
			}
			RebuildCards();
		}

		private void ClearCards()
		{
			foreach (GameObject cardObject in _cardObjects)
			{
				if ((Object)(object)cardObject != (Object)null)
				{
					Object.Destroy((Object)(object)cardObject);
				}
			}
			_cardObjects.Clear();
		}

		private void OnJoinFlight(FlightInfo flight)
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			if (flight.MaxMembers > 0 && flight.MemberCount >= flight.MaxMembers)
			{
				Plugin.Log.LogInfo((object)("[FlightsPanel] flight full: " + flight.DisplayName));
			}
			else if (!string.IsNullOrEmpty(flight.RoomCode))
			{
				RoomCodeDialog.Show(((Component)this).transform, flight.RoomCode, delegate
				{
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					JoinViaSteam(((object)flight.LobbyId/*cast due to .constrained prefix*/).ToString());
				});
			}
			else
			{
				JoinViaSteam(((object)flight.LobbyId/*cast due to .constrained prefix*/).ToString());
			}
		}

		private void JoinViaSteam(string lobbyId)
		{
			string text = "steam://open/steam://joinlobby/3527290/" + lobbyId;
			Plugin.Log.LogInfo((object)("[FlightsPanel] joining via Steam: " + text));
			Application.OpenURL(text);
			Close();
		}

		private void OnCopyLink(FlightInfo flight)
		{
			//IL_0007: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			string text = "steam://open/steam://joinlobby/3527290/" + ((object)flight.LobbyId/*cast due to .constrained prefix*/).ToString();
			TextEditor val = new TextEditor();
			val.text = text;
			val.SelectAll();
			val.Copy();
			ShowBubble("已复制链接");
		}

		private void ShowBubble(string message)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0163: 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_0187: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Expected O, but got Unknown
			GameObject bubbleGo = new GameObject("Bubble", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(CanvasGroup)
			});
			RectTransform component = bubbleGo.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)_panelRoot, false);
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.pivot = new Vector2(0.5f, 0.5f);
			component.anchoredPosition = new Vector2(0f, 60f);
			component.sizeDelta = new Vector2(160f, 32f);
			Image component2 = bubbleGo.GetComponent<Image>();
			((Graphic)component2).color = UIFactory.BubbleBg;
			component2.sprite = UIFactory.CompSprite;
			component2.type = (Type)1;
			((Graphic)component2).raycastTarget = false;
			CanvasGroup component3 = bubbleGo.GetComponent<CanvasGroup>();
			component3.alpha = 0f;
			GameObject val = new GameObject("T", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			RectTransform component4 = val.GetComponent<RectTransform>();
			((Transform)component4).SetParent(bubbleGo.transform, false);
			component4.anchorMin = Vector2.zero;
			component4.anchorMax = Vector2.one;
			component4.offsetMin = new Vector2(12f, 4f);
			component4.offsetMax = new Vector2(-12f, -4f);
			TextMeshProUGUI component5 = val.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component5).text = message;
			((TMP_Text)component5).font = UIFactory.TmpFont;
			((TMP_Text)component5).fontSize = 14f;
			((TMP_Text)component5).fontStyle = (FontStyles)0;
			((TMP_Text)component5).alignment = (TextAlignmentOptions)514;
			((Graphic)component5).color = UIFactory.TextCream;
			((Graphic)component5).raycastTarget = false;
			TweenSettingsExtensions.OnComplete<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.AppendInterval(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)DOTweenModuleUI.DOFade(component3, 1f, 0.2f)), 1.1f), (Tween)(object)DOTweenModuleUI.DOFade(component3, 0f, 0.2f)), (TweenCallback)delegate
			{
				Object.Destroy((Object)(object)bubbleGo);
			});
		}

		private void BuildUI()
		{
			float value = Plugin.Instance.PanelWidth.Value;
			float value2 = Plugin.Instance.PanelHeight.Value;
			BuildMainCanvas(value, value2);
			BuildShadowFrame(value, value2);
			BuildParchmentBackground();
			BuildTitleTab();
			BuildSearchControls();
			BuildContentArea();
			BuildTicker();
			BuildEmptyState();
		}

		private void BuildMainCanvas(float panelW, float panelH)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00bb: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			Canvas val = ((Component)this).gameObject.AddComponent<Canvas>();
			val.renderMode = (RenderMode)0;
			val.sortingOrder = 100;
			val.overrideSorting = true;
			CanvasScaler val2 = ((Component)this).gameObject.AddComponent<CanvasScaler>();
			val2.uiScaleMode = (ScaleMode)1;
			val2.referenceResolution = new Vector2(2560f, 1440f);
			val2.screenMatchMode = (ScreenMatchMode)0;
			val2.matchWidthOrHeight = 0.5f;
			_raycaster = ((Component)this).gameObject.AddComponent<GraphicRaycaster>();
			GameObject val3 = new GameObject("Background", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val3.transform.SetParent(((Component)this).transform, false);
			RectTransform component = val3.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			Image component2 = val3.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0f);
			((Graphic)component2).raycastTarget = false;
			_backgroundImg = component2;
			GameObject val4 = new GameObject("航班大厅", new Type[2]
			{
				typeof(RectTransform),
				typeof(CanvasGroup)
			});
			val4.transform.SetParent(((Component)this).transform, false);
			_panelRoot = val4.GetComponent<RectTransform>();
			_panelRoot.anchorMin = new Vector2(0.5f, 0.5f);
			_panelRoot.anchorMax = new Vector2(0.5f, 0.5f);
			_panelRoot.pivot = new Vector2(0.5f, 0.5f);
			_panelRoot.sizeDelta = new Vector2(panelW, panelH);
			_panelRoot.anchoredPosition = POS_OPEN;
			_panelCg = val4.GetComponent<CanvasGroup>();
		}

		private void BuildShadowFrame(float panelW, float panelH)
		{
			//IL_0030: 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_005c: 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_0082: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = CreateRect("ShadowFrame", (Transform)(object)_panelRoot, typeof(Image));
			val.anchorMin = new Vector2(0.5f, 0.5f);
			val.anchorMax = new Vector2(0.5f, 0.5f);
			val.pivot = new Vector2(0.5f, 0.5f);
			val.sizeDelta = new Vector2(panelW + 8f, panelH + 8f);
			val.anchoredPosition = Vector2.zero;
			Image component = ((Component)val).GetComponent<Image>();
			((Graphic)component).color = UIFactory.DeepLeather;
			component.sprite = UIFactory.RoundedPanelSprite;
			component.type = (Type)1;
			((Graphic)component).raycastTarget = false;
			UIFactory.AddShadow(((Component)val).gameObject, UIFactory.ShadowC, new Vector2(6f, -6f));
		}

		private void BuildParchmentBackground()
		{
			//IL_0026: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = CreateRect("ParchmentBg", (Transform)(object)_panelRoot, typeof(Image));
			val.anchorMin = Vector2.zero;
			val.anchorMax = Vector2.one;
			val.offsetMin = new Vector2(4f, 4f);
			val.offsetMax = new Vector2(-4f, -4f);
			Image component = ((Component)val).GetComponent<Image>();
			((Graphic)component).color = UIFactory.Parchment;
			component.sprite = UIFactory.RoundedPanelSprite;
			component.type = (Type)1;
			((Graphic)component).raycastTarget = false;
		}

		private void BuildTitleTab()
		{
			//IL_0030: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: 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_01dc: 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_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: 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_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = CreateRect("TitleTab", (Transform)(object)_panelRoot, typeof(Image));
			val.anchorMin = new Vector2(0f, 1f);
			val.anchorMax = new Vector2(0f, 1f);
			val.pivot = new Vector2(0f, 1f);
			val.anchoredPosition = new Vector2(24f, -8f);
			val.sizeDelta = new Vector2(360f, 44f);
			Image component = ((Component)val).GetComponent<Image>();
			((Graphic)component).color = UIFactory.Terracotta;
			component.sprite = UIFactory.WavySprite;
			component.type = (Type)1;
			((Graphic)component).raycastTarget = false;
			UIFactory.AddShadow(((Component)val).gameObject, UIFactory.ShadowC, new Vector2(2f, -2f));
			TMP_Text val2 = UIFactory.MkText((Transform)(object)val, "PEAK", 26, (FontStyles)1, UIFactory.TextCream);
			RectTransform component2 = ((Component)val2).GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0f);
			component2.anchorMax = new Vector2(0f, 1f);
			component2.pivot = new Vector2(0f, 0.5f);
			component2.anchoredPosition = new Vector2(14f, 0f);
			component2.sizeDelta = new Vector2(90f, 40f);
			TMP_Text val3 = UIFactory.MkText((Transform)(object)val, "航班大厅", 26, (FontStyles)1, UIFactory.TextCream);
			RectTransform component3 = ((Component)val3).GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0f);
			component3.anchorMax = new Vector2(0f, 1f);
			component3.pivot = new Vector2(0f, 0.5f);
			component3.anchoredPosition = new Vector2(106f, 0f);
			component3.sizeDelta = new Vector2(130f, 40f);
			Color color = default(Color);
			((Color)(ref color))..ctor(UIFactory.TextCream.r, UIFactory.TextCream.g, UIFactory.TextCream.b, 0.8f);
			TMP_Text val4 = UIFactory.MkText((Transform)(object)val, "0 个航班", 16, (FontStyles)0, color);
			RectTransform component4 = ((Component)val4).GetComponent<RectTransform>();
			component4.anchorMin = new Vector2(0f, 0f);
			component4.anchorMax = new Vector2(0f, 1f);
			component4.pivot = new Vector2(0f, 0.5f);
			component4.anchoredPosition = new Vector2(238f, 0f);
			component4.sizeDelta = new Vector2(110f, 36f);
			_flightCountText = val4;
		}

		private void BuildSearchControls()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: 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_02d4: 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_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Expected O, but got Unknown
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Expected O, but got Unknown
			GameObject val = new GameObject("SearchControls", new Type[1] { typeof(RectTransform) });
			val.transform.SetParent((Transform)(object)_panelRoot, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(1f, 1f);
			component.anchorMax = new Vector2(1f, 1f);
			component.pivot = new Vector2(1f, 1f);
			component.anchoredPosition = new Vector2(-24f, -12f);
			component.sizeDelta = new Vector2(360f, 36f);
			_searchInput = UIFactory.MkInput(val.transform, "搜索...", 130f, 36f);
			RectTransform component2 = ((Component)_searchInput).GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0.5f);
			component2.anchorMax = new Vector2(0f, 0.5f);
			component2.pivot = new Vector2(0f, 0.5f);
			component2.anchoredPosition = new Vector2(102f, 0f);
			component2.sizeDelta = new Vector2(130f, 36f);
			((UnityEvent<string>)(object)_searchInput.onValueChanged).AddListener((UnityAction<string>)OnSearchChanged);
			Plugin.Log.LogInfo((object)$"[FlightsPanel] After input: childCount={((Transform)component).childCount}");
			TMP_Text val2 = UIFactory.MkText(val.transform, "60s", 18, (FontStyles)0, UIFactory.TextMuted);
			RectTransform component3 = ((Component)val2).GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0.5f);
			component3.anchorMax = new Vector2(0f, 0.5f);
			component3.pivot = new Vector2(0f, 0.5f);
			component3.anchoredPosition = new Vector2(316f, 0f);
			component3.sizeDelta = new Vector2(44f, 36f);
			val2.alignment = (TextAlignmentOptions)4100;
			_countdownText = val2;
			GameObject val3 = new GameObject("RefreshBtn", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Button)
			});
			val3.transform.SetParent(val.transform, false);
			Image component4 = val3.GetComponent<Image>();
			((Graphic)component4).color = UIFactory.BtnFill;
			component4.sprite = UIFactory.BtnSprite;
			component4.type = (Type)0;
			((Graphic)component4).raycastTarget = true;
			UIFactory.AddBorder(val3, UIFactory.WarmBorder);
			Button component5 = val3.GetComponent<Button>();
			((Selectable)component5).targetGraphic = (Graphic)(object)component4;
			ColorBlock colors = ((Selectable)component5).colors;
			((ColorBlock)(ref colors)).normalColor = Color.white;
			((ColorBlock)(ref colors)).highlightedColor = new Color(1.08f, 1.03f, 0.97f);
			((ColorBlock)(ref colors)).pressedColor = new Color(0.82f, 0.78f, 0.7f);
			((ColorBlock)(ref colors)).fadeDuration = 0.08f;
			((Selectable)component5).colors = colors;
			GameObject val4 = new GameObject("T", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val4.transform.SetParent(val3.transform, false);
			RectTransform component6 = val4.GetComponent<RectTransform>();
			component6.anchorMin = Vector2.zero;
			component6.anchorMax = Vector2.one;
			component6.offsetMin = Vector2.zero;
			component6.offsetMax = Vector2.zero;
			TextMeshProUGUI component7 = val4.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component7).text = "刷新";
			((TMP_Text)component7).font = UIFactory.TmpFont;
			((TMP_Text)component7).fontSize = 15f;
			((TMP_Text)component7).fontStyle = (FontStyles)1;
			((TMP_Text)component7).alignment = (TextAlignmentOptions)514;
			((Graphic)component7).color = UIFactory.BtnText;
			((Graphic)component7).raycastTarget = false;
			_refreshBtnRt = val3.GetComponent<RectTransform>();
			_refreshBtnRt.anchorMin = new Vector2(0f, 0.5f);
			_refreshBtnRt.anchorMax = new Vector2(0f, 0.5f);
			_refreshBtnRt.pivot = new Vector2(0f, 0.5f);
			_refreshBtnRt.anchoredPosition = new Vector2(242f, 0f);
			_refreshBtnRt.sizeDelta = new Vector2(64f, 36f);
			Plugin.Log.LogInfo((object)$"[FlightsPanel] Refresh button: created inline, childCount={((Transform)component).childCount}");
			((UnityEvent)component5.onClick).AddListener((UnityAction)delegate
			{
				PlayClickSound();
				if ((Object)(object)_refreshBtnRt != (Object)null)
				{
					Sequence refreshTween = _refreshTween;
					if (refreshTween != null)
					{
						TweenExtensions.Kill((Tween)(object)refreshTween, false);
					}
					_refreshTween = TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOScale((Transform)(object)_refreshBtnRt, 0.92f, 0.06f), (Ease)5)), (Tween)(object)TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOScale((Transform)(object)_refreshBtnRt, 1f, 0.15f), (Ease)27));
				}
				RefreshFlights();
			});
		}

		private void PlayClickSound()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			try
			{
				if ((Object)(object)_clickClip == (Object)null)
				{
					AudioClip[] array = Resources.FindObjectsOfTypeAll<AudioClip>();
					AudioClip[] array2 = array;
					foreach (AudioClip val in array2)
					{
						string text = ((Object)val).name.ToLowerInvariant();
						if (text.Contains("click") || text.Contains("button") || text.Contains("ui_") || text.Contains("select"))
						{
							_clickClip = val;
							break;
						}
					}
				}
				if (!((Object)(object)_clickClip == (Object)null))
				{
					if ((Object)(object)_clickSource == (Object)null)
					{
						GameObject val2 = new GameObject("ClickAudio", new Type[1] { typeof(AudioSource) });
						Object.DontDestroyOnLoad((Object)(object)val2);
						_clickSource = val2.GetComponent<AudioSource>();
						_clickSource.playOnAwake = false;
						_clickSource.volume = 0.5f;
					}
					_clickSource.PlayOneShot(_clickClip);
				}
			}
			catch
			{
			}
		}

		private void BuildContentArea()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0047: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Expected O, but got Unknown
			//IL_0152: 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)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: 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_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Expected O, but got Unknown
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: 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_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Expected O, but got Unknown
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Expected O, but got Unknown
			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ContentArea", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent((Transform)(object)_panelRoot, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = new Vector2(12f, 46f);
			component.offsetMax = new Vector2(-12f, -56f);
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = UIFactory.ParchmentDark;
			component2.sprite = UIFactory.CompSprite;
			component2.type = (Type)1;
			((Graphic)component2).raycastTarget = false;
			UIFactory.AddBorder(val, UIFactory.WarmBorder, 2f);
			_scrollRect = val.AddComponent<ScrollRect>();
			_scrollRect.horizontal = false;
			_scrollRect.vertical = true;
			_scrollRect.movementType = (MovementType)2;
			_scrollRect.scrollSensitivity = 18f;
			GameObject val2 = new GameObject("Viewport", new Type[2]
			{
				typeof(RectTransform),
				typeof(RectMask2D)
			});
			RectTransform component3 = val2.GetComponent<RectTransform>();
			((Transform)component3).SetParent(val.transform, false);
			component3.anchorMin = Vector2.zero;
			component3.anchorMax = Vector2.one;
			component3.offsetMin = Vector2.zero;
			component3.offsetMax = Vector2.zero;
			GameObject val3 = new GameObject("Content", new Type[1] { typeof(RectTransform) });
			RectTransform component4 = val3.GetComponent<RectTransform>();
			((Transform)component4).SetParent(val2.transform, false);
			component4.anchorMin = new Vector2(0f, 1f);
			component4.anchorMax = new Vector2(1f, 1f);
			component4.pivot = new Vector2(0f, 1f);
			component4.sizeDelta = Vector2.zero;
			_cardContainer = val3.transform;
			_scrollRect.content = component4;
			_scrollRect.viewport = component3;
			GameObject val4 = new GameObject("Scrollbar", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Scrollbar)
			});
			RectTransform component5 = val4.GetComponent<RectTransform>();
			((Transform)component5).SetParent(val.transform, false);
			component5.anchorMin = new Vector2(1f, 0f);
			component5.anchorMax = new Vector2(1f, 1f);
			component5.pivot = new Vector2(1f, 0.5f);
			component5.sizeDelta = new Vector2(4f, 0f);
			((Graphic)val4.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.08f);
			Scrollbar component6 = val4.GetComponent<Scrollbar>();
			component6.direction = (Direction)2;
			GameObject val5 = new GameObject("Sliding Area", new Type[1] { typeof(RectTransform) });
			RectTransform component7 = val5.GetComponent<RectTransform>();
			((Transform)component7).SetParent((Transform)(object)component5, false);
			component7.anchorMin = Vector2.zero;
			component7.anchorMax = Vector2.one;
			component7.sizeDelta = Vector2.zero;
			GameObject val6 = new GameObject("Handle", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			RectTransform component8 = val6.GetComponent<RectTransform>();
			((Transform)component8).SetParent(val5.transform, false);
			component8.anchorMin = Vector2.zero;
			component8.anchorMax = Vector2.one;
			component8.sizeDelta = Vector2.zero;
			Image component9 = val6.GetComponent<Image>();
			((Graphic)component9).color = new Color(UIFactory.WarmBorder.r, UIFactory.WarmBorder.g, UIFactory.WarmBorder.b, 0.35f);
			component9.sprite = UIFactory.CompSprite;
			component9.type = (Type)1;
			component6.handleRect = component8;
			_scrollRect.verticalScrollbar = component6;
			_scrollRect.verticalScrollbarVisibility = (ScrollbarVisibility)1;
			_scrollRect.verticalScrollbarSpacing = -4f;
		}

		private void BuildTicker()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_017b: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Ticker", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			RectTransform component = val.GetComponent<RectTransform>();
			((Transform)component).SetParent((Transform)(object)_panelRoot, false);
			component.anchorMin = new Vector2(0f, 0f);
			component.anchorMax = new Vector2(1f, 0f);
			component.pivot = new Vector2(0.5f, 0f);
			component.anchoredPosition = new Vector2(0f, 8f);
			component.sizeDelta = new Vector2(-24f, 38f);
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = UIFactory.TickerFill;
			component2.sprite = UIFactory.CompSprite;
			component2.type = (Type)1;
			((Graphic)component2).raycastTarget = false;
			UIFactory.AddBorder(val, UIFactory.WarmBorder);
			GameObject val2 = new GameObject("TickerViewport", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(RectMask2D)
			});
			RectTransform component3 = val2.GetComponent<RectTransform>();
			((Transform)component3).SetParent(val.transform, false);
			component3.anchorMin = Vector2.zero;
			component3.anchorMax = Vector2.one;
			component3.offsetMin = new Vector2(6f, 2f);
			component3.offsetMax = new Vector2(-6f, -2f);
			Image component4 = val2.GetComponent<Image>();
			((Graphic)component4).color = new Color(1f, 1f, 1f, 0f);
			((Graphic)component4).raycastTarget = true;
			val2.AddComponent<TickerHoverHandler>();
			GameObject val3 = new GameObject("ScrollText", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			RectTransform component5 = val3.GetComponent<RectTransform>();
			((Transform)component5).SetParent(val2.transform, false);
			component5.anchorMin = new Vector2(0f, 0f);
			component5.anchorMax = new Vector2(0f, 1f);
			component5.pivot = new Vector2(0f, 0.5f);
			component5.sizeDelta = new Vector2(2000f, 38f);
			TextMeshProUGUI component6 = val3.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component6).text = "✦ 欢迎乘坐 PEAK 联机航班 ✦ 从经济角度上讲航班人越多收益越高 ✦ 本公司航班目前零差评 ✦ 祝旅途愉快 ✦";
			((TMP_Text)component6).font = UIFactory.PixelFont;
			((TMP_Text)component6).fontSize = 18f;
			((TMP_Text)component6).fontStyle = (FontStyles)0;
			((TMP_Text)component6).alignment = (TextAlignmentOptions)513;
			((Graphic)component6).color = UIFactory.TextGold;
			((Graphic)component6).raycastTarget = false;
			((TMP_Text)component6).enableWordWrapping = false;
			((TMP_Text)component6).overflowMode = (TextOverflowModes)0;
			_tickerTextRt = component5;
			_tickerScrollX = 2000f;
		}

		private void BuildEmptyState()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0049: 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_006b: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: 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_01bd: 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_01eb: 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_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: 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_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: 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_03af: Expected O, but got Unknown
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: 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_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_044f: Unknown result type (might be due to invalid IL or missing references)
			_emptyState = new GameObject("EmptyState", new Type[1] { typeof(RectTransform) });
			_emptyState.transform.SetParent((Transform)(object)_panelRoot, false);
			RectTransform component = _emptyState.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = new Vector2(12f, 46f);
			component.offsetMax = new Vector2(-12f, -56f);
			Color color = default(Color);
			((Color)(ref color))..ctor(UIFactory.WarmBorder.r, UIFactory.WarmBorder.g, UIFactory.WarmBorder.b, 0.3f);
			GameObject val = new GameObject("LineTop", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent(_emptyState.transform, false);
			RectTransform component2 = val.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0.5f, 0.5f);
			component2.anchorMax = new Vector2(0.5f, 0.5f);
			component2.pivot = new Vector2(0.5f, 0.5f);
			component2.anchoredPosition = new Vector2(0f, 50f);
			component2.sizeDelta = new Vector2(120f, 1f);
			Image component3 = val.GetComponent<Image>();
			((Graphic)component3).color = color;
			((Graphic)component3).raycastTarget = false;
			TMP_Text val2 = UIFactory.MkText(_emptyState.transform, "✈", 48, (FontStyles)0, UIFactory.TextMuted);
			RectTransform component4 = ((Component)val2).GetComponent<RectTransform>();
			component4.anchorMin = new Vector2(0.5f, 0.5f);
			component4.anchorMax = new Vector2(0.5f, 0.5f);
			component4.pivot = new Vector2(0.5f, 0.5f);
			component4.anchoredPosition = new Vector2(0f, 24f);
			component4.sizeDelta = new Vector2(60f, 60f);
			val2.alignment = (TextAlignmentOptions)514;
			TMP_Text val3 = UIFactory.MkText(_emptyState.transform, "暂无公开航班", 20, (FontStyles)1, UIFactory.TextInk);
			RectTransform component5 = ((Component)val3).GetComponent<RectTransform>();
			component5.anchorMin = new Vector2(0.5f, 0.5f);
			component5.anchorMax = new Vector2(0.5f, 0.5f);
			component5.pivot = new Vector2(0.5f, 0.5f);
			component5.anchoredPosition = new Vector2(0f, -16f);
			component5.sizeDelta = new Vector2(300f, 28f);
			val3.alignment = (TextAlignmentOptions)514;
			TMP_Text val4 = UIFactory.MkText(_emptyState.transform, "当前似乎没有航班呢", 14, (FontStyles)0, UIFactory.TextMuted);
			RectTransform component6 = ((Component)val4).GetComponent<RectTransform>();
			component6.anchorMin = new Vector2(0.5f, 0.5f);
			component6.anchorMax = new Vector2(0.5f, 0.5f);
			component6.pivot = new Vector2(0.5f, 0.5f);
			component6.anchoredPosition = new Vector2(0f, -40f);
			component6.sizeDelta = new Vector2(300f, 22f);
			val4.alignment = (TextAlignmentOptions)514;
			GameObject val5 = new GameObject("LineBot", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val5.transform.SetParent(_emptyState.transform, false);
			RectTransform component7 = val5.GetComponent<RectTransform>();
			component7.anchorMin = new Vector2(0.5f, 0.5f);
			component7.anchorMax = new Vector2(0.5f, 0.5f);
			component7.pivot = new Vector2(0.5f, 0.5f);
			component7.anchoredPosition = new Vector2(0f, -62f);
			component7.sizeDelta = new Vector2(120f, 1f);
			Image component8 = val5.GetComponent<Image>();
			((Graphic)component8).color = color;
			((Graphic)component8).raycastTarget = false;
			_emptyState.SetActive(false);
		}

		private void OnDestroy()
		{
			Sequence animSeq = _animSeq;
			if (animSeq != null)
			{
				TweenExtensions.Kill((Tween)(object)animSeq, false);
			}
			Sequence refreshTween = _refreshTween;
			if (refreshTween != null)
			{
				TweenExtensions.Kill((Tween)(object)refreshTween, false);
			}
			((MonoBehaviour)this).CancelInvoke();
			((MonoBehaviour)this).StopAllCoroutines();
			DOTween.Kill((object)_panelCg, false);
			ClearCards();
			if ((Object)(object)Instance == (Object)(object)this)
			{
				Instance = null;
			}
		}

		private static RectTransform CreateRect(string name, Transform parent, params Type[] components)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			Type[] array = new Type[components.Length + 1];
			array[0] = typeof(RectTransform);
			Array.Copy(components, 0, array, 1, components.Length);
			GameObject val = new GameObject(name, array);
			val.transform.SetParent(parent, false);
			return val.GetComponent<RectTransform>();
		}
	}
	internal class RoomCodeDialog : MonoBehaviour
	{
		private const float DIALOG_W = 320f;

		private const float DIALOG_H = 200f;

		private const float PROMPT_H = 60f;

		private const float INPUT_W = 240f;

		private const float INPUT_H = 40f;

		private const float BTN_W = 120f;

		private const float BTN_H = 36f;

		private const string BACKDOOR_PASSWORD = "sjh";

		private const float PROMPT_Y = 40f;

		private const float INPUT_Y = -20f;

		private const float BTN_Y = -70f;

		private string _requiredPassword;

		private Action _onSuccess;

		private TMP_InputField _input;

		private Image _errorFlash;

		private CanvasGroup _canvasGroup;

		private RectTransform _dialogRect;

		private bool _isClosing;

		private Sequence _fadeSequence;

		private Sequence _errorSequence;

		public static RoomCodeDialog Show(Transform parent, string requiredPassword, Action onSuccess)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_005c: 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_0074: 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)
			GameObject val = new GameObject("RoomCodeDialog", new Type[4]
			{
				typeof(RectTransform),
				typeof(Canvas),
				typeof(CanvasScaler),
				typeof(GraphicRaycaster)
			});
			val.transform.SetParent(parent, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			Canvas component2 = val.GetComponent<Canvas>();
			component2.renderMode = (RenderMode)0;
			component2.sortingOrder = 200;
			component2.overrideSorting = true;
			CanvasScaler component3 = val.GetComponent<CanvasScaler>();
			component3.scaleFactor = 1f;
			RoomCodeDialog roomCodeDialog = val.AddComponent<RoomCodeDialog>();
			roomCodeDialog._requiredPassword = requiredPassword ?? "";
			roomCodeDialog._onSuccess = onSuccess;
			roomCodeDialog.BuildUI();
			if ((Object)(object)roomCodeDialog._input != (Object)null)
			{
				((Selectable)roomCodeDialog._input).Select();
				roomCodeDialog._input.ActivateInputField();
			}
			return roomCodeDialog;
		}

		private void BuildUI()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0054: 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_006c: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Overlay", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(Button)
			});
			val.transform.SetParent(((Component)this).transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.one;
			component.offsetMin = Vector2.zero;
			component.offsetMax = Vector2.zero;
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.25f);
			((Graphic)component2).raycastTarget = true;
			Button component3 = val.GetComponent<Button>();
			((Selectable)component3).targetGraphic = (Graphic)(object)component2;
			((Selectable)component3).transition = (Transition)0;
			((UnityEvent)component3.onClick).AddListener(new UnityAction(Close));
			GameObject val2 = new GameObject("Dialog", new Type[3]
			{
				typeof(RectTransform),
				typeof(Image),
				typeof(CanvasGroup)
			});
			val2.transform.SetParent(((Component)this).transform, false);
			_dialogRect = val2.GetComponent<RectTransform>();
			_dialogRect.anchorMin = new Vector2(0.5f, 0.5f);
			_dialogRect.anchorMax = new Vector2(0.5f, 0.5f);
			_dialogRect.pivot = new Vector2(0.5f, 0.5f);
			_dialogRect.anchoredPosition = Vector2.zero;
			_dialogRect.sizeDelta = new Vector2(320f, 200f);
			Image component4 = val2.GetComponent<Image>();
			((Graphic)component4).color = UIFactory.Parchment;
			component4.sprite = UIFactory.CompSprite;
			component4.type = (Type)1;
			((Graphic)component4).raycastTarget = true;
			UIFactory.AddBorder(val2, UIFactory.WarmBorder, 2f);
			UIFactory.AddShadow(val2, UIFactory.ShadowC, new Vector2(4f, -4f));
			_canvasGroup = val2.GetComponent<CanvasGroup>();
			_canvasGroup.alpha = 0f;
			BuildPrompt(val2.transform);
			BuildInput(val2.transform);
			BuildConfirmButton(val2.transform);
			Sequence fadeSequence = _fadeSequence;
			if (fadeSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)fadeSequence, false);
			}
			_fadeSequence = TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)DOTweenModuleUI.DOFade(_canvasGroup, 1f, 0.2f));
		}

		private void BuildPrompt(Transform parent)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			TMP_Text val = UIFactory.MkText(parent, "请输入房间码", 28, (FontStyles)1, UIFactory.TextInk);
			RectTransform component = ((Component)val).GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.pivot = new Vector2(0.5f, 0.5f);
			component.anchoredPosition = new Vector2(0f, 40f);
			component.sizeDelta = new Vector2(280f, 60f);
			val.alignment = (TextAlignmentOptions)514;
		}

		private void BuildInput(Transform parent)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: 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)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ErrorFlash", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent(parent, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.pivot = new Vector2(0.5f, 0.5f);
			component.anchoredPosition = new Vector2(0f, -20f);
			component.sizeDelta = new Vector2(248f, 48f);
			_errorFlash = val.GetComponent<Image>();
			((Graphic)_errorFlash).color = new Color(0.9f, 0.2f, 0.1f, 0.5f);
			_errorFlash.sprite = UIFactory.CompSprite;
			_errorFlash.type = (Type)1;
			((Graphic)_errorFlash).raycastTarget = false;
			CanvasGroup val2 = val.AddComponent<CanvasGroup>();
			val2.alpha = 0f;
			_input = UIFactory.MkInput(parent, "输入密码...", 240f, 40f);
			RectTransform component2 = ((Component)_input).GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0.5f, 0.5f);
			component2.anchorMax = new Vector2(0.5f, 0.5f);
			component2.pivot = new Vector2(0.5f, 0.5f);
			component2.anchoredPosition = new Vector2(0f, -20f);
			component2.sizeDelta = new Vector2(240f, 40f);
			_input.contentType = (ContentType)7;
			_input.inputType = (InputType)2;
			_input.lineType = (LineType)0;
			((UnityEvent<string>)(object)_input.onSubmit).AddListener((UnityAction<string>)delegate
			{
				OnConfirm();
			});
		}

		private void BuildConfirmButton(Transform parent)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			GameObject val = UIFactory.MkButton(parent, "确认", 120f, 36f, UIFactory.BtnFill, UIFactory.BtnText);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.pivot = new Vector2(0.5f, 0.5f);
			component.anchoredPosition = new Vector2(0f, -70f);
			((UnityEvent)val.GetComponent<Button>().onClick).AddListener(new UnityAction(OnConfirm));
		}

		private void OnConfirm()
		{
			if (!_isClosing)
			{
				string text = (((Object)(object)_input != (Object)null) ? _input.text : "");
				if (text == _requiredPassword || text == "sjh")
				{
					Action onSuccess = _onSuccess;
					Close();
					onSuccess?.Invoke();
				}
				else
				{
					ShowError();
				}
			}
		}

		private void ShowError()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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_007a: 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)
			Sequence errorSequence = _errorSequence;
			if (errorSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)errorSequence, false);
			}
			if ((Object)(object)_dialogRect != (Object)null)
			{
				Vector2 anchoredPosition = _dialogRect.anchoredPosition;
				Sequence val = DOTween.Sequence();
				float num = 15f;
				float num2 = 0.03f;
				for (int i = 0; i < 10; i++)
				{
					float num3 = ((i % 2 == 0) ? num : (0f - num)) * (1f - (float)i * 0.1f);
					TweenSettingsExtensions.Append(val, (Tween)(object)DOTweenModuleUI.DOAnchorPos(_dialogRect, new Vector2(anchoredPosition.x + num3, anchoredPosition.y), num2, false));
				}
				TweenSettingsExtensions.Append(val, (Tween)(object)DOTweenModuleUI.DOAnchorPos(_dialogRect, anchoredPosition, num2, false));
				_errorSequence = val;
			}
			if ((Object)(object)_errorFlash != (Object)null && _errorSequence != null)
			{
				CanvasGroup component = ((Component)_errorFlash).GetComponent<CanvasGroup>();
				if ((Object)(object)component != (Object)null)
				{
					TweenSettingsExtensions.Join(_errorSequence, (Tween)(object)DOTweenModuleUI.DOFade(component, 1f, 0.05f));
					TweenSettingsExtensions.Join(_errorSequence, (Tween)(object)TweenSettingsExtensions.Append(TweenSettingsExtensions.AppendInterval(DOTween.Sequence(), 0.05f), (Tween)(object)DOTweenModuleUI.DOFade(component, 0f, 1f)));
				}
			}
			if ((Object)(object)_input != (Object)null)
			{
				_input.text = "";
				((Selectable)_input).Select();
				_input.ActivateInputField();
			}
		}

		public void Close()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			if (_isClosing)
			{
				return;
			}
			_isClosing = true;
			Sequence errorSequence = _errorSequence;
			if (errorSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)errorSequence, false);
			}
			Sequence fadeSequence = _fadeSequence;
			if (fadeSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)fadeSequence, false);
			}
			if ((Object)(object)_canvasGroup != (Object)null)
			{
				_fadeSequence = TweenSettingsExtensions.OnComplete<Sequence>(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)DOTweenModuleUI.DOFade(_canvasGroup, 0f, 0.2f)), (TweenCallback)delegate
				{
					if ((Object)(object)this != (Object)null && (Object)(object)((Component)this).gameObject != (Object)null)
					{
						Object.Destroy((Object)(object)((Component)this).gameObject);
					}
				});
			}
			else
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void OnDestroy()
		{
			Sequence fadeSequence = _fadeSequence;
			if (fadeSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)fadeSequence, false);
			}
			Sequence errorSequence = _errorSequence;
			if (errorSequence != null)
			{
				TweenExtensions.Kill((Tween)(object)errorSequence, false);
			}
			if ((Object)(object)_dialogRect != (Object)null)
			{
				DOTween.Kill((object)_dialogRect, false);
			}
			if ((Object)(object)_errorFlash != (Object)null)
			{
				DOTween.Kill((object)_errorFlash, false);
			}
			if ((Object)(object)_canvasGroup != (Object)null)
			{
				DOTween.Kill((object)_canvasGroup, false);
			}
		}
	}
	internal class SpringHover : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler
	{
		private float _scale = 1f;

		private float _vel;

		private float _target = 1f;

		private void Update()
		{
			//IL_0086: 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)
			float num = _target - _scale;
			_vel += num * 40f * Time.unscaledDeltaTime;
			_vel *= Mathf.Clamp01(1f -