Use videoSensing extension for sb2 senseVideoMotion

This commit is contained in:
Michael "Z" Goddard 2018-03-26 15:32:05 -04:00
parent c206dc3241
commit f3d19dc1a1
No known key found for this signature in database
GPG key ID: 762CD40DD5349872
2 changed files with 46 additions and 15 deletions

View file

@ -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 = '';

View file

@ -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: [