Decompiled source of Dead Menu v1.1.0

DeadMenu.dll

Decompiled 7 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DeadMenu")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeadMenu")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a56ea1bb-e34e-45cb-9ab3-331dbeb85bf0")]
[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 DeadMenu;

[BepInPlugin("Marcuz.DeadMenu", "Dead Menu", "1.1.0")]
public class Info : BaseUnityPlugin
{
	private Harmony harmony;

	private void Awake()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		harmony = new Harmony("Marcuz.DeadMenu");
		harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"DeadMenu Worked!");
	}
}
internal class DeadMenu : MonoBehaviour
{
	public static DeadMenu Instance;

	private readonly GUIStyle centerStyle = new GUIStyle
	{
		fontSize = 70,
		normal = new GUIStyleState
		{
			textColor = Color.white
		},
		alignment = (TextAnchor)1
	};

	private readonly GUIStyle leftStyle = new GUIStyle
	{
		fontSize = 60,
		normal = new GUIStyleState
		{
			textColor = Color.white
		},
		alignment = (TextAnchor)3
	};

	private void Awake()
	{
		if ((Object)(object)Instance != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		else
		{
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}
	}

	private void OnGUI()
	{
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		if (Spectate.spectating)
		{
			if ((Object)(object)Player.observedPlayer != (Object)null)
			{
				string nickName = Player.observedPlayer.refs.view.Owner.NickName;
				GUI.Label(new Rect((float)(Screen.width / 2 - 150), 20f, 300f, 100f), $"(Spectating: {nickName})", centerStyle);
			}
			string nickName2 = Player.localPlayer.refs.view.Owner.NickName;
			GUI.Label(new Rect(292f, 222f, 162f, 59f), nickName2, leftStyle);
			GUI.Label(new Rect(294f, 288f, 162f, 59f), $"(DEAD)", leftStyle);
			Sprite val = default(Sprite);
			if (SteamAvatarHandler.TryGetAvatarForPlayer(Player.localPlayer.refs.view.Owner, ref val))
			{
				GUI.DrawTexture(new Rect(131f, 358f, 145f, -134f), (Texture)(object)val.texture);
			}
		}
	}
}
[HarmonyPatch(typeof(MainMenuHandler), "Awake")]
internal class MainMenuHandler_Awake
{
	private static void Postfix()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		if ((Object)(object)DeadMenu.Instance == (Object)null)
		{
			GameObject val = new GameObject("DeadMenu");
			val.AddComponent<DeadMenu>();
		}
	}
}