Decompiled source of AccessibilityMod v1.1.3

AccessibilityMod/fire.AccessibilityMod.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using A;
using AccessibilityMod;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using GlobalSettings;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Silksong.ModMenu;
using Silksong.ModMenu.Elements;
using Silksong.ModMenu.Models;
using Silksong.ModMenu.Screens;
using TMProOld;
using UnityEngine;
using UnityEngine.UI;

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

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AccessibilityMod
{
	internal enum PauseLabelPosition
	{
		TopRight,
		TopLeft,
		BottomRight,
		BottomLeft
	}
}
namespace A
{
	internal static class A
	{
		internal const float A = 0.25f;

		internal const float a = 0.23f;

		internal const bool B = false;

		internal const KeyCode b = (KeyCode)0;

		internal static ConfigEntry<PauseLabelPosition> C;

		internal static ConfigEntry<bool> c;

		internal static ConfigEntry<float> D;

		internal static ConfigEntry<float> d;

		internal static ConfigEntry<bool> E;

		internal static ConfigEntry<KeyCode> e;

		internal static void A(ConfigFile P_0)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			c = P_0.Bind<bool>("General", "Enabled", true, "Master toggle for the Accessibility Mod.");
			C = P_0.Bind<PauseLabelPosition>("General", "Pause Label Position", PauseLabelPosition.TopRight, "Corner used for the AccessibilityMod label.");
			D = P_0.Bind<float>("Speed", "Neutral Pogo Speed", 0.25f, new ConfigDescription("Speed boost applied before dash (0 = off)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			d = P_0.Bind<float>("Speed", "Dive-dash Speed", 0.23f, new ConfigDescription("Speed boost applied after dash while sprinting (0 = off).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			E = P_0.Bind<bool>("Hotkey", "Speed Toggle Hotkey", false, "Hotkey to turn off mod's speed boosts.");
			e = P_0.Bind<KeyCode>("Hotkey", "Key", (KeyCode)0, "Key to toggle speed boosts.");
		}
	}
	internal sealed class a
	{
		private readonly struct A
		{
			internal readonly string X;

			internal readonly string? x;

			internal A(string P_0, string? color)
			{
				X = P_0;
				x = color;
			}
		}

		private readonly struct a
		{
			internal readonly List<A> Y;

			internal readonly float y;

			internal readonly float Z;

			internal a(List<A> P_0, float P_1, float P_2)
			{
				Y = P_0;
				y = P_1;
				Z = P_2;
			}
		}

		private const float F = 40f;

		private const float f = 0.075f;

		private const float G = 0.115f;

		private const float g = 0.12f;

		private const float H = 14.5f;

		private const float h = -14.5f;

		private const float I = 8.25f;

		private const float i = -8.25f;

		private const float J = 4f;

		private const float j = 1f;

		private const float K = 0.12f;

		private const string k = "FFCC33";

		private const string L = "66D0FF";

		private static readonly CultureInfo l = CultureInfo.InvariantCulture;

		private readonly E M = new E();

		private GameObject? m;

		private readonly List<TextMeshPro> N = new List<TextMeshPro>();

		private readonly List<a> n = new List<a>();

		private float O = -1f;

		private bool o;

		internal void A(bool P_0)
		{
			o = P_0;
			O = Time.unscaledTime + 4f + 1f;
		}

		internal void A()
		{
			if (!a())
			{
				return;
			}
			if (!global::A.A.c.Value)
			{
				B();
				return;
			}
			n.Clear();
			if (b())
			{
				C();
			}
			int count = n.Count;
			float num = O - Time.unscaledTime;
			if (num > 0f)
			{
				float num2 = ((num < 1f) ? (num / 1f) : 1f);
				List<A> list = new List<A>
				{
					new A("AccessibilityMod", "FFCC33"),
					new A(o ? " Speed Disabled" : " Speed Enabled", null)
				};
				n.Add(new a(list, 0.115f, num2));
			}
			A(count);
		}

		private bool a()
		{
			if ((Object)(object)m != (Object)null)
			{
				return true;
			}
			N.Clear();
			m = d.A("AccessibilityModHud");
			return (Object)(object)m != (Object)null;
		}

		private void B()
		{
			for (int i = 0; i < N.Count; i++)
			{
				D.A(N[i]);
			}
		}

		private static bool b()
		{
			GameManager instance = GameManager.instance;
			if ((Object)(object)instance != (Object)null)
			{
				return instance.IsGamePaused();
			}
			return false;
		}

		private void C()
		{
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			float value = global::A.A.D.Value;
			float value2 = global::A.A.d.Value;
			bool flag = Mathf.Abs(value - 0.25f) > 0.0001f;
			bool flag2 = Mathf.Abs(value2 - 0.23f) > 0.0001f;
			bool value3 = global::A.A.E.Value;
			if (!flag && !flag2 && !value3)
			{
				n.Add(new a(new List<A>
				{
					new A("AccessibilityMod", "FFCC33"),
					new A(" set to ", null),
					new A("Default", "66D0FF"),
					new A(".", null)
				}, 0.075f, 1f));
				return;
			}
			n.Add(new a(new List<A>
			{
				new A("AccessibilityMod", "FFCC33")
			}, 0.075f, 1f));
			if (flag)
			{
				n.Add(new a(new List<A>
				{
					new A("NeutralPogoSpeed changed to ", null),
					new A(value.ToString("0.00", l), "66D0FF"),
					new A(".", null)
				}, 0.075f, 1f));
			}
			if (flag2)
			{
				n.Add(new a(new List<A>
				{
					new A("DivedashSpeed changed to ", null),
					new A(value2.ToString("0.00", l), "66D0FF"),
					new A(".", null)
				}, 0.075f, 1f));
			}
			if (value3)
			{
				KeyCode value4 = global::A.A.e.Value;
				n.Add(new a(new List<A>
				{
					new A("Speed Toggle Hotkey is ", null),
					new A("On", "66D0FF"),
					new A(((int)value4 == 0) ? "." : $" ({value4}).", null)
				}, 0.075f, 1f));
			}
		}

		private void A(int P_0)
		{
			while (N.Count < n.Count)
			{
				TextMeshPro val = D.A(m, "Line" + N.Count);
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				N.Add(val);
			}
			for (int i = n.Count; i < N.Count; i++)
			{
				D.A(N[i]);
			}
			float num = a(P_0);
			A(P_0, num);
		}

		private float a(int P_0)
		{
			if (n.Count == P_0)
			{
				return -8.25f;
			}
			return A(P_0, 14.5f, -8.25f, false, false);
		}

		private void A(int P_0, float P_1)
		{
			if (P_0 != 0)
			{
				PauseLabelPosition value = global::A.A.C.Value;
				bool flag = value != PauseLabelPosition.BottomRight && value != PauseLabelPosition.BottomLeft;
				bool flag2 = value == PauseLabelPosition.TopLeft || value == PauseLabelPosition.BottomLeft;
				float num = (flag2 ? (-14.5f) : 14.5f);
				float num2 = (flag ? 8.25f : (-8.25f));
				num2 = M.A(value, num2, m.GetComponentInParent<Camera>());
				if (value == PauseLabelPosition.BottomRight)
				{
					num2 = Mathf.Max(num2, P_1);
				}
				int num3 = ((!flag) ? (P_0 - 1) : 0);
				int num4 = (flag ? 1 : (-1));
				for (int i = num3; i >= 0 && i < P_0; i += num4)
				{
					num2 = A(i, num, num2, flag2, flag);
				}
			}
		}

		private float A(int P_0, float P_1, float P_2, bool P_3, bool P_4)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00f9: 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)
			a a2 = n[P_0];
			TextMeshPro obj = N[P_0];
			((Component)obj).gameObject.SetActive(true);
			obj.transform.localScale = new Vector3(a2.y, a2.y, 1f);
			((TMP_Text)obj).fontSize = 40f;
			((TMP_Text)obj).richText = true;
			((Graphic)obj).color = new Color(1f, 1f, 1f, a2.Z);
			((TMP_Text)obj).text = A(a2.Y, a2.Z);
			((TMP_Text)obj).ForceMeshUpdate();
			Bounds bounds = ((TMP_Text)obj).bounds;
			float num = (P_3 ? ((Bounds)(ref bounds)).min.x : ((Bounds)(ref bounds)).max.x);
			float num2 = (P_4 ? ((Bounds)(ref bounds)).max.y : ((Bounds)(ref bounds)).min.y);
			obj.transform.position = new Vector3(P_1 - num * a2.y, P_2 - num2 * a2.y, 0f);
			A(obj);
			float num3 = ((Bounds)(ref bounds)).size.y * a2.y + 0.12f;
			if (!P_4)
			{
				return P_2 + num3;
			}
			return P_2 - num3;
		}

		private static string A(List<A> P_0, float P_1)
		{
			string value = Mathf.Clamp(Mathf.RoundToInt(P_1 * 255f), 0, 255).ToString("X2");
			StringBuilder stringBuilder = new StringBuilder();
			foreach (A item in P_0)
			{
				string value2 = c.A(item.X);
				if (item.x != null)
				{
					stringBuilder.Append("<color=#").Append(item.x);
					if (P_1 < 1f)
					{
						stringBuilder.Append(value);
					}
					stringBuilder.Append('>').Append(value2).Append("</color>");
				}
				else
				{
					stringBuilder.Append(value2);
				}
			}
			return stringBuilder.ToString();
		}

		private static bool A(char P_0)
		{
			if (P_0 != 'Ò' && P_0 != 'Ù')
			{
				return P_0 == 'Ý';
			}
			return true;
		}

		private static void A(TextMeshPro P_0)
		{
			//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_003a: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_011f: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0153: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				TMP_TextInfo textInfo = ((TMP_Text)P_0).textInfo;
				if (textInfo == null || textInfo.characterCount == 0)
				{
					return;
				}
				float num = float.NegativeInfinity;
				float num2 = float.PositiveInfinity;
				for (int i = 0; i < textInfo.characterCount; i++)
				{
					TMP_CharacterInfo val = textInfo.characterInfo[i];
					if (val.isVisible && !A(val.character))
					{
						Vector3[] vertices = textInfo.meshInfo[val.materialReferenceIndex].vertices;
						int vertexIndex = val.vertexIndex;
						float num3 = Mathf.Max(vertices[vertexIndex + 1].y, vertices[vertexIndex + 2].y);
						float num4 = Mathf.Min(vertices[vertexIndex].y, vertices[vertexIndex + 3].y);
						if (num3 > num)
						{
							num = num3;
						}
						if (num4 < num2)
						{
							num2 = num4;
						}
					}
				}
				if (float.IsNegativeInfinity(num))
				{
					return;
				}
				float num5 = ((num2 < num) ? (num - (num - num2) * 0.12f) : num);
				bool flag = false;
				for (int j = 0; j < textInfo.characterCount; j++)
				{
					TMP_CharacterInfo val2 = textInfo.characterInfo[j];
					if (val2.isVisible && A(val2.character))
					{
						TMP_MeshInfo val3 = textInfo.meshInfo[val2.materialReferenceIndex];
						int vertexIndex2 = val2.vertexIndex;
						A(val3.vertices, val3.uvs0, vertexIndex2, vertexIndex2 + 1, num5);
						A(val3.vertices, val3.uvs0, vertexIndex2 + 3, vertexIndex2 + 2, num5);
						flag = true;
					}
				}
				if (flag)
				{
					((TMP_Text)P_0).UpdateVertexData((TMP_VertexDataUpdateFlags)3);
				}
			}
			catch
			{
			}
		}

		private static void A(Vector3[] P_0, Vector2[] P_1, int P_2, int P_3, float P_4)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			float y = P_0[P_3].y;
			float y2 = P_0[P_2].y;
			if (!(y <= P_4) && !(y <= y2))
			{
				float num = (P_4 - y2) / (y - y2);
				P_0[P_3] = new Vector3(P_0[P_3].x, P_4, P_0[P_3].z);
				P_1[P_3] = new Vector2(P_1[P_3].x, P_1[P_2].y + num * (P_1[P_3].y - P_1[P_2].y));
			}
		}
	}
	internal static class B
	{
		[CompilerGenerated]
		private static class A
		{
			public static MenuElementGenerator z;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class a
		{
			public static readonly a aA = new a();

			public static Action<bool> aa;

			public static Action<PauseLabelPosition> aB;

			public static IndexedToString<float> ab;

			public static Action<float> aC;

			public static IndexedToString<float> ac;

			public static Action<float> aD;

			public static Action<bool> ad;

			public static Action<KeyCode> aE;

			internal void A(bool P_0)
			{
				global::A.A.c.Value = P_0;
			}

			internal void A(PauseLabelPosition P_0)
			{
				global::A.A.C.Value = P_0;
			}

			internal LocalizedText A(int P_0, float P_1)
			{
				return LocalizedText.op_Implicit(P_1.ToString("0.00", CultureInfo.InvariantCulture));
			}

			internal void A(float P_0)
			{
				global::A.A.D.Value = P_0;
			}

			internal LocalizedText a(int P_0, float P_1)
			{
				return LocalizedText.op_Implicit(P_1.ToString("0.00", CultureInfo.InvariantCulture));
			}

			internal void a(float P_0)
			{
				global::A.A.d.Value = P_0;
			}

			internal void a(bool P_0)
			{
				global::A.A.E.Value = P_0;
			}

			internal void A(KeyCode P_0)
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				global::A.A.e.Value = P_0;
			}
		}

		[CompilerGenerated]
		private sealed class B
		{
			public AbstractMenuScreen ae;

			internal void A()
			{
				if (ae == null)
				{
					ae = B();
				}
				MenuScreenNavigation.Show(ae, (HistoryMode)0);
			}
		}

		[CompilerGenerated]
		private sealed class b
		{
			public ChoiceElement<PauseLabelPosition> aF;

			public ListSliderModel<float> af;

			public List<float> aG;

			public ListSliderModel<float> ag;

			public ChoiceElement<bool> aH;

			public KeyBindElement ah;

			internal void A()
			{
				global::A.A.D.Value = 0.25f;
				global::A.A.d.Value = 0.23f;
				global::A.A.E.Value = false;
				global::A.A.e.Value = (KeyCode)0;
				global::A.A.C.Value = PauseLabelPosition.TopRight;
				((SelectableValueElement<PauseLabelPosition>)(object)aF).Value = PauseLabelPosition.TopRight;
				((SliderModel<float>)(object)af).Index = global::A.B.A(aG, 0.25f);
				((SliderModel<float>)(object)ag).Index = global::A.B.A(aG, 0.23f);
				((SelectableValueElement<bool>)(object)aH).Value = false;
				((SelectableValueElement<KeyCode>)(object)ah).Value = (KeyCode)0;
			}
		}

		private const float P = 0.01f;

		private const float p = 1f;

		internal static void A()
		{
			//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_0020: Expected O, but got Unknown
			object obj = global::A.B.A.z;
			if (obj == null)
			{
				MenuElementGenerator val = a;
				global::A.B.A.z = val;
				obj = (object)val;
			}
			Registry.AddModMenu("Accessibility Mod", (MenuElementGenerator)obj);
		}

		private static SelectableElement a()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			TextButton val = new TextButton(LocalizedText.op_Implicit("Accessibility Mod"));
			AbstractMenuScreen ae = null;
			val.OnSubmit = (Action)Delegate.Combine(val.OnSubmit, (Action)delegate
			{
				if (ae == null)
				{
					ae = B();
				}
				MenuScreenNavigation.Show(ae, (HistoryMode)0);
			});
			return (SelectableElement)val;
		}

		private static AbstractMenuScreen B()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Expected O, but got Unknown
			//IL_0305: Expected O, but got Unknown
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Expected O, but got Unknown
			SimpleMenuScreen val = new SimpleMenuScreen("Accessibility Mod");
			List<float> aG = b();
			ChoiceElement<bool> val2 = new ChoiceElement<bool>(LocalizedText.op_Implicit("Enabled"), (IChoiceModel<bool>)(object)ChoiceModels.ForBool("Off", "On"), LocalizedText.op_Implicit("Master toggle for the whole mod."))
			{
				Value = global::A.A.c.Value
			};
			((SelectableValueElement<bool>)(object)val2).OnValueChanged += delegate(bool P_0)
			{
				global::A.A.c.Value = P_0;
			};
			val.Add((MenuElement)(object)val2);
			ChoiceElement<PauseLabelPosition> aF = new ChoiceElement<PauseLabelPosition>(LocalizedText.op_Implicit("Pause Label Position"), (IChoiceModel<PauseLabelPosition>)(object)ChoiceModels.ForNamedValues<PauseLabelPosition>((IEnumerable<ValueTuple<PauseLabelPosition, string>>)new(PauseLabelPosition, string)[4]
			{
				(PauseLabelPosition.TopRight, "Top Right"),
				(PauseLabelPosition.TopLeft, "Top Left"),
				(PauseLabelPosition.BottomRight, "Bottom Right"),
				(PauseLabelPosition.BottomLeft, "Bottom Left")
			}), LocalizedText.op_Implicit("Corner used for the AccessibilityMod label."))
			{
				Value = global::A.A.C.Value
			};
			((SelectableValueElement<PauseLabelPosition>)(object)aF).OnValueChanged += delegate(PauseLabelPosition P_0)
			{
				global::A.A.C.Value = P_0;
			};
			val.Add((MenuElement)(object)aF);
			ListSliderModel<float> af = new ListSliderModel<float>(aG)
			{
				DisplayFn = (int P_0, float P_1) => LocalizedText.op_Implicit(P_1.ToString("0.00", CultureInfo.InvariantCulture))
			};
			SliderElement<float> val3 = new SliderElement<float>(LocalizedText.op_Implicit("Neutral Pogo Speed"), (SliderModel<float>)(object)af);
			((SliderModel<float>)(object)af).Index = A(aG, global::A.A.D.Value);
			((SelectableValueElement<float>)(object)val3).OnValueChanged += delegate(float P_0)
			{
				global::A.A.D.Value = P_0;
			};
			val.Add((MenuElement)(object)val3);
			ListSliderModel<float> ag = new ListSliderModel<float>(aG)
			{
				DisplayFn = (int P_0, float P_1) => LocalizedText.op_Implicit(P_1.ToString("0.00", CultureInfo.InvariantCulture))
			};
			SliderElement<float> val4 = new SliderElement<float>(LocalizedText.op_Implicit("Dive-dash Speed"), (SliderModel<float>)(object)ag);
			((SliderModel<float>)(object)ag).Index = A(aG, global::A.A.d.Value);
			((SelectableValueElement<float>)(object)val4).OnValueChanged += delegate(float P_0)
			{
				global::A.A.d.Value = P_0;
			};
			val.Add((MenuElement)(object)val4);
			ChoiceElement<bool> aH = new ChoiceElement<bool>(LocalizedText.op_Implicit("Speed Toggle Hotkey"), (IChoiceModel<bool>)(object)ChoiceModels.ForBool("Off", "On"), LocalizedText.op_Implicit("Hotkey to turn off mod's speed boosts."))
			{
				Value = global::A.A.E.Value
			};
			((SelectableValueElement<bool>)(object)aH).OnValueChanged += delegate(bool P_0)
			{
				global::A.A.E.Value = P_0;
			};
			val.Add((MenuElement)(object)aH);
			KeyBindElement val5 = new KeyBindElement(LocalizedText.op_Implicit("Key"));
			((SelectableValueElement<KeyCode>)val5).Value = global::A.A.e.Value;
			KeyBindElement ah = val5;
			((SelectableValueElement<KeyCode>)(object)ah).OnValueChanged += delegate(KeyCode P_0)
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				global::A.A.e.Value = P_0;
			};
			val.Add((MenuElement)(object)ah);
			TextButton val6 = new TextButton(LocalizedText.op_Implicit("Set to Default"));
			val6.OnSubmit = (Action)Delegate.Combine(val6.OnSubmit, (Action)delegate
			{
				global::A.A.D.Value = 0.25f;
				global::A.A.d.Value = 0.23f;
				global::A.A.E.Value = false;
				global::A.A.e.Value = (KeyCode)0;
				global::A.A.C.Value = PauseLabelPosition.TopRight;
				((SelectableValueElement<PauseLabelPosition>)(object)aF).Value = PauseLabelPosition.TopRight;
				((SliderModel<float>)(object)af).Index = A(aG, 0.25f);
				((SliderModel<float>)(object)ag).Index = A(aG, 0.23f);
				((SelectableValueElement<bool>)(object)aH).Value = false;
				((SelectableValueElement<KeyCode>)(object)ah).Value = (KeyCode)0;
			});
			val.Add((MenuElement)(object)val6);
			return (AbstractMenuScreen)(object)val;
		}

		private static List<float> b()
		{
			int num = (int)Math.Round(100.0) + 1;
			List<float> list = new List<float>(num);
			for (int i = 0; i < num; i++)
			{
				list.Add((float)Math.Round((float)i * 0.01f, 2));
			}
			return list;
		}

		private static int A(List<float> P_0, float P_1)
		{
			int result = 0;
			float num = float.MaxValue;
			for (int i = 0; i < P_0.Count; i++)
			{
				float num2 = Math.Abs(P_0[i] - P_1);
				if (num2 < num)
				{
					num = num2;
					result = i;
				}
			}
			return result;
		}
	}
}
namespace AccessibilityMod
{
	[BepInPlugin("fire.AccessibilityMod", "fire.AccessibilityMod", "1.1.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[ModMenuIgnore]
	public class AccessibilityPlugin : BaseUnityPlugin
	{
		internal const string PluginGuid = "fire.AccessibilityMod";

		internal const string PluginName = "fire.AccessibilityMod";

		internal const string PluginVersion = "1.1.3";

		private const string ModMenuGuid = "org.silksong-modding.modmenu";

		private a? hud;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			global::A.A.A(((BaseUnityPlugin)this).Config);
			new Harmony("fire.AccessibilityMod").PatchAll();
			hud = new a();
			TryRegisterModMenu();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"fire.AccessibilityMod 1.1.3 loaded.");
		}

		private void Update()
		{
			HandleSpeedToggleHotkey();
			hud?.A();
		}

		private void HandleSpeedToggleHotkey()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (!global::A.A.c.Value)
			{
				b.Q = false;
				return;
			}
			if (!global::A.A.E.Value)
			{
				b.Q = false;
				return;
			}
			KeyCode value = global::A.A.e.Value;
			if ((int)value != 0 && Input.GetKeyDown(value))
			{
				b.Q = !b.Q;
				hud?.A(b.Q);
			}
		}

		private void TryRegisterModMenu()
		{
			if (!Chainloader.PluginInfos.ContainsKey("org.silksong-modding.modmenu"))
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Silksong.ModMenu not installed; the in-game Mod Menu is unavailable (settings remain editable in BepInEx/config).");
				return;
			}
			try
			{
				RegisterModMenu();
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Failed to register the Mod Menu: {arg}");
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static void RegisterModMenu()
		{
			B.A();
		}
	}
}
namespace A
{
	internal static class b
	{
		internal static bool Q;
	}
}
namespace AccessibilityMod
{
	[HarmonyPatch(typeof(HeroController), "FixedUpdate")]
	internal static class DiveDashSpeedEffect
	{
		private const float SprintSpeedRatio = 2.121212f;

		private static bool IsEnabled
		{
			get
			{
				if (global::A.A.c.Value && !b.Q && PlayerData.instance != null && PlayerData.instance.hasDash)
				{
					return IsHunterCrestEquipped;
				}
				return false;
			}
		}

		private static bool IsHunterCrestEquipped
		{
			get
			{
				ToolCrest hunterCrest = Gameplay.HunterCrest;
				ToolCrest hunterCrest2 = Gameplay.HunterCrest2;
				ToolCrest hunterCrest3 = Gameplay.HunterCrest3;
				if ((!((Object)(object)hunterCrest != (Object)null) || !((ToolBase)hunterCrest).IsEquipped) && (!((Object)(object)hunterCrest2 != (Object)null) || !((ToolBase)hunterCrest2).IsEquipped))
				{
					if ((Object)(object)hunterCrest3 != (Object)null)
					{
						return ((ToolBase)hunterCrest3).IsEquipped;
					}
					return false;
				}
				return true;
			}
		}

		[HarmonyPostfix]
		private static void BoostSprintSpeed(HeroController __instance)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			if (!IsEnabled || !__instance.cState.isSprinting || !__instance.cState.onGround || __instance.cState.downAttacking || __instance.cState.isBinding || __instance.IsSprintMasterActive || __instance.IsUsingQuickening)
			{
				return;
			}
			float value = global::A.A.d.Value;
			if (value <= 0f)
			{
				return;
			}
			Rigidbody2D rb2d = __instance.rb2d;
			if ((Object)(object)rb2d == (Object)null)
			{
				return;
			}
			Vector2 linearVelocity = rb2d.linearVelocity;
			float num = Mathf.Abs(linearVelocity.x);
			if (!(num <= 0f))
			{
				if (linearVelocity.x > 0f == __instance.cState.facingRight && !__instance.cState.dashing && num < __instance.DASH_SPEED)
				{
					float num2 = __instance.RUN_SPEED * value;
					linearVelocity.x += Mathf.Sign(linearVelocity.x) * num2;
					num = Mathf.Abs(linearVelocity.x);
				}
				float num3 = __instance.RUN_SPEED * (2.121212f + value);
				if (num > num3)
				{
					linearVelocity.x = Mathf.Sign(linearVelocity.x) * num3;
				}
				rb2d.linearVelocity = linearVelocity;
			}
		}
	}
}
namespace A
{
	internal static class C
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class A
		{
			public static readonly A aI = new A();

			public static Func<TMP_FontAsset, bool> ai;

			internal TMP_FontAsset A()
			{
				return Resources.FindObjectsOfTypeAll<TMP_FontAsset>().First((TMP_FontAsset P_0) => ((Object)P_0).name == "trajan_bold_tmpro");
			}

			internal bool A(TMP_FontAsset P_0)
			{
				return ((Object)P_0).name == "trajan_bold_tmpro";
			}
		}

