mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 09:37:27 +08:00
[F] Need to press skip multiple time to exit photo edit while ExtendTimer is on
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using Manager;
|
||||||
|
using Monitor;
|
||||||
|
using Process;
|
||||||
|
|
||||||
namespace AquaMai.UX
|
namespace AquaMai.UX
|
||||||
{
|
{
|
||||||
@@ -10,5 +13,17 @@ namespace AquaMai.UX
|
|||||||
{
|
{
|
||||||
second = 200;
|
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 Manager;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using Process;
|
using Process;
|
||||||
using Process.Information;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace AquaMai.UX
|
namespace AquaMai.UX
|
||||||
@@ -15,21 +14,21 @@ namespace AquaMai.UX
|
|||||||
{
|
{
|
||||||
private static ProcessDataContainer _container;
|
private static ProcessDataContainer _container;
|
||||||
private static int _keyPressFrames;
|
private static int _keyPressFrames;
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(ProcessDataContainer), MethodType.Constructor)]
|
[HarmonyPatch(typeof(ProcessDataContainer), MethodType.Constructor)]
|
||||||
public static void OnCreateProcessDataContainer(ProcessDataContainer __instance)
|
public static void OnCreateProcessDataContainer(ProcessDataContainer __instance)
|
||||||
{
|
{
|
||||||
_container = __instance;
|
_container = __instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(GameMainObject), "Update")]
|
[HarmonyPatch(typeof(GameMainObject), "Update")]
|
||||||
public static void OnGameMainObjectUpdate()
|
public static void OnGameMainObjectUpdate()
|
||||||
{
|
{
|
||||||
// The button between [1p] and [2p] button on ADX
|
// The button between [1p] and [2p] button on ADX
|
||||||
if (Input.GetKey(KeyCode.Alpha7)) _keyPressFrames++;
|
if (Input.GetKey(KeyCode.Alpha7)) _keyPressFrames++;
|
||||||
|
|
||||||
if (Input.GetKeyUp(KeyCode.Alpha7))
|
if (Input.GetKeyUp(KeyCode.Alpha7))
|
||||||
{
|
{
|
||||||
_keyPressFrames = 0;
|
_keyPressFrames = 0;
|
||||||
@@ -38,12 +37,12 @@ namespace AquaMai.UX
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_keyPressFrames != 60) return;
|
if (_keyPressFrames != 60) return;
|
||||||
|
|
||||||
var traverse = Traverse.Create(_container.processManager);
|
var traverse = Traverse.Create(_container.processManager);
|
||||||
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
||||||
|
|
||||||
var flagGoToMusicSelect = false;
|
ProcessBase processToRelease = null;
|
||||||
|
|
||||||
foreach (ProcessManager.ProcessControle process in processList)
|
foreach (ProcessManager.ProcessControle process in processList)
|
||||||
{
|
{
|
||||||
switch (process.Process.ToString())
|
switch (process.Process.ToString())
|
||||||
@@ -53,21 +52,16 @@ namespace AquaMai.UX
|
|||||||
case "Process.RegionalSelectProcess":
|
case "Process.RegionalSelectProcess":
|
||||||
case "Process.CharacterSelectProcess":
|
case "Process.CharacterSelectProcess":
|
||||||
case "Process.TicketSelect.TicketSelectProcess":
|
case "Process.TicketSelect.TicketSelectProcess":
|
||||||
// After playing a song
|
processToRelease = process.Process;
|
||||||
case "Process.ResultProcess":
|
|
||||||
case "Process.MapResultProcess":
|
|
||||||
_container.processManager.ReleaseProcess(process.Process);
|
|
||||||
flagGoToMusicSelect = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Process.MusicSelectProcess":
|
case "Process.MusicSelectProcess":
|
||||||
// Skip to save
|
// Skip to save
|
||||||
SoundManager.PreviewEnd();
|
SoundManager.PreviewEnd();
|
||||||
SoundManager.PlayBGM(Cue.BGM_COLLECTION, 2);
|
SoundManager.PlayBGM(Cue.BGM_COLLECTION, 2);
|
||||||
_container.processManager.ReleaseProcess(process.Process);
|
_container.processManager.AddProcess(new FadeProcess(_container, process.Process, new UnlockMusicProcess(_container)));
|
||||||
_container.processManager.AddProcess(new UnlockMusicProcess(_container));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Process.GameProcess":
|
case "Process.GameProcess":
|
||||||
// This is original typo in Assembly-CSharp
|
// This is original typo in Assembly-CSharp
|
||||||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||||
@@ -75,12 +69,11 @@ namespace AquaMai.UX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagGoToMusicSelect)
|
if (processToRelease != null)
|
||||||
{
|
{
|
||||||
GameManager.SetMaxTrack();
|
GameManager.SetMaxTrack();
|
||||||
_container.processManager.AddProcess(new MusicSelectProcess(_container));
|
_container.processManager.AddProcess(new FadeProcess(_container, processToRelease, new MusicSelectProcess(_container)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user