Decompiled source of UnretroifiedStyleIndicator v1.0.0

UnretroifiedStyleIndicator/ukmod_unretro_styleindicator.dll

Decompiled 5 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Fields;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using namjainapananan.ukmod_unretro_styleindicator.src;
using namjainapananan.ukmod_unretro_styleindicator.src.unretrostylehud_components;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ukmod_unretro_styleindicator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ukmod_unretro_styleindicator")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa6fff83-2908-4304-b1bc-b899e8ad63cb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace namjainapananan.ukmod_unretro_styleindicator
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct PluginInfo
	{
		public const string guid = "namjainapananan.ukmod_unretro_styleindicator";

		public const string name = "Unretro Style Indicator";

		public const string version = "1.0.0";
	}
	public class PluginConfigVar
	{
		public BoolField enabledHitmarker;

		public BoolField enabledScoreFeed;

		public BoolField enabledFreshnessMultiplier;

		public PluginConfigVar(PluginConfigurator config)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			enabledHitmarker = new BoolField(config.rootPanel, "Hitmarker Enabled", "enabledHitmarker", true);
			enabledScoreFeed = new BoolField(config.rootPanel, "Score Feed Enabled", "enabledScoreFeed", true);
			enabledFreshnessMultiplier = new BoolField(config.rootPanel, "Freshness Multiplier Enabled", "enabledFreshnessMultiplier", true);
		}
	}
	[BepInPlugin("namjainapananan.ukmod_unretro_styleindicator", "Unretro Style Indicator", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static PluginConfigVar configVar;

		private void Awake()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			PluginConfigurator config = PluginConfigurator.Create("Unretro Style Indicator", "namjainapananan.ukmod_unretro_styleindicator");
			configVar = new PluginConfigVar(config);
			Harmony val = new Harmony("namjainapananan.ukmod_unretro_styleindicator");
			val.PatchAll();
		}
	}
}
namespace namjainapananan.ukmod_unretro_styleindicator.src
{
	public class UnretroStyleHUD : MonoSingleton<UnretroStyleHUD>
	{
		public ScoreFeed scoreFeed;

		public ScoreMultiplier scoreMultiplier;

		public Hitmarker hitmarker;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			Plugin.configVar.enabledHitmarker.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				UpdateSettings();
			};
			Plugin.configVar.enabledScoreFeed.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				UpdateSettings();
			};
			Plugin.configVar.enabledFreshnessMultiplier.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				UpdateSettings();
			};
			Canvas val = ((Component)this).gameObject.AddComponent<Canvas>();
			val.renderMode = (RenderMode)0;
			((Component)this).transform.localScale = Vector3.one * 0.001f;
			((Component)this).transform.SetLocalPositionAndRotation(new Vector3(0f, 0f, 1f), Quaternion.identity);
			CanvasScaler val2 = ((Component)this).gameObject.AddComponent<CanvasScaler>();
			val2.uiScaleMode = (ScaleMode)1;
			val2.referenceResolution = new Vector2(1920f, 1080f);
			val2.matchWidthOrHeight = 0.5f;
			GameObject val3 = new GameObject("Score Feed");
			val3.transform.SetParent(((Component)this).transform, false);
			scoreFeed = val3.AddComponent<ScoreFeed>();
			GameObject val4 = new GameObject("Score Multiplier");
			val4.transform.SetParent(((Component)this).transform, false);
			scoreMultiplier = val4.AddComponent<ScoreMultiplier>();
			GameObject val5 = new GameObject("Hitmarker");
			val5.transform.SetParent(((Component)this).transform, false);
			hitmarker = val5.AddComponent<Hitmarker>();
		}

		private void UpdateSettings()
		{
			((Component)scoreFeed).gameObject.SetActive(Plugin.configVar.enabledScoreFeed.value);
			((Component)scoreMultiplier).gameObject.SetActive(Plugin.configVar.enabledFreshnessMultiplier.value);
			((Component)hitmarker).gameObject.SetActive(Plugin.configVar.enabledHitmarker.value);
		}
	}
}
namespace namjainapananan.ukmod_unretro_styleindicator.src.unretrostylehud_components
{
	public class Hitmarker : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <HitAnimation>d__9 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public float enterDuration;

			public float lifeTime;

			public float exitDuration;

			public Color color;

			public Hitmarker <>4__this;

			private float <totalTime>5__1;

			private float <elapsed>5__2;

			private bool <entering>5__3;

			private bool <living>5__4;

			private bool <exiting>5__5;

			private float <delta>5__6;

			private float <easedT>5__7;

			private float <stateElapsed>5__8;

			private float <delta>5__9;

			private float <stateElapsed>5__10;

			private float <delta>5__11;

			private float <easedT>5__12;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <HitAnimation>d__9(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_002a: 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)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.hitmarkerColor = color;
					<totalTime>5__1 = enterDuration + lifeTime + exitDuration;
					<elapsed>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__2 <= <totalTime>5__1)
				{
					<elapsed>5__2 += Time.unscaledDeltaTime;
					<entering>5__3 = <elapsed>5__2 <= enterDuration;
					<living>5__4 = <elapsed>5__2 > enterDuration && <elapsed>5__2 <= <totalTime>5__1 - exitDuration;
					<exiting>5__5 = <elapsed>5__2 >= <totalTime>5__1 - exitDuration;
					if (<entering>5__3)
					{
						<delta>5__6 = <elapsed>5__2 / enterDuration;
						<easedT>5__7 = Mathf.SmoothStep(0f, 1f, <delta>5__6);
						<>4__this.hitmarkerAlpha = 1f;
						<>4__this.distanceFromCenter = Mathf.Lerp(60f, 40f, <easedT>5__7);
						<>4__this.stickLength = Mathf.Lerp(25f, 10f, <easedT>5__7);
					}
					if (<living>5__4)
					{
						<stateElapsed>5__8 = <elapsed>5__2 - enterDuration;
						<delta>5__9 = <stateElapsed>5__8 / lifeTime;
					}
					if (<exiting>5__5)
					{
						<stateElapsed>5__10 = <elapsed>5__2 - (enterDuration + lifeTime);
						<delta>5__11 = <stateElapsed>5__10 / exitDuration;
						<easedT>5__12 = Mathf.SmoothStep(0f, 1f, <delta>5__11);
						<>4__this.hitmarkerAlpha = Mathf.Lerp(1f, 0f, <delta>5__11);
						<>4__this.distanceFromCenter = Mathf.Lerp(40f, 50f, <easedT>5__12);
						<>4__this.stickLength = Mathf.Lerp(10f, 25f, <easedT>5__12);
					}
					<>4__this.UpdateHitmarkerSticks();
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public float stickWidth = 3f;

		public float stickLength = 30f;

		public float distanceFromCenter = 50f;

		public float hitmarkerAlpha;

		public Color hitmarkerColor = Color.white;

		private List<GameObject> hmSticksOBJs = new List<GameObject>();

		private Coroutine activeAnimation;

		public void HitEnemy(bool kill)
		{
			//IL_002a: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (activeAnimation != null)
			{
				((MonoBehaviour)this).StopCoroutine(activeAnimation);
				activeAnimation = null;
			}
			float num = 1f;
			Color color = Color.white;
			if (kill)
			{
				color = Color.red;
				num = 2f;
			}
			activeAnimation = ((MonoBehaviour)this).StartCoroutine(HitAnimation(0.125f, 0.25f * num, 0.25f, color));
		}

		private void Start()
		{
			ConstructHitmarker();
			UpdateHitmarkerSticks();
		}

		[IteratorStateMachine(typeof(<HitAnimation>d__9))]
		private IEnumerator HitAnimation(float enterDuration, float lifeTime, float exitDuration, Color color)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HitAnimation>d__9(0)
			{
				<>4__this = this,
				enterDuration = enterDuration,
				lifeTime = lifeTime,
				exitDuration = exitDuration,
				color = color
			};
		}

		private void ConstructHitmarker()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = ((Component)this).gameObject.AddComponent<RectTransform>();
			val.anchorMin = new Vector2(0.5f, 0.5f);
			val.anchorMax = new Vector2(0.5f, 0.5f);
			val.pivot = new Vector2(0.5f, 0.5f);
			val.anchoredPosition = Vector2.zero;
			float[] array = new float[4] { 45f, 135f, 225f, 315f };
			for (int i = 0; i < 4; i++)
			{
				GameObject val2 = new GameObject("HitmarkerStick_" + i);
				val2.transform.SetParent(((Component)this).transform, false);
				RectTransform val3 = val2.AddComponent<RectTransform>();
				Image val4 = val2.AddComponent<Image>();
				((Graphic)val4).color = hitmarkerColor;
				val3.anchorMin = new Vector2(0.5f, 0.5f);
				val3.anchorMax = new Vector2(0.5f, 0.5f);
				val3.pivot = new Vector2(0.5f, 0f);
				((Transform)val3).localRotation = Quaternion.Euler(0f, 0f, array[i]);
				hmSticksOBJs.Add(val2);
			}
		}

		private void UpdateHitmarkerSticks()
		{
			//IL_0037: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			foreach (GameObject hmSticksOBJ in hmSticksOBJs)
			{
				RectTransform component = hmSticksOBJ.GetComponent<RectTransform>();
				Image component2 = hmSticksOBJ.GetComponent<Image>();
				component.sizeDelta = new Vector2(stickWidth, stickLength);
				component.anchoredPosition = new Vector2(0f, 0f);
				((Transform)component).localPosition = ((Transform)component).localRotation * new Vector3(0f, distanceFromCenter, 0f);
				Color color = hitmarkerColor;
				color.a = hitmarkerAlpha;
				((Graphic)component2).color = color;
			}
		}
	}
	public class ScoreFeed : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = ((Component)this).gameObject.AddComponent<RectTransform>();
			val.pivot = new Vector2(0f, 1f);
			val.anchoredPosition = new Vector2(60f, -25f);
			VerticalLayoutGroup val2 = ((Component)this).gameObject.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val2).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)val2).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandWidth = false;
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandHeight = false;
			((LayoutGroup)val2).childAlignment = (TextAnchor)3;
			ContentSizeFitter val3 = ((Component)this).gameObject.AddComponent<ContentSizeFitter>();
			val3.verticalFit = (FitMode)2;
		}

		public void SpawnFeed(int points, string pointID, int count, string prefix, string postfix)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			GameObject val = new GameObject(pointID, new Type[1] { typeof(ScoreFeedElement) });
			ScoreFeedElement component = val.GetComponent<ScoreFeedElement>();
			component.Prepare(points, pointID, count, prefix, postfix);
			val.transform.SetParent(((Component)this).transform, false);
			val.transform.SetAsFirstSibling();
		}
	}
	public class ScoreFeedElement : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <FeedAnimation>d__10 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public ScoreFeedElement <>4__this;

			private int <counter>5__1;

			private float <fadeelapsed>5__2;

			private float <originalPosX>5__3;

			private float <originalPosY>5__4;

			private float <delta>5__5;

			private float <tmpAlpha>5__6;

			private float <tmpPosX>5__7;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <FeedAnimation>d__10(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: 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_0091: Expected O, but got Unknown
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Expected O, but got Unknown
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<counter>5__1 = 0;
					goto IL_00a2;
				case 1:
					<>1__state = -1;
					goto IL_00a2;
				case 2:
					<>1__state = -1;
					<fadeelapsed>5__2 = 0f;
					<originalPosX>5__3 = <>4__this.rect.anchoredPosition.x;
					<originalPosY>5__4 = <>4__this.rect.anchoredPosition.y;
					break;
				case 3:
					{
						<>1__state = -1;
						break;
					}
					IL_00a2:
					if (<counter>5__1 <= ((TMP_Text)<>4__this.tmpugui).textInfo.characterCount)
					{
						((TMP_Text)<>4__this.tmpugui).maxVisibleCharacters = <counter>5__1;
						<counter>5__1++;
						((TMP_Text)<>4__this.tmpugui).ForceMeshUpdate(false, false);
						<>2__current = (object)new WaitForSecondsRealtime(<>4__this.timeBetweenChars);
						<>1__state = 1;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(<>4__this.lifeTime);
					<>1__state = 2;
					return true;
				}
				if (<fadeelapsed>5__2 <= <>4__this.fadeDuration)
				{
					<fadeelapsed>5__2 += Time.unscaledDeltaTime;
					<delta>5__5 = <fadeelapsed>5__2 / <>4__this.fadeDuration;
					<tmpAlpha>5__6 = Mathf.Lerp(1f, 0f, <delta>5__5);
					<tmpPosX>5__7 = Mathf.Lerp(<originalPosX>5__3, <originalPosX>5__3 + 25f, <delta>5__5 * <delta>5__5);
					((TMP_Text)<>4__this.tmpugui).alpha = <tmpAlpha>5__6;
					((TMP_Text)<>4__this.tmpugui).ForceMeshUpdate(false, false);
					<>4__this.rect.anchoredPosition = new Vector2(<tmpPosX>5__7, <originalPosY>5__4);
					<>2__current = null;
					<>1__state = 3;
					return true;
				}
				((TMP_Text)<>4__this.tmpugui).alpha = 0f;
				((TMP_Text)<>4__this.tmpugui).ForceMeshUpdate(false, false);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private RectTransform rect;

		private string displayText;

		private TextMeshProUGUI tmpugui;

		private float timeBetweenChars = 0.015f;

		private float lifeTime = 2f;

		private float fadeDuration = 0.25f;

		private Coroutine activeFeedAnimation;

		private void Awake()
		{
			LayoutElement val = ((Component)this).gameObject.AddComponent<LayoutElement>();
			val.preferredHeight = 26f;
			val.flexibleWidth = 1f;
			tmpugui = ((Component)this).gameObject.AddComponent<TextMeshProUGUI>();
			rect = GameObjectExtensions.GetOrAddComponent<RectTransform>(((Component)this).gameObject);
		}

		public void Prepare(int points, string pointID, int count, string prefix, string postfix)
		{
			StyleHUD instance = MonoSingleton<StyleHUD>.Instance;
			string localizedName = instance.GetLocalizedName(pointID);
			displayText = "[" + points + "] " + prefix + localizedName + postfix + ((count > 0) ? (" x" + count) : string.Empty);
			((TMP_Text)tmpugui).text = displayText;
			((TMP_Text)tmpugui).font = instance.styleInfo.font;
			((TMP_Text)tmpugui).fontSize = 24f;
			((TMP_Text)tmpugui).alignment = (TextAlignmentOptions)4097;
			((TMP_Text)tmpugui).enableWordWrapping = false;
		}

		private void Start()
		{
			activeFeedAnimation = ((MonoBehaviour)this).StartCoroutine(FeedAnimation());
			Object.Destroy((Object)(object)((Component)this).gameObject, 5f);
		}

		[IteratorStateMachine(typeof(<FeedAnimation>d__10))]
		private IEnumerator FeedAnimation()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FeedAnimation>d__10(0)
			{
				<>4__this = this
			};
		}
	}
	public class ScoreMultiplier : MonoBehaviour
	{
		private TextMeshProUGUI tmpugui;

		private float shakeDelta = 0f;

		private float decaySpeed = 10f;

		private float curTextSize = 28f;

		private float minTextSize = 28f;

		private Vector2 originalPos = new Vector2(60f, 0f);

		private RectTransform rectTransform;

		private Color currentColor = Color.yellow;

		private float NextDisappearTime;

		private float alpha = 0f;

		private void Awake()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			rectTransform = ((Component)this).gameObject.AddComponent<RectTransform>();
			rectTransform.anchorMin = new Vector2(0.5f, 0.5f);
			rectTransform.anchorMax = new Vector2(0.5f, 0.5f);
			rectTransform.pivot = new Vector2(0f, 0.5f);
			rectTransform.anchoredPosition = originalPos;
			tmpugui = ((Component)this).gameObject.AddComponent<TextMeshProUGUI>();
		}

		private void Start()
		{
			StyleHUD instance = MonoSingleton<StyleHUD>.Instance;
			((TMP_Text)tmpugui).font = instance.styleInfo.font;
		}

		private void Update()
		{
			//IL_0127: 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_013c: 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_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			StyleHUD instance = MonoSingleton<StyleHUD>.Instance;
			string text = string.Empty;
			if (Object.op_Implicit((Object)(object)instance.gc.currentWeapon))
			{
				StyleFreshnessState freshnessState = instance.GetFreshnessState(instance.gc.currentWeapon);
				UpdateColor(instance, instance.gc.currentWeapon);
				text = "<color=#" + ColorUtility.ToHtmlStringRGB(currentColor) + "> x " + instance.freshnessStateDict[freshnessState].scoreMultiplier.ToString("F1") + "</color>";
			}
			shakeDelta = Mathf.MoveTowards(shakeDelta, 0f, Time.deltaTime * decaySpeed * 0.5f);
			curTextSize = Mathf.Lerp(curTextSize, minTextSize, Time.deltaTime * decaySpeed);
			((TMP_Text)tmpugui).alignment = (TextAlignmentOptions)4097;
			((TMP_Text)tmpugui).text = text;
			((TMP_Text)tmpugui).fontSize = curTextSize;
			((TMP_Text)tmpugui).alpha = alpha;
			Vector2 val = Random.insideUnitCircle * 10f * shakeDelta;
			rectTransform.anchoredPosition = originalPos + val;
		}

		private void UpdateColor(StyleHUD stylehud, GameObject weapon)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Invalid comparison between Unknown and I4
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Invalid comparison between Unknown and I4
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			StyleFreshnessState freshnessState = stylehud.GetFreshnessState(stylehud.gc.currentWeapon);
			float max = stylehud.freshnessStateDict[freshnessState].max;
			float min = stylehud.freshnessStateDict[freshnessState].min;
			float freshness = stylehud.GetFreshness(stylehud.gc.currentWeapon);
			float num = 1f - (freshness - min) / (max - min);
			if ((int)freshnessState == 0)
			{
				currentColor = Color.Lerp(Color.yellow, Color.red, num);
			}
			if ((int)freshnessState == 1)
			{
				currentColor = Color.Lerp(Color.red, Color.gray, num);
			}
			if ((int)freshnessState == 1)
			{
				currentColor = Color.Lerp(Color.gray, Color.black, num);
			}
			if (Time.time >= NextDisappearTime)
			{
				alpha = Mathf.Lerp(alpha, 0f, Time.unscaledDeltaTime * 10f);
			}
			else
			{
				alpha = 1f;
			}
		}

		public void TriggerAnim()
		{
			shakeDelta = 1f;
			curTextSize += 5f;
			NextDisappearTime = Time.time + 2f;
		}
	}
}
namespace namjainapananan.ukmod_unretro_styleindicator.patches.styleHUD
{
	[HarmonyPatch(typeof(StyleHUD), "Awake")]
	internal class SpawnNewHUDObject
	{
		private static void Postfix(StyleHUD __instance)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			GameObject val = new GameObject("Un-retro Style HUD", new Type[1] { typeof(UnretroStyleHUD) });
			val.layer = ((Component)__instance).gameObject.layer;
			val.transform.SetParent(((Component)__instance).transform.parent, false);
		}
	}
	[HarmonyPatch(typeof(StyleHUD), "AddPoints")]
	internal class TriggerStuff
	{
		private static void Postfix(StyleHUD __instance, int points, string pointID, GameObject sourceWeapon = null, EnemyIdentifier eid = null, int count = -1, string prefix = "", string postfix = "")
		{
			if ((Object)(object)sourceWeapon != (Object)null && (Object)(object)eid != (Object)null)
			{
				if (Plugin.configVar.enabledHitmarker.value)
				{
					MonoSingleton<UnretroStyleHUD>.Instance.hitmarker.HitEnemy(eid.health < 2f);
				}
				if (Plugin.configVar.enabledFreshnessMultiplier.value)
				{
					MonoSingleton<UnretroStyleHUD>.Instance.scoreMultiplier.TriggerAnim();
				}
			}
			if (__instance.GetLocalizedName(pointID) != string.Empty && Plugin.configVar.enabledScoreFeed.value)
			{
				MonoSingleton<UnretroStyleHUD>.Instance.scoreFeed.SpawnFeed(points, pointID, count, prefix, postfix);
			}
		}
	}
}