mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
rename stage monitors along with stage
Rename Stage object and monitors together then use the set name to name the sprite.
This commit is contained in:
parent
b41423bdfa
commit
db7b356825
1 changed files with 10 additions and 1 deletions
|
@ -355,7 +355,16 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip)
|
|||
const sprite = new Sprite(blocks, runtime);
|
||||
// Sprite/stage name from JSON.
|
||||
if (object.hasOwnProperty('objName')) {
|
||||
sprite.name = topLevel ? 'Stage' : object.objName;
|
||||
if (topLevel && object.objName !== 'Stage') {
|
||||
for (const child of object.children) {
|
||||
if (!child.hasOwnProperty('objName') && child.target === object.objName) {
|
||||
child.target = 'Stage';
|
||||
}
|
||||
}
|
||||
object.objName = 'Stage';
|
||||
}
|
||||
|
||||
sprite.name = object.objName;
|
||||
}
|
||||
// Costumes from JSON.
|
||||
const costumePromises = [];
|
||||
|
|
Loading…
Reference in a new issue