Files
AquaDX/AquaMai/AquaMai.Mods/GameSettings/JudgeAdjust.cs
Menci 37044dae01 [RF] AquaMai configuration refactor (#82)
更新了配置文件格式,原有的配置文件将被自动无缝迁移,详情请见新的配置文件中的注释(例外:`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.
2024-11-25 01:25:19 +08:00

51 lines
1.3 KiB
C#

using System.Threading;
using AquaMai.Config.Attributes;
using HarmonyLib;
using IO;
using Manager.UserDatas;
namespace AquaMai.Mods.GameSettings;
[ConfigSection(
en: "Globally adjust A/B judgment (unit same as in-game options) or increase touch delay.",
zh: "全局调整 A/B 判(单位和游戏里一样)或增加触摸延迟")]
public class JudgeAdjust
{
[ConfigEntry(
en: "Adjust A judgment.",
zh: "调整 A 判")]
private static readonly double a = 0;
[ConfigEntry(
en: "Adjust B judgment.",
zh: "调整 B 判")]
private static readonly double b = 0;
[ConfigEntry(
en: "Increase touch delay.",
zh: "增加触摸延迟")]
private static readonly int touchDelay = 0;
[HarmonyPostfix]
[HarmonyPatch(typeof(UserOption), "GetAdjustMSec")]
public static void GetAdjustMSec(ref float __result)
{
__result += (float)(a * 16.666666d);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UserOption), "GetJudgeTimingFrame")]
public static void GetJudgeTimingFrame(ref float __result)
{
__result += (float)b;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(NewTouchPanel), "Recv")]
public static void NewTouchPanelRecv()
{
if (touchDelay <= 0) return;
Thread.Sleep(touchDelay);
}
}