[+] Light Board COM Port Customize (#97)

For 837-15070-02/04, change COM21 23 to COM5 7 can support maimai FiNALE.
This commit is contained in:
村場 榞彦 2025-12-11 13:04:53 +08:00 committed by GitHub
parent a52bfd4596
commit 5676fd3eb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,47 @@
using AquaMai.Config.Attributes;
using HarmonyLib;
using IO;
namespace AquaMai.Mods.GameSystem;
[ConfigSection(
name: "灯光串口",
en: """
Adjust the port of the Light Boards' serial port, default value is COM21 COM23.
Requires configuration by Device Manager. If you are unsure, don't use it.
""",
zh: """
COM21 COM23
使使
""")]
public class LightBoardPort
{
[ConfigEntry(
en: "Port for 1P LED.",
name: "1P灯光串口号")]
private static readonly string portName_1PLED = "COM21";
[ConfigEntry(
en: "Port for 2P LED.",
name: "2P灯光串口号")]
private static readonly string portName_2PLED = "COM23";
[HarmonyPatch]
public static class MechaManagerPatch
{
[HarmonyPatch(typeof(MechaManager), "Initialize")]
[HarmonyPrefix]
static bool PrefixInitialize(MechaManager.InitParam initParam)
{
if (initParam != null &&
initParam.LedParam != null &&
initParam.LedParam.Length > 0)
{
initParam.LedParam[0].ComName = portName_1PLED;
initParam.LedParam[1].ComName = portName_2PLED;
}
return true;
}
}
}

View File

@ -88,6 +88,7 @@
高级设置:
- Fancy.HideMask
- GameSystem.LightBoardPort
- GameSystem.TouchPanelPort
- GameSystem.TouchPanelBaudRate
- GameSystem.SkipBoardNoCheck