diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index 5efd5c9da..9ca378d90 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -954,6 +954,12 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension value: 'number' }; break; + case 'costumeName': + activeBlock.fields.NUMBER_NAME = { + name: 'NUMBER_NAME', + value: 'name' + }; + break; } // Special cases to generate mutations. diff --git a/src/serialization/sb2_specmap.js b/src/serialization/sb2_specmap.js index e22025285..5079c206f 100644 --- a/src/serialization/sb2_specmap.js +++ b/src/serialization/sb2_specmap.js @@ -428,6 +428,11 @@ const specMap = { argMap: [ ] }, + 'costumeName': { + opcode: 'looks_costumenumbername', + argMap: [ + ] + }, 'sceneName': { opcode: 'looks_backdropnumbername', argMap: [ diff --git a/test/unit/blocks_looks.js b/test/unit/blocks_looks.js index c7b4c3d7b..a9602a706 100644 --- a/test/unit/blocks_looks.js +++ b/test/unit/blocks_looks.js @@ -34,8 +34,8 @@ test('getCostumeNumberName returns 1-indexed costume number', t => { test('getCostumeNumberName can return costume name', t => { util.target.currentCostume = 0; // This is 0-indexed. const args = {NUMBER_NAME: 'name'}; - const number = blocks.getCostumeNumberName(args, util); - t.strictEqual(number, 'first name'); + const name = blocks.getCostumeNumberName(args, util); + t.strictEqual(name, 'first name'); t.end(); });