Update specmap and sb2 import to add new fields to layering blocks.

This commit is contained in:
Paul Kaplan 2017-12-28 14:52:06 -05:00
parent fe51bd6450
commit 477ef531ba
3 changed files with 21 additions and 3 deletions
src/serialization

View file

@ -601,6 +601,20 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
}
}
}
// Updated layering blocks
if (oldOpcode === 'comeToFront') {
activeBlock.fields.FRONT_BACK = {
name: 'FRONT_BACK',
value: 'front'
};
} else if (oldOpcode === 'goBackByLayers:') {
activeBlock.fields.FORWARD_BACKWARD = {
name: 'FORWARD_BACKWARD',
value: 'backward'
};
}
// Special cases to generate mutations.
if (oldOpcode === 'stopScripts') {
// Mutation for stop block: if the argument is 'other scripts',

View file

@ -345,12 +345,12 @@ const specMap = {
]
},
'comeToFront': {
opcode: 'looks_gotofront',
opcode: 'looks_gotofrontback',
argMap: [
]
},
'goBackByLayers:': {
opcode: 'looks_gobacklayers',
opcode: 'looks_goforwardbackwardlayers',
argMap: [
{
type: 'input',