@@ -236,6 +236,23 @@ protected List<String> serialiseCameraAngle(VirtualCameraAngle subticks) {
236
236
return out ;
237
237
}
238
238
239
+ @ Override
240
+ protected String serialiseFileCommandsInline (List <PlaybackFileCommand > fileCommands ) {
241
+ if (fileCommands == null ) {
242
+ return null ;
243
+ }
244
+ List <String > serialisedCommands = new ArrayList <>();
245
+ for (PlaybackFileCommand command : fileCommands ) {
246
+ if ("hud" .equals (command .getName ())) {
247
+ serialisedCommands .add (String .format ("$hud %s" , command .getArgs ()[0 ].equals ("true" ) ? "on" : "off" ));
248
+ }
249
+ if ("label" .equals (command .getName ())) {
250
+ serialisedCommands .add (String .format ("$info %s" , command .getArgs ().length == 0 ? "off" : String .join (" " , command .getArgs ())));
251
+ }
252
+ }
253
+ return String .join (" " , serialisedCommands );
254
+ }
255
+
239
256
@ Override
240
257
protected String serialiseFileCommandsEndline (List <PlaybackFileCommand > fileCommands ) {
241
258
if (fileCommands == null ) {
@@ -320,6 +337,32 @@ protected String splitInputRegex() {
320
337
return "^\\ d+\\ |(.*?)\\ |(.*?)\\ |(\\ S*)~&" ;
321
338
}
322
339
340
+ @ Override
341
+ protected String deserialiseFileCommandsInline (String comment , List <PlaybackFileCommand > deserialisedFileCommands ) {
342
+ Matcher matcher = extract ("\\ $(.+?) (.+?)" , comment );
343
+
344
+ // Iterate through all file commands and add each to the list
345
+ while (matcher .find ()) {
346
+ String name = matcher .group (1 );
347
+ String [] args = matcher .group (2 ).split (" " );
348
+
349
+ if ("hud" .equals (name )) {
350
+ args [0 ] = "on" .equals (args [0 ]) ? "true" : "false" ;
351
+ } else if ("info" .equals (name )) {
352
+ name = "label" ;
353
+ args [0 ] = "off" .equals (args [0 ]) ? "" : args [0 ];
354
+ }
355
+
356
+ if (processExtensions )
357
+ deserialisedFileCommands .add (new PlaybackFileCommand (name , args ));
358
+
359
+ comment = matcher .replaceFirst ("" );
360
+ matcher .reset (comment );
361
+ }
362
+
363
+ return comment ;
364
+ }
365
+
323
366
@ Override
324
367
protected String deserialiseFileCommandsEndline (String comment , List <PlaybackFileCommand > deserialisedFileCommands ) {
325
368
Matcher matcher = extract ("Monitoring:(.+)" , comment );
0 commit comments