mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 21:07:27 +08:00
[F] Modify ImproveLoadSpeed to only skip delays to reduce bugs
This commit is contained in:
@@ -24,6 +24,5 @@ QuickSkip=true
|
|||||||
LoadAssetBundleWithoutManifest=true
|
LoadAssetBundleWithoutManifest=true
|
||||||
|
|
||||||
[Performance]
|
[Performance]
|
||||||
# Disable some useless checks and delays to speed up the game boot process
|
# Disable some useless delays to speed up the game boot process
|
||||||
# !! Known issue: The game may crash if DX Pass scanning is enabled
|
|
||||||
ImproveLoadSpeed=false
|
ImproveLoadSpeed=false
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MAI2.Util;
|
|
||||||
using Manager;
|
|
||||||
using Process;
|
using Process;
|
||||||
|
|
||||||
namespace AquaMai.Performance
|
namespace AquaMai.Performance
|
||||||
@@ -9,55 +7,20 @@ namespace AquaMai.Performance
|
|||||||
public class ImproveLoadSpeed
|
public class ImproveLoadSpeed
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(PowerOnProcess), "OnUpdate")]
|
[HarmonyPatch(typeof(PowerOnProcess), "OnStart")]
|
||||||
public static bool PrePowerOnUpdate(PowerOnProcess __instance)
|
public static void PrePowerOnStart(ref float ____waitTime)
|
||||||
{
|
{
|
||||||
var traverse = Traverse.Create(__instance);
|
____waitTime = 0f;
|
||||||
var state = traverse.Field("_state").GetValue<byte>();
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case 3:
|
|
||||||
traverse.Field("_state").SetValue((byte)4);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
traverse.Field("_state").SetValue((byte)8);
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
traverse.Field("_state").SetValue((byte)10);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
|
[HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
|
||||||
public static bool PreStartupUpdate(StartupProcess __instance)
|
public static void PreStartupUpdate(byte ____state, ref Stopwatch ___timer)
|
||||||
{
|
{
|
||||||
var traverse = Traverse.Create(__instance);
|
if (____state == 8)
|
||||||
var state = traverse.Field("_state").GetValue<byte>();
|
|
||||||
switch (state)
|
|
||||||
{
|
{
|
||||||
case 0:
|
Traverse.Create(___timer).Field("elapsed").SetValue(2 * 10000000L);
|
||||||
traverse.Field("_state").SetValue((byte)1);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
// AimeReader maybe typeof AimeReaderManager or ChimeReaderManager, must build with correct Assembly-CSharp.dll in Libs folder
|
|
||||||
if(SingletonStateMachine<AmManager, AmManager.EState>.Instance.AimeReader.GetType().FullName == "Manager.AimeReaderManager")
|
|
||||||
traverse.Field("_state").SetValue((byte)3);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
traverse.Field("_state").SetValue((byte)5);
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
var timer = traverse.Field("timer").GetValue<Stopwatch>();
|
|
||||||
Traverse.Create(timer).Field("elapsed").SetValue(2 * 10000000L);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user