Decompiled source of BloodcraftMenuUI v0.1.0

BloodcraftMenuUI.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BloodcraftMenuUI.Config;
using BloodcraftMenuUI.Models;
using BloodcraftMenuUI.Patches;
using BloodcraftMenuUI.Services;
using BloodcraftMenuUI.UI;
using BloodcraftMenuUI.UI.Panels;
using BloodcraftMenuUI.Utils;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.Network;
using ProjectM.UI;
using Unity.Collections;
using Unity.Entities;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BloodcraftMenuUI")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Full Bloodcraft menu UI for V Rising")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("BloodcraftMenuUI")]
[assembly: AssemblyTitle("BloodcraftMenuUI")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsUnmanagedAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 BloodcraftMenuUI
{
	[BepInPlugin("BloodcraftMenuUI", "BloodcraftMenuUI", "0.1.0")]
	public class Plugin : BasePlugin
	{
		private Harmony _harmony;

		public static Plugin Instance { get; private set; }

		public static ManualLogSource Log { get; private set; }

		public static World ClientWorld { get; set; }

		public static EntityManager EntityManager
		{
			get
			{
				//IL_0013: 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_0011: Unknown result type (might be due to invalid IL or missing references)
				World clientWorld = ClientWorld;
				if (clientWorld == null)
				{
					return default(EntityManager);
				}
				return clientWorld.EntityManager;
			}
		}

		public static Entity LocalCharacter { get; set; }

		public static Entity LocalUser { get; set; }

		public static bool IsInitialized { get; set; }

		public override void Load()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			if (Process.GetCurrentProcess().ProcessName.Contains("Server", StringComparison.OrdinalIgnoreCase))
			{
				ManualLogSource log = Log;
				if (log != null)
				{
					log.LogInfo((object)"BloodcraftMenuUI is a client-only mod. Skipping load on server.");
				}
				return;
			}
			Instance = this;
			Log = ((BasePlugin)this).Log;
			Settings.Initialize(((BasePlugin)this).Config);
			_harmony = new Harmony("BloodcraftMenuUI");
			_harmony.PatchAll(typeof(ChatSystemPatch));
			_harmony.PatchAll(typeof(InitializationPatch));
			_harmony.PatchAll(typeof(EscapeMenuPatch));
			_harmony.PatchAll(typeof(InputBlockPatch));
			((BasePlugin)this).AddComponent<UIMonoBehaviour>();
			ManualLogSource log2 = Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("BloodcraftMenuUI");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("0.1.0");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded!");
			}
			log2.LogInfo(val);
		}

		public override bool Unload()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			return true;
		}

		public static bool IsClientNull()
		{
			if (ClientWorld != null)
			{
				return !ClientWorld.IsCreated;
			}
			return true;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "BloodcraftMenuUI";

		public const string PLUGIN_NAME = "BloodcraftMenuUI";

		public const string PLUGIN_VERSION = "0.1.0";
	}
	public class UIMonoBehaviour : MonoBehaviour
	{
		public UIMonoBehaviour(IntPtr handle)
			: base(handle)
		{
		}

		private void Update()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.IsInitialized)
			{
				if (!InputField.AnyFocused && Input.GetKeyDown(Settings.ToggleKey.Value))
				{
					UIManager.ToggleMenu();
				}
				CommandService.ProcessQueue();
			}
		}

		private void OnGUI()
		{
			if (Plugin.IsInitialized)
			{
				UIManager.Draw();
			}
		}
	}
}
namespace BloodcraftMenuUI.Utils
{
	public static class ECSExtensions
	{
		public unsafe static T Read<T>(this Entity entity) where T : unmanaged
		{
			//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_0015: 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)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Plugin.EntityManager;
			return Marshal.PtrToStructure<T>((IntPtr)((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex));
		}

		public static bool Has<T>(this Entity entity)
		{
			//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_0015: 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)
			ComponentType val = default(ComponentType);
			((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0);
			EntityManager entityManager = Plugin.EntityManager;
			return ((EntityManager)(ref entityManager)).HasComponent(entity, val);
		}

		public static bool TryGetComponent<T>(this Entity entity, out T component) where T : unmanaged
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if (entity.Has<T>())
			{
				component = entity.Read<T>();
				return true;
			}
			component = default(T);
			return false;
		}
	}
}
namespace BloodcraftMenuUI.UI
{
	public class DraggableWindow
	{
		private bool _isDragging;

		private Vector2 _dragOffset;

		private const float TitleBarHeight = 20f;

		public Rect WindowRect { get; set; }

		public string Title { get; set; }

		public bool IsVisible { get; set; }

		public bool CloseRequested { get; private set; }

		public DraggableWindow(string title, float x, float y, float width, float height)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Title = title;
			WindowRect = new Rect(x, y, width, height);
			IsVisible = true;
		}

		public bool Begin()
		{
			//IL_0017: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_00f6: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			CloseRequested = false;
			if (!IsVisible)
			{
				return false;
			}
			Styles.EnsureInitialized();
			UIManager.RegisterWindowRect(WindowRect);
			HandleDrag();
			GUI.Box(WindowRect, "", Styles.WindowStyle);
			Rect windowRect = WindowRect;
			float num = ((Rect)(ref windowRect)).x + 4f;
			windowRect = WindowRect;
			float num2 = ((Rect)(ref windowRect)).y + 2f;
			windowRect = WindowRect;
			GUI.Label(new Rect(num, num2, ((Rect)(ref windowRect)).width - 28f, 20f), Title, Styles.HeaderStyle);
			windowRect = WindowRect;
			float x = ((Rect)(ref windowRect)).x;
			windowRect = WindowRect;
			float num3 = x + ((Rect)(ref windowRect)).width - 22f;
			windowRect = WindowRect;
			if (GUI.Button(new Rect(num3, ((Rect)(ref windowRect)).y + 2f, 18f, 16f), "×", Styles.SmallButtonStyle))
			{
				CloseRequested = true;
			}
			windowRect = WindowRect;
			float num4 = ((Rect)(ref windowRect)).x + 8f;
			windowRect = WindowRect;
			float num5 = ((Rect)(ref windowRect)).y + 20f + 4f;
			windowRect = WindowRect;
			float num6 = ((Rect)(ref windowRect)).width - 16f;
			windowRect = WindowRect;
			GUILayout.BeginArea(new Rect(num4, num5, num6, ((Rect)(ref windowRect)).height - 20f - 12f));
			return true;
		}

		public void End()
		{
			GUILayout.EndArea();
		}

