From 404834018bcbcffd3fc97d5b140206950424b81c Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 9 Jun 2018 21:34:21 -0300 Subject: [PATCH] Implement costume name block --- src/blocks/scratch3_looks.js | 6 ++++++ src/serialization/sb2_specmap.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/blocks/scratch3_looks.js b/src/blocks/scratch3_looks.js index 4a7994a4a..487e61389 100644 --- a/src/blocks/scratch3_looks.js +++ b/src/blocks/scratch3_looks.js @@ -252,6 +252,7 @@ class Scratch3LooksBlocks { looks_goforwardbackwardlayers: this.goForwardBackwardLayers, looks_size: this.getSize, looks_costumenumbername: this.getCostumeNumberName, + looks_costumename: this.getCostumeName, looks_backdropnumbername: this.getBackdropNumberName }; } @@ -488,6 +489,11 @@ class Scratch3LooksBlocks { // Else return name return util.target.getCostumes()[util.target.currentCostume].name; } + + getCostumeName (args, util) { + // Obsolete block from earlier Scratch versions. + return util.target.getCostumes()[util.target.currentCostume].name; + } } module.exports = Scratch3LooksBlocks; diff --git a/src/serialization/sb2_specmap.js b/src/serialization/sb2_specmap.js index e22025285..44dc41bdd 100644 --- a/src/serialization/sb2_specmap.js +++ b/src/serialization/sb2_specmap.js @@ -428,6 +428,11 @@ const specMap = { argMap: [ ] }, + 'costumeName': { + opcode: 'looks_costumename', + argMap: [ + ] + }, 'sceneName': { opcode: 'looks_backdropnumbername', argMap: [