mirror of https://github.com/hykilpikonna/AquaDX
[+] Skip to next step or restart current song
parent
f6cf157930
commit
c8db3ec762
|
@ -271,6 +271,7 @@
|
||||||
<Compile Include="Main.cs" />
|
<Compile Include="Main.cs" />
|
||||||
<Compile Include="UX\CustomVersionString.cs" />
|
<Compile Include="UX\CustomVersionString.cs" />
|
||||||
<Compile Include="UX\LoadJacketPng.cs" />
|
<Compile Include="UX\LoadJacketPng.cs" />
|
||||||
|
<Compile Include="UX\QuickSkip.cs" />
|
||||||
<Compile Include="UX\SinglePlayer.cs" />
|
<Compile Include="UX\SinglePlayer.cs" />
|
||||||
<Compile Include="UX\SkipWarningScreen.cs" />
|
<Compile Include="UX\SkipWarningScreen.cs" />
|
||||||
<Compile Include="UX\SkipToMusicSelection.cs" />
|
<Compile Include="UX\SkipToMusicSelection.cs" />
|
||||||
|
|
|
@ -18,6 +18,8 @@ SkipToMusicSelection=false
|
||||||
CustomVersionString=""
|
CustomVersionString=""
|
||||||
# Load Jacket image from folder "LocalAssets" and filename "{MusicID}.png" for self-made charts
|
# Load Jacket image from folder "LocalAssets" and filename "{MusicID}.png" for self-made charts
|
||||||
LoadJacketPng=true
|
LoadJacketPng=true
|
||||||
|
# Press key "7" for 1 second to skip to next step or restart current song
|
||||||
|
QuickSkip=true
|
||||||
|
|
||||||
[Performance]
|
[Performance]
|
||||||
# Disable some useless checks and delays to speed up the game boot process
|
# Disable some useless checks and delays to speed up the game boot process
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace AquaMai
|
||||||
public bool SinglePlayer { get; set; }
|
public bool SinglePlayer { get; set; }
|
||||||
public bool SkipToMusicSelection { get; set; }
|
public bool SkipToMusicSelection { get; set; }
|
||||||
public bool LoadJacketPng { get; set; }
|
public bool LoadJacketPng { get; set; }
|
||||||
|
public bool QuickSkip { get; set; }
|
||||||
public string CustomVersionString { get; set; }
|
public string CustomVersionString { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using HarmonyLib;
|
||||||
|
using Mai2.Mai2Cue;
|
||||||
|
using MAI2.Util;
|
||||||
|
using Main;
|
||||||
|
using Manager;
|
||||||
|
using MelonLoader;
|
||||||
|
using Process;
|
||||||
|
using Process.Information;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AquaMai.UX
|
||||||
|
{
|
||||||
|
public class QuickSkip
|
||||||
|
{
|
||||||
|
private static ProcessDataContainer _container;
|
||||||
|
private static int _keyPressFrames;
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(ProcessDataContainer), MethodType.Constructor)]
|
||||||
|
public static void OnCreateProcessDataContainer(ProcessDataContainer __instance)
|
||||||
|
{
|
||||||
|
_container = __instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPrefix]
|
||||||
|
[HarmonyPatch(typeof(GameMainObject), "Update")]
|
||||||
|
public static void OnGameMainObjectUpdate()
|
||||||
|
{
|
||||||
|
// The button between [1p] and [2p] button on ADX
|
||||||
|
if (Input.GetKey(KeyCode.Alpha7)) _keyPressFrames++;
|
||||||
|
|
||||||
|
if (Input.GetKeyUp(KeyCode.Alpha7))
|
||||||
|
{
|
||||||
|
_keyPressFrames = 0;
|
||||||
|
MelonLogger.Msg(_container.processManager.Dump());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_keyPressFrames != 60) return;
|
||||||
|
|
||||||
|
var traverse = Traverse.Create(_container.processManager);
|
||||||
|
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
||||||
|
|
||||||
|
var flagGoToMusicSelect = false;
|
||||||
|
|
||||||
|
foreach (ProcessManager.ProcessControle process in processList)
|
||||||
|
{
|
||||||
|
switch (process.Process.ToString())
|
||||||
|
{
|
||||||
|
// After login
|
||||||
|
case "Process.ModeSelect.ModeSelectProcess":
|
||||||
|
case "Process.RegionalSelectProcess":
|
||||||
|
case "Process.CharacterSelectProcess":
|
||||||
|
case "Process.TicketSelect.TicketSelectProcess":
|
||||||
|
// After playing a song
|
||||||
|
case "Process.ResultProcess":
|
||||||
|
case "Process.MapResultProcess":
|
||||||
|
_container.processManager.ReleaseProcess(process.Process);
|
||||||
|
flagGoToMusicSelect = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Process.MusicSelectProcess":
|
||||||
|
// Skip to save
|
||||||
|
SoundManager.PreviewEnd();
|
||||||
|
SoundManager.PlayBGM(Cue.BGM_COLLECTION, 2);
|
||||||
|
_container.processManager.ReleaseProcess(process.Process);
|
||||||
|
_container.processManager.AddProcess(new UnlockMusicProcess(_container));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Process.GameProcess":
|
||||||
|
// This is original typo in Assembly-CSharp
|
||||||
|
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flagGoToMusicSelect)
|
||||||
|
{
|
||||||
|
GameManager.SetMaxTrack();
|
||||||
|
_container.processManager.AddProcess(new MusicSelectProcess(_container));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue