mirror of https://github.com/hykilpikonna/AquaDX
[F] Need to press skip multiple time to exit photo edit while ExtendTimer is on
parent
e55d17fd08
commit
ef85156bae
|
@ -1,4 +1,7 @@
|
|||
using HarmonyLib;
|
||||
using Manager;
|
||||
using Monitor;
|
||||
using Process;
|
||||
|
||||
namespace AquaMai.UX
|
||||
{
|
||||
|
@ -10,5 +13,17 @@ namespace AquaMai.UX
|
|||
{
|
||||
second = 200;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(PhotoEditProcess), "MainMenuUpdate")]
|
||||
public static void PhotoEditProcess(PhotoEditMonitor[] ____monitors, ProcessDataContainer ___container)
|
||||
{
|
||||
if (InputManager.GetButtonDown(0, InputManager.ButtonSetting.Button04))
|
||||
{
|
||||
___container.processManager.DecrementTime(0, 200);
|
||||
SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_SYS_SKIP, 0);
|
||||
____monitors[0].SetButtonPressed(InputManager.ButtonSetting.Button04);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@ using Main;
|
|||
using Manager;
|
||||
using MelonLoader;
|
||||
using Process;
|
||||
using Process.Information;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AquaMai.UX
|
||||
|
@ -15,21 +14,21 @@ namespace AquaMai.UX
|
|||
{
|
||||
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;
|
||||
|
@ -38,12 +37,12 @@ namespace AquaMai.UX
|
|||
}
|
||||
|
||||
if (_keyPressFrames != 60) return;
|
||||
|
||||
|
||||
var traverse = Traverse.Create(_container.processManager);
|
||||
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
||||
|
||||
var flagGoToMusicSelect = false;
|
||||
|
||||
|
||||
ProcessBase processToRelease = null;
|
||||
|
||||
foreach (ProcessManager.ProcessControle process in processList)
|
||||
{
|
||||
switch (process.Process.ToString())
|
||||
|
@ -53,21 +52,16 @@ namespace AquaMai.UX
|
|||
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;
|
||||
processToRelease = process.Process;
|
||||
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));
|
||||
_container.processManager.AddProcess(new FadeProcess(_container, process.Process, new UnlockMusicProcess(_container)));
|
||||
break;
|
||||
|
||||
|
||||
case "Process.GameProcess":
|
||||
// This is original typo in Assembly-CSharp
|
||||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||
|
@ -75,12 +69,11 @@ namespace AquaMai.UX
|
|||
}
|
||||
}
|
||||
|
||||
if (flagGoToMusicSelect)
|
||||
if (processToRelease != null)
|
||||
{
|
||||
GameManager.SetMaxTrack();
|
||||
_container.processManager.AddProcess(new MusicSelectProcess(_container));
|
||||
_container.processManager.AddProcess(new FadeProcess(_container, processToRelease, new MusicSelectProcess(_container)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue