mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 23:49:21 -04:00
Add visual reporting of top-level reporter execution
This commit is contained in:
parent
d4353458ff
commit
9c6dca8131
4 changed files with 32 additions and 0 deletions
src/engine
|
@ -69,6 +69,12 @@ Runtime.BLOCK_GLOW_ON = 'BLOCK_GLOW_ON';
|
|||
*/
|
||||
Runtime.BLOCK_GLOW_OFF = 'BLOCK_GLOW_OFF';
|
||||
|
||||
/**
|
||||
* Event name for visual value report.
|
||||
* @const {string}
|
||||
*/
|
||||
Runtime.VISUAL_REPORT = 'VISUAL_REPORT';
|
||||
|
||||
/**
|
||||
* Inherit from EventEmitter
|
||||
*/
|
||||
|
@ -218,6 +224,15 @@ Runtime.prototype.glowBlock = function (blockId, isGlowing) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Emit value for reporter to show in the blocks.
|
||||
* @param {string} blockId ID for the block.
|
||||
* @param {string} value Value to show associated with the block.
|
||||
*/
|
||||
Runtime.prototype.visualReport = function (blockId, value) {
|
||||
this.emit(Runtime.VISUAL_REPORT, blockId, String(value));
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the Target for a particular thread.
|
||||
* @param {!Thread} thread Thread to determine target for.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue