File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ namespace microcode {
9494 if ( this . programChanged ) {
9595 this . programChanged = false
9696 this . app . save ( SAVESLOT_AUTO , this . progdef . toBuffer ( ) )
97+ console . log ( this . progdef . toString ( ) )
9798 }
9899 // runProgram(this.progdef)
99100 }
Original file line number Diff line number Diff line change @@ -279,8 +279,19 @@ namespace microcode {
279279 return defn
280280 }
281281
282+ // TODO: deal with field editors
282283 public toString ( ) {
283- return ""
284+ const toToken = ( tile : Tile ) =>
285+ resolveTooltip ( "T" + getTid ( tile ) ) . replaceAll ( " " , "-" )
286+ return toToken ( this . sensor ) +
287+ " " +
288+ this . filters . map ( toToken ) . join ( " " ) +
289+ " " +
290+ this . actuators . length
291+ ? toToken ( this . actuators [ 0 ] ) +
292+ " " +
293+ this . modifiers . map ( toToken ) . join ( " " )
294+ : ""
284295 }
285296 }
286297
@@ -335,7 +346,8 @@ namespace microcode {
335346 }
336347
337348 public toString ( ) {
338- return ""
349+ const res = this . rules . map ( rule => rule . toString ( ) )
350+ return res . join ( "\n" )
339351 }
340352 }
341353
You can’t perform that action at this time.
0 commit comments