mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-08 03:24:56 -04:00
Use string enumerated values for videoSensing sensor block
This commit is contained in:
parent
044370790c
commit
8ebd659094
4 changed files with 77 additions and 64 deletions
src/serialization
|
@ -611,21 +611,13 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
|||
if (shadowObscured) {
|
||||
fieldValue = 1;
|
||||
}
|
||||
} else if (expectedArg.inputOp === 'videoSensing.menu.MOTION_DIRECTION') {
|
||||
} else if (expectedArg.inputOp === 'videoSensing.menu.ATTRIBUTE') {
|
||||
if (shadowObscured) {
|
||||
fieldValue = 1;
|
||||
} else if (fieldValue === 'motion') {
|
||||
fieldValue = 1;
|
||||
} else if (fieldValue === 'direction') {
|
||||
fieldValue = 2;
|
||||
fieldValue = 'motion';
|
||||
}
|
||||
} else if (expectedArg.inputOp === 'videoSensing.menu.STAGE_SPRITE') {
|
||||
} else if (expectedArg.inputOp === 'videoSensing.menu.SUBJECT') {
|
||||
if (shadowObscured) {
|
||||
fieldValue = 2;
|
||||
} else if (fieldValue === 'Stage') {
|
||||
fieldValue = 1;
|
||||
} else if (fieldValue === 'this sprite') {
|
||||
fieldValue = 2;
|
||||
fieldValue = 'this sprite';
|
||||
}
|
||||
} else if (expectedArg.inputOp === 'videoSensing.menu.VIDEO_STATE') {
|
||||
if (shadowObscured) {
|
||||
|
|
|
@ -614,13 +614,13 @@ const specMap = {
|
|||
argMap: [
|
||||
{
|
||||
type: 'input',
|
||||
inputOp: 'videoSensing.menu.MOTION_DIRECTION',
|
||||
inputName: 'MOTION_DIRECTION'
|
||||
inputOp: 'videoSensing.menu.ATTRIBUTE',
|
||||
inputName: 'ATTRIBUTE'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
inputOp: 'videoSensing.menu.STAGE_SPRITE',
|
||||
inputName: 'STAGE_SPRITE'
|
||||
inputOp: 'videoSensing.menu.SUBJECT',
|
||||
inputName: 'SUBJECT'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue