mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -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
|
// Updates for blocks that have new menus (e.g. in Looks)
|
||||||
if (oldOpcode === 'comeToFront') {
|
switch (oldOpcode) {
|
||||||
|
case 'comeToFront':
|
||||||
activeBlock.fields.FRONT_BACK = {
|
activeBlock.fields.FRONT_BACK = {
|
||||||
name: 'FRONT_BACK',
|
name: 'FRONT_BACK',
|
||||||
value: 'front'
|
value: 'front'
|
||||||
};
|
};
|
||||||
} else if (oldOpcode === 'goBackByLayers:') {
|
break;
|
||||||
|
case 'goBackByLayers:':
|
||||||
activeBlock.fields.FORWARD_BACKWARD = {
|
activeBlock.fields.FORWARD_BACKWARD = {
|
||||||
name: 'FORWARD_BACKWARD',
|
name: 'FORWARD_BACKWARD',
|
||||||
value: '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.
|
// Special cases to generate mutations.
|
||||||
|
|
|
@ -360,12 +360,12 @@ const specMap = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'costumeIndex': {
|
'costumeIndex': {
|
||||||
opcode: 'looks_costumeorder',
|
opcode: 'looks_costumenumbername',
|
||||||
argMap: [
|
argMap: [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'sceneName': {
|
'sceneName': {
|
||||||
opcode: 'looks_backdropname',
|
opcode: 'looks_backdropnumbername',
|
||||||
argMap: [
|
argMap: [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -390,7 +390,7 @@ const specMap = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'backgroundIndex': {
|
'backgroundIndex': {
|
||||||
opcode: 'looks_backdroporder',
|
opcode: 'looks_backdropnumbername',
|
||||||
argMap: [
|
argMap: [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue