File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 8888
8989高级设置 :
9090 - Fancy.HideMask
91+ - GameSystem.LightBoardPort
9192 - GameSystem.TouchPanelPort
9293 - GameSystem.TouchPanelBaudRate
9394 - GameSystem.SkipBoardNoCheck
You can’t perform that action at this time.
0 commit comments