mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix import of current day of week block from sb2.
This commit is contained in:
parent
0e7eae98d5
commit
7d1226458f
1 changed files with 5 additions and 0 deletions
|
@ -297,6 +297,7 @@ const parseMonitorObject = (object, runtime, targets, extensions) => {
|
||||||
} else if (object.cmd === 'contentsOfList:') {
|
} else if (object.cmd === 'contentsOfList:') {
|
||||||
block.id = getVariableId(object.param, Variable.LIST_TYPE);
|
block.id = getVariableId(object.param, Variable.LIST_TYPE);
|
||||||
} else if (runtime.monitorBlockInfo.hasOwnProperty(block.opcode)) {
|
} else if (runtime.monitorBlockInfo.hasOwnProperty(block.opcode)) {
|
||||||
|
if (object.param === 'day of week') object.param = 'DAYOFWEEK';
|
||||||
block.id = runtime.monitorBlockInfo[block.opcode].getId(target.id, [object.param]);
|
block.id = runtime.monitorBlockInfo[block.opcode].getId(target.id, [object.param]);
|
||||||
} else {
|
} else {
|
||||||
// If the opcode can't be found in the runtime monitorBlockInfo,
|
// If the opcode can't be found in the runtime monitorBlockInfo,
|
||||||
|
@ -1028,6 +1029,10 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
||||||
value: providedArg
|
value: providedArg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (expectedArg.fieldName === 'CURRENTMENU' && providedArg === 'day of week') {
|
||||||
|
activeBlock.fields[expectedArg.fieldName].value = 'DAYOFWEEK';
|
||||||
|
}
|
||||||
|
|
||||||
if (expectedArg.fieldName === 'VARIABLE') {
|
if (expectedArg.fieldName === 'VARIABLE') {
|
||||||
// Add `id` property to variable fields
|
// Add `id` property to variable fields
|
||||||
activeBlock.fields[expectedArg.fieldName].id = getVariableId(providedArg, Variable.SCALAR_TYPE);
|
activeBlock.fields[expectedArg.fieldName].id = getVariableId(providedArg, Variable.SCALAR_TYPE);
|
||||||
|
|
Loading…
Reference in a new issue