mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -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) {
|
||||
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) {
|
||||
// Filled drop-down menu.
|
||||
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': {
|
||||
opcode: 'event_whenflagclicked',
|
||||
argMap: [
|
||||
|
@ -905,21 +920,21 @@ const specMap = {
|
|||
argMap: [
|
||||
]
|
||||
},
|
||||
'senseVideoMotion': {
|
||||
opcode: 'sensing_videoon',
|
||||
argMap: [
|
||||
{
|
||||
type: 'input',
|
||||
inputOp: 'sensing_videoonmenuone',
|
||||
inputName: 'VIDEOONMENU1'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
inputOp: 'sensing_videoonmenutwo',
|
||||
inputName: 'VIDEOONMENU2'
|
||||
}
|
||||
]
|
||||
},
|
||||
// 'senseVideoMotion': {
|
||||
// opcode: 'sensing_videoon',
|
||||
// argMap: [
|
||||
// {
|
||||
// type: 'input',
|
||||
// inputOp: 'sensing_videoonmenuone',
|
||||
// inputName: 'VIDEOONMENU1'
|
||||
// },
|
||||
// {
|
||||
// type: 'input',
|
||||
// inputOp: 'sensing_videoonmenutwo',
|
||||
// inputName: 'VIDEOONMENU2'
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
'setVideoState': {
|
||||
opcode: 'sensing_videotoggle',
|
||||
argMap: [
|
||||
|
|
Loading…
Reference in a new issue