mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-13 17:04:39 -04:00
Add stack highlighting to playground blocks.
This commit is contained in:
parent
1ab391281d
commit
690745aaf0
1 changed files with 9 additions and 1 deletions
|
@ -10,7 +10,7 @@ window.onload = function() {
|
|||
});
|
||||
window.workspace = workspace;
|
||||
|
||||
// @todo: Also bind to flyout events, block running feedback.
|
||||
// @todo: Also bind to flyout events.
|
||||
// Block events.
|
||||
workspace.addChangeListener(vm.blockListener);
|
||||
|
||||
|
@ -21,6 +21,14 @@ window.onload = function() {
|
|||
window.hljs.highlightBlock(explorer);
|
||||
});
|
||||
|
||||
// Feedback for stacks running.
|
||||
vm.runtime.on('STACK_GLOW_ON', function(blockId) {
|
||||
workspace.glowStack(blockId, true);
|
||||
});
|
||||
vm.runtime.on('STACK_GLOW_OFF', function(blockId) {
|
||||
workspace.glowStack(blockId, false);
|
||||
});
|
||||
|
||||
// Run threads
|
||||
vm.runtime.start();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue