using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Il2Cpp;
using Il2CppFemur;
using Il2CppTMPro;
using MelonLoader;
using Template;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "GangBeastsStatsMod", "1.0.0", "Starry", "")]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("GangBeastsStatsMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[assembly: AssemblyProduct("GangBeastsStatsMod")]
[assembly: AssemblyTitle("GangBeastsStatsMod")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Template;
public class Main : MelonMod
{
public override void OnUpdate()
{
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Invalid comparison between Unknown and I4
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Invalid comparison between Unknown and I4
if (Resources.FindObjectsOfTypeAll<NameBarHandler>() == null)
{
return;
}
foreach (NameBarHandler item in Resources.FindObjectsOfTypeAll<NameBarHandler>())
{
if ((Object)(object)item != (Object)null && (Object)(object)((Component)((Component)item).transform.parent).GetComponent<StatusHandeler>() != (Object)null)
{
StatusHandeler component = ((Component)((Component)item).transform.parent).GetComponent<StatusHandeler>();
item.ShowName = true;
float num = (float)Math.Round(component.health);
float num2 = (float)Math.Round(component.stamina);
if ((int)component.actor.ControlledBy != 2)
{
((TMP_Text)item.CachedNameText).text = $"Health: {num}/{component.maxHealth}\nStamina: {num2}/{component.maxStamina}";
}
if ((int)component.actor.ControlledBy == 2)
{
((TMP_Text)item.CachedNameText).text = $"{item.User.userName}\nHealth: {num}/{component.maxHealth}\nStamina: {num2}/{component.maxStamina}";
}
}
}
}
}