mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-14 17:07:28 +08:00
[RF] Move some settings to TimeSavingConfig
This commit is contained in:
15
AquaMai/TimeSaving/IWontTapOrSlideVigorously.cs
Normal file
15
AquaMai/TimeSaving/IWontTapOrSlideVigorously.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using HarmonyLib;
|
||||
using Monitor;
|
||||
|
||||
namespace AquaMai.TimeSaving;
|
||||
|
||||
public class IWontTapOrSlideVigorously
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PlInformationMonitor), "IsPlayPlInfoEnd")]
|
||||
public static bool Patch(ref bool __result)
|
||||
{
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
26
AquaMai/TimeSaving/ImproveLoadSpeed.cs
Normal file
26
AquaMai/TimeSaving/ImproveLoadSpeed.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Diagnostics;
|
||||
using HarmonyLib;
|
||||
using Process;
|
||||
|
||||
namespace AquaMai.TimeSaving
|
||||
{
|
||||
public class ImproveLoadSpeed
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PowerOnProcess), "OnStart")]
|
||||
public static void PrePowerOnStart(ref float ____waitTime)
|
||||
{
|
||||
____waitTime = 0f;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(StartupProcess), "OnUpdate")]
|
||||
public static void PreStartupUpdate(byte ____state, ref Stopwatch ___timer)
|
||||
{
|
||||
if (____state == 8)
|
||||
{
|
||||
Traverse.Create(___timer).Field("elapsed").SetValue(2 * 10000000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
24
AquaMai/TimeSaving/SkipEventInfo.cs
Normal file
24
AquaMai/TimeSaving/SkipEventInfo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using Process;
|
||||
using Process.Information;
|
||||
|
||||
namespace AquaMai.TimeSaving
|
||||
{
|
||||
public class SkipEventInfo
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(InformationProcess), "OnStart")]
|
||||
public static void InformationProcessPostStart(ref uint ____state)
|
||||
{
|
||||
____state = 3;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(RegionalSelectProcess), "OnStart")]
|
||||
public static void RegionalSelectProcessPreStart(ref Queue<int>[] ____discoverList)
|
||||
{
|
||||
____discoverList = new Queue<int>[] { new Queue<int>(), new Queue<int>() };
|
||||
}
|
||||
}
|
||||
}
|
||||
26
AquaMai/TimeSaving/SkipGameOverScreen.cs
Normal file
26
AquaMai/TimeSaving/SkipGameOverScreen.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using HarmonyLib;
|
||||
using Monitor;
|
||||
using Process;
|
||||
|
||||
namespace AquaMai.TimeSaving;
|
||||
|
||||
public class SkipGameOverScreen
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameOverMonitor), "IsPlayEnd")]
|
||||
public static bool GameOverMonitorPlayEnd(ref bool __result)
|
||||
{
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameOverProcess), "OnUpdate")]
|
||||
public static void GameOverProcessOnUpdate(ref GameOverProcess.GameOverSequence ____state)
|
||||
{
|
||||
if (____state == GameOverProcess.GameOverSequence.SkyChange)
|
||||
{
|
||||
____state = GameOverProcess.GameOverSequence.Disp;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
AquaMai/TimeSaving/SkipToMusicSelection.cs
Normal file
38
AquaMai/TimeSaving/SkipToMusicSelection.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using HarmonyLib;
|
||||
using MAI2.Util;
|
||||
using Manager;
|
||||
using Monitor;
|
||||
using Process;
|
||||
using Process.Information;
|
||||
|
||||
namespace AquaMai.TimeSaving
|
||||
{
|
||||
public class SkipToMusicSelection
|
||||
{
|
||||
/*
|
||||
* Highly experimental, may well break some stuff
|
||||
* Works by overriding the info screen (where it shows new events and stuff)
|
||||
* to directly exit to the music selection screen, skipping character and
|
||||
* event selection, among others
|
||||
*/
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(InformationProcess), "OnUpdate")]
|
||||
public static bool OnUpdate(InformationProcess __instance, ProcessDataContainer ___container)
|
||||
{
|
||||
GameManager.SetMaxTrack();
|
||||
___container.processManager.AddProcess(new MusicSelectProcess(___container));
|
||||
___container.processManager.ReleaseProcess(__instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MapResultMonitor), "Initialize")]
|
||||
public static void MapResultMonitorPreInitialize(int monIndex)
|
||||
{
|
||||
var userData = Singleton<UserDataManager>.Instance.GetUserData(monIndex);
|
||||
var index = userData.MapList.FindIndex((UserMapData m) => m.ID == userData.Detail.SelectMapID);
|
||||
if (index >= 0) return;
|
||||
userData.MapList.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
AquaMai/TimeSaving/SkipWarningScreen.cs
Normal file
28
AquaMai/TimeSaving/SkipWarningScreen.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using HarmonyLib;
|
||||
using Monitor;
|
||||
|
||||
namespace AquaMai.TimeSaving
|
||||
{
|
||||
public class SkipWarningScreen
|
||||
{
|
||||
/*
|
||||
* Patch PlayLogo to disable the warning screen
|
||||
*/
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof (WarningMonitor), "PlayLogo")]
|
||||
public static bool PlayLogo()
|
||||
{
|
||||
// Return false to block the original method
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof (WarningMonitor), "IsLogoAnimationEnd")]
|
||||
public static bool IsLogoAnimationEnd(ref bool __result)
|
||||
{
|
||||
// Always return true to indicate the animation has ended
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user