mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-15 06:47:27 +08:00
[RF] Move some settings to TimeSavingConfig
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user