Decompiled source of InputHistory v1.0.0

plugins/InputHistory/InputHistory.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameplayEntities;
using HarmonyLib;
using LLBML.States;
using LLBML.Utils;
using LLHandlers;
using Microsoft.CodeAnalysis;
using Multiplayer;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("Cubical")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyProduct("InputHistory")]
[assembly: AssemblyTitle("InputHistory")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.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]
	[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 InputHistory
{
	[BepInPlugin("us.Cubical.plugins.llb.InputHistory", "InputHistory", "1.0.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LLBlaze.exe")]
	public class InputHistoryClass : BaseUnityPlugin
	{
		public enum TimeMode
		{
			Off,
			MS,
			Frames,
			Both
		}

		public TimeMode timeMode;

		public ConfigEntry<int> selectTimeMode;

		public ConfigEntry<bool> inputHistoryOn;

		internal static ManualLogSource Logger;

		private Harmony harmony = new Harmony("InputHistory");

		public int MaxRows = 30;

		public GameObject verticalPanelGO;

		public GameObject nestedPanelGO;

		public Text timeTextPrefab;

		public float lastInstantiationTime;

		public int lastFrameCount;

		public Image nestedPanelImage;

		public Queue<GameObject> rowQueue = new Queue<GameObject>();

		private bool wasInputHistoryOn = true;

		private bool wasInMatch = false;

		public static InputHistoryClass Instance { get; private set; }

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			MakeCanvas();
			ConfigInit();
			harmony.PatchAll();
		}

		public void Start()
		{
			Logger.LogInfo((object)"InputHistory Started");
			ModDependenciesUtils.RegisterToModMenu(((BaseUnityPlugin)this).Info, new List<string> { "<b>Select Time Info Mode Index</b>:", "", "0 : <b>None</b>", "1 : <b>Time in Ms</b>", "2 : <b>Time in Frames</b>", "3 : <b>Display Both</b>" });
		}

		private void ConfigInit()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			inputHistoryOn = ((BaseUnityPlugin)this).Config.Bind<bool>("Toggles", "InputHistoryOn", true, (ConfigDescription)null);
			selectTimeMode = ((BaseUnityPlugin)this).Config.Bind<int>("General", "selectTimeMode", 3, new ConfigDescription("Viewing mode index", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 3), new object[0]));
		}

		private void MakeCanvas()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Expected O, but got Unknown
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Canvas");
			Canvas val2 = val.AddComponent<Canvas>();
			val2.renderMode = (RenderMode)0;
			val.AddComponent<GraphicRaycaster>();
			CanvasScaler val3 = val.AddComponent<CanvasScaler>();
			val3.uiScaleMode = (ScaleMode)1;
			val3.referenceResolution = new Vector2(1920f, 1080f);
			verticalPanelGO = new GameObject("VerticalPanel");
			verticalPanelGO.transform.SetParent(val.transform, false);
			RectTransform val4 = verticalPanelGO.AddComponent<RectTransform>();
			VerticalLayoutGroup val5 = verticalPanelGO.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val5).childForceExpandWidth = true;
			((HorizontalOrVerticalLayoutGroup)val5).childForceExpandHeight = false;
			((LayoutGroup)val5).childAlignment = (TextAnchor)6;
			((HorizontalOrVerticalLayoutGroup)val5).spacing = 3f;
			Image val6 = verticalPanelGO.AddComponent<Image>();
			((Graphic)val6).color = new Color(1f, 1f, 1f, 0f);
			val4.anchorMin = new Vector2(0f, 0f);
			val4.anchorMax = new Vector2(0f, 0f);
			val4.pivot = new Vector2(0f, 0f);
			val4.anchoredPosition = new Vector2(0f, 0f);
			val4.sizeDelta = new Vector2(240f, 1080f);
			nestedPanelGO = new GameObject("NestedPanel");
			RectTransform val7 = nestedPanelGO.AddComponent<RectTransform>();
			nestedPanelImage = (Image)(object)nestedPanelGO.AddComponent<UIStyle>();
			((Graphic)nestedPanelImage).color = new Color(0f, 1f, 0f, 0.1f);
			nestedPanelGO.transform.SetParent(val.transform, false);
			LayoutElement val8 = nestedPanelGO.AddComponent<LayoutElement>();
			val8.minWidth = 150f;
			val8.minHeight = 33f;
			val7.anchorMin = new Vector2(0f, 0f);
			val7.anchorMax = new Vector2(0f, 0f);
			val7.pivot = new Vector2(0f, 0f);
			val7.anchoredPosition = Vector2.zero;
			val7.sizeDelta = new Vector2(150f, 36f);
			val.SetActive(true);
			verticalPanelGO.SetActive(true);
			nestedPanelGO.SetActive(false);
			val2.sortingOrder = 100;
			val.transform.localScale = Vector3.one;
			Object.DontDestroyOnLoad((Object)(object)val);
		}

		public void Update()
		{
			bool flag = GameStates.IsInMatch();
			if (!inputHistoryOn.Value && wasInputHistoryOn)
			{
				ClearRows();
				wasInputHistoryOn = false;
			}
			else if (inputHistoryOn.Value)
			{
				wasInputHistoryOn = true;
			}
			if (!flag && wasInMatch)
			{
				ClearRows();
			}
			wasInMatch = flag;
		}

		public void ClearRows()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			foreach (Transform item in verticalPanelGO.transform)
			{
				Transform val = item;
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
		}

		public void AddRow(List<int> actions)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Invalid comparison between Unknown and I4
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Expected O, but got Unknown
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Expected O, but got Unknown
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Expected O, but got Unknown
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Expected O, but got Unknown
			//IL_0512: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			if (!inputHistoryOn.Value)
			{
				return;
			}
			GameObject val = Object.Instantiate<GameObject>(nestedPanelGO, verticalPanelGO.transform);
			val.SetActive(true);
			val.transform.SetParent(verticalPanelGO.transform, false);
			HorizontalLayoutGroup val2 = val.AddComponent<HorizontalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandWidth = false;
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)val2).spacing = 0f;
			((LayoutGroup)val2).childAlignment = (TextAnchor)6;
			PlayerEntity playerEntity = PlayerHandler.instance.GetPlayerEntity(0);
			if ((int)((MovableEntity)playerEntity).moveableData.playerState == 0 && (int)((HitableData)((MovableEntity)playerEntity).moveableData).hitstunState == 51)
			{
				((Graphic)nestedPanelImage).color = new Color(1f, 0f, 0f, 0.2f);
			}
			else
			{
				((Graphic)nestedPanelImage).color = new Color(0f, 1f, 0f, 0.2f);
			}
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0f);
			component.anchorMax = new Vector2(0f, 0f);
			component.pivot = new Vector2(0f, 0f);
			Dictionary<int, Texture2D> input2Texture = Patcher.input2Texture;
			foreach (int action in actions)
			{
				if (input2Texture.ContainsKey(action) && (Object)(object)input2Texture[action] != (Object)null)
				{
					GameObject val3 = new GameObject("ActionImage");
					val3.transform.SetParent(val.transform, false);
					Image val4 = val3.AddComponent<Image>();
					Sprite sprite = Sprite.Create(input2Texture[action], new Rect(0f, 0f, (float)((Texture)input2Texture[action]).width, (float)((Texture)input2Texture[action]).height), new Vector2(0.5f, 0.5f));
					val4.sprite = sprite;
					AspectRatioFitter component2 = val3.GetComponent<AspectRatioFitter>();
					if ((Object)(object)component2 != (Object)null)
					{
						Object.Destroy((Object)(object)component2);
					}
					RectTransform component3 = val3.GetComponent<RectTransform>();
					component3.sizeDelta = new Vector2(5f, 5f);
					LayoutElement val5 = val3.AddComponent<LayoutElement>();
					val5.preferredWidth = 22f;
					val5.preferredHeight = 22f;
					component3.anchorMin = new Vector2(0.5f, 0.5f);
					component3.anchorMax = new Vector2(0.5f, 0.5f);
				}
				else
				{
					Debug.LogWarning((object)$"No InputImage assigned for action {action}");
				}
			}
			float num = Time.time - lastInstantiationTime;
			int num2 = World.instance.worldData.timeLeft - lastFrameCount;
			TimeMode value = (TimeMode)selectTimeMode.Value;
			GameObject val6 = new GameObject("NewText");
			Text val7 = val6.AddComponent<Text>();
			val7.text = "Sample Text";
			Font font = (val7.font = Patcher.timeTextFont);
			val7.fontSize = 14;
			val7.alignment = (TextAnchor)3;
			((Graphic)val7).color = Color.white;
			switch (value)
			{
			case TimeMode.MS:
			{
				GameObject val12 = new GameObject("TimeText_MS");
				Text val13 = val12.AddComponent<Text>();
				val13.font = font;
				val13.fontSize = 14;
				val13.alignment = (TextAnchor)3;
				((Graphic)val13).color = Color.white;
				val12.transform.SetParent(val.transform, false);
				if (num * 1000f < 3000f)
				{
					val13.text = $"{num * 1000f:F2} ms";
				}
				else
				{
					val13.text = "+3000 ms";
				}
				break;
			}
			case TimeMode.Frames:
			{
				GameObject val10 = new GameObject("TimeText_Frames");
				Text val11 = val10.AddComponent<Text>();
				val11.font = font;
				val11.fontSize = 14;
				val11.alignment = (TextAnchor)3;
				((Graphic)val11).color = Color.white;
				val10.transform.SetParent(val.transform, false);
				if (num2 < 99)
				{
					val11.text = $"{num2} frames";
				}
				else
				{
					val11.text = "+99 Frames";
				}
				break;
			}
			case TimeMode.Both:
			{
				GameObject val8 = new GameObject("TimeText_Both");
				Text val9 = val8.AddComponent<Text>();
				val9.text = $"{num * 1000f:F2} ms ({num2} frames)";
				val9.font = font;
				val9.fontSize = 14;
				val9.alignment = (TextAnchor)3;
				((Graphic)val9).color = Color.white;
				val8.transform.SetParent(val.transform, false);
				break;
			}
			}
			lastInstantiationTime = Time.time;
			lastFrameCount = World.instance.worldData.timeLeft;
			rowQueue.Enqueue(val);
			if (rowQueue.Count > MaxRows)
			{
				GameObject val14 = rowQueue.Dequeue();
				Object.Destroy((Object)(object)val14);
			}
		}
	}
	[HarmonyPatch]
	internal class Patcher
	{
		public static int[] inputActions;

		public static List<Texture2D> input_Images;

		public static Font timeTextFont;

		private static readonly string bundlesFolder = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)InputHistoryClass.Instance).Info.Location), "Bundles");

		public static Dictionary<int, Texture2D> input2Texture;

		public static float lastInstantiationTime;

		public static int lastFrameCount;

		private static List<int> lastFrameActions = new List<int>();

		[HarmonyPatch(typeof(InputAction), "Init")]
		[HarmonyPostfix]
		public static void Init()
		{
			input_Images = new List<Texture2D>();
			lastInstantiationTime = World.DELTA_TIME;
			lastFrameCount = FrameObject.lastIndex;
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(bundlesFolder, "inputhistoryuibundle"));
			timeTextFont = val.LoadAsset<Font>("assets/images/elements.ttf");
			string[] allAssetNames = val.GetAllAssetNames();
			string[] array = allAssetNames;
			foreach (string text in array)
			{
			}
			Texture2D[] array2 = val.LoadAllAssets<Texture2D>();
			for (int j = 0; j < array2.Length; j++)
			{
				if (!((Object)array2[j]).name.Contains("Font Texture"))
				{
					input_Images.Add(array2[j]);
				}
			}
			inputActions = new int[InputAction.nGameActions];
			for (int k = 0; k < InputAction.nGameActions; k++)
			{
				inputActions[k] = InputAction.actions[k];
			}
			input2Texture = new Dictionary<int, Texture2D>();
			input2Texture[inputActions[11]] = input_Images[3];
			input2Texture[inputActions[12]] = input_Images[0];
			input2Texture[inputActions[9]] = input_Images[1];
			input2Texture[inputActions[10]] = input_Images[2];
			input2Texture[inputActions[1]] = input_Images[7];
			input2Texture[inputActions[0]] = input_Images[10];
			input2Texture[inputActions[2]] = input_Images[5];
			input2Texture[inputActions[3]] = input_Images[6];
			input2Texture[inputActions[4]] = input_Images[11];
			input2Texture[inputActions[5]] = input_Images[8];
			input2Texture[inputActions[6]] = input_Images[4];
			input2Texture[inputActions[7]] = input_Images[9];
			input2Texture[inputActions[8]] = input_Images[12];
		}

		[HarmonyPatch(typeof(InputHandler), "UpdateInput")]
		[HarmonyPostfix]
		public static void UpdateInput()
		{
			PlayerEntity playerEntity = PlayerHandler.instance.GetPlayerEntity(0);
			if (false)
			{
				return;
			}
			List<int> list = new List<int>();
			foreach (KeyValuePair<int, Texture2D> item in input2Texture)
			{
				int key = item.Key;
				if (((ControllableEntity)playerEntity).GetInput(key))
				{
					list.Add(key);
				}
			}
			if (list.Count > 0 && !AreListsEqual(list, lastFrameActions))
			{
				InputHistoryClass.Instance.AddRow(list);
			}
			lastFrameActions = new List<int>(list);
			bool flag = true;
		}

		private static bool AreListsEqual(List<int> list1, List<int> list2)
		{
			if (list1.Count != list2.Count)
			{
				return false;
			}
			foreach (int item in list1)
			{
				if (!list2.Contains(item))
				{
					return false;
				}
			}
			return true;
		}
	}
	public class UIStyle : Image
	{
		[SerializeField]
		private float skewX = 5f;

		[SerializeField]
		private float borderWidth = 2.5f;

		[SerializeField]
		private Color borderColor = new Color(1f, 1f, 1f, 0.75f);

		protected override void OnPopulateMesh(VertexHelper vh)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			vh.Clear();
			Rect rect = ((Graphic)this).rectTransform.rect;
			float width = ((Rect)(ref rect)).width;
			rect = ((Graphic)this).rectTransform.rect;
			float height = ((Rect)(ref rect)).height;
			Vector3 position = default(Vector3);
			((Vector3)(ref position))..ctor(0f - borderWidth, 0f - borderWidth);
			Vector3 position2 = default(Vector3);
			((Vector3)(ref position2))..ctor(width + borderWidth, 0f - borderWidth);
			Vector3 position3 = default(Vector3);
			((Vector3)(ref position3))..ctor(skewX - borderWidth, height + borderWidth);
			Vector3 position4 = default(Vector3);
			((Vector3)(ref position4))..ctor(width + skewX + borderWidth, height + borderWidth);
			Vector3 position5 = default(Vector3);
			((Vector3)(ref position5))..ctor(0f, 0f);
			Vector3 position6 = default(Vector3);
			((Vector3)(ref position6))..ctor(width, 0f);
			Vector3 position7 = default(Vector3);
			((Vector3)(ref position7))..ctor(skewX, height);
			Vector3 position8 = default(Vector3);
			((Vector3)(ref position8))..ctor(width + skewX, height);
			Color32 color = Color32.op_Implicit(borderColor);
			Color32 color2 = Color32.op_Implicit(((Graphic)this).color);
			UIVertex simpleVert = UIVertex.simpleVert;
			simpleVert.color = color;
			simpleVert.position = position;
			UIVertex simpleVert2 = UIVertex.simpleVert;
			simpleVert2.color = color;
			simpleVert2.position = position2;
			UIVertex simpleVert3 = UIVertex.simpleVert;
			simpleVert3.color = color;
			simpleVert3.position = position4;
			UIVertex simpleVert4 = UIVertex.simpleVert;
			simpleVert4.color = color;
			simpleVert4.position = position3;
			UIVertex simpleVert5 = UIVertex.simpleVert;
			simpleVert5.color = color2;
			simpleVert5.position = position5;
			UIVertex simpleVert6 = UIVertex.simpleVert;
			simpleVert6.color = color2;
			simpleVert6.position = position6;
			UIVertex simpleVert7 = UIVertex.simpleVert;
			simpleVert7.color = color2;
			simpleVert7.position = position8;
			UIVertex simpleVert8 = UIVertex.simpleVert;
			simpleVert8.color = color2;
			simpleVert8.position = position7;
			vh.AddVert(simpleVert);
			vh.AddVert(simpleVert2);
			vh.AddVert(simpleVert3);
			vh.AddVert(simpleVert4);
			vh.AddVert(simpleVert5);
			vh.AddVert(simpleVert6);
			vh.AddVert(simpleVert7);
			vh.AddVert(simpleVert8);
			vh.AddTriangle(0, 1, 4);
			vh.AddTriangle(1, 5, 4);
			vh.AddTriangle(1, 2, 5);
			vh.AddTriangle(2, 6, 5);
			vh.AddTriangle(2, 3, 6);
			vh.AddTriangle(3, 7, 6);
			vh.AddTriangle(3, 0, 7);
			vh.AddTriangle(0, 4, 7);
			vh.AddTriangle(4, 5, 6);
			vh.AddTriangle(6, 7, 4);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "InputHistory";

		public const string PLUGIN_NAME = "InputHistory";

		public const string PLUGIN_VERSION = "1.0.0.0";
	}
}