Decompiled source of TimerNoLimit v1.0.0

On-Together_TimerSet.dll

Decompiled 3 days ago
using System;
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("On-Together_TimerSet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("On-Together_TimerSet")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("739e745a-5806-486c-aee6-0d516f2a1272")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace On_Together_TimerSet;

[BepInPlugin("Wan7.OnTogether.TimerNoLimit", "Timer No Limit", "1.0.0")]
public class main : BaseUnityPlugin
{
	internal static ManualLogSource Log;

	private void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		Harmony val = new Harmony("Wan7.OnTogether.TimerNoLimit");
		val.PatchAll();
		Log.LogInfo((object)"[TimerNoLimit] Loaded");
	}
}
[HarmonyPatch(typeof(UIManager), "FocusChange")]
public static class Patch_FocusChange
{
	private static bool Prefix(UIManager __instance, int count)
	{
		PlayerData playerData = MonoSingleton<DataManager>.I.PlayerData;
		playerData.FocusMinute = Math.Max(1, playerData.FocusMinute + count);
		object? obj = AccessTools.Field(typeof(UIManager), "_focusMinuteText")?.GetValue(__instance);
		TMP_Text val = (TMP_Text)((obj is TMP_Text) ? obj : null);
		if ((Object)(object)val != (Object)null)
		{
			val.text = ((playerData.FocusMinute < 10) ? "0" : "") + playerData.FocusMinute;
		}
		AccessTools.Field(typeof(UIManager), "_pomodoroFocusChangeTimer")?.SetValue(__instance, 0.15f);
		return false;
	}
}