When there is a loop specified in the gui, write that into the mscript that gets generated from the grid

This commit is contained in:
mmcw-dev 2018-06-24 12:45:14 -04:00
parent 4c98b5c828
commit d306bc915c
1 changed files with 12 additions and 0 deletions

View File

@ -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) {