Decompiled source of SSJHudIndicator v1.0.0

SSJIndicator.dll

Decompiled 18 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using TMPro;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SSJIndicator")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SSJ Indicator")]
[assembly: AssemblyTitle("SSJIndicator")]
[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 SSJIndicator
{
	[BepInPlugin("SSJIndicator", "SSJ Indicator", "1.0.0")]
	[Harmony]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static Sprite spr_fill;

		private static PluginConfigurator config;

		public static int SSJTier;

		public static float SSJTimer;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("SSJIndicator");
			val.PatchAll();
			config = PluginConfig.CreateConfig();
			spr_fill = LoadImage("SSJ_Fill.png");
			Logger.LogInfo((object)"Plugin SSJIndicator is loaded!");
		}

		private static Sprite LoadImage(string fn)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SSJIndicator.Resources." + fn);
			byte[] array = new byte[manifestResourceStream.Length];
			manifestResourceStream.Read(array, 0, array.Length);
			Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false);
			ImageConversion.LoadImage(val, array, true);
			return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
		}

		[HarmonyPatch(typeof(HudController), "Start")]
		[HarmonyPrefix]
		private static void SetupSSJPanel(HudController __instance)
		{
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: 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_021a: Unknown result type (might be due to invalid IL or missing references)
			Logger.LogInfo((object)("Creating SSJ HUD for HudController \"" + ((Object)((Component)__instance).gameObject).name + "\""));
			Transform val = null;
			string empty = string.Empty;
			string empty2 = string.Empty;
			string empty3 = string.Empty;
			if (((Object)((Component)__instance).gameObject).name == "HUD")
			{
				val = ((Component)__instance).transform.Find("GunCanvas");
				empty = "StatsPanel/Filler/FistPanel";
				empty2 = "Background";
				empty3 = "Panel";
			}
			else
			{
				val = ((Component)__instance).transform.Find("Filler");
				empty = "Arm" + ((((Object)((Component)__instance).gameObject).name == "AltHud") ? string.Empty : " (1)");
				empty2 = "Image";
				empty3 = "Fill";
			}
			GameObject val2 = Object.Instantiate<GameObject>(((Component)val.Find(empty)).gameObject);
			val2.transform.parent = val;
			Transform val3 = val2.transform.Find(empty2);
			((Component)val3).GetComponent<Image>().sprite = spr_fill;
			((Object)val3).name = "Background";
			((Object)val2).name = "SSJPanel";
			if (((Object)((Component)__instance).gameObject).name == "HUD")
			{
				val2.transform.localScale = new Vector3(4f, 4f, 4f);
				val2.transform.localPosition = new Vector3(PluginConfig.PanelPos[0], PluginConfig.PanelPos[1], PluginConfig.PanelPos[2]);
				val2.GetComponent<RectTransform>().sizeDelta = new Vector2(46f, 25f);
			}
			else
			{
				((TMP_Text)((Component)val2.transform.Find("Title")).GetComponent<TextMeshProUGUI>()).text = "SSJ";
				val2.transform.localPosition = new Vector3(PluginConfig.AltPanelPos[0], PluginConfig.AltPanelPos[1], PluginConfig.AltPanelPos[2]);
				val2.transform.localScale = new Vector3(1f, 1f, 1f);
			}
			val2.transform.localEulerAngles = Vector3.zero;
			Transform val4 = val2.transform.Find(empty3);
			((Object)val4).name = "Fill";
			Image component = ((Component)val4).GetComponent<Image>();
			component.sprite = spr_fill;
			component.fillMethod = (FillMethod)0;
			List<Image> list = __instance.hudBackgrounds.ToList();
			list.Add(val2.GetComponent<Image>());
			__instance.hudBackgrounds = list.ToArray();
			val2.SetActive(false);
			val2.AddComponent<SSJIndicator>();
			if (((Object)((Component)__instance).gameObject).name == "HUD")
			{
				val2.AddComponent<HudOpenEffect>();
			}
			if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent<SSJHUDVisibilityHandler>()))
			{
				((Component)__instance).gameObject.AddComponent<SSJHUDVisibilityHandler>();
			}
		}

		[HarmonyPatch(typeof(NewMovement), "TrySSJ")]
		[HarmonyPostfix]
		private static void UpdateSSJ(NewMovement __instance)
		{
			if (__instance.framesSinceSlide > 0 && (float)__instance.framesSinceSlide < __instance.ssjMaxFrames && !__instance.boost)
			{
				SSJTier = (int)__instance.ssjMaxFrames - __instance.framesSinceSlide;
				SSJTimer = PluginConfig.SSJTimer;
			}
		}
	}
	public static class PluginConfig
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static FloatValueChangeEventDelegate <>9__7_0;

			public static FloatValueChangeEventDelegate <>9__7_1;

			public static FloatValueChangeEventDelegate <>9__7_2;

			public static FloatValueChangeEventDelegate <>9__7_3;

			public static ColorValueChangeEventDelegate <>9__7_4;

			public static ColorValueChangeEventDelegate <>9__7_5;

			public static ColorValueChangeEventDelegate <>9__7_6;

			public static ColorValueChangeEventDelegate <>9__7_7;

			public static ColorValueChangeEventDelegate <>9__7_8;

			public static FloatValueChangeEventDelegate <>9__7_9;

			public static FloatValueChangeEventDelegate <>9__7_10;

			public static FloatValueChangeEventDelegate <>9__7_11;

			public static FloatValueChangeEventDelegate <>9__7_12;

			public static FloatValueChangeEventDelegate <>9__7_13;

			public static FloatValueChangeEventDelegate <>9__7_14;

			internal void <CreateConfig>b__7_0(FloatValueChangeEvent e)
			{
				SSJTimer = e.value;
			}

			internal void <CreateConfig>b__7_1(FloatValueChangeEvent e)
			{
				SSJFlashTime = e.value;
			}

			internal void <CreateConfig>b__7_2(FloatValueChangeEvent e)
			{
				SSJFlashFadeDelay = e.value;
			}

			internal void <CreateConfig>b__7_3(FloatValueChangeEvent e)
			{
				SSJFadeTime = e.value;
			}

			internal void <CreateConfig>b__7_4(ColorValueChangeEvent e)
			{
				//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)
				SSJColors[0] = e.value;
			}

			internal void <CreateConfig>b__7_5(ColorValueChangeEvent e)
			{
				//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)
				SSJColors[1] = e.value;
			}

			internal void <CreateConfig>b__7_6(ColorValueChangeEvent e)
			{
				//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)
				SSJColors[2] = e.value;
			}

			internal void <CreateConfig>b__7_7(ColorValueChangeEvent e)
			{
				//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)
				SSJColors[3] = e.value;
			}

			internal void <CreateConfig>b__7_8(ColorValueChangeEvent e)
			{
				//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)
				SSJColors[4] = e.value;
			}

			internal void <CreateConfig>b__7_9(FloatValueChangeEvent e)
			{
				PanelPos[0] = e.value;
			}

			internal void <CreateConfig>b__7_10(FloatValueChangeEvent e)
			{
				PanelPos[1] = e.value;
			}

			internal void <CreateConfig>b__7_11(FloatValueChangeEvent e)
			{
				PanelPos[2] = e.value;
			}

			internal void <CreateConfig>b__7_12(FloatValueChangeEvent e)
			{
				AltPanelPos[0] = e.value;
			}

			internal void <CreateConfig>b__7_13(FloatValueChangeEvent e)
			{
				AltPanelPos[1] = e.value;
			}

			internal void <CreateConfig>b__7_14(FloatValueChangeEvent e)
			{
				AltPanelPos[2] = e.value;
			}
		}

		public static Color[] SSJColors = (Color[])(object)new Color[5]
		{
			new Color(0.2f, 0.2f, 0.2f),
			new Color(0.75f, 0.75f, 0.75f),
			new Color(0.75f, 0.75f, 0.75f),
			new Color(0.75f, 0.75f, 0.75f),
			Color.white
		};

		public static float SSJTimer = 3f;

		public static float SSJFlashTime = 0.5f;

		public static float SSJFlashFadeDelay = 0.25f;

		public static float SSJFadeTime = 0.5f;

		public static float[] PanelPos = new float[3] { 466f, 391f, 45f };

		public static float[] AltPanelPos = new float[3] { 360f, -361.4118f, 0f };

		public static PluginConfigurator CreateConfig()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00fa: 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_0105: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Expected O, but got Unknown
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: 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_0145: Expected O, but got Unknown
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Expected O, but got Unknown
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Expected O, but got Unknown
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Expected O, but got Unknown
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Expected O, but got Unknown
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Expected O, but got Unknown
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Expected O, but got Unknown
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Expected O, but got Unknown
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Expected O, but got Unknown
			PluginConfigurator val = PluginConfigurator.Create("SSJ HUD Config", "SSJIndicator");
			val.SetIconWithURL(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "icon.png"));
			new ConfigSpace(val.rootPanel, 5f);
			FloatField obj = FloatSetting(val, val.rootPanel, "HUD Timer", "SSJTimer", ref SSJTimer);
			object obj2 = <>c.<>9__7_0;
			if (obj2 == null)
			{
				FloatValueChangeEventDelegate val2 = delegate(FloatValueChangeEvent e)
				{
					SSJTimer = e.value;
				};
				<>c.<>9__7_0 = val2;
				obj2 = (object)val2;
			}
			obj.onValueChange += (FloatValueChangeEventDelegate)obj2;
			FloatField obj3 = FloatSetting(val, val.rootPanel, "Flash Time", "SSJFlashTime", ref SSJFlashTime);
			object obj4 = <>c.<>9__7_1;
			if (obj4 == null)
			{
				FloatValueChangeEventDelegate val3 = delegate(FloatValueChangeEvent e)
				{
					SSJFlashTime = e.value;
				};
				<>c.<>9__7_1 = val3;
				obj4 = (object)val3;
			}
			obj3.onValueChange += (FloatValueChangeEventDelegate)obj4;
			FloatField obj5 = FloatSetting(val, val.rootPanel, "Flash Fade Delay", "SSJFlashFadeDelay", ref SSJFlashFadeDelay);
			object obj6 = <>c.<>9__7_2;
			if (obj6 == null)
			{
				FloatValueChangeEventDelegate val4 = delegate(FloatValueChangeEvent e)
				{
					SSJFlashFadeDelay = e.value;
				};
				<>c.<>9__7_2 = val4;
				obj6 = (object)val4;
			}
			obj5.onValueChange += (FloatValueChangeEventDelegate)obj6;
			FloatField obj7 = FloatSetting(val, val.rootPanel, "Fadeout Time", "SSJFadeTime", ref SSJFadeTime);
			object obj8 = <>c.<>9__7_3;
			if (obj8 == null)
			{
				FloatValueChangeEventDelegate val5 = delegate(FloatValueChangeEvent e)
				{
					SSJFadeTime = e.value;
				};
				<>c.<>9__7_3 = val5;
				obj8 = (object)val5;
			}
			obj7.onValueChange += (FloatValueChangeEventDelegate)obj8;
			ConfigPanel val6 = new ConfigPanel(val.rootPanel, "HUD Colors", "colorPanel");
			ConfigPanel val7 = new ConfigPanel(val.rootPanel, "HUD Position", "posPanel");
			new ConfigSpace(val6, 5f);
			new ConfigSpace(val7, 5f);
			ColorField obj9 = ColorSetting(val, val6, "Back Color", "SSJColorsB", ref SSJColors[0]);
			object obj10 = <>c.<>9__7_4;
			if (obj10 == null)
			{
				ColorValueChangeEventDelegate val8 = delegate(ColorValueChangeEvent e)
				{
					//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)
					SSJColors[0] = e.value;
				};
				<>c.<>9__7_4 = val8;
				obj10 = (object)val8;
			}
			obj9.onValueChange += (ColorValueChangeEventDelegate)obj10;
			ColorField obj11 = ColorSetting(val, val6, "Slow SSJ Color", "SSJColors1", ref SSJColors[1]);
			object obj12 = <>c.<>9__7_5;
			if (obj12 == null)
			{
				ColorValueChangeEventDelegate val9 = delegate(ColorValueChangeEvent e)
				{
					//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)
					SSJColors[1] = e.value;
				};
				<>c.<>9__7_5 = val9;
				obj12 = (object)val9;
			}
			obj11.onValueChange += (ColorValueChangeEventDelegate)obj12;
			ColorField obj13 = ColorSetting(val, val6, "Medium SSJ Color", "SSJColors2", ref SSJColors[2]);
			object obj14 = <>c.<>9__7_6;
			if (obj14 == null)
			{
				ColorValueChangeEventDelegate val10 = delegate(ColorValueChangeEvent e)
				{
					//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)
					SSJColors[2] = e.value;
				};
				<>c.<>9__7_6 = val10;
				obj14 = (object)val10;
			}
			obj13.onValueChange += (ColorValueChangeEventDelegate)obj14;
			ColorField obj15 = ColorSetting(val, val6, "Fast SSJ Color", "SSJColors3", ref SSJColors[3]);
			object obj16 = <>c.<>9__7_7;
			if (obj16 == null)
			{
				ColorValueChangeEventDelegate val11 = delegate(ColorValueChangeEvent e)
				{
					//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)
					SSJColors[3] = e.value;
				};
				<>c.<>9__7_7 = val11;
				obj16 = (object)val11;
			}
			obj15.onValueChange += (ColorValueChangeEventDelegate)obj16;
			ColorField obj17 = ColorSetting(val, val6, "SSJ Flash Color", "SSJColorsF", ref SSJColors[4]);
			object obj18 = <>c.<>9__7_8;
			if (obj18 == null)
			{
				ColorValueChangeEventDelegate val12 = delegate(ColorValueChangeEvent e)
				{
					//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)
					SSJColors[4] = e.value;
				};
				<>c.<>9__7_8 = val12;
				obj18 = (object)val12;
			}
			obj17.onValueChange += (ColorValueChangeEventDelegate)obj18;
			new ConfigHeader(val7, "Standard HUD", 24);
			FloatField obj19 = FloatSetting(val, val7, "Panel X", "PanelPos0", ref PanelPos[0]);
			object obj20 = <>c.<>9__7_9;
			if (obj20 == null)
			{
				FloatValueChangeEventDelegate val13 = delegate(FloatValueChangeEvent e)
				{
					PanelPos[0] = e.value;
				};
				<>c.<>9__7_9 = val13;
				obj20 = (object)val13;
			}
			obj19.onValueChange += (FloatValueChangeEventDelegate)obj20;
			FloatField obj21 = FloatSetting(val, val7, "Panel Y", "PanelPos1", ref PanelPos[1]);
			object obj22 = <>c.<>9__7_10;
			if (obj22 == null)
			{
				FloatValueChangeEventDelegate val14 = delegate(FloatValueChangeEvent e)
				{
					PanelPos[1] = e.value;
				};
				<>c.<>9__7_10 = val14;
				obj22 = (object)val14;
			}
			obj21.onValueChange += (FloatValueChangeEventDelegate)obj22;
			FloatField obj23 = FloatSetting(val, val7, "Panel Z", "PanelPos2", ref PanelPos[2]);
			object obj24 = <>c.<>9__7_11;
			if (obj24 == null)
			{
				FloatValueChangeEventDelegate val15 = delegate(FloatValueChangeEvent e)
				{
					PanelPos[2] = e.value;
				};
				<>c.<>9__7_11 = val15;
				obj24 = (object)val15;
			}
			obj23.onValueChange += (FloatValueChangeEventDelegate)obj24;
			new ConfigHeader(val7, "Classic HUD", 24);
			FloatField obj25 = FloatSetting(val, val7, "HUD X", "AltPanelX", ref AltPanelPos[0]);
			object obj26 = <>c.<>9__7_12;
			if (obj26 == null)
			{
				FloatValueChangeEventDelegate val16 = delegate(FloatValueChangeEvent e)
				{
					AltPanelPos[0] = e.value;
				};
				<>c.<>9__7_12 = val16;
				obj26 = (object)val16;
			}
			obj25.onValueChange += (FloatValueChangeEventDelegate)obj26;
			FloatField obj27 = FloatSetting(val, val7, "HUD Y", "AltPanelY", ref AltPanelPos[1]);
			object obj28 = <>c.<>9__7_13;
			if (obj28 == null)
			{
				FloatValueChangeEventDelegate val17 = delegate(FloatValueChangeEvent e)
				{
					AltPanelPos[1] = e.value;
				};
				<>c.<>9__7_13 = val17;
				obj28 = (object)val17;
			}
			obj27.onValueChange += (FloatValueChangeEventDelegate)obj28;
			FloatField obj29 = FloatSetting(val, val7, "HUD Z", "AltPanelZ", ref AltPanelPos[2]);
			object obj30 = <>c.<>9__7_14;
			if (obj30 == null)
			{
				FloatValueChangeEventDelegate val18 = delegate(FloatValueChangeEvent e)
				{
					AltPanelPos[2] = e.value;
				};
				<>c.<>9__7_14 = val18;
				obj30 = (object)val18;
			}
			obj29.onValueChange += (FloatValueChangeEventDelegate)obj30;
			return val;
		}

		public static FloatField FloatSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref float value)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			FloatField val = new FloatField(panel, name, guid, value);
			value = val.value;
			return val;
		}

		public static ColorField ColorSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref Color value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//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)
			ColorField val = new ColorField(panel, name, guid, value);
			value = val.value;
			return val;
		}
	}
	public class SSJHUDVisibilityHandler : MonoBehaviour
	{
		private GameObject bars;

		private GameObject indicator;

		private void Start()
		{
			indicator = ((Component)((Component)this).GetComponentInChildren<SSJIndicator>(true)).gameObject;
			bars = ((Component)indicator.transform.parent.Find((((Object)((Component)this).gameObject).name == "HUD") ? "StatsPanel/RailcannonChargePanel" : ((((Object)((Component)this).gameObject).name == "AltHud") ? "Health" : "Health (1)"))).gameObject;
		}

		private void OnDisable()
		{
			indicator.SetActive(false);
		}

		private void Update()
		{
			indicator.SetActive(bars.activeSelf);
		}
	}
	public class SSJIndicator : MonoBehaviour
	{
		private Image back;

		private Image fill;

		private float onePixelWidth;

		private void Awake()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			back = ((Component)((Component)this).transform.Find("Background")).GetComponent<Image>();
			fill = ((Component)((Component)this).transform.Find("Fill")).GetComponent<Image>();
			fill.fillAmount = 0f;
			Rect rect = Plugin.spr_fill.rect;
			onePixelWidth = 1f / ((Rect)(ref rect)).width;
		}

		private void Update()
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: 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_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			fill.fillAmount = (float)Plugin.SSJTier / 3f;
			if (fill.fillAmount != 1f)
			{
				Image obj = fill;
				obj.fillAmount -= onePixelWidth;
			}
			float num = PluginConfig.SSJTimer - PluginConfig.SSJFlashFadeDelay - Plugin.SSJTimer;
			if (num > PluginConfig.SSJFlashTime)
			{
				num = PluginConfig.SSJFlashTime;
			}
			num = ((PluginConfig.SSJFlashTime != 0f) ? (num / PluginConfig.SSJFlashTime) : 1f);
			Color val = Color.Lerp(PluginConfig.SSJColors[4], PluginConfig.SSJColors[Plugin.SSJTier], num);
			num = Plugin.SSJTimer;
			num = ((PluginConfig.SSJFadeTime != 0f) ? (num / PluginConfig.SSJFadeTime) : 1f);
			if (num < 1f)
			{
				val = Color.Lerp(PluginConfig.SSJColors[0], val, num);
			}
			((Graphic)fill).color = val;
			((Graphic)back).color = PluginConfig.SSJColors[0];
			if (Plugin.SSJTimer > 0f)
			{
				Plugin.SSJTimer -= Time.deltaTime;
				if (Plugin.SSJTimer <= 0f)
				{
					Plugin.SSJTier = 0;
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SSJIndicator";

		public const string PLUGIN_NAME = "SSJ Indicator";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}