@@ -42,13 +42,13 @@ static IEnumerable<CodeInstruction> Transpiler1(IEnumerable<CodeInstruction> ins
4242 codes . Insert ( i + 2 , new CodeInstruction ( OpCodes . Ldc_I4_1 ) ) ;
4343
4444 patched = true ;
45- MelonLoader . MelonLogger . Msg ( "[SkipBoardNoCheck ] 修补 BoardCtrl15070_4._md_initBoard_GetBoardInfo 方法成功" ) ;
45+ MelonLoader . MelonLogger . Msg ( "[OldCabLightBoardSupport ] 修补 BoardCtrl15070_4._md_initBoard_GetBoardInfo 方法成功" ) ;
4646 break ;
4747 }
4848 }
4949 if ( ! patched )
5050 {
51- MelonLoader . MelonLogger . Warning ( "[SkipBoardNoCheck ] 未找到需要修补的代码位置:BoardCtrl15070_4._md_initBoard_GetBoardInfo" ) ;
51+ MelonLoader . MelonLogger . Warning ( "[OldCabLightBoardSupport ] 未找到需要修补的代码位置:BoardCtrl15070_4._md_initBoard_GetBoardInfo" ) ;
5252 }
5353 return codes ;
5454 }
@@ -73,13 +73,13 @@ static IEnumerable<CodeInstruction> Transpiler2(IEnumerable<CodeInstruction> ins
7373 codes . Insert ( i + 2 , new CodeInstruction ( OpCodes . Ldc_I4_1 ) ) ;
7474
7575 patched = true ;
76- MelonLoader . MelonLogger . Msg ( "[SkipBoardNoCheck ] 修补 Bd15070_4Control.IsNeedFirmUpdate 方法成功" ) ;
76+ MelonLoader . MelonLogger . Msg ( "[OldCabLightBoardSupport ] 修补 Bd15070_4Control.IsNeedFirmUpdate 方法成功" ) ;
7777 break ;
7878 }
7979 }
8080 if ( ! patched )
8181 {
82- MelonLoader . MelonLogger . Warning ( "[SkipBoardNoCheck ] 未找到需要修补的代码位置:Bd15070_4Control.IsNeedFirmUpdate" ) ;
82+ MelonLoader . MelonLogger . Warning ( "[OldCabLightBoardSupport ] 未找到需要修补的代码位置:Bd15070_4Control.IsNeedFirmUpdate" ) ;
8383 }
8484 return codes ;
8585 }
@@ -106,15 +106,15 @@ static OldCabLightBoardSupport()
106106
107107 if ( _controlField == null )
108108 {
109- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] Failed to cache _control field" ) ;
109+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] Failed to cache _control field" ) ;
110110 }
111111 if ( _setLedGs8BitCommandField == null )
112112 {
113- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] Failed to cache SetLedGs8BitCommand field" ) ;
113+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] Failed to cache SetLedGs8BitCommand field" ) ;
114114 }
115115 if ( _sendForceCommandMethod == null )
116116 {
117- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] Failed to cache SendForceCommand method" ) ;
117+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] Failed to cache SendForceCommand method" ) ;
118118 }
119119 }
120120
@@ -138,11 +138,11 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
138138 }
139139 if ( patchedNum == 2 )
140140 {
141- MelonLoader . MelonLogger . Msg ( "[SkipBoardNoCheck ] Extended Bd15070_4IF._switchParam size and its initialize for loop from 8 to 10!" ) ;
141+ MelonLoader . MelonLogger . Msg ( "[OldCabLightBoardSupport ] Extended Bd15070_4IF._switchParam size and its initialize for loop from 8 to 10!" ) ;
142142 }
143143 else
144144 {
145- MelonLoader . MelonLogger . Warning ( $ "[SkipBoardNoCheck ] Bd15070_4IF._switchParam patching failed (patched { patchedNum } /2)") ;
145+ MelonLoader . MelonLogger . Warning ( $ "[OldCabLightBoardSupport ] Bd15070_4IF._switchParam patching failed (patched { patchedNum } /2)") ;
146146 }
147147 return codes ;
148148 }
@@ -157,7 +157,7 @@ static MethodBase TargetMethod()
157157 var type = typeof ( IO . Jvs ) . GetNestedType ( "JvsOutputPwm" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
158158 if ( type == null )
159159 {
160- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] JvsOutputPwm type not found" ) ;
160+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] JvsOutputPwm type not found" ) ;
161161 return null ;
162162 }
163163 return type . GetMethod ( "Set" , new [ ] { typeof ( byte ) , typeof ( Color32 ) , typeof ( bool ) } ) ;
@@ -177,15 +177,15 @@ private static void RedirectToButtonLedMechanism(byte playerIndex, Color32 color
177177 // Check if MechaManager is initialized
178178 if ( ! IO . MechaManager . IsInitialized )
179179 {
180- MelonLoader . MelonLogger . Warning ( "[SkipBoardNoCheck ] MechaManager not initialized, cannot set woofer LED" ) ;
180+ MelonLoader . MelonLogger . Warning ( "[OldCabLightBoardSupport ] MechaManager not initialized, cannot set woofer LED" ) ;
181181 return ;
182182 }
183183
184184 // Get the LED interface for the player
185185 var ledIf = IO . MechaManager . LedIf ;
186186 if ( ledIf == null || playerIndex >= ledIf . Length || ledIf [ playerIndex ] == null )
187187 {
188- MelonLoader . MelonLogger . Warning ( $ "[SkipBoardNoCheck ] LED interface not available for player { playerIndex } ") ;
188+ MelonLoader . MelonLogger . Warning ( $ "[OldCabLightBoardSupport ] LED interface not available for player { playerIndex } ") ;
189189 return ;
190190 }
191191
@@ -195,72 +195,72 @@ private static void RedirectToButtonLedMechanism(byte playerIndex, Color32 color
195195 {
196196 if ( _controlField == null )
197197 {
198- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] _control field not found in Bd15070_4IF" ) ;
198+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] _control field not found in Bd15070_4IF" ) ;
199199 return ;
200200 }
201201
202202 var control = _controlField . GetValue ( ledIf [ playerIndex ] ) ;
203203 if ( control == null )
204204 {
205- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] Control object is null" ) ;
205+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] Control object is null" ) ;
206206 return ;
207207 }
208208
209209 if ( _boardField == null )
210210 {
211- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] _board field not found in Bd15070_4Control" ) ;
211+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] _board field not found in Bd15070_4Control" ) ;
212212 return ;
213213 }
214214
215215 var board = _boardField . GetValue ( control ) ;
216216 if ( board == null )
217217 {
218- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] Board object is null" ) ;
218+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] Board object is null" ) ;
219219 return ;
220220 }
221221
222222 if ( _ctrlField == null )
223223 {
224- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] _ctrl field not found in Board15070_4" ) ;
224+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] _ctrl field not found in Board15070_4" ) ;
225225 return ;
226226 }
227227
228228 var boardCtrl = _ctrlField . GetValue ( board ) ;
229229 if ( boardCtrl == null )
230230 {
231- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] BoardCtrl object is null" ) ;
231+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] BoardCtrl object is null" ) ;
232232 return ;
233233 }
234234
235235 if ( _ioCtrlField == null )
236236 {
237- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] _ioCtrl field not found in BoardCtrl15070_4" ) ;
237+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] _ioCtrl field not found in BoardCtrl15070_4" ) ;
238238 return ;
239239 }
240240
241241 var ioCtrl = _ioCtrlField . GetValue ( boardCtrl ) ;
242242 if ( ioCtrl == null )
243243 {
244- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] IoCtrl object is null" ) ;
244+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] IoCtrl object is null" ) ;
245245 return ;
246246 }
247247
248248 if ( _setLedGs8BitCommandField == null )
249249 {
250- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] SetLedGs8BitCommand field not found in IoCtrl" ) ;
250+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] SetLedGs8BitCommand field not found in IoCtrl" ) ;
251251 return ;
252252 }
253253
254254 var setLedGs8BitCommandArray = _setLedGs8BitCommandField . GetValue ( ioCtrl ) as SetLedGs8BitCommand [ ] ;
255- if ( setLedGs8BitCommandArray == null || setLedGs8BitCommandArray . Length <= 8 )
255+ if ( setLedGs8BitCommandArray == null || setLedGs8BitCommandArray . Length <= 9 )
256256 {
257- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] SetLedGs8BitCommand array is null or too small" ) ;
257+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] SetLedGs8BitCommand array is null or too small" ) ;
258258 return ;
259259 }
260260
261261 if ( _sendForceCommandMethod == null )
262262 {
263- MelonLoader . MelonLogger . Error ( "[SkipBoardNoCheck ] SendForceCommand method not found in BoardCtrl15070_4" ) ;
263+ MelonLoader . MelonLogger . Error ( "[OldCabLightBoardSupport ] SendForceCommand method not found in BoardCtrl15070_4" ) ;
264264 return ;
265265 }
266266
@@ -279,12 +279,12 @@ private static void RedirectToButtonLedMechanism(byte playerIndex, Color32 color
279279 }
280280 else
281281 {
282- MelonLoader . MelonLogger . Warning ( "[SkipBoardNoCheck ] _gsUpdate field not found, LED may not update" ) ;
282+ MelonLoader . MelonLogger . Warning ( "[OldCabLightBoardSupport ] _gsUpdate field not found, LED may not update" ) ;
283283 }
284284 }
285285 catch ( System . Exception ex )
286286 {
287- MelonLoader . MelonLogger . Error ( $ "[SkipBoardNoCheck ] Failed to set woofer LED: { ex . Message } \n { ex . StackTrace } ") ;
287+ MelonLoader . MelonLogger . Error ( $ "[OldCabLightBoardSupport ] Failed to set woofer LED: { ex . Message } \n { ex . StackTrace } ") ;
288288 }
289289 }
290290}
0 commit comments