Write costumes and sounds to JSON on save

This commit is contained in:
morant 2017-02-07 18:15:11 -05:00
parent e16f2924a3
commit 0dc1883e9f
2 changed files with 4 additions and 2 deletions

View file

@ -67,7 +67,7 @@ var parseScratchObject = function (object, runtime, topLevel) {
// Costumes from JSON.
if (object.hasOwnProperty('costumes') || object.hasOwnProperty('costume')) {
for (var i = 0; i < object.costumeCount; i++) {
var costume = object.costume; // [i]?
var costume = object.costumes[i];
// @todo: Make sure all the relevant metadata is being pulled out.
sprite.costumes.push({
skin: costume.skin,

View file

@ -723,7 +723,9 @@ RenderedTarget.prototype.toJSON = function () {
rotationStyle: this.rotationStyle,
blocks: this.blocks._blocks,
variables: this.variables,
lists: this.lists
lists: this.lists,
costumes: this.getCostumes(),
sounds: this.sprite.sounds
};
};