mirror of https://github.com/hykilpikonna/AquaDX
Merge branch 'v1-dev' of https://github.com/hykilpikonna/AquaDX into v1-dev
commit
ba61ac46d1
|
@ -271,6 +271,8 @@
|
|||
<Compile Include="Main.cs" />
|
||||
<Compile Include="UX\CustomVersionString.cs" />
|
||||
<Compile Include="UX\LoadJacketPng.cs" />
|
||||
<Compile Include="UX\LoadAssetBundleWithoutManifest.cs" />
|
||||
<Compile Include="UX\QuickSkip.cs" />
|
||||
<Compile Include="UX\SinglePlayer.cs" />
|
||||
<Compile Include="UX\SkipWarningScreen.cs" />
|
||||
<Compile Include="UX\SkipToMusicSelection.cs" />
|
||||
|
|
|
@ -18,6 +18,10 @@ SkipToMusicSelection=false
|
|||
CustomVersionString=""
|
||||
# Load Jacket image from folder "LocalAssets" and filename "{MusicID}.png" for self-made charts
|
||||
LoadJacketPng=true
|
||||
# Press key "7" for 1 second to skip to next step or restart current song
|
||||
QuickSkip=true
|
||||
# Add ".ab" image resources without the need of rebuilding a manifest
|
||||
LoadAssetBundleWithoutManifest=true
|
||||
|
||||
[Performance]
|
||||
# Disable some useless checks and delays to speed up the game boot process
|
||||
|
|
|
@ -20,6 +20,8 @@ namespace AquaMai
|
|||
public bool SinglePlayer { get; set; }
|
||||
public bool SkipToMusicSelection { get; set; }
|
||||
public bool LoadJacketPng { get; set; }
|
||||
public bool LoadAssetBundleWithoutManifest { get; set; }
|
||||
public bool QuickSkip { get; set; }
|
||||
public string CustomVersionString { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
using Manager;
|
||||
using Util;
|
||||
|
||||
namespace AquaMai.UX
|
||||
{
|
||||
public class LoadAssetBundleWithoutManifest
|
||||
{
|
||||
private static HashSet<string> abFiles = new HashSet<string>();
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(OptionDataManager), "CheckAssetBundle")]
|
||||
public static void PostCheckAssetBundle(ref Safe.ReadonlySortedDictionary<string, string> abs)
|
||||
{
|
||||
foreach (var ab in abs)
|
||||
{
|
||||
abFiles.Add(ab.Key);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AssetBundleManifest), "GetAllAssetBundles")]
|
||||
public static bool PreGetAllAssetBundles(AssetBundleManifest __instance, ref string[] __result)
|
||||
{
|
||||
__result = abFiles.ToArray();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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