mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-08 13:57:26 +08:00
更新了配置文件格式,原有的配置文件将被自动无缝迁移,详情请见新的配置文件中的注释(例外:`SlideJudgeTweak` 不再默认启用) 旧配置文件将被重命名备份,如果更新到此版本遇到 Bug 请联系我们 Updated configuration file schema. The old config file will be migrated automatically and seamlessly. See the comments in the new configuration file for details. (Except for `SlideJudgeTweak` is no longer enabled by default) Your old configuration file will be renamed as a backup. If you encounter any bug with this version, please contact us.
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using AquaMai.Config.Attributes;
|
||
using AquaMai.Config.Types;
|
||
using AquaMai.Core.Helpers;
|
||
using HarmonyLib;
|
||
using MAI2.Util;
|
||
using Manager;
|
||
using Process;
|
||
|
||
namespace AquaMai.Mods.UX;
|
||
|
||
[ConfigSection(
|
||
en: "One key to retry (1.30+) or skip current chart in gameplay.",
|
||
zh: "在游戏中途一键重试(1.30+)或跳过当前谱面")]
|
||
public class OneKeyRetrySkip
|
||
{
|
||
[ConfigEntry]
|
||
public static readonly KeyCodeOrName retryKey = KeyCodeOrName.Service;
|
||
|
||
[ConfigEntry]
|
||
public static readonly bool retryLongPress = false;
|
||
|
||
[ConfigEntry]
|
||
public static readonly KeyCodeOrName skipKey = KeyCodeOrName.Service;
|
||
|
||
[ConfigEntry]
|
||
public static readonly bool skipLongPress = true;
|
||
|
||
[HarmonyPostfix]
|
||
[HarmonyPatch(typeof(GameProcess), "OnUpdate")]
|
||
public static void PostGameProcessUpdate(GameProcess __instance, Message[] ____message, ProcessDataContainer ___container)
|
||
{
|
||
if (KeyListener.GetKeyDownOrLongPress(skipKey, skipLongPress))
|
||
{
|
||
var traverse = Traverse.Create(__instance);
|
||
___container.processManager.SendMessage(____message[0]);
|
||
Singleton<GamePlayManager>.Instance.SetSyncResult(0);
|
||
traverse.Method("SetRelease").GetValue();
|
||
}
|
||
|
||
if (KeyListener.GetKeyDownOrLongPress(retryKey, retryLongPress) && GameInfo.GameVersion >= 23000)
|
||
{
|
||
// This is original typo in Assembly-CSharp
|
||
Singleton<GamePlayManager>.Instance.SetQuickRetryFrag(flag: true);
|
||
}
|
||
}
|
||
}
|