From d99c11ef91a110f3dc6523dafab121cfb0d233ee Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford Date: Mon, 4 Sep 2017 15:37:13 -0700 Subject: [PATCH] Fix extension conditional blocks' appearance The JSON generated for conditional blocks had slightly incorrect structure for its `argsN` items and was missing some necessary `messageN` items. --- src/engine/runtime.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 1c525246..7c0fd1a8 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -464,10 +464,11 @@ class Runtime extends EventEmitter { case BlockType.CONDITIONAL: // Statement inputs get names like 'SUBSTACK', 'SUBSTACK2', 'SUBSTACK3', ... for (let branchNum = 1; branchNum <= blockInfo.branchCount; ++branchNum) { - blockJSON[`args${branchNum}`] = { + blockJSON[`message${branchNum}`] = '%1'; + blockJSON[`args${branchNum}`] = [{ type: 'input_statement', name: `SUBSTACK${branchNum > 1 ? branchNum : ''}` - }; + }]; } blockJSON.outputShape = ScratchBlocks.OUTPUT_SHAPE_SQUARE; blockJSON.previousStatement = null; // null = available connection; undefined = hat