Decompiled source of Ethranet Explorer v0.4.1

plugins/Ethranet_Explorer/EthranetExplorer.dll

Decompiled 12 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
using BepInEx;
using EntertainmentPack;
using EthranetExplorer;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.CharacterAI;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.Sprites;
using UnityEngine.UI;

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

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 EthranetExplorer
{
	public sealed class ItemAttackScope : IDisposable
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_GetItemCountEffective_ItemIndex <0>__Count;
		}

		private static readonly Dictionary<CharacterBody, int> active = new Dictionary<CharacterBody, int>();

		private readonly CharacterBody body;

		public ItemAttackScope(CharacterBody body)
		{
			this.body = body;
			active.TryGetValue(body, out var value);
			active[body] = value + 1;
		}

		public void Dispose()
		{
			if (active.TryGetValue(body, out var value))
			{
				if (value <= 1)
				{
					active.Remove(body);
				}
				else
				{
					active[body] = value - 1;
				}
			}
		}

		internal static bool Suppressed(CharacterBody? body)
		{
			if (Object.op_Implicit((Object)(object)body))
			{
				if (!active.ContainsKey(body))
				{
					return DesktopProtection.Protects(body);
				}
				return true;
			}
			return false;
		}

		internal static void Install()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__Count;
			if (obj == null)
			{
				hook_GetItemCountEffective_ItemIndex val = Count;
				<>O.<0>__Count = val;
				obj = (object)val;
			}
			Inventory.GetItemCountEffective_ItemIndex += (hook_GetItemCountEffective_ItemIndex)obj;
		}

		internal static void Shutdown()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__Count;
			if (obj == null)
			{
				hook_GetItemCountEffective_ItemIndex val = Count;
				<>O.<0>__Count = val;
				obj = (object)val;
			}
			Inventory.GetItemCountEffective_ItemIndex -= (hook_GetItemCountEffective_ItemIndex)obj;
			active.Clear();
		}

		private static int Count(orig_GetItemCountEffective_ItemIndex orig, Inventory inventory, ItemIndex item)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster component = ((Component)inventory).GetComponent<CharacterMaster>();
			CharacterBody obj = (Object.op_Implicit((Object)(object)component) ? component.GetBody() : null);
			ItemDef itemDef = ItemCatalog.GetItemDef(item);
			if (!Suppressed(obj) || !Object.op_Implicit((Object)(object)itemDef) || (!itemDef.ContainsTag((ItemTag)1) && !PinkCatalog.IsSlot(item)))
			{
				return orig.Invoke(inventory, item);
			}
			return 0;
		}
	}
	public static class Ethranet
	{
		public const string PluginGuid = "local.ethranet.explorer";

		public static EquipmentIndex PortableComputerIndex => PortableComputer.Definition.equipmentIndex;

		public static Sprite ComputerIcon => PortableComputer.Definition.pickupIconSprite;

		public static IEnumerator EnsureAssets()
		{
			return ExplorerContent.Ensure();
		}

		public static bool OpenBrowser(CharacterBody body)
		{
			return ComputerTerminals.Open(body);
		}

		public static void SetUtilityProtection(CharacterBody body, bool active)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)body))
			{
				if (active)
				{
					DesktopProtection.Begin(body, 1);
				}
				else
				{
					DesktopProtection.End(body, 1);
				}
			}
		}

		public static bool IsBrowsing(CharacterBody body)
		{
			ArcadeActor arcadeActor = ComputerTerminals.Resolve(Object.op_Implicit((Object)(object)body) ? ((Component)body).gameObject : null);
			if (Object.op_Implicit((Object)(object)arcadeActor))
			{
				return arcadeActor.Phase == ArcadePhase.Browser;
			}
			return false;
		}

		public static GameObject CreateComputerModel(Transform parent)
		{
			return ComputerShrineModel.CreateVisual(parent);
		}
	}
	public enum DigitalWeaponKind : byte
	{
		Cursor,
		Toolbar
	}
	public sealed class DigitalProjectileProfile
	{
		public string Id { get; }

		public DigitalWeaponKind Kind { get; }

		public Sprite Icon { get; }

		public GameObject? ProjectilePrefab { get; }

		public GameObject? TracerPrefab { get; }

		public Action<CharacterBody, HealthComponent, DamageInfo>? ContactEffect { get; }

		public DigitalProjectileProfile(string id, DigitalWeaponKind kind, Sprite icon, GameObject? projectilePrefab = null, GameObject? tracerPrefab = null, Action<CharacterBody, HealthComponent, DamageInfo>? contactEffect = null)
		{
			Id = id;
			Kind = kind;
			Icon = icon;
			ProjectilePrefab = projectilePrefab;
			TracerPrefab = tracerPrefab;
			ContactEffect = contactEffect;
		}
	}
	public static class DigitalProjectiles
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static NetworkMessageDelegate <0>__Receive;
		}

		private const short MessageId = 29129;

		private static NetworkClient? client;

		private static float nextSync;

		private static Run? run;

		private static readonly Dictionary<string, DigitalProjectileProfile> profiles = new Dictionary<string, DigitalProjectileProfile>();

		private static readonly Dictionary<NetworkInstanceId, string[]> selected = new Dictionary<NetworkInstanceId, string[]>();

		public static void Register(DigitalProjectileProfile profile)
		{
			if (profile == null || string.IsNullOrWhiteSpace(profile.Id) || profile.Id.Length > 128)
			{
				throw new ArgumentException("A projectile profile requires a short ID");
			}
			profiles[profile.Id] = profile;
		}

		public static bool Select(CharacterMaster player, DigitalWeaponKind kind, string id)
		{
			//IL_002f: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)player) || !profiles.TryGetValue(id, out DigitalProjectileProfile value) || value.Kind != kind)
			{
				return false;
			}
			if (!selected.TryGetValue(((NetworkBehaviour)player).netId, out string[] value2))
			{
				Dictionary<NetworkInstanceId, string[]> dictionary = selected;
				NetworkInstanceId netId = ((NetworkBehaviour)player).netId;
				string[] obj = new string[2] { "cursor.classic", "toolbar.classic" };
				value2 = obj;
				dictionary[netId] = obj;
			}
			value2[(uint)kind] = id;
			Send(((NetworkBehaviour)player).netId, kind, id);
			return true;
		}

		public static DigitalProjectileProfile? Get(CharacterMaster player, DigitalWeaponKind kind)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			string[] value;
			string key = (selected.TryGetValue(((NetworkBehaviour)player).netId, out value) ? value[(uint)kind] : ((kind == DigitalWeaponKind.Cursor) ? "cursor.classic" : "toolbar.classic"));
			if (!profiles.TryGetValue(key, out DigitalProjectileProfile value2))
			{
				return null;
			}
			return value2;
		}

		public static void ClearRun()
		{
			selected.Clear();
		}

		private static void Send(NetworkInstanceId master, DigitalWeaponKind kind, string id)
		{
			//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_0027: 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)
			if (Object.op_Implicit((Object)(object)Run.instance))
			{
				NetworkServer.SendToAll((short)29129, (MessageBase)(object)new DigitalSelectionMessage
				{
					Run = ((NetworkBehaviour)Run.instance).netId,
					Master = master,
					Kind = (byte)kind,
					Profile = id
				});
			}
		}

		internal static void Tick()
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)run != (Object)(object)Run.instance)
			{
				run = Run.instance;
				selected.Clear();
			}
			NetworkClient val = (Object.op_Implicit((Object)(object)NetworkManager.singleton) ? NetworkManager.singleton.client : null);
			if (val != client)
			{
				if (client != null)
				{
					client.UnregisterHandler((short)29129);
				}
				client = val;
				if (client != null)
				{
					NetworkClient? obj = client;
					object obj2 = <>O.<0>__Receive;
					if (obj2 == null)
					{
						NetworkMessageDelegate val2 = Receive;
						<>O.<0>__Receive = val2;
						obj2 = (object)val2;
					}
					obj.RegisterHandler((short)29129, (NetworkMessageDelegate)obj2);
				}
			}
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance) || !(Time.unscaledTime >= nextSync))
			{
				return;
			}
			nextSync = Time.unscaledTime + 1f;
			foreach (KeyValuePair<NetworkInstanceId, string[]> item in selected)
			{
				for (int i = 0; i < 2; i++)
				{
					Send(item.Key, (DigitalWeaponKind)i, item.Value[i]);
				}
			}
		}

		private static void Receive(NetworkMessage message)
		{
			//IL_0040: 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_0088: 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)
			if ((Object)(object)run != (Object)(object)Run.instance)
			{
				run = Run.instance;
				selected.Clear();
			}
			DigitalSelectionMessage digitalSelectionMessage = message.ReadMessage<DigitalSelectionMessage>();
			if (!NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && !(digitalSelectionMessage.Run != ((NetworkBehaviour)Run.instance).netId) && digitalSelectionMessage.Kind <= 1 && profiles.TryGetValue(digitalSelectionMessage.Profile, out DigitalProjectileProfile value) && (uint)value.Kind == digitalSelectionMessage.Kind)
			{
				if (!selected.TryGetValue(digitalSelectionMessage.Master, out string[] value2))
				{
					Dictionary<NetworkInstanceId, string[]> dictionary = selected;
					NetworkInstanceId master = digitalSelectionMessage.Master;
					string[] obj = new string[2] { "cursor.classic", "toolbar.classic" };
					value2 = obj;
					dictionary[master] = obj;
				}
				value2[digitalSelectionMessage.Kind] = digitalSelectionMessage.Profile;
			}
		}

		internal static void Shutdown()
		{
			if (client != null)
			{
				client.UnregisterHandler((short)29129);
			}
			client = null;
			selected.Clear();
		}
	}
	public sealed class DigitalSelectionMessage : MessageBase
	{
		public NetworkInstanceId Run;

		public NetworkInstanceId Master;

		public byte Kind;

		public string Profile = "";

		public override void Serialize(NetworkWriter writer)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(Run);
			writer.Write(Master);
			writer.Write(Kind);
			writer.Write(Profile);
		}

		public override void Deserialize(NetworkReader reader)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			Run = reader.ReadNetworkId();
			Master = reader.ReadNetworkId();
			Kind = reader.ReadByte();
			Profile = reader.ReadString();
			if (Profile.Length > 128)
			{
				throw new InvalidOperationException("Projectile profile ID too long");
			}
		}
	}
	public static class DesktopUI
	{
		public static Texture2D Cursor
		{
			get
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Expected O, but got Unknown
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				Texture2D val = new Texture2D(24, 30, (TextureFormat)4, false)
				{
					filterMode = (FilterMode)0
				};
				for (int i = 0; i < ((Texture)val).height; i++)
				{
					for (int j = 0; j < ((Texture)val).width; j++)
					{
						int num = DesktopCursor.Pixel(j, i);
						val.SetPixel(j, ((Texture)val).height - 1 - i, (Color)(num switch
						{
							1 => Color.black, 
							0 => Color.clear, 
							_ => Color.white, 
						}));
					}
				}
				val.Apply();
				return val;
			}
		}

		public static void Label(Rect rect, string text, int size = 16, Color? color = null, TextAnchor anchor = (TextAnchor)4)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = size,
				alignment = anchor,
				wordWrap = true
			};
			val.normal.textColor = (Color)(((??)color) ?? Color.white);
			MenuFont.Draw(rect, text, val);
		}

		public static void Fill(Rect rect, Color color)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Color color2 = GUI.color;
			GUI.color = color;
			GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = color2;
		}

		public static void Panel(Rect rect)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			Fill(rect, Color.white);
			Fill(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 2f, ((Rect)(ref rect)).height - 2f), Color.black);
			Fill(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 4f, ((Rect)(ref rect)).height - 4f), new Color(0.75f, 0.75f, 0.75f));
		}

		public static bool Button(Rect rect, string caption, Vector2 pointer, bool enabled = true)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			Panel(rect);
			Label(rect, caption, 14, enabled ? Color.black : Color.gray, (TextAnchor)4);
			if (!enabled || (int)Event.current.type != 0 || Event.current.button != 0 || !((Rect)(ref rect)).Contains(pointer))
			{
				return false;
			}
			Event.current.Use();
			return true;
		}
	}
	public sealed class DesktopInputScope : IDisposable
	{
		private readonly InputFocus focus;

		public DesktopInputScope(LocalUser user)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			focus = new GameObject("Ethranet input scope").AddComponent<InputFocus>();
			focus.Begin(user);
		}

		public void Dispose()
		{
			if (Object.op_Implicit((Object)(object)focus))
			{
				focus.Closing = true;
			}
		}
	}
	internal sealed class InputFocus : MonoBehaviour
	{
		private static readonly HashSet<InputFocus> active = new HashSet<InputFocus>();

		internal bool Closing;

		private LocalUser user;

		private GameObject gate;

		private bool visible;

		private CursorLockMode locked;

		internal static void OwnCursor(MPEventSystem events)
		{
			foreach (InputFocus item in active)
			{
				if (Object.op_Implicit((Object)(object)item) && !item.Closing && events.localUser == item.user)
				{
					Cursor.lockState = (CursorLockMode)0;
					Cursor.visible = false;
					break;
				}
			}
		}

		internal void Begin(LocalUser owner)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			active.Add(this);
			user = owner;
			visible = Cursor.visible;
			locked = Cursor.lockState;
			gate = new GameObject("Native player UI focus");
			gate.SetActive(false);
			gate.transform.SetParent(((Component)this).transform, false);
			MPEventSystemProvider obj = gate.AddComponent<MPEventSystemProvider>();
			obj.fallBackToMainEventSystem = false;
			obj.eventSystem = user.eventSystem;
			gate.AddComponent<MPEventSystemLocator>();
			gate.AddComponent<CursorOpener>();
			gate.SetActive(true);
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		private void LateUpdate()
		{
			if (!Object.op_Implicit((Object)(object)user.cachedBody) || !user.cachedBody.healthComponent.alive)
			{
				Closing = true;
			}
			if (Closing)
			{
				for (int i = 4; i <= 10; i++)
				{
					if (user.inputPlayer.GetButton(i))
					{
						return;
					}
				}
				if (!Input.GetMouseButton(0) && !Input.GetMouseButton(1) && !Input.GetKey((KeyCode)27))
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
			else
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = false;
			}
		}

		private void OnDestroy()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			active.Remove(this);
			if (Object.op_Implicit((Object)(object)gate))
			{
				gate.SetActive(false);
			}
			Cursor.lockState = locked;
			Cursor.visible = visible;
		}
	}
}
namespace EntertainmentPack
{
	internal static class AuthoredContent
	{
		internal static readonly Dictionary<string, AuthorAsset> Assets = new Dictionary<string, AuthorAsset>();

		private static readonly Dictionary<string, Texture2D?> textures = new Dictionary<string, Texture2D>();

		internal static void Load(Action<string> log)
		{
			Assembly assembly = typeof(Plugin).Assembly;
			HashSet<string> hashSet = new HashSet<string>();
			List<string> list = new List<string>();
			string[] manifestResourceNames = assembly.GetManifestResourceNames();
			foreach (string text in manifestResourceNames)
			{
				if (text.StartsWith("EntertainmentPack.Authored.", StringComparison.Ordinal))
				{
					list.Add(text);
				}
			}
			list.Sort(StringComparer.Ordinal);
			foreach (string item in list)
			{
				try
				{
					using Stream stream = assembly.GetManifestResourceStream(item);
					if (stream.Length > 12582912)
					{
						throw new InvalidDataException("Design exceeds 12 MB.");
					}
					using StreamReader streamReader = new StreamReader(stream);
					string text2 = streamReader.ReadToEnd();
					AuthorPack pack = JsonUtility.FromJson<AuthorPack>(text2);
					string text3 = AuthoredRules.Validate(pack);
					if (text3.Length > 0)
					{
						throw new InvalidDataException(text3);
					}
					if (hashSet.Contains(pack.id))
					{
						throw new InvalidDataException("Duplicate design ID.");
					}
					AuthorPage[] pages = pack.pages;
					foreach (AuthorPage authorPage in pages)
					{
						if (BrowserPages.Find(authorPage.address) != null)
						{
							throw new InvalidDataException("Website address is already registered: " + authorPage.address);
						}
					}
					hashSet.Add(pack.id);
					AuthorAsset[] assets = pack.assets;
					foreach (AuthorAsset authorAsset in assets)
					{
						Assets.Add(pack.id + "/" + authorAsset.id, authorAsset);
					}
					pages = pack.pages;
					foreach (AuthorPage authorPage2 in pages)
					{
						Prefix(authorPage2.elements);
						Enum.TryParse<WebAction>(authorPage2.service, out var result);
						BrowserPages.Register(new WebPage(authorPage2.address, authorPage2.title, authorPage2.title, Array.Empty<string>(), Array.Empty<WebLink>(), WebTemplate.Authored, result, authorPage2));
						BrowserPages.AddHomeLink(new WebLink(authorPage2.title, authorPage2.address));
					}
					log("Loaded compiled design " + pack.name + ": " + pack.pages.Length + " pages, " + pack.games.Length + " games.");
					void Prefix(AuthorElement[] elements)
					{
						foreach (AuthorElement authorElement in elements)
						{
							if (authorElement.image.Length > 0)
							{
								authorElement.image = pack.id + "/" + authorElement.image;
							}
						}
					}
				}
				catch (Exception ex)
				{
					log("Skipped compiled design " + item + ": " + ex.Message);
				}
			}
		}

		internal static Texture2D? Texture(string id)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			if (textures.TryGetValue(id, out Texture2D value))
			{
				return value;
			}
			textures[id] = null;
			if (!Assets.TryGetValue(id, out AuthorAsset value2))
			{
				return null;
			}
			Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)0,
				wrapMode = (TextureWrapMode)1
			};
			try
			{
				if (!ImageConversion.LoadImage(val, Convert.FromBase64String(value2.data), true) || ((Texture)val).width > 2048 || ((Texture)val).height > 2048)
				{
					Object.Destroy((Object)(object)val);
					return null;
				}
				textures[id] = val;
				return val;
			}
			catch
			{
				Object.Destroy((Object)(object)val);
				return null;
			}
		}

		internal static void Dispose()
		{
			foreach (Texture2D value in textures.Values)
			{
				if (Object.op_Implicit((Object)(object)value))
				{
					Object.Destroy((Object)(object)value);
				}
			}
			textures.Clear();
		}
	}
	[Serializable]
	public sealed class AuthorPack
	{
		public int schema = 1;

		public string id = "";

		public string name = "";

		public AuthorPage[] pages = Array.Empty<AuthorPage>();

		public AuthorGame[] games = Array.Empty<AuthorGame>();

		public AuthorAsset[] assets = Array.Empty<AuthorAsset>();
	}
	[Serializable]
	public sealed class AuthorAsset
	{
		public string id = "";

		public string data = "";
	}
	[Serializable]
	public sealed class AuthorPage
	{
		public string address = "";

		public string title = "";

		public string background = "#ffffff";

		public string service = "None";

		public int height = 500;

		public AuthorElement[] elements = Array.Empty<AuthorElement>();
	}
	[Serializable]
	public sealed class AuthorGame
	{
		public int slot = 128;

		public string title = "";

		public string command = "CLICK!";

		public string mode = "click";

		public string background = "#008080";

		public float seconds = 8f;

		public float speed = 170f;

		public AuthorElement[] elements = Array.Empty<AuthorElement>();
	}
	[Serializable]
	public sealed class AuthorElement
	{
		public string id = "";

		public string kind = "box";

		public string label = "";

		public string color = "#ffffff";

		public string image = "";

		public string target = "";

		public float x;

		public float y;

		public float w = 100f;

		public float h = 40f;

		public float vx;

		public float vy;

		public int font = 16;
	}
	public static class AuthoredRules
	{
		public static bool Identifier(string id)
		{
			if (string.IsNullOrEmpty(id) || id.Length > 48)
			{
				return false;
			}
			foreach (char c in id)
			{
				if (!char.IsLetterOrDigit(c) && c != '-' && c != '_' && c != '.')
				{
					return false;
				}
			}
			return true;
		}

		public static bool Hex(string value)
		{
			if (value == null || value.Length != 7 || value[0] != '#')
			{
				return false;
			}
			for (int i = 1; i < 7; i++)
			{
				if (!Uri.IsHexDigit(value[i]))
				{
					return false;
				}
			}
			return true;
		}

		private static bool Finite(float value)
		{
			if (!float.IsNaN(value))
			{
				return !float.IsInfinity(value);
			}
			return false;
		}

		public static string Validate(AuthorPack pack)
		{
			if (pack == null || pack.schema != 1 || !Identifier(pack.id) || string.IsNullOrWhiteSpace(pack.name) || pack.name.Length > 80)
			{
				return "Pack requires schema 1, an ID and a name (up to 80 characters).";
			}
			if (pack.pages == null || pack.games == null || pack.assets == null || pack.pages.Length > 24 || pack.games.Length > 32 || pack.assets.Length > 32)
			{
				return "Pack limits: 24 pages, 32 games and 32 images.";
			}
			HashSet<string> assets = new HashSet<string>();
			AuthorAsset[] assets2 = pack.assets;
			foreach (AuthorAsset authorAsset in assets2)
			{
				if (authorAsset == null || !Identifier(authorAsset.id) || !assets.Add(authorAsset.id) || string.IsNullOrEmpty(authorAsset.data) || authorAsset.data.Length > 1400000)
				{
					return "Images need unique IDs and must be below 1 MB each.";
				}
				try
				{
					Convert.FromBase64String(authorAsset.data);
				}
				catch (FormatException)
				{
					return "Invalid image base64.";
				}
			}
			HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
			HashSet<int> hashSet2 = new HashSet<int>();
			AuthorPage[] pages = pack.pages;
			foreach (AuthorPage authorPage in pages)
			{
				if (authorPage == null || string.IsNullOrWhiteSpace(authorPage.title) || authorPage.title.Length > 80 || !Hex(authorPage.background) || authorPage.height < 360 || authorPage.height > 2400)
				{
					return "Pages require a title, valid background and height 360–2400.";
				}
				string text = BrowserPages.Normalize(authorPage.address);
				if (text.Length == 0 || !hashSet.Add(text) || (!(authorPage.service == "None") && !(authorPage.service == "EShop") && !(authorPage.service == "MarketBuying") && !(authorPage.service == "MarketSelling")))
				{
					return "Pages require unique addresses and a supported service.";
				}
				string text2 = Elements(authorPage.elements, authorPage.height, game: false);
				if (text2.Length > 0)
				{
					return text2;
				}
			}
			AuthorGame[] games = pack.games;
			foreach (AuthorGame authorGame in games)
			{
				if (authorGame == null || authorGame.slot < 128 || authorGame.slot > 223 || !hashSet2.Add(authorGame.slot) || string.IsNullOrWhiteSpace(authorGame.title) || authorGame.title.Length > 80 || string.IsNullOrWhiteSpace(authorGame.command) || authorGame.command.Length > 20 || !Hex(authorGame.background) || !Finite(authorGame.seconds) || authorGame.seconds < 2f || authorGame.seconds > 30f || !Finite(authorGame.speed) || authorGame.speed < 20f || authorGame.speed > 400f)
				{
					return "Games require a unique slot 128–223, title, short cue, duration 2–30 and speed 20–400.";
				}
				if (authorGame.mode != "click" && authorGame.mode != "sequence" && authorGame.mode != "move" && authorGame.mode != "survive")
				{
					return "Unsupported microgame template.";
				}
				string text3 = Elements(authorGame.elements, 360, game: true);
				if (text3.Length > 0)
				{
					return text3;
				}
				int num = 0;
				int num2 = 0;
				int num3 = 0;
				int num4 = 0;
				AuthorElement[] elements = authorGame.elements;
				foreach (AuthorElement obj in elements)
				{
					if (obj.kind == "target")
					{
						num++;
					}
					if (obj.kind == "player")
					{
						num2++;
					}
					if (obj.kind == "goal")
					{
						num3++;
					}
					if (obj.kind == "hazard")
					{
						num4++;
					}
				}
				if ((authorGame.mode == "click" || authorGame.mode == "sequence") && num == 0)
				{
					return "Click games need at least one target.";
				}
				if ((authorGame.mode == "move" || authorGame.mode == "survive") && num2 != 1)
				{
					return "Movement games need exactly one player.";
				}
				if (authorGame.mode == "move" && num3 == 0)
				{
					return "Reach-the-goal games need a goal.";
				}
				if (authorGame.mode == "survive" && num4 == 0)
				{
					return "Survival games need a hazard.";
				}
				elements = authorGame.elements;
				foreach (AuthorElement authorElement in elements)
				{
					if (!(authorElement.kind == "player"))
					{
						continue;
					}
					AuthorElement[] elements2 = authorGame.elements;
					foreach (AuthorElement authorElement2 in elements2)
					{
						if ((authorElement2.kind == "hazard" || (authorGame.mode == "move" && authorElement2.kind == "goal")) && Overlaps(authorElement.x, authorElement.y, authorElement.w, authorElement.h, authorElement2.x, authorElement2.y, authorElement2.w, authorElement2.h))
						{
							return "The player must start clear of hazards and goals.";
						}
					}
				}
			}
			return "";
			string Elements(AuthorElement[] rows, int height, bool game)
			{
				if (rows == null || rows.Length > 48)
				{
					return "Each scene supports at most 48 elements.";
				}
				HashSet<string> hashSet3 = new HashSet<string>();
				foreach (AuthorElement authorElement3 in rows)
				{
					if (authorElement3 == null || !Identifier(authorElement3.id) || !hashSet3.Add(authorElement3.id) || !Hex(authorElement3.color) || authorElement3.label == null || authorElement3.label.Length > 1000 || authorElement3.image == null || authorElement3.target == null)
					{
						return "Elements require unique IDs, valid colors and bounded text.";
					}
					if (!Finite(authorElement3.x) || !Finite(authorElement3.y) || !Finite(authorElement3.w) || !Finite(authorElement3.h) || !Finite(authorElement3.vx) || !Finite(authorElement3.vy) || authorElement3.x < 0f || authorElement3.y < 0f || authorElement3.w < 8f || authorElement3.h < 8f || authorElement3.x + authorElement3.w > 800f || authorElement3.y + authorElement3.h > (float)height || Math.Abs(authorElement3.vx) > 400f || Math.Abs(authorElement3.vy) > 400f || authorElement3.font < 8 || authorElement3.font > 52)
					{
						return "Elements must fit the canvas; font 8–52 and velocity -400–400.";
					}
					if (authorElement3.image.Length > 0 && !assets.Contains(authorElement3.image))
					{
						return "An element refers to a missing image.";
					}
					if (!(authorElement3.kind == "box") && !(authorElement3.kind == "text") && !(authorElement3.kind == "image"))
					{
						bool num6;
						if (!game)
						{
							num6 = authorElement3.kind == "link";
						}
						else
						{
							if (authorElement3.kind == "target" || authorElement3.kind == "hazard" || authorElement3.kind == "player")
							{
								goto IL_023d;
							}
							num6 = authorElement3.kind == "goal";
						}
						if (!num6)
						{
							return "Unsupported element type.";
						}
					}
					goto IL_023d;
					IL_023d:
					if (authorElement3.kind == "link" && BrowserPages.Normalize(authorElement3.target).Length == 0)
					{
						return "Links require an http(s) address for a registered in-game page.";
					}
					if (authorElement3.kind == "image" && authorElement3.image.Length == 0)
					{
						return "Image elements require an image.";
					}
				}
				return "";
			}
		}

		public static bool Overlaps(float x, float y, float w, float h, float bx, float by, float bw, float bh)
		{
			if (x < bx + bw && x + w > bx && y < by + bh)
			{
				return y + h > by;
			}
			return false;
		}

		public static float Position(float start, float velocity, float time, float extent)
		{
			if (extent <= 0f)
			{
				return 0f;
			}
			float num = (start + velocity * time) % (extent * 2f);
			if (num < 0f)
			{
				num += extent * 2f;
			}
			if (!(num <= extent))
			{
				return extent * 2f - num;
			}
			return num;
		}
	}
	public static class AuthoredCatalog
	{
		private static readonly Dictionary<int, AuthorGame> games = new Dictionary<int, AuthorGame>();

		public static AuthorGame? Game(int slot)
		{
			if (!games.TryGetValue(slot, out AuthorGame value))
			{
				return null;
			}
			return value;
		}

		public static void Register(AuthorGame game)
		{
			games.Add(game.slot, game);
		}
	}
	public sealed class AuthoredRound
	{
		public readonly AuthorGame Game;

		public ulong Mask;

		public float X;

		public float Y;

		public float Elapsed;

		public int Outcome;

		private int player = -1;

		public AuthoredRound(AuthorGame game)
		{
			Game = game;
			for (int i = 0; i < game.elements.Length; i++)
			{
				if (game.elements[i].kind == "player")
				{
					player = i;
					X = game.elements[i].x;
					Y = game.elements[i].y;
				}
			}
		}

		public (float X, float Y) Position(int index, float time, float speed)
		{
			AuthorElement authorElement = Game.elements[index];
			if (index == player)
			{
				return (X: X, Y: Y);
			}
			return (X: AuthoredRules.Position(authorElement.x, authorElement.vx, time * speed, 800f - authorElement.w), Y: AuthoredRules.Position(authorElement.y, authorElement.vy, time * speed, 360f - authorElement.h));
		}

		public int Click(int index)
		{
			if (Outcome != 0 || index < 0 || index >= Game.elements.Length)
			{
				return 0;
			}
			AuthorElement authorElement = Game.elements[index];
			if (Game.mode != "click" && Game.mode != "sequence")
			{
				return 0;
			}
			if (authorElement.kind == "hazard" && Elapsed >= 0.6f)
			{
				return Outcome = -1;
			}
			if ((Game.mode != "click" && Game.mode != "sequence") || authorElement.kind != "target" || (Mask & (ulong)(1L << index)) != 0L)
			{
				return 0;
			}
			if (Game.mode == "sequence")
			{
				for (int i = 0; i < index; i++)
				{
					if (Game.elements[i].kind == "target" && (Mask & (ulong)(1L << i)) == 0L)
					{
						if (!(Elapsed >= 0.6f))
						{
							return 0;
						}
						return Outcome = -1;
					}
				}
			}
			Mask |= (ulong)(1L << index);
			for (int j = 0; j < Game.elements.Length; j++)
			{
				if (Game.elements[j].kind == "target" && (Mask & (ulong)(1L << j)) == 0L)
				{
					return 0;
				}
			}
			return Outcome = 1;
		}

		public int Step(float dt, float speed, float duration, float inputX, float inputY)
		{
			if (Outcome != 0)
			{
				return 0;
			}
			Elapsed += Math.Max(0f, dt);
			if (player >= 0)
			{
				AuthorElement authorElement = Game.elements[player];
				float num = (float)Math.Sqrt(inputX * inputX + inputY * inputY);
				if (num > 1f)
				{
					inputX /= num;
					inputY /= num;
				}
				X = Math.Max(0f, Math.Min(800f - authorElement.w, X + inputX * Game.speed * dt));
				Y = Math.Max(0f, Math.Min(360f - authorElement.h, Y + inputY * Game.speed * dt));
				bool flag = false;
				for (int i = 0; i < Game.elements.Length; i++)
				{
					AuthorElement authorElement2 = Game.elements[i];
					(float, float) tuple = Position(i, Elapsed, speed);
					if (AuthoredRules.Overlaps(X, Y, authorElement.w, authorElement.h, tuple.Item1, tuple.Item2, authorElement2.w, authorElement2.h))
					{
						if (authorElement2.kind == "hazard" && Elapsed >= 0.6f)
						{
							return Outcome = -1;
						}
						if (authorElement2.kind == "goal")
						{
							flag = true;
						}
					}
				}
				if (Game.mode == "move" && flag)
				{
					return Outcome = 1;
				}
			}
			if (Elapsed >= duration)
			{
				return Outcome = ((Game.mode == "survive") ? 1 : (-1));
			}
			return 0;
		}
	}
	internal static class ArcadeView
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_LateUpdate <0>__CursorUpdate;
		}

		private static GUIStyle? text;

		private static GUIStyle? large;

		private static GUIStyle? command;

		private static GUIStyle? buttonText;

		private static GUIStyle? tileText;

		private static bool acceptUiInput;

		private static Texture2D? cursor;

		private static readonly Dictionary<Color, Texture2D> cursorVariants = new Dictionary<Color, Texture2D>();

		private static readonly Color Gray = new Color(0.75f, 0.75f, 0.75f);

		private static readonly Color Navy = new Color(0.03f, 0.04f, 0.45f);

		private static GameObject? ui;

		private static BonziVoice? bonziVoice;

		private static BrowserHistory browser = new BrowserHistory();

		private static int browserOwner;

		private static uint browserRound;

		private static float browserScroll;

		private static bool browserFavorites;

		private static readonly Color DepotBlue = new Color(0.08f, 0.18f, 0.38f);

		private static readonly Color DepotTeal = new Color(0f, 0.43f, 0.43f);

		private static readonly Color DepotPaper = new Color(0.96f, 0.96f, 0.91f);

		private static readonly string[] bankAmounts = new string[4] { "1", "1", "1", "1" };

		private static int bankEditing = -1;

		private static BankTransfer debitDepositSource = BankTransfer.WalletToDebit;

		private static BankTransfer offshoreDepositSource = BankTransfer.WalletToOffshore;

		private static readonly Color CraftPaper = new Color(0.985f, 0.98f, 0.96f);

		private static readonly Color CraftInk = new Color(0.22f, 0.24f, 0.22f);

		private static readonly Color CraftPink = new Color(1f, 0.08f, 0.8f);

		private static readonly Color CraftOrange = new Color(0.86f, 0.3f, 0.035f);

		private static readonly Color CraftLink = new Color(0.14f, 0.4f, 0.48f);

		private static readonly Color CraftOlive = new Color(0.54f, 0.56f, 0.5f);

		private static readonly Color CraftSidebar = new Color(0.95f, 0.96f, 0.94f);

		private static int? craftBudget;

		private static string craftInput = "";

		private static string craftQuery = "";

		private static bool craftSearchFocused;

		private static bool craftAvailableOnly;

		private static readonly Color EbayYellow = new Color(1f, 0.87f, 0.12f);

		private static readonly Color EbayCream = new Color(1f, 1f, 0.87f);

		private static readonly Color EbayBlue = new Color(0.02f, 0.05f, 0.4f);

		private static MarketRarity? ebayRarity;

		private static string ebayInput = "";

		private static string ebayQuery = "";

		private static bool ebaySearchFocused;

		private static Color AuthorColor(string hex)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			Color result = default(Color);
			ColorUtility.TryParseHtmlString(hex, ref result);
			return result;
		}

		private static void AuthorElementDraw(Rect rect, AuthorElement element, float scale)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_00a7: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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)
			bool flag = element.kind == "text" || element.kind == "link";
			if (!flag)
			{
				Fill(rect, AuthorColor(element.color));
			}
			if (element.image.Length > 0)
			{
				Texture2D val = AuthoredContent.Texture(element.image);
				if (Object.op_Implicit((Object)(object)val))
				{
					GUI.DrawTexture(rect, (Texture)(object)val, (ScaleMode)2);
				}
			}
			GUIStyle val2 = new GUIStyle(text)
			{
				fontSize = Mathf.RoundToInt((float)element.font * scale),
				alignment = (TextAnchor)4,
				wordWrap = true
			};
			val2.normal.textColor = (flag ? AuthorColor(element.color) : Color.white);
			if (element.label.Length > 0)
			{
				Label(rect, element.label, val2);
			}
			if (element.kind == "link")
			{
				Fill(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).yMax - 2f, ((Rect)(ref rect)).width, 1f), AuthorColor(element.color));
			}
		}

		private static float AuthoredPageHeight(ArcadeActor actor, WebPage page, float width)
		{
			return (float)page.Layout.height * width / 800f + (float)((page.Action == WebAction.EShop) ? 90 : ((page.Action == WebAction.MarketBuying) ? (actor.MarketBuying.Length * 78 + 50) : ((page.Action == WebAction.MarketSelling) ? (actor.MarketSelling.Length * 78 + 50) : 0)));
		}

		private static void DrawAuthoredPage(ArcadeActor actor, WebPage page, Vector2 pointer, float width, float scroll, Action<string> navigate)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			AuthorPage layout = page.Layout;
			float num = width / 800f;
			Fill(new Rect(0f, 0f - scroll, width, (float)layout.height * num), AuthorColor(layout.background));
			AuthorElement[] elements = layout.elements;
			Rect rect = default(Rect);
			foreach (AuthorElement authorElement in elements)
			{
				((Rect)(ref rect))..ctor(authorElement.x * num, authorElement.y * num - scroll, authorElement.w * num, authorElement.h * num);
				AuthorElementDraw(rect, authorElement, num);
				if (authorElement.kind == "link" && BrowserPages.Find(authorElement.target) != null && Clicked(rect, pointer))
				{
					navigate(authorElement.target);
				}
			}
			float num2 = (float)layout.height * num - scroll;
			if (page.Action == WebAction.EShop && Button(new Rect(20f, num2 + 10f, 260f, 36f), pointer, "VISIT SHOP"))
			{
				navigate("http://bonzi.micro/");
			}
			if (page.Action == WebAction.MarketBuying || page.Action == WebAction.MarketSelling)
			{
				DrawEbayRows(actor, page.Action == WebAction.MarketBuying, pointer, 20f, width - 40f, num2 + 12f, filter: false);
			}
		}

		internal static void Install()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__CursorUpdate;
			if (obj == null)
			{
				hook_LateUpdate val = CursorUpdate;
				<>O.<0>__CursorUpdate = val;
				obj = (object)val;
			}
			MPEventSystem.LateUpdate += (hook_LateUpdate)obj;
			ui = new GameObject("Ethranet Explorer UI");
			Object.DontDestroyOnLoad((Object)(object)ui);
			ui.AddComponent<BrowserGUI>();
			bonziVoice = ui.AddComponent<BonziVoice>();
		}

		private static void CursorUpdate(orig_LateUpdate orig, MPEventSystem events)
		{
			orig.Invoke(events);
			ComputerTerminals.OwnCursor(events);
			InputFocus.OwnCursor(events);
		}

		internal static void Tick()
		{
			ArcadeActor local = ComputerTerminals.Local;
			if (Object.op_Implicit((Object)(object)bonziVoice))
			{
				bonziVoice.Tick(local, !Application.isFocused);
			}
		}

		internal static void Draw()
		{
			DrawTerminalBrowser();
		}

		internal static void Uninstall()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__CursorUpdate;
			if (obj == null)
			{
				hook_LateUpdate val = CursorUpdate;
				<>O.<0>__CursorUpdate = val;
				obj = (object)val;
			}
			MPEventSystem.LateUpdate -= (hook_LateUpdate)obj;
			if (Object.op_Implicit((Object)(object)ui))
			{
				Object.Destroy((Object)(object)ui);
			}
			bonziVoice = null;
			HandcraftedIcons.Dispose();
			NativeItemIcons.Dispose();
			DiskArt.Dispose();
			ClippyPortrait.Dispose();
			foreach (Texture2D value in cursorVariants.Values)
			{
				if (Object.op_Implicit((Object)(object)value))
				{
					Object.Destroy((Object)(object)value);
				}
			}
			cursorVariants.Clear();
		}

		private static void SetupGUI()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			if (text == null)
			{
				text = new GUIStyle(GUI.skin.label)
				{
					fontSize = 16,
					alignment = (TextAnchor)4,
					richText = false
				};
				text.normal.textColor = Color.white;
				large = new GUIStyle(text)
				{
					fontSize = 40,
					fontStyle = (FontStyle)1
				};
				command = new GUIStyle(large)
				{
					fontSize = 82
				};
				buttonText = new GUIStyle(text)
				{
					fontSize = 14,
					wordWrap = true
				};
				tileText = new GUIStyle(text)
				{
					fontSize = 32,
					fontStyle = (FontStyle)1
				};
				tileText.normal.textColor = Navy;
				cursor = CursorVariant(Color.white);
			}
		}

		private static Texture2D CursorVariant(Color face)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (cursorVariants.TryGetValue(face, out Texture2D value))
			{
				return value;
			}
			Texture2D val = new Texture2D(24, 30, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)0
			};
			for (int i = 0; i < 30; i++)
			{
				for (int j = 0; j < 24; j++)
				{
					val.SetPixel(j, 29 - i, (Color)(DesktopCursor.Pixel(j, i) switch
					{
						1 => Color.black, 
						0 => Color.clear, 
						_ => face, 
					}));
				}
			}
			val.Apply();
			cursorVariants.Add(face, val);
			return val;
		}

		private static void Fill(Rect rect, Color color)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Color color2 = GUI.color;
			GUI.color = color;
			GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = color2;
		}

		private static void Bevel(Rect rect, Color face, bool inset = false)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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_0067: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			Fill(rect, inset ? Color.black : Color.white);
			Fill(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 2f, ((Rect)(ref rect)).height - 2f), (Color)(inset ? Color.white : new Color(0.25f, 0.25f, 0.25f)));
			Fill(new Rect(((Rect)(ref rect)).x + 2f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 4f, ((Rect)(ref rect)).height - 4f), face);
		}

		private static void Label(Rect rect, string value, GUIStyle? style = null)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			MenuFont.Draw(rect, value, style ?? text);
		}

		private static bool Clicked(Rect rect, Vector2 pointer, int button = 0)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (!acceptUiInput || (int)Event.current.type != 0 || Event.current.button != button || !((Rect)(ref rect)).Contains(pointer))
			{
				return false;
			}
			Event.current.Use();
			return true;
		}

		private static bool Button(Rect rect, Vector2 pointer, string label, bool enabled = true)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_004d: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			Bevel(rect, (Color)((!enabled) ? new Color(0.4f, 0.4f, 0.4f) : (((Rect)(ref rect)).Contains(pointer) ? new Color(0.9f, 0.9f, 0.8f) : Gray)));
			Color color = GUI.color;
			GUI.color = (enabled ? Color.black : Color.gray);
			Label(rect, label, buttonText);
			GUI.color = color;
			if (enabled)
			{
				return Clicked(rect, pointer);
			}
			return false;
		}

		private static void DrawBrowser(ArcadeActor actor, Vector2 pointer)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: 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_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Expected O, but got Unknown
			//IL_053f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_064d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Invalid comparison between Unknown and I4
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0716: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0772: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_085c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_0865: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_087b: Expected O, but got Unknown
			//IL_0882: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_090d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0963: Unknown result type (might be due to invalid IL or missing references)
			//IL_096e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0975: Expected O, but got Unknown
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
			if (browserOwner != ((Object)actor).GetInstanceID() || browserRound != actor.Round)
			{
				browserOwner = ((Object)actor).GetInstanceID();
				browserRound = actor.Round;
				browser = new BrowserHistory();
				browser.Navigate("http://home.micro/");
				browserScroll = 0f;
				browserFavorites = false;
				ResetEbayzaar();
				ResetUkeletsy();
			}
			WebPage webPage = BrowserPages.Find(browser.Address);
			actor.IsShop = webPage.Template == WebTemplate.Shop;
			actor.ShopKeeper = ((!webPage.Address.Contains("clippy")) ? ((!webPage.Address.Contains("corrupted")) ? 1 : 2) : 0);
			Bevel(new Rect(14f, 63f, 932f, 465f), Gray);
			Fill(new Rect(20f, 69f, 920f, 21f), Navy);
			GUIStyle style = new GUIStyle(text)
			{
				fontSize = 14,
				alignment = (TextAnchor)3
			};
			Label(new Rect(28f, 69f, 840f, 21f), webPage.Title + " - ETHRANET EXPLORER", style);
			if (Button(new Rect(914f, 72f, 20f, 19f), pointer, "X"))
			{
				if (actor.TerminalProxy)
				{
					ComputerTerminals.RequestClose();
				}
				else
				{
					ArcadeNetwork.Send(actor, -11);
				}
				return;
			}
			GUIStyle val = new GUIStyle(text)
			{
				fontSize = 11,
				alignment = (TextAnchor)3
			};
			val.normal.textColor = Color.black;
			Label(new Rect(26f, 92f, 850f, 13f), "FILE    EDIT    VIEW    FAVORITES    TOOLS    HELP", val);
			if (Button(new Rect(26f, 106f, 62f, 26f), pointer, "<", browser.CanBack))
			{
				browser.Back();
				browserScroll = 0f;
			}
			if (Button(new Rect(94f, 106f, 80f, 26f), pointer, ">", browser.CanForward))
			{
				browser.Forward();
				browserScroll = 0f;
			}
			if (Button(new Rect(180f, 106f, 77f, 26f), pointer, "REFRESH"))
			{
				browserScroll = 0f;
			}
			if (Button(new Rect(263f, 106f, 58f, 26f), pointer, "HOME"))
			{
				Navigate("http://home.micro/");
			}
			if (Button(new Rect(327f, 106f, 94f, 26f), pointer, "FAVORITES"))
			{
				browserFavorites = !browserFavorites;
			}
			Label(new Rect(429f, 107f, 53f, 24f), "ADDRESS", val);
			Bevel(new Rect(486f, 106f, 448f, 26f), Color.white, inset: true);
			Label(new Rect(493f, 108f, 434f, 22f), webPage.Address, val);
			Fill(new Rect(22f, 137f, 916f, 359f), Color.white);
			float num = (browserFavorites ? 680 : 868);
			if (browserFavorites)
			{
				Fill(new Rect(22f, 137f, 184f, 359f), new Color(0.94f, 0.94f, 0.94f));
				Label(new Rect(32f, 147f, 164f, 26f), "FAVORITES", val);
				WebLink[] array = new WebLink[8]
				{
					new WebLink("MICRO-NET", "http://home.micro/"),
					new WebLink("BONZI ONLINE", "http://bonzi.micro/"),
					new WebLink("FIELD GUIDE", "http://guide.micro/"),
					new WebLink("EBAYZAAR", "http://ebayzaar.micro/"),
					new WebLink("UKELETSY", "http://ukeletsy.micro/"),
					new WebLink("DESKTOP DEPOT", "http://desktopdepot.micro/"),
					new WebLink("AURELIONITE BANK", "http://bankofaurelionite.micro/"),
					new WebLink("DRONES-R-US", "http://drones-r-us.micro/")
				};
				for (int i = 0; i < array.Length; i++)
				{
					if (Button(new Rect(32f, (float)(180 + i * 38), 162f, 32f), pointer, array[i].Label))
					{
						Navigate(array[i].Address);
					}
				}
			}
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor((float)(browserFavorites ? 210 : 24), 139f, (float)(browserFavorites ? 726 : 912), 355f);
			GUIStyle val3 = new GUIStyle(text)
			{
				fontSize = 14,
				alignment = (TextAnchor)0,
				wordWrap = true
			};
			val3.normal.textColor = Color.black;
			float num2 = 100f;
			string[] paragraphs = webPage.Paragraphs;
			foreach (string value in paragraphs)
			{
				num2 += MenuFont.Height(value, num, 14) + 16f;
			}
			num2 += (float)(webPage.Links.Length * 31);
			if (webPage.Template == WebTemplate.Marketplace)
			{
				num2 = EbayzaarHeight(actor, webPage);
			}
			if (webPage.Template == WebTemplate.DesktopStore)
			{
				num2 = 355f;
			}
			if (webPage.Template == WebTemplate.Bank)
			{
				num2 = ((BrowserPages.Normalize(webPage.Address) == BrowserPages.Normalize("http://bankofaurelionite.micro/")) ? 355 : 550);
			}
			if (webPage.Template == WebTemplate.Drones)
			{
				num2 = 560f;
			}
			if (webPage.Template == WebTemplate.Handcrafted)
			{
				num2 = UkeletsyHeight(actor, ((Rect)(ref val2)).width);
			}
			if (webPage.Layout != null)
			{
				num2 = AuthoredPageHeight(actor, webPage, ((Rect)(ref val2)).width);
			}
			float num3 = Mathf.Max(0f, num2 - ((Rect)(ref val2)).height);
			if (acceptUiInput && ((Rect)(ref val2)).Contains(pointer) && (int)Event.current.type == 6)
			{
				browserScroll = Mathf.Clamp(browserScroll + Event.current.delta.y * 24f, 0f, num3);
				Event.current.Use();
			}
			browserScroll = Mathf.Clamp(browserScroll, 0f, num3);
			bool flag = acceptUiInput;
			acceptUiInput &= ((Rect)(ref val2)).Contains(pointer);
			GUI.BeginGroup(val2);
			try
			{
				Vector2 val4 = pointer - ((Rect)(ref val2)).position;
				if (webPage.Layout != null)
				{
					DrawAuthoredPage(actor, webPage, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.Shop)
				{
					DrawShopPreview(actor, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.Marketplace)
				{
					DrawEbayzaar(actor, webPage, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.DesktopStore)
				{
					DrawDesktopStoreCover(val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.Bank)
				{
					DrawBank(actor, webPage, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.Drones)
				{
					DrawDroneStore(actor, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else if (webPage.Template == WebTemplate.Handcrafted)
				{
					DrawUkeletsy(actor, val4, ((Rect)(ref val2)).width, browserScroll, Navigate);
				}
				else
				{
					float num4 = 16f - browserScroll;
					Color val5 = ((webPage.Template == WebTemplate.Shop) ? new Color(0.42f, 0.08f, 0.63f) : new Color(0f, 0f, 0.55f));
					GUIStyle val6 = new GUIStyle(val3)
					{
						fontSize = 24,
						fontStyle = (FontStyle)1
					};
					val6.normal.textColor = val5;
					Label(new Rect(20f, num4, num, 40f), webPage.Heading, val6);
					num4 += 52f;
					if (webPage.Template == WebTemplate.Directory)
					{
						Fill(new Rect(20f, num4, num, 3f), val5);
						num4 += 17f;
					}
					paragraphs = webPage.Paragraphs;
					foreach (string value2 in paragraphs)
					{
						float num5 = MenuFont.Height(value2, num, 14);
						Label(new Rect(20f, num4, num, num5 + 2f), value2, val3);
						num4 += num5 + 16f;
					}
					WebLink[] links = webPage.Links;
					Rect rect = default(Rect);
					foreach (WebLink webLink in links)
					{
						((Rect)(ref rect))..ctor(20f, num4, num, 28f);
						bool flag2 = ((Rect)(ref rect)).Contains(val4);
						GUIStyle val7 = new GUIStyle(val3);
						val7.normal.textColor = (Color)(flag2 ? new Color(0.5f, 0f, 0.5f) : Color.blue);
						Label(rect, webLink.Label, val7);
						Fill(new Rect(20f, num4 + 22f, Mathf.Min(num, (float)(webLink.Label.Length * 8)), 1f), val7.normal.textColor);
						if (Clicked(rect, val4))
						{
							Navigate(webLink.Address);
							break;
						}
						num4 += 31f;
					}
				}
			}
			finally
			{
				GUI.EndGroup();
				acceptUiInput = flag;
			}
			if (Button(new Rect(910f, 139f, 26f, 24f), pointer, "^", browserScroll > 0f))
			{
				browserScroll = Mathf.Max(0f, browserScroll - 100f);
			}
			if (Button(new Rect(910f, 468f, 26f, 24f), pointer, "v", browserScroll < num3))
			{
				browserScroll = Mathf.Min(num3, browserScroll + 100f);
			}
			Bevel(new Rect(22f, 500f, 916f, 20f), Gray, inset: true);
			Label(new Rect(30f, 500f, 800f, 20f), "DONE", val);
			static void Navigate(string address)
			{
				if (browser.Navigate(address))
				{
					browserScroll = 0f;
					browserFavorites = false;
				}
			}
		}

		private static bool DrawTerminalBrowser()
		{
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: 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_01f7: Expected O, but got Unknown
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			ArcadeActor local = ComputerTerminals.Local;
			if (!Object.op_Implicit((Object)(object)local) || !Object.op_Implicit((Object)(object)local.Body) || !local.Body.healthComponent.alive)
			{
				return false;
			}
			NetworkUser val = PlayerSupport.User(local.Body);
			CameraRigController val2 = (Object.op_Implicit((Object)(object)val) ? val.cameraRigController : null);
			if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.sceneCam))
			{
				return true;
			}
			if (ComputerTerminals.Blocked(val2, input: false) || (Application.isFocused && Input.GetKey((KeyCode)9)))
			{
				return true;
			}
			SetupGUI();
			Rect pixelRect = val2.sceneCam.pixelRect;
			float num = Mathf.Min(((Rect)(ref pixelRect)).width / 960f, ((Rect)(ref pixelRect)).height / 540f);
			float num2 = ((Rect)(ref pixelRect)).x + (((Rect)(ref pixelRect)).width - 960f * num) * 0.5f;
			float num3 = (float)Screen.height - ((Rect)(ref pixelRect)).yMax + (((Rect)(ref pixelRect)).height - 540f * num) * 0.5f;
			Matrix4x4 matrix = GUI.matrix;
			Color color = GUI.color;
			try
			{
				GUI.matrix = Matrix4x4.TRS(new Vector3(num2, num3), Quaternion.identity, new Vector3(num, num, 1f));
				Vector2 val3 = default(Vector2);
				((Vector2)(ref val3))..ctor((Input.mousePosition.x - num2) / num, ((float)Screen.height - Input.mousePosition.y - num3) / num);
				acceptUiInput = !ComputerTerminals.Blocked(val2);
				Bevel(new Rect(14f, 14f, 932f, 42f), Gray);
				Fill(new Rect(19f, 19f, 922f, 32f), Navy);
				Label(new Rect(24f, 19f, 230f, 32f), local.TerminalPortable ? "PORTABLE COMPUTER" : "SHRINE OF THE DESKTOP");
				GUIStyle style = new GUIStyle(text)
				{
					fontSize = 12
				};
				Label(new Rect(262f, 19f, 128f, 32f), "GOLD $" + local.Money, style);
				if (Button(new Rect(396f, 22f, 26f, 26f), val3, ">", !local.BankPending && BankRules.WalletDepositAmount(local.Money, local.Debit) != 0))
				{
					ArcadeNetwork.Finance(local, 20, 0u);
				}
				Label(new Rect(430f, 19f, 150f, 32f), "DEBIT $" + local.Debit, style);
				Label(new Rect(588f, 19f, 188f, 32f), "LUNAR " + local.LunarCoins, style);
				Label(new Rect(784f, 19f, 148f, 32f), "VOID " + local.VoidCoins, style);
				DrawBrowser(local, val3);
				if (((Rect)(ref pixelRect)).Contains(Input.mousePosition))
				{
					GUI.DrawTexture(new Rect(val3.x, val3.y, 24f, 30f), (Texture)(object)cursor);
				}
			}
			finally
			{
				GUI.matrix = matrix;
				GUI.color = color;
			}
			return true;
		}

		private static void DrawDesktopStoreCover(Vector2 pointer, float width, float scroll, Action<string> navigate)
		{
			//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)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			Fill(new Rect(0f, 0f - scroll, width, 355f), DepotPaper);
			Label(new Rect(20f, 45f - scroll, width - 40f, 42f), "DESKTOP DEPOT", DepotStyle(28, DepotBlue, bold: true));
			Fill(new Rect(20f, 111f - scroll, width - 40f, 92f), DepotBlue);
			GUIStyle val = DepotStyle(32, Color.white, bold: true);
			val.alignment = (TextAnchor)4;
			Label(new Rect(30f, 127f - scroll, width - 60f, 58f), "COMING SOON", val);
			Label(new Rect(25f, 226f - scroll, width - 50f, 40f), "A BETTER DESKTOP IS UNDER CONSTRUCTION.", DepotStyle(14, DepotTeal, bold: true));
			if (EbayButton(new Rect(25f, 283f - scroll, 200f, 34f), pointer, "MICRO-NET HOME"))
			{
				navigate("http://home.micro/");
			}
		}

		private static float DesktopStoreHeight(WebPage page)
		{
			return 230f + Mathf.Ceil((float)DesktopStore.Listings(page.Address).Length / 2f) * 190f + 62f;
		}

		private static GUIStyle DepotStyle(int size, Color color, bool bold = false)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			GUIStyle val = new GUIStyle(text)
			{
				fontSize = size,
				alignment = (TextAnchor)0,
				wordWrap = true,
				fontStyle = (FontStyle)(bold ? 1 : 0)
			};
			val.normal.textColor = color;
			return val;
		}

		private static void DepotIcon(Rect rect, DesktopProduct product)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0045: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: 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_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: 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_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: 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_01e1: 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_0214: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: 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)
			Color val = default(Color);
			ColorUtility.TryParseHtmlString(product.Color, ref val);
			Fill(rect, new Color(0.91f, 0.92f, 0.9f));
			if (product.Category == 1)
			{
				GUI.DrawTexture(new Rect(((Rect)(ref rect)).center.x - 12f, ((Rect)(ref rect)).center.y - 15f, 24f, 30f), (Texture)(object)CursorVariant(val));
			}
			else if (product.Category == 2)
			{
				Bevel(new Rect(((Rect)(ref rect)).x + 4f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 8f, 30f), Gray);
				Fill(new Rect(((Rect)(ref rect)).x + 7f, ((Rect)(ref rect)).y + 13f, ((Rect)(ref rect)).width - 14f, 6f), val);
				for (int i = 0; i < 4; i++)
				{
					Fill(new Rect(((Rect)(ref rect)).x + 8f + (float)(i * 9), ((Rect)(ref rect)).y + 24f, 6f, 7f), (i % 2 == 0) ? val : Color.white);
				}
			}
			else if (product.Category == 3)
			{
				for (int j = 0; j < 32; j++)
				{
					float num = ((j < 18) ? 17f : Mathf.Max(1f, 17f - (float)(j - 18) * 1.15f));
					Fill(new Rect(((Rect)(ref rect)).center.x - num, ((Rect)(ref rect)).y + 8f + (float)j, num * 2f, 1f), val);
				}
				Fill(new Rect(((Rect)(ref rect)).center.x - 3f, ((Rect)(ref rect)).y + 15f, 6f, 18f), Color.white);
				Fill(new Rect(((Rect)(ref rect)).center.x - 9f, ((Rect)(ref rect)).y + 21f, 18f, 6f), Color.white);
			}
			else
			{
				Bevel(new Rect(((Rect)(ref rect)).x + 7f, ((Rect)(ref rect)).y + 6f, ((Rect)(ref rect)).width - 14f, ((Rect)(ref rect)).height - 12f), val);
				Fill(new Rect(((Rect)(ref rect)).x + 14f, ((Rect)(ref rect)).y + 9f, ((Rect)(ref rect)).width - 28f, 10f), Color.white);
				Fill(new Rect(((Rect)(ref rect)).x + 13f, ((Rect)(ref rect)).yMax - 21f, ((Rect)(ref rect)).width - 26f, 12f), DepotPaper);
				Fill(new Rect(((Rect)(ref rect)).center.x - 2f, ((Rect)(ref rect)).yMax - 20f, 4f, 10f), val);
				Fill(new Rect(((Rect)(ref rect)).center.x - 5f, ((Rect)(ref rect)).yMax - 17f, 10f, 4f), val);
			}
		}

		private static void DrawDesktopStore(WebPage page, Vector2 pointer, float width, float scroll, Action<string> navigate)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: 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_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			float num = 0f - scroll;
			int num2 = DesktopStore.Category(page.Address);
			float num3 = 154f;
			float num4 = num3 + 26f;
			float num5 = width - num4 - 38f;
			DesktopProduct[] array = DesktopStore.Listings(page.Address);
			Fill(new Rect(0f, num, width, DesktopStoreHeight(page)), DepotPaper);
			Fill(new Rect(0f, num, width, 77f), DepotBlue);
			Label(new Rect(18f, num + 10f, width - 36f, 37f), "DESKTOP DEPOT", DepotStyle(28, Color.white, bold: true));
			Label(new Rect(20f, num + 50f, width - 40f, 20f), "LOOK SHARP. BROWSE HAPPY.", DepotStyle(11, new Color(0.63f, 0.92f, 0.83f)));
			Fill(new Rect(0f, num + 77f, width, 31f), DepotTeal);
			Label(new Rect(18f, num + 84f, width - 190f, 23f), "CURSORS  /  TOOLBARS  /  SOFTWARE  /  EXTRAS", DepotStyle((width < 800f) ? 10 : 12, Color.white));
			if (EbayButton(new Rect(width - 155f, num + 81f, 133f, 24f), pointer, "MICRO-NET HOME"))
			{
				navigate("http://home.micro/");
			}
			Fill(new Rect(16f, num + 126f, width - 54f, 50f), new Color(1f, 0.96f, 0.76f));
			Label(new Rect(27f, num + 133f, width - 76f, 20f), "CATALOG PREVIEW", DepotStyle(13, DepotBlue, bold: true));
			Label(new Rect(27f, num + 153f, width - 76f, 20f), "PURCHASES AND EFFECTS COMING SOON.", DepotStyle(11, DepotBlue));
			Label(new Rect(18f, num + 196f, num3, 23f), "SHOP DEPARTMENTS", DepotStyle(11, DepotTeal, bold: true));
			Rect rect = default(Rect);
			for (int i = 0; i < DesktopStore.Categories.Length; i++)
			{
				((Rect)(ref rect))..ctor(16f, num + 226f + (float)(i * 34), num3, 29f);
				if (i == num2)
				{
					Fill(rect, DepotBlue);
					Label(new Rect(((Rect)(ref rect)).x + 8f, ((Rect)(ref rect)).y + 6f, ((Rect)(ref rect)).width - 12f, 21f), DesktopStore.Categories[i], DepotStyle(11, Color.white, bold: true));
				}
				else if (EbayLink(new Rect(((Rect)(ref rect)).x + 8f, ((Rect)(ref rect)).y + 6f, ((Rect)(ref rect)).width - 12f, 23f), pointer, DesktopStore.Categories[i], 11))
				{
					navigate(DesktopStore.Addresses[i]);
				}
			}
			Label(new Rect(24f, num + 417f, num3 - 12f, 92f), "YOUR DESKTOP,\nYOUR STYLE.\n\nMORE DOWNLOADS\nON THE WAY.", DepotStyle(11, DepotTeal));
			Label(new Rect(num4, num + 193f, num5, 25f), DesktopStore.Categories[num2], DepotStyle(18, DepotBlue, bold: true));
			float num6 = (num5 - 12f) / 2f;
			for (int j = 0; j < array.Length; j++)
			{
				DesktopProduct desktopProduct = array[j];
				float num7 = num4 + (float)(j % 2) * (num6 + 12f);
				float num8 = num + 230f + (float)(j / 2 * 190);
				Fill(new Rect(num7, num8, num6, 178f), new Color(0.73f, 0.78f, 0.79f));
				Fill(new Rect(num7 + 1f, num8 + 1f, num6 - 2f, 176f), Color.white);
				DepotIcon(new Rect(num7 + 12f, num8 + 13f, 48f, 48f), desktopProduct);
				Label(new Rect(num7 + 70f, num8 + 15f, num6 - 82f, 46f), desktopProduct.Name, DepotStyle(13, DepotBlue, bold: true));
				Label(new Rect(num7 + 12f, num8 + 78f, num6 - 24f, 53f), desktopProduct.Description, DepotStyle(12, Color.black));
				Label(new Rect(num7 + 12f, num8 + 143f, num6 - 130f, 24f), "PRICE TBA", DepotStyle(10, DepotTeal, bold: true));
				EbayButton(new Rect(num7 + num6 - 118f, num8 + 134f, 106f, 31f), pointer, "COMING SOON", enabled: false);
			}
			float num9 = num + 230f + Mathf.Ceil((float)array.Length / 2f) * 190f;
			Fill(new Rect(num4, num9 + 5f, num5, 1f), DepotTeal);
			Label(new Rect(num4, num9 + 16f, num5, 33f), "NO SHIPPING. NO DISKS. JUST A BETTER DESKTOP.", DepotStyle(10, DepotTeal));
		}

		private static bool BankAmountInput(int slot, Rect rect, Vector2 pointer, BankBalances balances, BankTransfer route, out uint amount)
		{
			//IL_0027: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Invalid comparison between Unknown and I4
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: 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)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Invalid comparison between Unknown and I4
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Invalid comparison between Unknown and I4
			Rect rect2 = default(Rect);
			((Rect)(ref rect2))..ctor(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 76f, 32f);
			Bevel(rect2, Color.white, inset: true);
			if (Clicked(rect2, pointer))
			{
				bankEditing = slot;
			}
			if (bankEditing == slot && acceptUiInput && (int)Event.current.type == 4)
			{
				Event current = Event.current;
				string text = bankAmounts[slot];
				if ((int)current.keyCode == 8)
				{
					if (text.Length > 0)
					{
						bankAmounts[slot] = text.Substring(0, text.Length - 1);
					}
					current.Use();
				}
				else if ((int)current.keyCode == 13 || (int)current.keyCode == 271)
				{
					bankEditing = -1;
					current.Use();
				}
				else if (current.character >= '0' && current.character <= '9' && text.Length < 10)
				{
					bankAmounts[slot] += current.character;
					current.Use();
				}
			}
			Label(new Rect(((Rect)(ref rect2)).x + 7f, ((Rect)(ref rect2)).y + 7f, ((Rect)(ref rect2)).width - 14f, 23f), bankAmounts[slot] + ((bankEditing == slot && Time.unscaledTime % 1f < 0.5f) ? "|" : ""), DepotStyle(14, Color.black));
			if (EbayButton(new Rect(((Rect)(ref rect)).xMax - 64f, ((Rect)(ref rect)).y, 64f, 32f), pointer, "MAX"))
			{
				bankEditing = -1;
				bankAmounts[slot] = BankRules.Maximum(balances, route).ToString(CultureInfo.InvariantCulture);
			}
			if (uint.TryParse(bankAmounts[slot], NumberStyles.None, CultureInfo.InvariantCulture, out amount))
			{
				return amount != 0;
			}
			return false;
		}

		private static void DrawBank(ArcadeActor actor, WebPage page, Vector2 pointer, float width, float scroll, Action<string> navigate)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: 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)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: 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_0535: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: 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_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_091b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_071b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_0757: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_084b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0850: Unknown result type (might be due to invalid IL or missing references)
			bool flag = BrowserPages.Normalize(page.Address) == BrowserPages.Normalize("http://bankofaurelionite.micro/");
			bool flag2 = BrowserPages.Normalize(page.Address) == BrowserPages.Normalize("http://bankofaurelionite.micro/offshore");
			float num = 0f - scroll;
			float num2 = (width - 44f) / 2f;
			Fill(new Rect(0f, num, width, (float)(flag ? 355 : 550)), DepotPaper);
			Fill(new Rect(0f, num, width, 65f), DepotBlue);
			Label(new Rect(18f, num + 8f, width - 36f, 31f), "BANK OF AURELIONITE", DepotStyle(24, new Color(1f, 0.86f, 0.4f), bold: true));
			Label(new Rect(20f, num + 44f, width - 40f, 20f), "A GOLDEN FUTURE, ONE DEPOSIT AT A TIME.", DepotStyle(11, Color.white));
			if (flag)
			{
				Label(new Rect(18f, num + 78f, width - 36f, 27f), "YOUR ACCOUNTS  |  GOLD WALLET $" + actor.Money, DepotStyle(13, DepotBlue, bold: true));
				for (int i = 0; i < 2; i++)
				{
					float num3 = 16f + (float)i * (num2 + 12f);
					Bevel(new Rect(num3, num + 118f, num2, 172f), Color.white);
					Label(new Rect(num3 + 12f, num + 131f, num2 - 24f, 25f), (i == 0) ? "DEBIT" : "OFF-SHORE", DepotStyle(18, DepotBlue, bold: true));
					Label(new Rect(num3 + 12f, num + 161f, num2 - 24f, 31f), "$" + ((i == 0) ? actor.Debit : actor.Offshore), DepotStyle(24, DepotTeal, bold: true));
					Label(new Rect(num3 + 12f, num + 203f, num2 - 24f, 32f), (i == 0) ? "KEPT BETWEEN STAGES. RESETS EACH RUN." : "KEPT BETWEEN RUNS. STORAGE ONLY.", DepotStyle(11, DepotBlue));
					if (EbayButton(new Rect(num3 + 12f, num + 246f, num2 - 24f, 31f), pointer, "OPEN ACCOUNT"))
					{
						Go((i == 0) ? "http://bankofaurelionite.micro/debit" : "http://bankofaurelionite.micro/offshore");
						return;
					}
				}
				Label(new Rect(18f, num + 304f, width - 36f, 23f), actor.BankStatus, DepotStyle(11, DepotTeal, bold: true));
				if (EbayLink(new Rect(18f, num + 332f, 200f, 22f), pointer, "MICRO-NET HOME", 11))
				{