VM changes for the sensing_of block. This handles lists properly (by ignoring them like Scratch2 and makes the attribute menu update based on what was chosen in the target menu.

This commit is contained in:
picklesrus 2018-11-20 16:32:08 -05:00
parent 631d44a061
commit f214d3a191
5 changed files with 59 additions and 5 deletions
src/engine

View file

@ -567,6 +567,16 @@ class Blocks {
if (!optRuntime){
break;
}
// The selected item in the sensing of block menu needs to change based on the
// selected target. Set it to the first item in the menu list.
if (block.opcode === 'sensing_of_object_menu') {
if (block.fields.OBJECT.value === '_stage_') {
this._blocks[block.parent].fields.PROPERTY.value = 'backdrop #';
} else {
this._blocks[block.parent].fields.PROPERTY.value = 'x position';
}
optRuntime.requestBlocksUpdate();
}
const flyoutBlock = block.shadow && block.parent ? this._blocks[block.parent] : block;
if (flyoutBlock.isMonitored) {