using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using DeathStatus.Patches;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DeathStatus")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeathStatus")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("36ce61e9-a4d5-4aed-b5f8-c2f7879eb3be")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DeathStatus
{
[BepInPlugin("DeathStatus", "Death Status", "1.0.0")]
public class PluginBase : BaseUnityPlugin
{
private const string PLUGIN_GUID = "DeathStatus";
private const string PLUGIN_NAME = "Death Status";
private const string PLUGIN_VERSION = "1.0.0";
public static PluginBase Instance;
internal ManualLogSource logger;
private Harmony harmony;
private void Awake()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Expected O, but got Unknown
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
logger = Logger.CreateLogSource("DeathStatus");
harmony = new Harmony("DeathStatus");
harmony.PatchAll(typeof(DivingBellSuitCellUIPatches));
logger.LogInfo((object)"Plugin DeathStatus is loaded!");
}
}
}
}
namespace DeathStatus.Patches
{
[HarmonyPatch(typeof(DivingBellSuitCellUI))]
public class DivingBellSuitCellUIPatches
{
[HarmonyPostfix]
[HarmonyPatch("Set")]
public static void SetPostfix(DivingBellSuitCellUI __instance, Player player)
{
//IL_0040: 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)
if (!((Object)(object)player != (Object)null) || player.data == null || !player.data.dead)
{
return;
}
Image[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<Image>(true);
foreach (Image val in componentsInChildren)
{
if (Mathf.Abs(((Graphic)val).color.g - 0.84f) < 0.082f)
{
((Graphic)val).color = new Color(0.8f, 0.2f, 0.2f, 1f);
}
}
}
}
}