		internal static readonly Lazy<TMP_FontAsset> q = new Lazy<TMP_FontAsset>((Func<TMP_FontAsset>)(() => Resources.FindObjectsOfTypeAll<TMP_FontAsset>().First((TMP_FontAsset P_0) => ((Object)P_0).name == "trajan_bold_tmpro")));
	}
	internal static class c
	{
		internal static string A(string P_0)
		{
			if (!string.IsNullOrEmpty(P_0))
			{
				return P_0.ToUpperInvariant().Replace('O', 'Ò').Replace('U', 'Ù')
					.Replace('Y', 'Ý');
			}
			return P_0;
		}
	}
	internal static class D
	{
		private static readonly Vector2 R = new Vector2(-1000f, -1000f);

		private const string r = "HUD";

		private const int S = 11;

		internal static TextMeshPro? A(GameObject P_0, string P_1)
		{
			//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_000e: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(P_1)
			{
				layer = 5
			};
			val.transform.SetParent(P_0.transform);
			TextMeshPro val2;
			try
			{
				val2 = val.AddComponent<TextMeshPro>();
				((TMP_Text)val2).font = C.q.Value;
			}
			catch
			{
				Object.Destroy((Object)(object)val);
				return null;
			}
			((Graphic)val2).color = Color.white;
			((TMP_Text)val2).enableWordWrapping = false;
			((TMP_Text)val2).autoSizeTextContainer = true;
			MeshRenderer component = val.GetComponent<MeshRenderer>();
			((Renderer)component).sortingLayerName = "HUD";
			((Renderer)component).sortingOrder = 11;
			val.SetActive(false);
			return val2;
		}

		internal static void A(TextMeshPro? P_0)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)P_0 == (Object)null))
			{
				((Component)P_0).gameObject.SetActive(false);
				P_0.transform.position = Vector2.op_Implicit(R);
			}
		}
	}
	internal static class d
	{
		private const string s = "_GameCameras/HudCamera/In-game";

		private static bool A(out GameObject P_0)
		{
			P_0 = GameObject.Find("_GameCameras/HudCamera/In-game");
			return (Object)(object)P_0 != (Object)null;
		}

		internal static GameObject? A(string P_0)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (!A(out GameObject val))
			{
				return null;
			}
			GameObject val2 = new GameObject(P_0)
			{
				layer = 5
			};
			Object.DontDestroyOnLoad((Object)val2);
			val2.transform.SetParent(val.transform);
			val2.transform.localPosition = Vector3.zero;
			return val2;
		}
	}
}
namespace AccessibilityMod
{
	[AttributeUsage(AttributeTargets.Class)]
	internal sealed class ModMenuIgnoreAttribute : Attribute
	{
	}
	[HarmonyPatch(typeof(HeroController), "Move")]
	internal static class NeutralPogoSpeedEffect
	{
		private static bool IsEnabled
		{
			get
			{
				if (global::A.A.c.Value && !b.Q && PlayerData.instance != null)
				{
					return !PlayerData.instance.hasDash;
				}
				return false;
			}
		}

