using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
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("ClassLibrary5")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary5")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("63b5a1e0-6544-477a-8490-51f40ccb968b")]
[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")]
public static class FastQuotaConfig
{
public static ConfigEntry<float> QuotaSpeedMultiplier { get; private set; }
public static void LoadConfig(ConfigFile config)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
QuotaSpeedMultiplier = config.Bind<float>("General", "QuotaSpeedMultiplier", 1f, new ConfigDescription("Determines the quota accumulation speed (higher = faster) 100000 - Instantly", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100000f), Array.Empty<object>()));
}
}
[BepInPlugin("com.pxntxrez.FastNewQuota", "Fast New Quota Animation", "1.1.0")]
public class FastQuotaMod : BaseUnityPlugin
{
private void Awake()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
FastQuotaConfig.LoadConfig(((BaseUnityPlugin)this).Config);
Harmony val = new Harmony("com.pxntxrez.FastNewQuota");
val.PatchAll();
Debug.Log((object)"[FastQuotaMod] Mod Loaded!");
}
}
[HarmonyPatch(typeof(HUDManager), "DisplayNewDeadline")]
public class FastQuotaPatch
{
private static bool Prefix(HUDManager __instance, int overtimeBonus)
{
if ((Object)(object)__instance == (Object)null)
{
Debug.LogError((object)"[FastQuotaMod] HUDManager instance is NULL!");
return true;
}
Debug.Log((object)"[FastQuotaMod] Overriding DisplayNewDeadline...");
__instance.reachedProfitQuotaAnimator.SetBool("display", true);
((TMP_Text)__instance.newProfitQuotaText).text = "$0";
__instance.UIAudio.PlayOneShot(__instance.reachedQuotaSFX);
__instance.displayingNewQuota = true;
((MonoBehaviour)__instance).StartCoroutine(WaitAndStartQuotaAnimation(__instance, overtimeBonus));
return false;
}
private static IEnumerator WaitAndStartQuotaAnimation(HUDManager __instance, int overtimeBonus)
{
if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.newProfitQuotaText == (Object)null)
{
Debug.LogError((object)"[FastQuotaMod] ERROR: HUDManager or quota text is NULL!");
yield break;
}
if (overtimeBonus < 0)
{
((TMP_Text)__instance.reachedProfitQuotaBonusText).text = "";
}
else
{
((TMP_Text)__instance.reachedProfitQuotaBonusText).text = "Overtime bonus: $" + overtimeBonus;
}
yield return (object)new WaitForSeconds(3.5f);
Debug.Log((object)"[FastQuotaMod] Starting quota animation...");
int quotaTextAmount2 = 0;
int targetQuota = TimeOfDay.Instance.profitQuota;
float quotaSpeed = Mathf.Max(1f, FastQuotaConfig.QuotaSpeedMultiplier.Value);
float animationDuration = Mathf.Clamp(2f / (quotaSpeed / 10f), 0.5f, 5f);
float startTime = Time.time;
while (quotaTextAmount2 < targetQuota)
{
float elapsedTime = Time.time - startTime;
float progress = elapsedTime / animationDuration;
quotaTextAmount2 = Mathf.RoundToInt((float)targetQuota * progress);
quotaTextAmount2 = Mathf.Clamp(quotaTextAmount2, 0, targetQuota);
((TMP_Text)__instance.newProfitQuotaText).text = "$" + quotaTextAmount2;
yield return null;
}
((TMP_Text)__instance.newProfitQuotaText).text = "$" + targetQuota;
Debug.Log((object)"[FastQuotaMod] Quota animation finished!");
TimeOfDay.Instance.UpdateProfitQuotaCurrentTime();
__instance.UIAudio.PlayOneShot(__instance.newProfitQuotaSFX);
yield return (object)new WaitForSeconds(0.5f);
__instance.displayingNewQuota = false;
__instance.reachedProfitQuotaAnimator.SetBool("display", false);
}
}