Skip to content

Commit 73943bb

Browse files
committed
Merge branch 'main' of github.com:MewoLab/AquaMai
2 parents a2eab0f + 5676fd3 commit 73943bb

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using AquaMai.Config.Attributes;
2+
using HarmonyLib;
3+
using IO;
4+
5+
namespace AquaMai.Mods.GameSystem;
6+
7+
[ConfigSection(
8+
name: "灯光串口",
9+
en: """
10+
Adjust the port of the Light Boards' serial port, default value is COM21 COM23.
11+
Requires configuration by Device Manager. If you are unsure, don't use it.
12+
""",
13+
zh: """
14+
调整灯板串口号,默认值 COM21 COM23
15+
需要设备管理器配置,如果你不清楚你是否可以使用,请不要使用
16+
""")]
17+
public class LightBoardPort
18+
{
19+
[ConfigEntry(
20+
en: "Port for 1P LED.",
21+
name: "1P灯光串口号")]
22+
private static readonly string portName_1PLED = "COM21";
23+
24+
[ConfigEntry(
25+
en: "Port for 2P LED.",
26+
name: "2P灯光串口号")]
27+
private static readonly string portName_2PLED = "COM23";
28+
[HarmonyPatch]
29+
public static class MechaManagerPatch
30+
{
31+
[HarmonyPatch(typeof(MechaManager), "Initialize")]
32+
[HarmonyPrefix]
33+
static bool PrefixInitialize(MechaManager.InitParam initParam)
34+
{
35+
36+
if (initParam != null &&
37+
initParam.LedParam != null &&
38+
initParam.LedParam.Length > 0)
39+
{
40+
initParam.LedParam[0].ComName = portName_1PLED;
41+
initParam.LedParam[1].ComName = portName_2PLED;
42+
}
43+
44+
return true;
45+
}
46+
}
47+
}

AquaMai/configSort.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888

8989
高级设置:
9090
- Fancy.HideMask
91+
- GameSystem.LightBoardPort
9192
- GameSystem.TouchPanelPort
9293
- GameSystem.TouchPanelBaudRate
9394
- GameSystem.SkipBoardNoCheck

0 commit comments

Comments
 (0)