		private static bool IsPogoing(HeroController hc)
		{
			HeroControllerStates cState = hc.cState;
			if (!cState.downAttacking && !cState.downSpiking && !cState.downSpikeAntic && !cState.downSpikeBouncing && !cState.downSpikeBouncingShort && !cState.downSpikeRecovery && !cState.bouncing)
			{
				return cState.recoilingDrill;
			}
			return true;
		}

		[HarmonyPostfix]
		private static void BoostRunSpeed(HeroController __instance, bool useInput)
		{
			//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_0088: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			if (!IsEnabled || !useInput || __instance.cState.wallSliding || !__instance.cState.onGround || __instance.cState.isSprinting || __instance.cState.dashing || __instance.cState.isBinding || IsPogoing(__instance) || __instance.IsUsingQuickening)
			{
				return;
			}
			float value = global::A.A.D.Value;
			if (value <= 0f)
			{
				return;
			}
			Rigidbody2D rb2d = __instance.rb2d;
			if (!((Object)(object)rb2d == (Object)null))
			{
				Vector2 linearVelocity = rb2d.linearVelocity;
				if (Mathf.Abs(linearVelocity.x) > 0f)
				{
					linearVelocity.x *= 1f + value;
				}
				float num = __instance.RUN_SPEED * (1f + value);
				if (Mathf.Abs(linearVelocity.x) > num)
				{
					linearVelocity.x = Mathf.Sign(linearVelocity.x) * num;
				}
				rb2d.linearVelocity = linearVelocity;
			}
		}
	}
}
namespace A
{
	internal sealed class E
	{
		private const float T = 0.2f;

		private const string t = "io.github.flibber-hk.bingoui";

		private const string U = "io.github.homothetyhk.benchwarp";

		private FieldInfo? u;

		private FieldInfo? V;

		private RectTransform? v;

		private RectTransform? W;

		private readonly Vector3[] w = (Vector3[])(object)new Vector3[4];

		internal float A(PauseLabelPosition P_0, float P_1, Camera? P_2)
		{
			if ((Object)(object)P_2 == (Object)null)
			{
				return P_1;
			}
			if (P_0 == PauseLabelPosition.BottomRight || P_0 == PauseLabelPosition.BottomLeft)
			{
				if (!A(P_2, out var num))
				{
					return P_1;
				}
				return Mathf.Max(P_1, num + 0.2f);
			}
			RectTransform val = A();
			if ((Object)(object)val == (Object)null)
			{
				return P_1;
			}
			if (P_0 == PauseLabelPosition.TopRight && A(val, P_2, out var num2, out var _))
			{
				return Mathf.Min(P_1, num2 - 0.2f);
			}
			if (P_0 == PauseLabelPosition.TopLeft && A(out var num4))
			{
				return Mathf.Min(P_1, num4 - 0.2f);
			}
			return P_1;
		}

