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)
{
QuotaSpeedMultiplier = config.Bind<float>("General", "QuotaSpeedMultiplier", 3000f, "Determines the quota accumulation speed (higher = faster)");
}
}
[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;
if (overtimeBonus < 0)
{
((TMP_Text)__instance.reachedProfitQuotaBonusText).text = "";
}
else
{
((TMP_Text)__instance.reachedProfitQuotaBonusText).text = $"Overtime bonus: ${overtimeBonus}";
}
((MonoBehaviour)__instance).StartCoroutine(FastQuotaCoroutine(__instance));
return false;
}
private static IEnumerator FastQuotaCoroutine(HUDManager instance)
{
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;
}
yield return (object)new WaitForSeconds(0.5f);
Debug.Log((object)"[FastQuotaMod] Updating profit quota text...");
int quotaTextAmount = 0;
int targetQuota = TimeOfDay.Instance.profitQuota;
float quotaSpeed = FastQuotaConfig.QuotaSpeedMultiplier.Value;
while (quotaTextAmount < targetQuota)
{
quotaTextAmount = (int)Mathf.Clamp((float)quotaTextAmount + Time.deltaTime * quotaSpeed, (float)(quotaTextAmount + 5), (float)(targetQuota + 5));
((TMP_Text)instance.newProfitQuotaText).text = "$" + quotaTextAmount;
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);
}
}