Decompiled source of QuotaDisplaySpeedUp v1.0.0

LethalCompanyQuotaUIOptimizer.dll

Decompiled 11 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("LethalCompanyQuotaUIOptimizer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalCompanyQuotaUIOptimizer")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("08db4f13-cb8b-4934-bd32-bfcee6b34993")]
[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")]
[HarmonyPatch(typeof(HUDManager))]
[HarmonyPatch("rackUpNewQuotaText")]
internal class HUDManager_Patch
{
	[CompilerGenerated]
	private sealed class <FixedDurationRackUpNewQuotaText>d__2 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public HUDManager instance;

		private int <currentAmount>5__1;

		private int <targetQuota>5__2;

		private float <rollingDuration>5__3;

		private float <amountPerSecond>5__4;

		private float <startTime>5__5;

		private float <elapsedTime>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <FixedDurationRackUpNewQuotaText>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(3.5f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<currentAmount>5__1 = 0;
				<targetQuota>5__2 = TimeOfDay.Instance.profitQuota;
				<rollingDuration>5__3 = TargetTotalDuration;
				<amountPerSecond>5__4 = (float)<targetQuota>5__2 / <rollingDuration>5__3;
				<startTime>5__5 = Time.time;
				goto IL_010e;
			case 2:
				<>1__state = -1;
				goto IL_010e;
			case 3:
				{
					<>1__state = -1;
					instance.displayingNewQuota = false;
					instance.reachedProfitQuotaAnimator.SetBool("display", false);
					return false;
				}
				IL_010e:
				if (<currentAmount>5__1 < <targetQuota>5__2)
				{
					<elapsedTime>5__6 = Time.time - <startTime>5__5;
					<currentAmount>5__1 = Mathf.Min(<targetQuota>5__2, Mathf.FloorToInt(<elapsedTime>5__6 * <amountPerSecond>5__4));
					((TMP_Text)instance.newProfitQuotaText).text = "$" + <currentAmount>5__1;
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				((TMP_Text)instance.newProfitQuotaText).text = "$" + <targetQuota>5__2;
				TimeOfDay.Instance.UpdateProfitQuotaCurrentTime();
				instance.UIAudio.PlayOneShot(instance.newProfitQuotaSFX);
				<>2__current = (object)new WaitForSeconds(1.25f);
				<>1__state = 3;
				return true;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private static readonly float TargetTotalDuration = 5f;

	[HarmonyPrefix]
	private static bool Prefix(HUDManager __instance, ref IEnumerator __result)
	{
		__result = FixedDurationRackUpNewQuotaText(__instance);
		return false;
	}

	[IteratorStateMachine(typeof(<FixedDurationRackUpNewQuotaText>d__2))]
	private static IEnumerator FixedDurationRackUpNewQuotaText(HUDManager instance)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <FixedDurationRackUpNewQuotaText>d__2(0)
		{
			instance = instance
		};
	}
}
[BepInPlugin("com.Maplewyn.QuotaUISpeedUp", "指标UI滚动加速", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.Maplewyn.UISpeedUp");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"【UI滚动加速】Mod 已加载!");
	}
}