mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-26 06:10:26 -04:00
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:
parent
631d44a061
commit
f214d3a191
5 changed files with 59 additions and 5 deletions
src/engine
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue