mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -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:') {
|
||||
block.id = getVariableId(object.param, Variable.LIST_TYPE);
|
||||
} 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]);
|
||||
} else {
|
||||
// If the opcode can't be found in the runtime monitorBlockInfo,
|
||||
|
@ -1028,6 +1029,10 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
|||
value: providedArg
|
||||
};
|
||||
|
||||
if (expectedArg.fieldName === 'CURRENTMENU' && providedArg === 'day of week') {
|
||||
activeBlock.fields[expectedArg.fieldName].value = 'DAYOFWEEK';
|
||||
}
|
||||
|
||||
if (expectedArg.fieldName === 'VARIABLE') {
|
||||
// Add `id` property to variable fields
|
||||
activeBlock.fields[expectedArg.fieldName].id = getVariableId(providedArg, Variable.SCALAR_TYPE);
|
||||
|
|
Loading…
Reference in a new issue