mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Use videoSensing extension for sb2 senseVideoMotion
This commit is contained in:
parent
c206dc3241
commit
f3d19dc1a1
2 changed files with 46 additions and 15 deletions
|
@ -562,6 +562,22 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
||||||
if (shadowObscured) {
|
if (shadowObscured) {
|
||||||
fieldValue = 1;
|
fieldValue = 1;
|
||||||
}
|
}
|
||||||
|
} else if (expectedArg.inputOp === 'videoSensing.menu.MOTION_DIRECTION') {
|
||||||
|
if (shadowObscured) {
|
||||||
|
fieldValue = 1;
|
||||||
|
} else if (fieldValue === 'motion') {
|
||||||
|
fieldValue = 1;
|
||||||
|
} else if (fieldValue === 'direction') {
|
||||||
|
fieldValue = 2;
|
||||||
|
}
|
||||||
|
} else if (expectedArg.inputOp === 'videoSensing.menu.STAGE_SPRITE') {
|
||||||
|
if (shadowObscured) {
|
||||||
|
fieldValue = 2;
|
||||||
|
} else if (fieldValue === 'Stage') {
|
||||||
|
fieldValue = 1;
|
||||||
|
} else if (fieldValue === 'this sprite') {
|
||||||
|
fieldValue = 2;
|
||||||
|
}
|
||||||
} else if (shadowObscured) {
|
} else if (shadowObscured) {
|
||||||
// Filled drop-down menu.
|
// Filled drop-down menu.
|
||||||
fieldValue = '';
|
fieldValue = '';
|
||||||
|
|
|
@ -609,6 +609,21 @@ const specMap = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
'senseVideoMotion': {
|
||||||
|
opcode: 'videoSensing.videoOn',
|
||||||
|
argMap: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
inputOp: 'videoSensing.menu.MOTION_DIRECTION',
|
||||||
|
inputName: 'MOTION_DIRECTION'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
inputOp: 'videoSensing.menu.STAGE_SPRITE',
|
||||||
|
inputName: 'STAGE_SPRITE'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
'whenGreenFlag': {
|
'whenGreenFlag': {
|
||||||
opcode: 'event_whenflagclicked',
|
opcode: 'event_whenflagclicked',
|
||||||
argMap: [
|
argMap: [
|
||||||
|
@ -905,21 +920,21 @@ const specMap = {
|
||||||
argMap: [
|
argMap: [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'senseVideoMotion': {
|
// 'senseVideoMotion': {
|
||||||
opcode: 'sensing_videoon',
|
// opcode: 'sensing_videoon',
|
||||||
argMap: [
|
// argMap: [
|
||||||
{
|
// {
|
||||||
type: 'input',
|
// type: 'input',
|
||||||
inputOp: 'sensing_videoonmenuone',
|
// inputOp: 'sensing_videoonmenuone',
|
||||||
inputName: 'VIDEOONMENU1'
|
// inputName: 'VIDEOONMENU1'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
type: 'input',
|
// type: 'input',
|
||||||
inputOp: 'sensing_videoonmenutwo',
|
// inputOp: 'sensing_videoonmenutwo',
|
||||||
inputName: 'VIDEOONMENU2'
|
// inputName: 'VIDEOONMENU2'
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
'setVideoState': {
|
'setVideoState': {
|
||||||
opcode: 'sensing_videotoggle',
|
opcode: 'sensing_videotoggle',
|
||||||
argMap: [
|
argMap: [
|
||||||
|
|
Loading…
Reference in a new issue