Implement costume name block

This commit is contained in:
Florrie 2018-06-09 21:34:21 -03:00
parent 173fb6127c
commit 404834018b
2 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -428,6 +428,11 @@ const specMap = {
argMap: [
]
},
'costumeName': {
opcode: 'looks_costumename',
argMap: [
]
},
'sceneName': {
opcode: 'looks_backdropnumbername',
argMap: [