		private RectTransform? A()
		{
			if (!A("io.github.homothetyhk.benchwarp", out BaseUnityPlugin _))
			{
				return null;
			}
			if ((Object)(object)v == (Object)null)
			{
				GameObject obj = GameObject.Find("BenchwarpGUI/Bench Menu Canvas/Page  Button");
				v = ((obj != null) ? obj.GetComponent<RectTransform>() : null);
			}
			if ((Object)(object)W == (Object)null)
			{
				GameObject obj2 = GameObject.Find("BenchwarpGUI/Warp Only Canvas/Config Button");
				W = ((obj2 != null) ? obj2.GetComponent<RectTransform>() : null);
			}
			if (A(v))
			{
				return v;
			}
			if (!A(W))
			{
				return null;
			}
			return W;
		}

		private bool A(Camera P_0, out float P_1)
		{
			P_1 = float.NegativeInfinity;
			if (!A("io.github.flibber-hk.bingoui", out BaseUnityPlugin val))
			{
				return false;
			}
			if ((object)u == null)
			{
				u = ((object)val).GetType().GetField("_canvasManager", BindingFlags.Instance | BindingFlags.NonPublic);
			}
			object obj = u?.GetValue(val);
			if (obj == null)
			{
				return false;
			}
			if ((object)V == null)
			{
				V = obj.GetType().GetField("_canvas", BindingFlags.Instance | BindingFlags.NonPublic);
			}
			object? obj2 = V?.GetValue(obj);
			GameObject val2 = (GameObject)((obj2 is GameObject) ? obj2 : null);
			if ((Object)(object)val2 == (Object)null || !val2.activeInHierarchy)
			{
				return false;
			}
			for (int i = 0; i < val2.transform.childCount; i++)
			{
				Transform child = val2.transform.GetChild(i);
				RectTransform val3 = (RectTransform)(object)((child is RectTransform) ? child : null);
				if (A(val3) && A(val3, P_0, out var _, out var num2))
				{
					P_1 = Mathf.Max(P_1, num2);
				}
			}
			return !float.IsNegativeInfinity(P_1);
		}

		private bool A(RectTransform P_0, Camera P_1, out float P_2, out float P_3)
		{
			//IL_002a: 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: Invalid comparison between Unknown and I4
			//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)
			//IL_007b: 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_0083: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			P_2 = float.PositiveInfinity;
			P_3 = float.NegativeInfinity;
			Canvas componentInParent = ((Component)P_0).GetComponentInParent<Canvas>();
			if ((Object)(object)componentInParent == (Object)null || !((Behaviour)componentInParent).isActiveAndEnabled)
			{
				return false;
			}
			Camera val = (((int)componentInParent.renderMode == 0) ? null : componentInParent.worldCamera);
			if ((int)componentInParent.renderMode == 2 && (Object)(object)val == (Object)null)
			{
				return false;
			}
			float z = P_1.WorldToScreenPoint(Vector3.zero).z;
			P_0.GetWorldCorners(w);
			Vector3[] array = w;
			foreach (Vector3 val2 in array)
			{
				Vector2 val3 = RectTransformUtility.WorldToScreenPoint(val, val2);
				float y = P_1.ScreenToWorldPoint(new Vector3(val3.x, val3.y, z)).y;
				P_2 = Mathf.Min(P_2, y);
				P_3 = Mathf.Max(P_3, y);
			}
			return true;
		}

		private static bool A(RectTransform? P_0)
		{
			if ((Object)(object)P_0 == (Object)null || !((Component)P_0).gameObject.activeInHierarchy)
			{
				return false;
			}
			CanvasGroup[] componentsInParent = ((Component)P_0).GetComponentsInParent<CanvasGroup>();
			foreach (CanvasGroup val in componentsInParent)
			{
				if (val.alpha <= 0.001f)
				{
					return false;
				}
				if (val.ignoreParentGroups)
				{
					break;
				}
			}
			return true;
		}

		private static bool A(out float P_0)
		{
			//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)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			P_0 = float.PositiveInfinity;
			SilkSpool instance = SilkSpool.Instance;
			if ((Object)(object)instance == (Object)null || !((Component)instance).gameObject.activeInHierarchy)
			{
				return false;
			}
			Renderer[] componentsInChildren = ((Component)instance).GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				if (val.enabled && (val is MeshRenderer || val is SpriteRenderer))
				{
					float num = P_0;
					Bounds bounds = val.bounds;
					P_0 = Mathf.Min(num, ((Bounds)(ref bounds)).min.y);
				}
			}
			return !float.IsPositiveInfinity(P_0);
		}

		private static bool A(string P_0, out BaseUnityPlugin P_1)
		{
			P_1 = null;
			if (!Chainloader.PluginInfos.TryGetValue(P_0, out var value) || (Object)(object)value.Instance == (Object)null || !((Behaviour)value.Instance).isActiveAndEnabled)
			{
				return false;
			}
			P_1 = value.Instance;
			return true;
		}
	}
}