mirror of https://github.com/hykilpikonna/AquaDX
[+] Splash+ support
parent
1b47bfa2f1
commit
e844164cf6
|
@ -48,14 +48,6 @@ public class BasicFix
|
|||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameManager), "CalcSpecialNum")]
|
||||
private static bool CalcSpecialNum(ref int __result)
|
||||
{
|
||||
__result = 1024;
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(NetHttpClient), MethodType.Constructor)]
|
||||
private static void OnNetHttpClientConstructor(NetHttpClient __instance)
|
||||
|
@ -75,4 +67,21 @@ public class BasicFix
|
|||
// Unset the certificate validation callback (SSL pinning) to restore the default behavior
|
||||
ServicePointManager.ServerCertificateValidationCallback = null;
|
||||
}
|
||||
|
||||
public static void DoCustomPatch(HarmonyLib.Harmony h)
|
||||
{
|
||||
if (typeof(GameManager).GetMethod("CalcSpecialNum") is null) return;
|
||||
h.PatchAll(typeof(CalcSpecialNumPatch));
|
||||
}
|
||||
|
||||
private class CalcSpecialNumPatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameManager), "CalcSpecialNum")]
|
||||
private static bool CalcSpecialNum(ref int __result)
|
||||
{
|
||||
__result = 1024;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using System.Reflection;
|
||||
using MAI2System;
|
||||
|
||||
namespace AquaMai.Helpers;
|
||||
|
||||
public class GameInfo
|
||||
{
|
||||
public static uint GameVersion { get; } = GetGameVersion();
|
||||
|
||||
private static uint GetGameVersion()
|
||||
{
|
||||
return (uint)typeof(ConstParameter).GetField("NowGameVersion", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).GetValue(null);
|
||||
}
|
||||
|
||||
public static string GameId { get; } = GetGameId();
|
||||
|
||||
private static string GetGameId()
|
||||
{
|
||||
return typeof(ConstParameter).GetField("GameIDStr", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).GetValue(null) as string;
|
||||
}
|
||||
}
|
|
@ -155,12 +155,15 @@ namespace AquaMai
|
|||
Patch(typeof(FixCharaCrash));
|
||||
Patch(typeof(BasicFix));
|
||||
Patch(typeof(DisableReboot));
|
||||
Patch(typeof(ExtendNotesPool));
|
||||
if (GameInfo.GameVersion >= 23000)
|
||||
Patch(typeof(ExtendNotesPool));
|
||||
Patch(typeof(FixCheckAuth));
|
||||
Patch(typeof(DebugFeature));
|
||||
Patch(typeof(FixConnSlide));
|
||||
if (GameInfo.GameVersion >= 23000)
|
||||
Patch(typeof(FixConnSlide));
|
||||
Patch(typeof(SlideAutoPlayTweak));
|
||||
Patch(typeof(FixLevelDisplay));
|
||||
if (GameInfo.GameVersion >= 24000)
|
||||
Patch(typeof(FixLevelDisplay));
|
||||
// UX
|
||||
Patch(typeof(CustomVersionString));
|
||||
Patch(typeof(CustomPlaceName));
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace AquaMai.Resources {
|
|||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Errors detected while loading!
|
||||
///- Check if you have installed the wrong version of AquaMai, such as using SDEZ version on SDGA
|
||||
///- Are you using a modified Assembly-CSharp.dll, which will cause inconsistent functions and cannot find the functions that need to be modified
|
||||
///- Check for conflicting mods, or enabled incompatible options.
|
||||
/// </summary>
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
</data>
|
||||
<data name="LoadError" xml:space="preserve">
|
||||
<value>Errors detected while loading!
|
||||
- Check if you have installed the wrong version of AquaMai, such as using SDEZ version on SDGA
|
||||
- Are you using a modified Assembly-CSharp.dll, which will cause inconsistent functions and cannot find the functions that need to be modified
|
||||
- Check for conflicting mods, or enabled incompatible options</value>
|
||||
</data>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
</data>
|
||||
<data name="LoadError" xml:space="preserve">
|
||||
<value>加载过程中检测到错误!
|
||||
- 请检查你是否安装了错误的 AquaMai 版本,比如在 SDGA 上使用了 SDEZ 的版本
|
||||
- 你是否正在使用魔改的 Assembly-CSharp.dll,这会导致函数不一致而无法找到需要修改的函数
|
||||
- 请检查是否有冲突的 Mod,或者开启了不兼容的选项</value>
|
||||
</data>
|
||||
|
|
|
@ -10,82 +10,90 @@ using Monitor;
|
|||
using Process;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AquaMai.UX
|
||||
namespace AquaMai.UX;
|
||||
|
||||
public class QuickSkip
|
||||
{
|
||||
public class QuickSkip
|
||||
private static int _keyPressFrames;
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameMainObject), "Update")]
|
||||
public static void OnGameMainObjectUpdate()
|
||||
{
|
||||
private static int _keyPressFrames;
|
||||
// The button between [1p] and [2p] button on ADX
|
||||
if (Input.GetKey(KeyCode.Alpha7) || InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService)) _keyPressFrames++;
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameMainObject), "Update")]
|
||||
public static void OnGameMainObjectUpdate()
|
||||
if (_keyPressFrames > 0 && !Input.GetKey(KeyCode.Alpha7) && !InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService))
|
||||
{
|
||||
// The button between [1p] and [2p] button on ADX
|
||||
if (Input.GetKey(KeyCode.Alpha7) || InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService)) _keyPressFrames++;
|
||||
_keyPressFrames = 0;
|
||||
MelonLogger.Msg(SharedInstances.ProcessDataContainer.processManager.Dump());
|
||||
return;
|
||||
}
|
||||
|
||||
if (_keyPressFrames > 0 && !Input.GetKey(KeyCode.Alpha7) && !InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService))
|
||||
if (_keyPressFrames != 60) return;
|
||||
MelonLogger.Msg("[QuickSkip] Activated");
|
||||
|
||||
var traverse = Traverse.Create(SharedInstances.ProcessDataContainer.processManager);
|
||||
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
||||
|
||||
ProcessBase processToRelease = null;
|
||||
|
||||
foreach (ProcessManager.ProcessControle process in processList)
|
||||
{
|
||||
switch (process.Process.ToString())
|
||||
{
|
||||
_keyPressFrames = 0;
|
||||
MelonLogger.Msg(SharedInstances.ProcessDataContainer.processManager.Dump());
|
||||
return;
|
||||
}
|
||||
// After login
|
||||
case "Process.ModeSelect.ModeSelectProcess":
|
||||
case "Process.LoginBonus.LoginBonusProcess":
|
||||
case "Process.RegionalSelectProcess":
|
||||
case "Process.CharacterSelectProcess":
|
||||
case "Process.TicketSelect.TicketSelectProcess":
|
||||
processToRelease = process.Process;
|
||||
break;
|
||||
|
||||
if (_keyPressFrames != 60) return;
|
||||
MelonLogger.Msg("[QuickSkip] Activated");
|
||||
|
||||
var traverse = Traverse.Create(SharedInstances.ProcessDataContainer.processManager);
|
||||
var processList = traverse.Field("_processList").GetValue<LinkedList<ProcessManager.ProcessControle>>();
|
||||
|
||||
ProcessBase processToRelease = null;
|
||||
|
||||
foreach (ProcessManager.ProcessControle process in processList)
|
||||
{
|
||||
switch (process.Process.ToString())
|
||||
{
|
||||
// After login
|
||||
case "Process.ModeSelect.ModeSelectProcess":
|
||||
case "Process.LoginBonus.LoginBonusProcess":
|
||||
case "Process.RegionalSelectProcess":
|
||||
case "Process.CharacterSelectProcess":
|
||||
case "Process.TicketSelect.TicketSelectProcess":
|
||||
processToRelease = process.Process;
|
||||
break;
|
||||
|
||||
case "Process.MusicSelectProcess":
|
||||
// Skip to save
|
||||
SoundManager.PreviewEnd();
|
||||
SoundManager.PlayBGM(Cue.BGM_COLLECTION, 2);
|
||||
SharedInstances.ProcessDataContainer.processManager.AddProcess(new FadeProcess(SharedInstances.ProcessDataContainer, process.Process, new UnlockMusicProcess(SharedInstances.ProcessDataContainer)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (processToRelease != null)
|
||||
{
|
||||
GameManager.SetMaxTrack();
|
||||
SharedInstances.ProcessDataContainer.processManager.AddProcess(new FadeProcess(SharedInstances.ProcessDataContainer, processToRelease, new MusicSelectProcess(SharedInstances.ProcessDataContainer)));
|
||||
case "Process.MusicSelectProcess":
|
||||
// Skip to save
|
||||
SoundManager.PreviewEnd();
|
||||
SoundManager.PlayBGM(Cue.BGM_COLLECTION, 2);
|
||||
SharedInstances.ProcessDataContainer.processManager.AddProcess(new FadeProcess(SharedInstances.ProcessDataContainer, process.Process, new UnlockMusicProcess(SharedInstances.ProcessDataContainer)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GameProcess), "OnUpdate")]
|
||||
public static void PostGameProcessUpdate(GameProcess __instance, Message[] ____message, ProcessDataContainer ___container)
|
||||
if (processToRelease != null)
|
||||
{
|
||||
if (InputManager.GetButtonDown(0, InputManager.ButtonSetting.Select))
|
||||
{
|
||||
var traverse = Traverse.Create(__instance);
|
||||
___container.processManager.SendMessage(____message[0]);
|
||||
Singleton<GamePlayManager>.Instance.SetSyncResult(0);
|
||||
traverse.Method("SetRelease").GetValue();
|
||||
}
|
||||
GameManager.SetMaxTrack();
|
||||
SharedInstances.ProcessDataContainer.processManager.AddProcess(new FadeProcess(SharedInstances.ProcessDataContainer, processToRelease, new MusicSelectProcess(SharedInstances.ProcessDataContainer)));
|
||||
}
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeyCode.Alpha7) || InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService))
|
||||
{
|
||||
// This is original typo in Assembly-CSharp
|
||||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||
}
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GameProcess), "OnUpdate")]
|
||||
public static void PostGameProcessUpdate(GameProcess __instance, Message[] ____message, ProcessDataContainer ___container)
|
||||
{
|
||||
if (InputManager.GetButtonDown(0, InputManager.ButtonSetting.Select))
|
||||
{
|
||||
var traverse = Traverse.Create(__instance);
|
||||
___container.processManager.SendMessage(____message[0]);
|
||||
Singleton<GamePlayManager>.Instance.SetSyncResult(0);
|
||||
traverse.Method("SetRelease").GetValue();
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeyCode.Alpha7) || InputManager.GetSystemInputPush(InputManager.SystemButtonSetting.ButtonService) && GameInfo.GameVersion >= 23000)
|
||||
{
|
||||
// This is original typo in Assembly-CSharp
|
||||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoCustomPatch(HarmonyLib.Harmony h)
|
||||
{
|
||||
if (GameInfo.GameVersion < 23000) return;
|
||||
h.PatchAll(typeof(FestivalAndLaterQuickRetryPatch));
|
||||
}
|
||||
|
||||
private class FestivalAndLaterQuickRetryPatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(QuickRetry), "IsQuickRetryEnable")]
|
||||
public static bool OnQuickRetryIsQuickRetryEnable(ref bool __result)
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using MAI2System;
|
||||
|
||||
namespace AquaMai.Utils;
|
||||
|
||||
public class GameInfo
|
||||
{
|
||||
public static uint GetGameVersion()
|
||||
{
|
||||
return (uint) typeof(ConstParameter).GetField("NowGameVersion", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).GetValue(null);
|
||||
}
|
||||
|
||||
public static string GetGameId()
|
||||
{
|
||||
return typeof(ConstParameter).GetField("GameIDStr", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).GetValue(null) as string;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue