Decompiled source of ThirdPersonHealthbar v1.0.0

Mods/ThirdPersonHealthbar.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using MelonLoader;
using Microsoft.CodeAnalysis;
using RumbleModdingAPI;
using ThirdPersonHealthbar;
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(MainTPH), "ThirdPersonHealthbar", "1.0.0", "Saveforth", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 93, 228, 230)]
[assembly: AssemblyDescription("Shows healthbar in 3rd person liv camera")]
[assembly: AssemblyCopyright("Copyright???")]
[assembly: AssemblyTrademark("")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ThirdPersonHealthbar")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ThirdPersonHealthbar")]
[assembly: AssemblyTitle("ThirdPersonHealthbar")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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;
		}
	}
}
namespace ThirdPersonHealthbar
{
	public class MainTPH : MelonMod
	{
		private int buildIndex = 0;

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			this.buildIndex = buildIndex;
		}

		public override void OnLateInitializeMelon()
		{
			Calls.onMapInitialized += entireModBasically;
		}

		private IEnumerator iWannaDie()
		{
			yield return (object)new WaitForSeconds(1f);
			GameObject player = ((Component)((Component)Players.GetLocalPlayer().Controller).gameObject.transform.GetChild(1)).gameObject;
			GameObject hpBar2 = GameObject.Find("/Health");
			hpBar2 = ((Component)hpBar2.transform.GetChild(1)).gameObject;
			GameObject rHealth = Object.Instantiate<GameObject>(hpBar2);
			rHealth.transform.position = player.transform.GetChild(0).GetChild(0).position;
			rHealth.transform.parent = hpBar2.transform;
			rHealth.transform.localPosition = new Vector3(rHealth.transform.localPosition.x, rHealth.transform.localPosition.y, rHealth.transform.localPosition.z - 2.2f);
			rHealth.transform.localScale = new Vector3(rHealth.transform.localScale.x + 1f, rHealth.transform.localScale.y + 5f, rHealth.transform.localScale.z + 1f);
			rHealth.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
		}

		public void entireModBasically()
		{
			if (buildIndex != 0)
			{
				MelonCoroutines.Start(iWannaDie());
			}
		}
	}
}