From 8b18ff7ae9a3052987fc0d52fbba6f7ef1d71087 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 26 Feb 2018 15:56:37 -0500 Subject: [PATCH 1/2] make inputOP, arg name and menu name the same --- src/extensions/scratch3_music/index.js | 8 ++++---- src/serialization/sb2_specmap.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extensions/scratch3_music/index.js b/src/extensions/scratch3_music/index.js index 386c2c4a6..c825383d6 100644 --- a/src/extensions/scratch3_music/index.js +++ b/src/extensions/scratch3_music/index.js @@ -464,7 +464,7 @@ class Scratch3MusicBlocks { arguments: { DRUM: { type: ArgumentType.NUMBER, - menu: 'drums', + menu: 'DRUM', defaultValue: 1 }, BEATS: { @@ -506,7 +506,7 @@ class Scratch3MusicBlocks { arguments: { INSTRUMENT: { type: ArgumentType.NUMBER, - menu: 'instruments', + menu: 'INSTRUMENT', defaultValue: 1 } } @@ -540,8 +540,8 @@ class Scratch3MusicBlocks { } ], menus: { - drums: this._buildMenu(this.DRUM_INFO), - instruments: this._buildMenu(this.INSTRUMENT_INFO) + DRUM: this._buildMenu(this.DRUM_INFO), + INSTRUMENT: this._buildMenu(this.INSTRUMENT_INFO) } }; } diff --git a/src/serialization/sb2_specmap.js b/src/serialization/sb2_specmap.js index e9b56b9d0..0a5d64899 100644 --- a/src/serialization/sb2_specmap.js +++ b/src/serialization/sb2_specmap.js @@ -424,7 +424,7 @@ const specMap = { argMap: [ { type: 'input', - inputOp: 'math_number', + inputOp: 'music.menu.DRUM', inputName: 'DRUM' }, { @@ -464,7 +464,7 @@ const specMap = { argMap: [ { type: 'input', - inputOp: 'math_number', + inputOp: 'music.menu.INSTRUMENT', inputName: 'INSTRUMENT' } ] From 651d46fff027cc19efec88bab8da572ab94ac1b6 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Mon, 26 Feb 2018 17:28:20 -0500 Subject: [PATCH 2/2] Add default values for obscured shadows --- src/serialization/sb2.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index 1102c005e..b8bca246c 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -533,6 +533,14 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension if (shadowObscured) { fieldValue = ''; } + } else if (expectedArg.inputOp === 'music.menu.DRUM') { + if (shadowObscured) { + fieldValue = 1; + } + } else if (expectedArg.inputOp === 'music.menu.INSTRUMENT') { + if (shadowObscured) { + fieldValue = 1; + } } else if (shadowObscured) { // Filled drop-down menu. fieldValue = '';