mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Transform sb2 looks reporters to new menu blocks
This commit is contained in:
parent
d6f1c48c08
commit
63be5bc487
2 changed files with 27 additions and 6 deletions
|
@ -602,17 +602,38 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
|||
}
|
||||
}
|
||||
|
||||
// Updated layering blocks
|
||||
if (oldOpcode === 'comeToFront') {
|
||||
// Updates for blocks that have new menus (e.g. in Looks)
|
||||
switch (oldOpcode) {
|
||||
case 'comeToFront':
|
||||
activeBlock.fields.FRONT_BACK = {
|
||||
name: 'FRONT_BACK',
|
||||
value: 'front'
|
||||
};
|
||||
} else if (oldOpcode === 'goBackByLayers:') {
|
||||
break;
|
||||
case 'goBackByLayers:':
|
||||
activeBlock.fields.FORWARD_BACKWARD = {
|
||||
name: 'FORWARD_BACKWARD',
|
||||
value: 'backward'
|
||||
};
|
||||
break;
|
||||
case 'backgroundIndex':
|
||||
activeBlock.fields.NUMBER_NAME = {
|
||||
name: 'NUMBER_NAME',
|
||||
value: 'number'
|
||||
};
|
||||
break;
|
||||
case 'sceneName':
|
||||
activeBlock.fields.NUMBER_NAME = {
|
||||
name: 'NUMBER_NAME',
|
||||
value: 'name'
|
||||
};
|
||||
break;
|
||||
case 'costumeIndex':
|
||||
activeBlock.fields.NUMBER_NAME = {
|
||||
name: 'NUMBER_NAME',
|
||||
value: 'number'
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
// Special cases to generate mutations.
|
||||
|
|
|
@ -360,12 +360,12 @@ const specMap = {
|
|||
]
|
||||
},
|
||||
'costumeIndex': {
|
||||
opcode: 'looks_costumeorder',
|
||||
opcode: 'looks_costumenumbername',
|
||||
argMap: [
|
||||
]
|
||||
},
|
||||
'sceneName': {
|
||||
opcode: 'looks_backdropname',
|
||||
opcode: 'looks_backdropnumbername',
|
||||
argMap: [
|
||||
]
|
||||
},
|
||||
|
@ -390,7 +390,7 @@ const specMap = {
|
|||
]
|
||||
},
|
||||
'backgroundIndex': {
|
||||
opcode: 'looks_backdroporder',
|
||||
opcode: 'looks_backdropnumbername',
|
||||
argMap: [
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue