mse.mscript and mse.console for mscript editor features.

This commit is contained in:
mmcwilliams 2018-03-05 13:27:00 -05:00
parent a6becef4cc
commit 749719e477
3 changed files with 14 additions and 4 deletions

View File

@ -2493,6 +2493,7 @@ const seq = require('./lib/ui/seq.js');
const cmd = require('./lib/ui/cmd.js');
const log = require('./lib/ui/log.js');
const devices = require('./lib/ui/devices.js');
const mse = require('./lib/ui/mscript.js');
const mscript = require('./lib/mscript');
@ -2539,8 +2540,8 @@ function init () {
'use strict';
nav.init();
gui.grid.init();
gui.mscript.init();
gui.console.init();
mse.mscript.init();
mse.console.init();
log.init();
devices.init();
light.init();

View File

@ -39,6 +39,7 @@ mse.mscript.eval = function () {
const data = mse.mscript.editor.getValue();
const output = mscript.interpret(data, function (output) {
console.dir(output);
mse.console.print(JSON.stringify(output, null, '\t'))
});
};
@ -88,4 +89,12 @@ mse.console.newLine = function () {
mse.console.elem.val(current);
};
module.exports = mse
mse.console.print = function (str) {
'use strict'
let current = mse.console.elem.val();
current += '> ';
current += str;
mse.console.elem.val(current);
};
module.exports = mse;

View File

@ -34,7 +34,7 @@ nav.change = function (id) {
light.rgb.set(light.color);
}
} else if (id === 'script') {
gui.mscript.open();
mse.mscript.open();
}
};