using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using HealthBarHider;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using RumbleModUI;
using RumbleModdingAPI;
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(HealthBarHiderClass), "Health Bar Hider", "2.1.1", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTitle("HealthBarHider")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HealthBarHider")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3550aa35-70e6-42ce-8bf8-abdced19af28")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HealthBarHider;
public class HealthBarHiderClass : MelonMod
{
private bool hideSelf = false;
private bool hideOthers = false;
private Mod HealthbarHider = new Mod();
public override void OnLateInitializeMelon()
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Expected O, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
HealthbarHider.ModName = "Health Bar Hider";
HealthbarHider.ModVersion = "2.1.1";
HealthbarHider.SetFolder("HealthbarHider");
HealthbarHider.AddDescription("Description", "Description", "Toggles Healthbars on Everyone", new Tags
{
IsSummary = true
});
HealthbarHider.AddToList("Hide Self", true, 0, "Turns On/Off Self Health", new Tags());
HealthbarHider.AddToList("Hide Others", false, 0, "Turns On/Off Others Health", new Tags());
HealthbarHider.GetFromFile();
hideSelf = (bool)HealthbarHider.Settings[1].Value;
hideOthers = (bool)HealthbarHider.Settings[2].Value;
HealthbarHider.ModSaved += Save;
UI.instance.UI_Initialized += UIInit;
Calls.onMapInitialized += mapInit;
Calls.onPlayerSpawned += playerSpawned;
}
public void UIInit()
{
UI.instance.AddMod(HealthbarHider);
}
public void Save()
{
hideSelf = (bool)HealthbarHider.Settings[1].Value;
hideOthers = (bool)HealthbarHider.Settings[2].Value;
((Component)Players.GetLocalHealthbarGameObject().transform.GetChild(1).GetChild(0)).gameObject.SetActive(!hideSelf);
MelonCoroutines.Start(hideEnemyHealths());
}
private void mapInit()
{
((Component)Players.GetLocalHealthbarGameObject().transform.GetChild(1).GetChild(0)).gameObject.SetActive(!hideSelf);
}
private void playerSpawned()
{
if (Singleton<PlayerManager>.instance.AllPlayers.Count > 1)
{
MelonCoroutines.Start(hideEnemyHealths());
}
}
private IEnumerator hideEnemyHealths()
{
yield return (object)new WaitForSeconds(1f);
Enumerator<Player> enumerator = Singleton<PlayerManager>.instance.AllPlayers.GetEnumerator();
while (enumerator.MoveNext())
{
Player tempPlayer = enumerator.Current;
if ((Object)(object)tempPlayer.Controller != (Object)(object)Singleton<PlayerManager>.instance.localPlayer.Controller)
{
((Component)((Component)tempPlayer.Controller).gameObject.transform.GetChild(5).GetChild(0).GetChild(0)).gameObject.SetActive(!hideOthers);
}
}
}
}