Decompiled source of DisplayAllyHealthNumber v1.2.0

DisplayAllyHealthNumber.dll

Decompiled 11 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using On.RoR2.UI;
using RoR2.UI;
using TMPro;
using UnityEngine;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("EnableHealthNumberDisplay")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EnableHealthNumberDisplay")]
[assembly: AssemblyTitle("EnableHealthNumberDisplay")]
[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 EnableHealthNumberDisplay
{
	[BepInPlugin("top.sshh.EnableHealthNumberDisplay", "EnableHealthNumberDisplay", "1.0.0")]
	public class EnableHealthNumberDisplay : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_LateUpdate <>9__0_0;

			public static hook_Awake <>9__0_1;

			public static hook_UpdateInfo <>9__0_2;

			internal void <Awake>b__0_0(orig_LateUpdate orig, AllyCardController self)
			{
			}

			internal void <Awake>b__0_1(orig_Awake orig, AllyCardController self)
			{
				orig.Invoke(self);
				MethodInfo method = typeof(AllyCardController).GetMethod("UpdateInfo", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method != null)
				{
					((MonoBehaviour)self).InvokeRepeating(method.Name, 0f, 0.2f);
				}
			}

			internal void <Awake>b__0_2(orig_UpdateInfo orig, AllyCardController self)
			{
				orig.Invoke(self);
				string text = Convert.ToInt64(self.healthBar.source.combinedHealth) + "/" + Convert.ToInt64(self.healthBar.source.fullHealth) + "|" + ((TMP_Text)self.nameLabel).text;
				if (!((TMP_Text)self.nameLabel).text.Equals(text))
				{
					((TMP_Text)self.nameLabel).text = text;
				}
			}
		}

		public void Awake()
		{
			//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
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				hook_LateUpdate val = delegate
				{
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			AllyCardController.LateUpdate += (hook_LateUpdate)obj;
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				hook_Awake val2 = delegate(orig_Awake orig, AllyCardController self)
				{
					orig.Invoke(self);
					MethodInfo method = typeof(AllyCardController).GetMethod("UpdateInfo", BindingFlags.Instance | BindingFlags.NonPublic);
					if (method != null)
					{
						((MonoBehaviour)self).InvokeRepeating(method.Name, 0f, 0.2f);
					}
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			AllyCardController.Awake += (hook_Awake)obj2;
			object obj3 = <>c.<>9__0_2;
			if (obj3 == null)
			{
				hook_UpdateInfo val3 = delegate(orig_UpdateInfo orig, AllyCardController self)
				{
					orig.Invoke(self);
					string text = Convert.ToInt64(self.healthBar.source.combinedHealth) + "/" + Convert.ToInt64(self.healthBar.source.fullHealth) + "|" + ((TMP_Text)self.nameLabel).text;
					if (!((TMP_Text)self.nameLabel).text.Equals(text))
					{
						((TMP_Text)self.nameLabel).text = text;
					}
				};
				<>c.<>9__0_2 = val3;
				obj3 = (object)val3;
			}
			AllyCardController.UpdateInfo += (hook_UpdateInfo)obj3;
		}
	}
}