Decompiled source of SpectateClock v1.0.0

SpectateClock/SpectateClock.dll

Decompiled a day ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
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("SpectateClock")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SpectateClock")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f8a45952-df6b-4a71-a151-a69e6bc0620f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SpectateClock;

[BepInPlugin("yazirushi.SpectateClock", "SpectateClock", "1.0.0")]
public class SpectateClock : BaseUnityPlugin
{
	private readonly Harmony harmony = new Harmony("yazirushi.SpectateClock");

	internal static ManualLogSource mls;

	private void Awake()
	{
		mls = ((BaseUnityPlugin)this).Logger;
		mls.LogInfo((object)"Starting SpectateClock...");
		harmony.PatchAll();
	}
}
[HarmonyPatch(typeof(HUDManager), "Update")]
public class UpdatePatch
{
	private static void Postfix()
	{
		if (GameNetworkManager.Instance.localPlayerController.isPlayerDead)
		{
			int num = (int)(TimeOfDay.Instance.normalizedTimeOfDay * (60f * (float)TimeOfDay.Instance.numberOfHours)) + 360;
			int num2 = (int)Mathf.Floor((float)(num / 60));
			int num3 = num % 60;
			string text = ((num2 >= 24) ? "\n12:00 AM" : ((num2 > 12) ? $"\n{num2 % 12}:{num3:00} PM" : ((num2 != 12) ? $"\n{num2}:{num3:00} AM" : $"\n{num2}:{num3:00} PM")));
			TextMeshProUGUI holdButtonToEndGameEarlyText = HUDManager.Instance.holdButtonToEndGameEarlyText;
			((TMP_Text)holdButtonToEndGameEarlyText).text = ((TMP_Text)holdButtonToEndGameEarlyText).text + text;
		}
	}
}