From d306bc915c4c035745bb8a6716ee0cccc664be66 Mon Sep 17 00:00:00 2001 From: mmcw-dev Date: Sun, 24 Jun 2018 12:45:14 -0400 Subject: [PATCH] When there is a loop specified in the gui, write that into the mscript that gets generated from the grid --- app/lib/ui/mscript.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/lib/ui/mscript.js b/app/lib/ui/mscript.js index 63e93b7..9283ab1 100644 --- a/app/lib/ui/mscript.js +++ b/app/lib/ui/mscript.js @@ -47,7 +47,19 @@ mse.mscript.fromSequence = function () { tmp = tmp.map(line => { return `${line.cmd} ${line.num}` }) + + if (mcopy.loop > 1) { + tmp.map(line => { + return ` ${line}`; + }) + tmp.reverse(); + tmp.push(`LOOP ${mcopy.loop}`); + tmp.reverse(); + tmp.push('END'); + } + str = tmp.join('\n'); + nav.change('script'); cont = confirm(`Are you sure you want to over-write the current sequence?`); if (cont) {