		private void HandleDrag()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Invalid comparison between Unknown and I4
			//IL_0047: 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_00ab: Invalid comparison between Unknown and I4
			//IL_005c: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			Rect windowRect = WindowRect;
			float x = ((Rect)(ref windowRect)).x;
			windowRect = WindowRect;
			float y = ((Rect)(ref windowRect)).y;
			windowRect = WindowRect;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(x, y, ((Rect)(ref windowRect)).width, 20f);
			Event current = Event.current;
			if ((int)current.type == 0 && ((Rect)(ref val)).Contains(current.mousePosition))
			{
				_isDragging = true;
				Vector2 mousePosition = current.mousePosition;
				windowRect = WindowRect;
				float x2 = ((Rect)(ref windowRect)).x;
				windowRect = WindowRect;
				_dragOffset = mousePosition - new Vector2(x2, ((Rect)(ref windowRect)).y);
				current.Use();
			}
			else if ((int)current.type == 1)
			{
				_isDragging = false;
			}
			else if ((int)current.type == 3 && _isDragging)
			{
				Rect windowRect2 = WindowRect;
				((Rect)(ref windowRect2)).x = current.mousePosition.x - _dragOffset.x;
				((Rect)(ref windowRect2)).y = current.mousePosition.y - _dragOffset.y;
				float value = Settings.UIScale.Value;
				((Rect)(ref windowRect2)).x = Mathf.Clamp(((Rect)(ref windowRect2)).x, 0f, (float)Screen.width / value - ((Rect)(ref windowRect2)).width);
				((Rect)(ref windowRect2)).y = Mathf.Clamp(((Rect)(ref windowRect2)).y, 0f, (float)Screen.height / value - ((Rect)(ref windowRect2)).height);
				WindowRect = windowRect2;
				current.Use();
			}
		}
	}
	public class InputField
	{
		private static InputField _currentlyFocused;

		private int _cursorBlink;

		public string Text { get; set; } = "";


		public bool IsFocused { get; private set; }

		public static bool AnyFocused
		{
			get
			{
				if (_currentlyFocused != null)
				{
					return _currentlyFocused.IsFocused;
				}
				return false;
			}
		}

		public string Draw(float width = 0f)
		{
			Styles.EnsureInitialized();
			GUIStyle val = (IsFocused ? Styles.TextFieldFocusedStyle : Styles.TextFieldStyle);
			GUILayoutOption[] array = (GUILayoutOption[])(object)((!(width > 0f)) ? new GUILayoutOption[1] { GUILayout.Height(22f) } : new GUILayoutOption[2]
			{
				GUILayout.Height(22f),
				GUILayout.Width(width)
			});
			if (GUILayout.Button(IsFocused ? (Text + ((_cursorBlink / 30 % 2 == 0) ? "|" : "")) : (string.IsNullOrEmpty(Text) ? " " : Text), val, array))
			{
				if (_currentlyFocused != null && _currentlyFocused != this)
				{
					_currentlyFocused.IsFocused = false;
				}
				IsFocused = true;
				_currentlyFocused = this;
			}
			if (IsFocused)
			{
				_cursorBlink++;
				HandleKeyboard();
			}
			return Text;
		}

		private void HandleKeyboard()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			Event current = Event.current;
			if (current == null || (int)current.type != 4)
			{
				return;
			}
			if ((int)current.keyCode == 27 || (int)current.keyCode == 13 || (int)current.keyCode == 271)
			{
				IsFocused = false;
				if (_currentlyFocused == this)
				{
					_currentlyFocused = null;
				}
				current.Use();
			}
			else if ((int)current.keyCode == 8)
			{
				if (Text.Length > 0)
				{
					Text = Text.Substring(0, Text.Length - 1);
				}
				current.Use();
			}
			else if (current.character != 0 && current.character != '\t' && current.character != '\n' && current.character != '\r')
			{
				Text += current.character;
				current.Use();
			}
		}

		public void Unfocus()
		{
			IsFocused = false;
			if (_currentlyFocused == this)
			{
				_currentlyFocused = null;
			}
		}

		public void Reset()
		{
			Text = "";
			Unfocus();
		}

		public static void UnfocusAll()
		{
			if (_currentlyFocused != null)
			{
				_currentlyFocused.IsFocused = false;
				_currentlyFocused = null;
			}
		}
	}
	public static class Styles
	{
		private static bool _initialized;

		private static float _lastTransparency;

		private static readonly List<Texture2D> _textures = new List<Texture2D>();

		public static GUIStyle ToggleButtonStyle { get; private set; }

		public static GUIStyle WindowStyle { get; private set; }

		public static GUIStyle HeaderStyle { get; private set; }

		public static GUIStyle ButtonStyle { get; private set; }

		public static GUIStyle ActiveButtonStyle { get; private set; }

		public static GUIStyle TabButtonStyle { get; private set; }

		public static GUIStyle ActiveTabStyle { get; private set; }

		public static GUIStyle LabelStyle { get; private set; }

		public static GUIStyle ResponseStyle { get; private set; }

		public static GUIStyle TextFieldStyle { get; private set; }

		public static GUIStyle TextFieldFocusedStyle { get; private set; }

		public static GUIStyle SmallButtonStyle { get; private set; }

		public static void EnsureInitialized()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: 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_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Expected O, but got Unknown
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Expected O, but got Unknown
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0416: Expected O, but got Unknown
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Expected O, but got Unknown
			//IL_053e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Expected O, but got Unknown
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Unknown result type (might be due to invalid IL or missing references)
			//IL_0649: Unknown result type (might be due to invalid IL or missing references)
			//IL_0653: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Expected O, but got Unknown
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Expected O, but got Unknown
			//IL_0751: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0765: Expected O, but got Unknown
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_082c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_0842: Expected O, but got Unknown
			//IL_0887: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08db: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e5: Expected O, but got Unknown
			//IL_0944: Unknown result type (might be due to invalid IL or missing references)
			float value = Settings.UITransparency.Value;
			if (_initialized && Mathf.Approximately(_lastTransparency, value))
			{
				return;
			}
			foreach (Texture2D texture in _textures)
			{
				if ((Object)(object)texture != (Object)null)
				{
					Object.Destroy((Object)(object)texture);
				}
			}
			_textures.Clear();
			_lastTransparency = value;
			float num = value;
			Texture2D background = MakeTex(new Color(0.08f, 0.08f, 0.12f, num));
			Texture2D background2 = MakeTex(new Color(0.18f, 0.18f, 0.28f, num));
			Texture2D background3 = MakeTex(new Color(0.3f, 0.3f, 0.42f, num));
			Texture2D background4 = MakeTex(new Color(0.22f, 0.22f, 0.35f, num));
			Texture2D background5 = MakeTex(new Color(0.45f, 0.12f, 0.12f, num));
			Texture2D background6 = MakeTex(new Color(0.55f, 0.18f, 0.18f, num));
			Texture2D background7 = MakeTex(new Color(0.14f, 0.14f, 0.22f, num));
			Texture2D background8 = MakeTex(new Color(0.35f, 0.1f, 0.1f, num));
			Texture2D background9 = MakeTex(new Color(0.05f, 0.05f, 0.1f, num));
			Texture2D background10 = MakeTex(new Color(0.04f, 0.04f, 0.07f, num));
			Texture2D background11 = MakeTex(new Color(0.12f, 0.1f, 0.18f, num));
			Texture2D background12 = MakeTex(new Color(0.2f, 0.15f, 0.28f, num));
			ToggleButtonStyle = new GUIStyle();
			ToggleButtonStyle.fontSize = 13;
			ToggleButtonStyle.fontStyle = (FontStyle)1;
			ToggleButtonStyle.alignment = (TextAnchor)4;
			ToggleButtonStyle.padding = MakeOffset(6, 6, 4, 4);
			ToggleButtonStyle.normal.background = background11;
			ToggleButtonStyle.normal.textColor = new Color(0.85f, 0.7f, 0.7f);
			ToggleButtonStyle.hover.background = background12;
			ToggleButtonStyle.hover.textColor = Color.white;
			ToggleButtonStyle.active.background = background4;
			ToggleButtonStyle.active.textColor = Color.white;
			WindowStyle = new GUIStyle();
			WindowStyle.fontSize = 13;
			WindowStyle.fontStyle = (FontStyle)1;
			WindowStyle.padding = MakeOffset(8, 8, 20, 8);
			WindowStyle.normal.background = background;
			WindowStyle.normal.textColor = new Color(0.9f, 0.8f, 0.8f);
			HeaderStyle = new GUIStyle();
			HeaderStyle.fontSize = 14;
			HeaderStyle.fontStyle = (FontStyle)1;
			HeaderStyle.alignment = (TextAnchor)3;
			HeaderStyle.padding = MakeOffset(2, 2, 4, 2);
			HeaderStyle.normal.textColor = new Color(0.95f, 0.75f, 0.65f);
			ButtonStyle = new GUIStyle();
			ButtonStyle.fontSize = 12;
			ButtonStyle.alignment = (TextAnchor)4;
			ButtonStyle.padding = MakeOffset(8, 8, 4, 4);
			ButtonStyle.margin = MakeOffset(2, 2, 2, 2);
			ButtonStyle.normal.background = background2;
			ButtonStyle.normal.textColor = new Color(0.85f, 0.85f, 0.92f);
			ButtonStyle.hover.background = background3;
			ButtonStyle.hover.textColor = Color.white;
			ButtonStyle.active.background = background4;
			ButtonStyle.active.textColor = Color.white;
			ActiveButtonStyle = new GUIStyle();
			ActiveButtonStyle.fontSize = 12;
			ActiveButtonStyle.fontStyle = (FontStyle)1;
			ActiveButtonStyle.alignment = (TextAnchor)4;
			ActiveButtonStyle.padding = MakeOffset(8, 8, 4, 4);
			ActiveButtonStyle.margin = MakeOffset(2, 2, 2, 2);
			ActiveButtonStyle.normal.background = background5;
			ActiveButtonStyle.normal.textColor = Color.white;
			ActiveButtonStyle.hover.background = background6;
			ActiveButtonStyle.hover.textColor = Color.white;
			ActiveButtonStyle.active.background = background5;
			ActiveButtonStyle.active.textColor = Color.white;
			TabButtonStyle = new GUIStyle();
			TabButtonStyle.fontSize = 11;
			TabButtonStyle.alignment = (TextAnchor)4;
			TabButtonStyle.padding = MakeOffset(6, 6, 3, 3);
			TabButtonStyle.margin = MakeOffset(1, 1, 1, 1);
			TabButtonStyle.normal.background = background7;
			TabButtonStyle.normal.textColor = new Color(0.8f, 0.8f, 0.85f);
			TabButtonStyle.hover.background = background3;
			TabButtonStyle.hover.textColor = Color.white;
			TabButtonStyle.active.background = background7;
			TabButtonStyle.active.textColor = Color.white;
			ActiveTabStyle = new GUIStyle();
			ActiveTabStyle.fontSize = 11;
			ActiveTabStyle.fontStyle = (FontStyle)1;
			ActiveTabStyle.alignment = (TextAnchor)4;
			ActiveTabStyle.padding = MakeOffset(6, 6, 3, 3);
			ActiveTabStyle.margin = MakeOffset(1, 1, 1, 1);
			ActiveTabStyle.normal.background = background8;
			ActiveTabStyle.normal.textColor = Color.white;
			ActiveTabStyle.hover.background = background6;
			ActiveTabStyle.hover.textColor = Color.white;
			ActiveTabStyle.active.background = background8;
			ActiveTabStyle.active.textColor = Color.white;
			SmallButtonStyle = new GUIStyle();
			SmallButtonStyle.fontSize = 11;
			SmallButtonStyle.alignment = (TextAnchor)4;
			SmallButtonStyle.padding = MakeOffset(4, 4, 2, 2);
			SmallButtonStyle.margin = MakeOffset(2, 2, 2, 2);
			SmallButtonStyle.normal.background = background2;
			SmallButtonStyle.normal.textColor = new Color(0.85f, 0.85f, 0.92f);
			SmallButtonStyle.hover.background = background3;
			SmallButtonStyle.hover.textColor = Color.white;
			SmallButtonStyle.active.background = background4;
			SmallButtonStyle.active.textColor = Color.white;
			LabelStyle = new GUIStyle();
			LabelStyle.fontSize = 12;
			LabelStyle.wordWrap = true;
			LabelStyle.normal.textColor = new Color(0.8f, 0.8f, 0.85f);
			TextFieldStyle = new GUIStyle();
			TextFieldStyle.fontSize = 12;
			TextFieldStyle.alignment = (TextAnchor)3;
			TextFieldStyle.padding = MakeOffset(6, 6, 4, 4);
			TextFieldStyle.normal.background = background9;
			TextFieldStyle.normal.textColor = new Color(0.9f, 0.9f, 0.95f);
			TextFieldStyle.hover.background = background9;
			TextFieldStyle.hover.textColor = new Color(0.9f, 0.9f, 0.95f);
			TextFieldStyle.active.background = background9;
			TextFieldStyle.active.textColor = Color.white;
			Texture2D background13 = MakeTex(new Color(0.08f, 0.08f, 0.15f, num));
			TextFieldFocusedStyle = new GUIStyle();
			TextFieldFocusedStyle.fontSize = 12;
			TextFieldFocusedStyle.alignment = (TextAnchor)3;
			TextFieldFocusedStyle.padding = MakeOffset(6, 6, 4, 4);
			TextFieldFocusedStyle.normal.background = background13;
			TextFieldFocusedStyle.normal.textColor = Color.white;
			TextFieldFocusedStyle.hover.background = background13;
			TextFieldFocusedStyle.hover.textColor = Color.white;
			TextFieldFocusedStyle.active.background = background13;
			TextFieldFocusedStyle.active.textColor = Color.white;
			ResponseStyle = new GUIStyle();
			ResponseStyle.fontSize = 11;
			ResponseStyle.wordWrap = true;
			ResponseStyle.richText = false;
			ResponseStyle.padding = MakeOffset(6, 6, 4, 4);
			ResponseStyle.normal.background = background10;
			ResponseStyle.normal.textColor = new Color(0.7f, 0.85f, 0.7f);
			_initialized = true;
		}

		private static RectOffset MakeOffset(int left, int right, int top, int bottom)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			return new RectOffset
			{
				left = left,
				right = right,
				top = top,
				bottom = bottom
			};
		}

		private static Texture2D MakeTex(Color color)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false);
			val.SetPixel(0, 0, color);
			val.Apply();
			((Object)val).hideFlags = (HideFlags)61;
			_textures.Add(val);
			return val;
		}
	}
	public static class UIManager
	{
		private static readonly List<Rect> _windowRects = new List<Rect>();

		private static MainMenuPanel _mainMenu;

		private static ClassesPanel _classesPanel;

		private static LevelingPanel _levelingPanel;

		private static WeaponExpertisePanel _weaponPanel;

		private static BloodLegaciesPanel _bloodPanel;

		private static PrestigePanel _prestigePanel;

		private static ProfessionsPanel _professionsPanel;

		private static QuestsPanel _questsPanel;

		private static FamiliarsPanel _familiarsPanel;

		private static MiscPanel _miscPanel;

		private static bool _panelsCreated;

		public static bool IsMenuOpen { get; private set; }

		public static CategoryType? ActiveCategory { get; set; }

		public static bool IsMouseOverUI
		{
			get
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				if (!IsMenuOpen)
				{
					return false;
				}
				float value = Settings.UIScale.Value;
				Vector3 mousePosition = Input.mousePosition;
				float num = mousePosition.x / value;
				float num2 = ((float)Screen.height - mousePosition.y) / value;
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor(num, num2);
				foreach (Rect windowRect in _windowRects)
				{
					Rect current = windowRect;
					if (((Rect)(ref current)).Contains(val))
					{
						return true;
					}
				}
				return false;
			}
		}

		public static void RegisterWindowRect(Rect r)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			_windowRects.Add(r);
		}

		private static void EnsurePanelsCreated()
		{
			if (!_panelsCreated)
			{
				_mainMenu = new MainMenuPanel();
				_classesPanel = new ClassesPanel();
				_levelingPanel = new LevelingPanel();
				_weaponPanel = new WeaponExpertisePanel();
				_bloodPanel = new BloodLegaciesPanel();
				_prestigePanel = new PrestigePanel();
				_professionsPanel = new ProfessionsPanel();
				_questsPanel = new QuestsPanel();
				_familiarsPanel = new FamiliarsPanel();
				_miscPanel = new MiscPanel();
				_panelsCreated = true;
			}
		}

		public static void Draw()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.IsInitialized)
			{
				return;
			}
			_windowRects.Clear();
			Styles.EnsureInitialized();
			float value = Settings.UIScale.Value;
			GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(value, value, 1f));
			DrawToggleButton();
			if (!IsMenuOpen)
			{
				return;
			}
			EnsurePanelsCreated();
			_mainMenu.Draw();
			if (_mainMenu.CloseRequested)
			{
				ToggleMenu();
				return;
			}
			bool flag = false;
			switch (ActiveCategory)
			{
			case CategoryType.Classes:
				_classesPanel.Draw();
				flag = _classesPanel.CloseRequested;
				break;
			case CategoryType.Leveling:
				_levelingPanel.Draw();
				flag = _levelingPanel.CloseRequested;
				break;
			case CategoryType.WeaponExpertise:
				_weaponPanel.Draw();
				flag = _weaponPanel.CloseRequested;
				break;
			case CategoryType.BloodLegacies:
				_bloodPanel.Draw();
				flag = _bloodPanel.CloseRequested;
				break;
			case CategoryType.Prestige:
				_prestigePanel.Draw();
				flag = _prestigePanel.CloseRequested;
				break;
			case CategoryType.Professions:
				_professionsPanel.Draw();
				flag = _professionsPanel.CloseRequested;
				break;
			case CategoryType.Quests:
				_questsPanel.Draw();
				flag = _questsPanel.CloseRequested;
				break;
			case CategoryType.Familiars:
				_familiarsPanel.Draw();
				flag = _familiarsPanel.CloseRequested;
				break;
			case CategoryType.Misc:
				_miscPanel.Draw();
				flag = _miscPanel.CloseRequested;
				break;
			}
			if (flag)
			{
				ActiveCategory = null;
			}
			GUI.matrix = Matrix4x4.identity;
		}

		private static void DrawToggleButton()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			Styles.EnsureInitialized();
			string text = (IsMenuOpen ? "Bloodcraft [-]" : "Bloodcraft [+]");
			Rect val = new Rect(Settings.ToggleButtonX.Value, Settings.ToggleButtonY.Value, 120f, 28f);
			RegisterWindowRect(val);
			if (GUI.Button(val, text, Styles.ToggleButtonStyle))
			{
				ToggleMenu();
			}
		}

		public static void ToggleMenu()
		{
			IsMenuOpen = !IsMenuOpen;
			if (!IsMenuOpen)
			{
				ActiveCategory = null;
			}
		}

		public static void Reset()
		{
			IsMenuOpen = false;
			ActiveCategory = null;
			if (_panelsCreated)
			{
				_classesPanel?.Reset();
				_levelingPanel?.Reset();
				_weaponPanel?.Reset();
				_bloodPanel?.Reset();
				_prestigePanel?.Reset();
				_professionsPanel?.Reset();
				_questsPanel?.Reset();
				_familiarsPanel?.Reset();
				_miscPanel?.Reset();
			}
		}
	}
}
namespace BloodcraftMenuUI.UI.Panels
{
	public class BloodLegaciesPanel
	{
		private static readonly string[] BloodTypes = new string[10] { "Worker", "Warrior", "Scholar", "Rogue", "Mutant", "Draculin", "Immortal", "Creature", "Brute", "Corruption" };

		private static readonly string[] StatLabels = new string[12]
		{
			"Heal Recv", "DMG Reduce", "Phys Resist", "Spell Resist", "Res Yield", "Drain Reduc", "Spell CDR", "Weap CDR", "Ult CDR", "Minion DMG",
			"Abil Atk Spd", "Corrupt DR"
		};

		private static readonly string[] StatValues = new string[12]
		{
			"1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
			"11", "12"
		};

		private readonly DraggableWindow _window;

		private string _response = "";

		private string _selectedBlood = "";

		private string _selectedStat = "";

		public bool CloseRequested => _window.CloseRequested;

		public BloodLegaciesPanel()
		{
			_window = new DraggableWindow("Blood Legacies", 200f, 48f, 360f, 548f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Toggle Log", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".bl log");
			}
			if (GUILayout.Button("List Bloods", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".bl l");
			}
			if (GUILayout.Button("List Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".bl lst");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Blood: " + ((_selectedBlood == "") ? "(none)" : _selectedBlood), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(BloodTypes, BloodTypes, ref _selectedBlood, 3);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("View Details", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".bl get " + _selectedBlood);
			}
			if (GUILayout.Button("Reset Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".bl rst");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Stat: " + ((_selectedStat == "") ? "(none)" : _selectedStat), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(StatLabels, StatValues, ref _selectedStat, 3);
			if (GUILayout.Button("Choose Stat", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".bl cst " + _selectedStat);
			}
			GUILayout.Space(4f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawGrid(string[] labels, string[] values, ref string selected, int cols)
		{
			int num = 0;
			while (num < values.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < values.Length)
				{
					GUIStyle val = ((selected == values[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(labels[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == values[num]) ? "" : values[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedBlood = "";
			_selectedStat = "";
		}
	}
	public class ClassesPanel
	{
		private static readonly string[] ClassLabels = new string[6] { "Blood Knight", "Demon Hunter", "Vampire Lord", "Shadow Blade", "Arcane Sorc", "Death Mage" };

		private static readonly string[] ClassValues = new string[6] { "BloodKnight", "DemonHunter", "VampireLord", "ShadowBlade", "ArcaneSorcerer", "DeathMage" };

		private static readonly string[] SpellNumbers = new string[5] { "1", "2", "3", "4", "5" };

		private readonly DraggableWindow _window;

		private string _response = "";

		private string _selectedClass = "";

		private string _selectedSpell = "";

		public bool CloseRequested => _window.CloseRequested;

		public ClassesPanel()
		{
			_window = new DraggableWindow("Classes", 200f, 48f, 340f, 400f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Classes", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".class l");
			}
			if (GUILayout.Button("Toggle Shift Spell", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".class shift");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Class: " + ((_selectedClass == "") ? "(none)" : _selectedClass), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(ClassLabels, ClassValues, ref _selectedClass, 2);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Select", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".class s " + _selectedClass);
			}
			if (GUILayout.Button("Change", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".class c " + _selectedClass);
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("View Synergies", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".class lst " + _selectedClass);
			}
			if (GUILayout.Button("List Spells", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".class lsp " + _selectedClass);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Shift Spell #: " + ((_selectedSpell == "") ? "(none)" : _selectedSpell), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			string[] spellNumbers = SpellNumbers;
			foreach (string text in spellNumbers)
			{
				GUIStyle val = ((_selectedSpell == text) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
				if (GUILayout.Button(text, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
				{
					_selectedSpell = ((_selectedSpell == text) ? "" : text);
				}
			}
			GUILayout.EndHorizontal();
			if (GUILayout.Button("Choose Spell", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".class csp " + _selectedSpell);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawGrid(string[] labels, string[] values, ref string selected, int cols)
		{
			int num = 0;
			while (num < values.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < values.Length)
				{
					GUIStyle val = ((selected == values[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(labels[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == values[num]) ? "" : values[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedClass = "";
			_selectedSpell = "";
		}
	}
	public class FamiliarsPanel
	{
		private enum FamTab
		{
			Basic,
			Boxes,
			BattleGroups,
			Special
		}

		private readonly DraggableWindow _window;

		private string _response = "";

		private FamTab _currentTab;

		private readonly InputField _famNumberInput = new InputField();

		private readonly InputField _famNameInput = new InputField();

		private readonly InputField _boxNameInput = new InputField();

		private readonly InputField _renameOldInput = new InputField();

		private readonly InputField _renameNewInput = new InputField();

		private readonly InputField _groupInput = new InputField();

		private readonly InputField _slotInput = new InputField();

		private readonly InputField _schoolInput = new InputField();

		private readonly InputField _vbloodInput = new InputField();

		private readonly InputField _playerInput = new InputField();

		public bool CloseRequested => _window.CloseRequested;

		public FamiliarsPanel()
		{
			_window = new DraggableWindow("Familiars", 200f, 48f, 400f, 520f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			TabButton("Basic", FamTab.Basic);
			TabButton("Boxes", FamTab.Boxes);
			TabButton("Battle Grps", FamTab.BattleGroups);
			TabButton("Special", FamTab.Special);
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			switch (_currentTab)
			{
			case FamTab.Basic:
				DrawBasicTab();
				break;
			case FamTab.Boxes:
				DrawBoxesTab();
				break;
			case FamTab.BattleGroups:
				DrawBattleGroupsTab();
				break;
			case FamTab.Special:
				DrawSpecialTab();
				break;
			}
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(120f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawBasicTab()
		{
			GUILayout.Label("Familiar Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Familiars", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam l");
			}
			if (GUILayout.Button("Get Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam gl");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Toggle Familiar", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam t");
			}
			if (GUILayout.Button("Toggle Combat", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam c");
			}
			if (GUILayout.Button("Unbind", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam ub");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Prestige Fam", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam pr");
			}
			if (GUILayout.Button("Toggle Emotes", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam e");
			}
			if (GUILayout.Button("Emote Actions", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam actions");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Bind / Remove by #", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			_famNumberInput.Draw(60f);
			if (GUILayout.Button("Bind", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				Execute(".fam b " + _famNumberInput.Text);
			}
			if (GUILayout.Button("Remove", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				Execute(".fam r " + _famNumberInput.Text);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Search / Smart Bind by Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_famNameInput.Draw();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Search", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				Execute(".fam s " + _famNameInput.Text);
			}
			if (GUILayout.Button("Smart Bind", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				Execute(".fam sb " + _famNameInput.Text);
			}
			GUILayout.EndHorizontal();
		}

		private void DrawBoxesTab()
		{
			GUILayout.Label("Box Management", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Boxes", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".fam boxes");
			}
			GUILayout.Space(4f);
			GUILayout.Label("Box Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_boxNameInput.Draw();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Choose", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam cb " + _boxNameInput.Text);
			}
			if (GUILayout.Button("Add", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam ab " + _boxNameInput.Text);
			}
			if (GUILayout.Button("Delete", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam db " + _boxNameInput.Text);
			}
			if (GUILayout.Button("Move Here", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam mb " + _boxNameInput.Text);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label("Rename Box", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Current Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_renameOldInput.Draw();
			GUILayout.Label("New Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_renameNewInput.Draw();
			if (GUILayout.Button("Rename", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam rb " + _renameOldInput.Text + " " + _renameNewInput.Text);
			}
		}

		private void DrawBattleGroupsTab()
		{
			GUILayout.Label("Battle Groups", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Battle Groups", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".fam bgs");
			}
			GUILayout.Space(4f);
			GUILayout.Label("Group Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_groupInput.Draw();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("View", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam bg " + _groupInput.Text);
			}
			if (GUILayout.Button("Add", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam abg " + _groupInput.Text);
			}
			if (GUILayout.Button("Delete", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam dbg " + _groupInput.Text);
			}
			if (GUILayout.Button("Choose", Styles.SmallButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam cbg " + _groupInput.Text);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Assign to Slot", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Slot #", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_slotInput.Draw(60f);
			if (GUILayout.Button("Assign to Slot", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam sbg " + _groupInput.Text + " " + _slotInput.Text);
			}
		}

		private void DrawSpecialTab()
		{
			GUILayout.Label("Shiny Buff", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Spell School", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_schoolInput.Draw();
			if (GUILayout.Button("Set Shiny", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam shiny " + _schoolInput.Text);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Purchase VBlood", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("VBlood Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_vbloodInput.Draw();
			if (GUILayout.Button("Buy with Echoes", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam echoes " + _vbloodInput.Text);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Familiar Battle", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Player Name", Styles.LabelStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			_playerInput.Draw();
			if (GUILayout.Button("Challenge Player", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".fam challenge " + _playerInput.Text);
			}
		}

		private void TabButton(string label, FamTab tab)
		{
			GUIStyle val = ((_currentTab == tab) ? Styles.ActiveTabStyle : Styles.TabButtonStyle);
			if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				_currentTab = tab;
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_famNumberInput.Reset();
			_famNameInput.Reset();
			_boxNameInput.Reset();
			_renameOldInput.Reset();
			_renameNewInput.Reset();
			_groupInput.Reset();
			_slotInput.Reset();
			_schoolInput.Reset();
			_vbloodInput.Reset();
			_playerInput.Reset();
		}
	}
	public class LevelingPanel
	{
		private readonly DraggableWindow _window;

		private string _response = "";

		public bool CloseRequested => _window.CloseRequested;

		public LevelingPanel()
		{
			_window = new DraggableWindow("Leveling", 200f, 48f, 320f, 220f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("View Level / XP", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".lvl get");
			}
			if (GUILayout.Button("Toggle XP Log", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".lvl log");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(100f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
		}
	}
	public class MainMenuPanel
	{
		private readonly DraggableWindow _window;

		public bool CloseRequested => _window.CloseRequested;

		public MainMenuPanel()
		{
			_window = new DraggableWindow("Bloodcraft Menu", 10f, 48f, 180f, 310f);
		}

		public void Draw()
		{
			if (_window.Begin())
			{
				if (_window.CloseRequested)
				{
					_window.End();
					return;
				}
				GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
				CategoryButton("Classes", CategoryType.Classes);
				CategoryButton("Leveling", CategoryType.Leveling);
				CategoryButton("Weapon Expertise", CategoryType.WeaponExpertise);
				CategoryButton("Blood Legacies", CategoryType.BloodLegacies);
				CategoryButton("Prestige", CategoryType.Prestige);
				CategoryButton("Professions", CategoryType.Professions);
				CategoryButton("Quests", CategoryType.Quests);
				CategoryButton("Familiars", CategoryType.Familiars);
				CategoryButton("Miscellaneous", CategoryType.Misc);
				GUILayout.EndVertical();
				_window.End();
			}
		}

		private void CategoryButton(string label, CategoryType type)
		{
			GUIStyle val = ((UIManager.ActiveCategory == type) ? Styles.ActiveButtonStyle : Styles.ButtonStyle);
			if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				UIManager.ActiveCategory = ((UIManager.ActiveCategory == type) ? null : new CategoryType?(type));
			}
		}
	}
	public class MiscPanel
	{
		private static readonly string[] SctTypes = new string[5] { "Leveling", "Expertise", "Legacy", "Professions", "Familiars" };

		private readonly DraggableWindow _window;

		private string _response = "";

		private string _selectedSct = "";

		public bool CloseRequested => _window.CloseRequested;

		public MiscPanel()
		{
			_window = new DraggableWindow("Miscellaneous", 200f, 48f, 320f, 310f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Starter Kit", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".misc kitme");
			}
			if (GUILayout.Button("User Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".misc userstats");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Toggle Reminders", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".misc remindme");
			}
			if (GUILayout.Button("Reset Music", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".misc silence");
			}
			GUILayout.EndHorizontal();
			if (GUILayout.Button("Prepare for the Hunt", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".misc prepare");
			}
			GUILayout.Space(6f);
			GUILayout.Label("Scrolling Combat Text: " + ((_selectedSct == "") ? "(none)" : _selectedSct), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(SctTypes, ref _selectedSct, 2);
			if (GUILayout.Button("Toggle SCT", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".misc sct " + _selectedSct);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawGrid(string[] options, ref string selected, int cols)
		{
			int num = 0;
			while (num < options.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < options.Length)
				{
					GUIStyle val = ((selected == options[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(options[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == options[num]) ? "" : options[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedSct = "";
		}
	}
	public class PrestigePanel
	{
		private enum TypeTab
		{
			Level,
			Weapons,
			Blood
		}

		private static readonly string[] LevelTypes = new string[1] { "experience" };

		private static readonly string[] WeaponTypes = new string[14]
		{
			"Sword", "Axe", "Mace", "Spear", "Crossbow", "Slashers", "Pistols", "Reaper", "Longbow", "Whip",
			"TwinBlades", "Daggers", "Unarmed", "FishingPole"
		};

		private static readonly string[] BloodTypes = new string[10] { "Worker", "Warrior", "Scholar", "Rogue", "Mutant", "Draculin", "Immortal", "Creature", "Brute", "Corruption" };

		private static readonly string[] ExoformLabels = new string[2] { "Evolved Vampire", "Corrupted Serpent" };

		private static readonly string[] ExoformValues = new string[2] { "EvolvedVampire", "CorruptedSerpent" };

		private readonly DraggableWindow _window;

		private string _response = "";

		private TypeTab _typeTab;

		private string _selectedType = "";

		private string _selectedForm = "";

		public bool CloseRequested => _window.CloseRequested;

		public PrestigePanel()
		{
			_window = new DraggableWindow("Prestige", 200f, 48f, 360f, 500f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Prestiges", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prestige l");
			}
			if (GUILayout.Button("Sync Buffs", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prestige sb");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Toggle Exoform", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prestige exoform");
			}
			if (GUILayout.Button("Toggle Shroud", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prestige shroud");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Type: " + ((_selectedType == "") ? "(none)" : _selectedType), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			TabButton("Level", TypeTab.Level);
			TabButton("Weapons", TypeTab.Weapons);
			TabButton("Blood", TypeTab.Blood);
			GUILayout.EndHorizontal();
			switch (_typeTab)
			{
			case TypeTab.Level:
				DrawGrid(LevelTypes, LevelTypes, ref _selectedType, 2);
				break;
			case TypeTab.Weapons:
				DrawGrid(WeaponTypes, WeaponTypes, ref _selectedType, 4);
				break;
			case TypeTab.Blood:
				DrawGrid(BloodTypes, BloodTypes, ref _selectedType, 3);
				break;
			}
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Prestige Self", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".prestige me " + _selectedType);
			}
			if (GUILayout.Button("View Status", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".prestige get " + _selectedType);
			}
			if (GUILayout.Button("Leaderboard", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".prestige lb " + _selectedType);
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Exoform: " + ((_selectedForm == "") ? "(none)" : _selectedForm), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(ExoformLabels, ExoformValues, ref _selectedForm, 2);
			if (GUILayout.Button("Select Form", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".prestige sf " + _selectedForm);
			}
			GUILayout.Space(4f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void TabButton(string label, TypeTab tab)
		{
			GUIStyle val = ((_typeTab == tab) ? Styles.ActiveTabStyle : Styles.TabButtonStyle);
			if (GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
			{
				_typeTab = tab;
				_selectedType = "";
			}
		}

		private void DrawGrid(string[] labels, string[] values, ref string selected, int cols)
		{
			int num = 0;
			while (num < values.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < values.Length)
				{
					GUIStyle val = ((selected == values[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(labels[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == values[num]) ? "" : values[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedType = "";
			_selectedForm = "";
			_typeTab = TypeTab.Level;
		}
	}
	public class ProfessionsPanel
	{
		private static readonly string[] Professions = new string[8] { "Mining", "Woodcutting", "Harvesting", "Fishing", "Alchemy", "Blacksmithing", "Enchanting", "Tailoring" };

		private readonly DraggableWindow _window;

		private string _response = "";

		private string _selectedProf = "";

		public bool CloseRequested => _window.CloseRequested;

		public ProfessionsPanel()
		{
			_window = new DraggableWindow("Professions", 200f, 48f, 330f, 300f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Professions", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prof l");
			}
			if (GUILayout.Button("Toggle Log", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prof log");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Profession: " + ((_selectedProf == "") ? "(none)" : _selectedProf), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(Professions, ref _selectedProf, 2);
			if (GUILayout.Button("View Profession", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".prof get " + _selectedProf);
			}
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawGrid(string[] options, ref string selected, int cols)
		{
			int num = 0;
			while (num < options.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < options.Length)
				{
					GUIStyle val = ((selected == options[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(options[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == options[num]) ? "" : options[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedProf = "";
		}
	}
	public class QuestsPanel
	{
		private readonly DraggableWindow _window;

		private string _response = "";

		public bool CloseRequested => _window.CloseRequested;

		public QuestsPanel()
		{
			_window = new DraggableWindow("Quests", 200f, 48f, 330f, 300f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Toggle Quest Log", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".quest log");
			}
			GUILayout.Space(6f);
			GUILayout.Label("Daily Quests", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Progress", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest p daily");
			}
			if (GUILayout.Button("Track", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest t daily");
			}
			if (GUILayout.Button("Reroll", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest r daily");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Weekly Quests", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Progress", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest p weekly");
			}
			if (GUILayout.Button("Track", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest t weekly");
			}
			if (GUILayout.Button("Reroll", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
			{
				Execute(".quest r weekly");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(100f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
		}
	}
	public class WeaponExpertisePanel
	{
		private static readonly string[] WeaponTypes = new string[14]
		{
			"Sword", "Axe", "Mace", "Spear", "Crossbow", "Slashers", "Pistols", "Reaper", "Longbow", "Whip",
			"TwinBlades", "Daggers", "Unarmed", "FishingPole"
		};

		private static readonly string[] StatLabels = new string[12]
		{
			"Max HP", "Move Speed", "Atk Speed", "Phys Leech", "Spell Leech", "Prim Leech", "Phys Power", "Spell Power", "Phys Crit%", "Phys CritDMG",
			"Spell Crit%", "Spell CritDMG"
		};

		private static readonly string[] StatValues = new string[12]
		{
			"1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
			"11", "12"
		};

		private readonly DraggableWindow _window;

		private string _response = "";

		private string _selectedWeapon = "";

		private string _selectedStat = "";

		public bool CloseRequested => _window.CloseRequested;

		public WeaponExpertisePanel()
		{
			_window = new DraggableWindow("Weapon Expertise", 200f, 48f, 360f, 540f);
		}

		public void Draw()
		{
			if (!_window.Begin())
			{
				return;
			}
			if (_window.CloseRequested)
			{
				_window.End();
				return;
			}
			GUILayout.BeginVertical((Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("Actions", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("View Current", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep get");
			}
			if (GUILayout.Button("Toggle Log", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep log");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("List Weapons", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep l");
			}
			if (GUILayout.Button("List Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep lst");
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			if (GUILayout.Button("Reset Stats", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep rst");
			}
			if (GUILayout.Button("Lock Spells", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep locksp");
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(4f);
			GUILayout.Label("Weapon: " + ((_selectedWeapon == "") ? "(none)" : _selectedWeapon), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(WeaponTypes, WeaponTypes, ref _selectedWeapon, 4);
			GUILayout.Space(4f);
			GUILayout.Label("Stat: " + ((_selectedStat == "") ? "(none)" : _selectedStat), Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			DrawGrid(StatLabels, StatValues, ref _selectedStat, 3);
			GUILayout.Space(4f);
			if (GUILayout.Button("Choose Stat", Styles.ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
			{
				Execute(".wep cst " + _selectedWeapon + " " + _selectedStat);
			}
			GUILayout.Space(4f);
			GUILayout.Label("Response", Styles.HeaderStyle, (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label(_response, Styles.ResponseStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(80f) });
			GUILayout.EndVertical();
			_window.End();
		}

		private void DrawGrid(string[] labels, string[] values, ref string selected, int cols)
		{
			int num = 0;
			while (num < values.Length)
			{
				GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				int num2 = 0;
				while (num2 < cols && num < values.Length)
				{
					GUIStyle val = ((selected == values[num]) ? Styles.ActiveButtonStyle : Styles.SmallButtonStyle);
					if (GUILayout.Button(labels[num], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }))
					{
						selected = ((selected == values[num]) ? "" : values[num]);
					}
					num2++;
					num++;
				}
				GUILayout.EndHorizontal();
			}
		}

		private void Execute(string cmd)
		{
			_response = "Sending...";
			CommandService.SendCommand(cmd, delegate(string r)
			{
				_response = r;
			});
		}

		public void Reset()
		{
			_response = "";
			_selectedWeapon = "";
			_selectedStat = "";
		}
	}
}
namespace BloodcraftMenuUI.Services
{
	public static class ChatListener
	{
		public static bool HandleMessage(Entity entity)
		{
			//IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			if (!entity.Has<ChatMessageServerEvent>())
			{
				return false;
			}
			ChatMessageServerEvent val = entity.Read<ChatMessageServerEvent>();
			string text = ((object)(FixedString512Bytes)(ref val.MessageText)).ToString();
			if (!IsBloodcraftResponse(text))
			{
				return false;
			}
			CommandService.AccumulateResponse(StripColorTags(text));
			return Settings.ClearServerMessages.Value;
		}

		private static bool IsBloodcraftResponse(string text)
		{
			if (string.IsNullOrEmpty(CommandService.PendingCommand) && !CommandService.IsCollecting)
			{
				return false;
			}
			return text.Contains("<color=");
		}

		public static string StripColorTags(string text)
		{
			return Regex.Replace(text, "</?color[^>]*>", "");
		}
	}
	public static class CommandService
	{
		private readonly struct QueuedCommand
		{
			public readonly string Command;

			public readonly Action<string> Callback;

			public QueuedCommand(string command, Action<string> callback)
			{
				Command = command;
				Callback = callback;
			}
		}

		private static readonly Queue<QueuedCommand> _commandQueue = new Queue<QueuedCommand>();

		private static float _lastSendTime;

		private static readonly ComponentType[] _networkEventComponents = (ComponentType[])(object)new ComponentType[4]
		{
			ComponentType.ReadOnly(Il2CppType.Of<FromCharacter>()),
			ComponentType.ReadOnly(Il2CppType.Of<NetworkEventType>()),
			ComponentType.ReadOnly(Il2CppType.Of<SendNetworkEventTag>()),
			ComponentType.ReadOnly(Il2CppType.Of<ChatMessageEvent>())
		};

		private static Action<string> _collectingCallback;

		private static readonly StringBuilder _responseBuffer = new StringBuilder();

		private static float _lastResponseTime;

		private const float CollectionWindow = 0.6f;

		public static string PendingCommand { get; private set; }

		public static Action<string> PendingCallback { get; private set; }

		public static float PendingSince { get; private set; }

		public static bool IsCollecting { get; private set; }

		public static void SendCommand(string command, Action<string> onResponse = null)
		{
			_commandQueue.Enqueue(new QueuedCommand(command, onResponse));
		}

		public static void AccumulateResponse(string cleanText)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			if (!IsCollecting)
			{
				IsCollecting = true;
				_collectingCallback = PendingCallback;
				_responseBuffer.Clear();
				PendingCommand = null;
				PendingCallback = null;
			}
			if (_responseBuffer.Length > 0)
			{
				_responseBuffer.Append('\n');
			}
			_responseBuffer.Append(cleanText);
			_lastResponseTime = Time.time;
			try
			{
				_collectingCallback?.Invoke(_responseBuffer.ToString());
			}
			catch (Exception ex)
			{
				ManualLogSource log = Plugin.Log;
				if (log != null)
				{
					bool flag = default(bool);
					BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error in response callback: ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
					}
					log.LogError(val);
				}
			}
		}

		public static void ProcessQueue()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			if (IsCollecting && Time.time - _lastResponseTime > 0.6f)
			{
				try
				{
					_collectingCallback?.Invoke(_responseBuffer.ToString());
				}
				catch (Exception ex)
				{
					ManualLogSource log = Plugin.Log;
					if (log != null)
					{
						bool flag = default(bool);
						BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(34, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error in final response callback: ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
						}
						log.LogError(val);
					}
				}
				IsCollecting = false;
				_collectingCallback = null;
				_responseBuffer.Clear();
			}
			if (!IsCollecting && PendingCommand != null && Time.time - PendingSince > Settings.ResponseTimeout.Value)
			{
				PendingCallback?.Invoke("[Timed out waiting for server response]");
				ClearPending();
			}
			if (_commandQueue.Count != 0 && !(Time.time - _lastSendTime < Settings.CommandCooldown.Value) && PendingCommand == null && !IsCollecting)
			{
				QueuedCommand queuedCommand = _commandQueue.Dequeue();
				PendingCommand = queuedCommand.Command;
				PendingCallback = queuedCommand.Callback;
				PendingSince = Time.time;
				SendChatMessage(queuedCommand.Command);
				_lastSendTime = Time.time;
			}
		}

		public static void ClearPending()
		{
			PendingCommand = null;
			PendingCallback = null;
		}

		private static void SendChatMessage(string message)
		{
			//IL_0008: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.IsClientNull())
			{
				EntityManager entityManager = Plugin.EntityManager;
				Entity val = ((EntityManager)(ref entityManager)).CreateEntity(_networkEventComponents);
				((EntityManager)(ref entityManager)).SetComponentData<FromCharacter>(val, new FromCharacter
				{
					Character = Plugin.LocalCharacter,
					User = Plugin.LocalUser
				});
				((EntityManager)(ref entityManager)).SetComponentData<ChatMessageEvent>(val, new ChatMessageEvent
				{
					MessageText = new FixedString512Bytes(message),
					MessageType = (ChatMessageType)0
				});
				((EntityManager)(ref entityManager)).SetComponentData<NetworkEventType>(val, new NetworkEventType
				{
					EventId = NetworkEvents.EventId_ChatMessageEvent,
					IsAdminEvent = false,
					IsDebugEvent = false
				});
			}
		}
	}
	public static class ResponseParser
	{
		public static string Clean(string rawText)
		{
			if (string.IsNullOrEmpty(rawText))
			{
				return "";
			}
			return ChatListener.StripColorTags(rawText).Replace("\r\n", "\n").Trim();
		}
	}
}
namespace BloodcraftMenuUI.Patches
{
	[HarmonyPatch]
	public static class ChatSystemPatch
	{
		[HarmonyPatch(typeof(ClientChatSystem), "OnUpdate")]
		[HarmonyPrefix]
		private static void OnUpdatePrefix(ClientChatSystem __instance)
		{
			//IL_0009: 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_000f: 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_0018: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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)
			if (Plugin.IsClientNull())
			{
				return;
			}
			EntityQuery receiveChatMessagesQuery = __instance._ReceiveChatMessagesQuery;
			if (receiveChatMessagesQuery == default(EntityQuery))
			{
				return;
			}
			NativeArray<Entity> val = ((EntityQuery)(ref receiveChatMessagesQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
			List<Entity> list = new List<Entity>();
			try
			{
				Enumerator<Entity> enumerator = val.GetEnumerator();
				while (enumerator.MoveNext())
				{
					Entity current = enumerator.Current;
					if (ChatListener.HandleMessage(current))
					{
						list.Add(current);
					}
				}
			}
			finally
			{
				val.Dispose();
			}
			foreach (Entity item in list)
			{
				EntityManager entityManager = Plugin.EntityManager;
				((EntityManager)(ref entityManager)).DestroyEntity(item);
			}
		}
	}
	[HarmonyPatch]
	public static class EscapeMenuPatch
	{
		[HarmonyPatch(typeof(EscapeMenuView), "OnDestroy")]
		[HarmonyPrefix]
		private static void EscapeMenuViewOnDestroyPrefix()
		{
			if (Plugin.IsInitialized)
			{
				UIManager.Reset();
				Plugin.IsInitialized = false;
				Plugin.ClientWorld = null;
				ManualLogSource log = Plugin.Log;
				if (log != null)
				{
					log.LogInfo((object)"Client disconnected, UI reset.");
				}
			}
		}
	}
	[HarmonyPatch]
	public static class InitializationPatch
	{
		[HarmonyPatch(typeof(CharacterHUDEntry), "Awake")]
		[HarmonyPostfix]
		private static void CharacterHUDAwakePostfix()
		{
			Plugin.IsInitialized = true;
			ManualLogSource log = Plugin.Log;
			if (log != null)
			{
				log.LogInfo((object)"CharacterHUD initialized, UI ready.");
			}
		}

		[HarmonyPatch(typeof(CommonClientDataSystem), "OnUpdate")]
		[HarmonyPostfix]
		private static void CommonClientDataOnUpdatePostfix(CommonClientDataSystem __instance)
		{
			//IL_0013: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0047: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.IsInitialized)
			{
				return;
			}
			Plugin.ClientWorld = ((ComponentSystemBase)__instance).World;
			if (Plugin.LocalUser != Entity.Null && Plugin.LocalCharacter != Entity.Null)
			{
				return;
			}
			try
			{
				EntityQuery _query_1840110770_ = __instance.__query_1840110770_0;
				if (_query_1840110770_ != default(EntityQuery))
				{
					NativeArray<Entity> val = ((EntityQuery)(ref _query_1840110770_)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
					try
					{
						Enumerator<Entity> enumerator = val.GetEnumerator();
						if (enumerator.MoveNext())
						{
							Plugin.LocalUser = enumerator.Current;
						}
					}
					finally
					{
						val.Dispose();
					}
				}
				EntityQuery _query_1840110770_2 = __instance.__query_1840110770_1;
				if (_query_1840110770_2 != default(EntityQuery))
				{
					NativeArray<Entity> val2 = ((EntityQuery)(ref _query_1840110770_2)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
					try
					{
						Enumerator<Entity> enumerator = val2.GetEnumerator();
						if (enumerator.MoveNext())
						{
							Plugin.LocalCharacter = enumerator.Current;
						}
					}
					finally
					{
						val2.Dispose();
					}
				}
				if (Plugin.LocalUser != Entity.Null)
				{
					ManualLogSource log = Plugin.Log;
					if (log != null)
					{
						log.LogInfo((object)"LocalUser and LocalCharacter entities found.");
					}
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				if (log2 != null)
				{
					bool flag = default(bool);
					BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(69, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Query field access failed (game may have updated): ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(". Trying fallback.");
					}
					log2.LogWarning(val3);
				}
				FallbackScanForLocalEntities(((ComponentSystemBase)__instance).World);
			}
		}

		private static void FallbackScanForLocalEntities(World world)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_00ab: Expected O, but got Unknown
			//IL_0040: 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_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_0055: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				EntityManager entityManager = world.EntityManager;
				EntityQuery val = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly(Il2CppType.Of<User>()) });
				NativeArray<Entity> val2 = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
				try
				{
					Enumerator<Entity> enumerator = val2.GetEnumerator();
					if (enumerator.MoveNext())
					{
						Plugin.LocalCharacter = (Plugin.LocalUser = enumerator.Current).Read<User>().LocalCharacter._Entity;
						ManualLogSource log = Plugin.Log;
						if (log != null)
						{
							log.LogInfo((object)"LocalUser and LocalCharacter found via fallback User scan.");
						}
					}
				}
				finally
				{
					val2.Dispose();
					((EntityQuery)(ref val)).Dispose();
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				if (log2 != null)
				{
					bool flag = default(bool);
					BepInExErrorLogInterpolatedStringHandler val3 = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Fallback entity scan failed: ");
						((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
					}
					log2.LogError(val3);
				}
			}
		}
	}
	[HarmonyPatch]
	public static class InputBlockPatch
	{
		[HarmonyPatch(typeof(Input), "GetKey", new Type[] { typeof(KeyCode) })]
		[HarmonyPrefix]
		private static bool GetKeyPrefix(ref bool __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetKeyDown", new Type[] { typeof(KeyCode) })]
		[HarmonyPrefix]
		private static bool GetKeyDownPrefix(ref bool __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetKeyUp", new Type[] { typeof(KeyCode) })]
		[HarmonyPrefix]
		private static bool GetKeyUpPrefix(ref bool __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetButton", new Type[] { typeof(string) })]
		[HarmonyPrefix]
		private static bool GetButtonPrefix(ref bool __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetButtonDown", new Type[] { typeof(string) })]
		[HarmonyPrefix]
		private static bool GetButtonDownPrefix(ref bool __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetAxis", new Type[] { typeof(string) })]
		[HarmonyPrefix]
		private static bool GetAxisPrefix(ref float __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = 0f;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetAxisRaw", new Type[] { typeof(string) })]
		[HarmonyPrefix]
		private static bool GetAxisRawPrefix(ref float __result)
		{
			if (!InputField.AnyFocused)
			{
				return true;
			}
			__result = 0f;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetMouseButton", new Type[] { typeof(int) })]
		[HarmonyPrefix]
		private static bool GetMouseButtonPrefix(ref bool __result)
		{
			if (!UIManager.IsMenuOpen || !UIManager.IsMouseOverUI)
			{
				return true;
			}
			__result = false;
			return false;
		}

		[HarmonyPatch(typeof(Input), "GetMouseButtonDown", new Type[] { typeof(int) })]
		[HarmonyPrefix]
		private static bool GetMouseButtonDownPrefix(ref bool __result)
		{
			if (!UIManager.IsMenuOpen || !UIManager.IsMouseOverUI)
			{
				return true;
			}
			__result = false;
			return false;
		}
	}
}
namespace BloodcraftMenuUI.Models
{
	public enum CategoryType
	{
		Classes,
		Leveling,
		WeaponExpertise,
		BloodLegacies,
		Prestige,
		Professions,
		Quests,
		Familiars,
		Misc
	}
}
namespace BloodcraftMenuUI.Config
{
	public static class Settings
	{
		public static Conf