Decompiled source of 24HourClock v1.0.0

24HourClock.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: AssemblyCompany("_24HourClock")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("My first plugin")]
[assembly: AssemblyTitle("_24HourClock")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace _24HourClock
{
	[BepInPlugin("com.zduniusz.lethalcompany.24hourclock", "24HourClock", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch]
		private class Patch
		{
			[HarmonyPatch(typeof(HUDManager), "SetClock")]
			[HarmonyPrefix]
			private static bool SetClock(ref TextMeshProUGUI ___clockNumber, ref float timeNormalized, ref float numberOfHours)
			{
				int num = (int)(timeNormalized * (60f * numberOfHours)) + 360;
				int num2 = (int)Mathf.Floor((float)(num / 60));
				int num3 = num % 60;
				((TMP_Text)___clockNumber).text = $"{num2:00}:{num3:00}".TrimStart(new char[1] { '0' });
				return false;
			}
		}

		private const string PLUGIN_GUID = "com.zduniusz.lethalcompany.24hourclock";

		private const string PLUGIN_NAME = "24HourClock";

		private const string PLUGIN_VERSION = "1.0.0";

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.zduniusz.lethalcompany.24hourclock").PatchAll();
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "_24HourClock";

		public const string PLUGIN_NAME = "My first plugin";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}