Removed the "undefined" lines from occurring. Code is a mess, but won't break anything else... for now.

This commit is contained in:
mmcwilliams 2019-05-28 14:10:00 -04:00
parent ce226a7f86
commit 02ca59ea7e
1 changed files with 5 additions and 5 deletions

View File

@ -37,8 +37,9 @@ mse.mscript.fromSequence = function () {
let cont; let cont;
let cmd; let cmd;
//str = seq.grid.map(step => { return step.cmd }).join('\n'); //quick hack //str = seq.grid.map(step => { return step.cmd }).join('\n'); //quick hack
console.dir(seq.grid); //console.dir(seq.grid);
for (let step of seq.grid) { for (let step of seq.grid) {
if (!step || !step.cmd) continue;
cmd = step.cmd; cmd = step.cmd;
if (tmp.length > 0 && tmp[tmp.length - 1].cmd === cmd) { if (tmp.length > 0 && tmp[tmp.length - 1].cmd === cmd) {
tmp[tmp.length - 1].num++; tmp[tmp.length - 1].num++;
@ -49,13 +50,13 @@ mse.mscript.fromSequence = function () {
tmp = tmp.map(line => { tmp = tmp.map(line => {
return `${line.cmd} ${line.num}` return `${line.cmd} ${line.num}`
}) })
//console.dir(tmp)
if (seq.loop > 1) { if (seq.gridLoops > 1) {
tmp.map(line => { tmp.map(line => {
return ` ${line}`; return ` ${line}`;
}) })
tmp.reverse(); tmp.reverse();
tmp.push(`LOOP ${seq.loop}`); tmp.push(`LOOP ${seq.gridLoops}`);
tmp.reverse(); tmp.reverse();
tmp.push('END'); tmp.push('END');
} }
@ -75,7 +76,6 @@ mse.mscript.toGUI = function () {
for (let x = 0; x < mse.mscript.data.arr.length; x++) { for (let x = 0; x < mse.mscript.data.arr.length; x++) {
c = mse.mscript.data.arr[x]; c = mse.mscript.data.arr[x];
seq.set(x, c); seq.set(x, c);
console.dir(mse.mscript.data);
if (c === 'CF' || c === 'CB') { if (c === 'CF' || c === 'CB') {
if (typeof mse.mscript.data.light[x] !== 'undefined' && mse.mscript.data.light[x] !== '') { if (typeof mse.mscript.data.light[x] !== 'undefined' && mse.mscript.data.light[x] !== '') {
seq.setLight(x, mse.mscript.data.light[x]); seq.setLight(x, mse.mscript.data.light[x]);