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