Decompiled source of Time Always On Display v1.0.2

Always On Clock.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using MelonLoader;
using ScheduleOne.DevUtilities;
using ScheduleOne.GameTime;
using TimeDisplayMod;
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(TimeDisplay), "Always Time Display", "1.0.3", "vcwk", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: MelonInfo(typeof(TimeDisplay), "Always Time Display", "1.0.0", "vcwk", null)]
[assembly: AssemblyTitle("Always On Clock")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Always On Clock")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("76ba7a31-1318-4fcd-83b0-16b1a1e1ba88")]
[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 TimeDisplayMod;

public class TimeDisplay : MelonMod
{
	private GUIStyle style;

	private Texture2D backgroundTexture;

	private bool showTime = true;

	public override void OnInitializeMelon()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0049: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		MelonLogger.Msg("Time Display mod loaded!");
		GUIStyle val = new GUIStyle
		{
			fontSize = 16
		};
		val.normal.textColor = Color.white;
		val.alignment = (TextAnchor)4;
		val.padding = new RectOffset(4, 4, 2, 2);
		style = val;
		backgroundTexture = new Texture2D(1, 1);
		backgroundTexture.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.7f));
		backgroundTexture.Apply();
	}

	public override void OnUpdate()
	{
		if (Input.GetKeyDown((KeyCode)110))
		{
			showTime = !showTime;
		}
	}

	public override void OnGUI()
	{
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		if (showTime)
		{
			TimeManager instance = NetworkSingleton<TimeManager>.Instance;
			if (!((Object)(object)instance == (Object)null))
			{
				int currentTime = instance.CurrentTime;
				int num = currentTime / 100;
				int num2 = currentTime % 100;
				EDay currentDay = instance.CurrentDay;
				string text = $"Day {currentDay} - {num:D2}:{num2:D2}";
				Vector2 val = style.CalcSize(new GUIContent(text));
				Rect val2 = default(Rect);
				((Rect)(ref val2))..ctor((float)Screen.width - val.x - 30f, 20f, val.x + 20f, val.y + 10f);
				GUI.DrawTexture(val2, (Texture)(object)backgroundTexture);
				GUI.Label(val2, text, style);
			}
		}
	}
}