add add monitor action

This commit is contained in:
DD Liu 2017-05-10 17:00:08 -04:00
parent b1355c6b0b
commit b2e0a632e3
4 changed files with 35 additions and 9 deletions
src/engine

View file

@ -87,7 +87,6 @@ const execute = function (sequencer, thread) {
} else {
// In a non-hat, report the value visually if necessary if
// at the top of the thread stack.
if (typeof resolvedValue !== 'undefined' && thread.atStackTop()) {
if (thread.showVisualReport) {
runtime.visualReport(currentBlockId, resolvedValue);
@ -95,15 +94,8 @@ const execute = function (sequencer, thread) {
if (thread.updateMonitor) {
runtime.updateMonitors([{
// @todo(dd) this will collide if multiple sprites use same block
id: currentBlockId,
category: 'data',
// @todo(dd) how to handle translation here?
label: blockContainer.getOpcode(blockContainer.getBlock(currentBlockId)),
value: String(resolvedValue),
x: 0,
// @todo(dd) place below the last monitor instead
y: 0
value: String(resolvedValue)
}]);
}
}