2024-04-08 17:02:14 +08:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using Process;
|
|
|
|
|
|
|
|
|
|
namespace AquaMai.Performance
|
|
|
|
|
{
|
|
|
|
|
public class ImproveLoadSpeed
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPrefix]
|
2024-05-05 19:54:50 +08:00
|
|
|
|
[HarmonyPatch(typeof(PowerOnProcess), "OnStart")]
|
|
|
|
|
public static void PrePowerOnStart(ref float ____waitTime)
|
2024-04-08 17:02:14 +08:00
|
|
|
|
{
|
2024-05-05 19:54:50 +08:00
|
|
|
|
____waitTime = 0f;
|
2024-04-08 17:02:14 +08:00
|
|
|
|
}
|
2024-05-05 19:54:50 +08:00
|
|
|
|
|
2024-04-08 17:02:14 +08:00
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
|
2024-05-05 19:54:50 +08:00
|
|
|
|
public static void PreStartupUpdate(byte ____state, ref Stopwatch ___timer)
|
2024-04-08 17:02:14 +08:00
|
|
|
|
{
|
2024-05-05 19:54:50 +08:00
|
|
|
|
if (____state == 8)
|
2024-04-08 17:02:14 +08:00
|
|
|
|
{
|
2024-05-05 19:54:50 +08:00
|
|
|
|
Traverse.Create(___timer).Field("elapsed").SetValue(2 * 10000000L);
|
2024-04-08 17:02:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|