Remove costume ID

This commit is contained in:
DD 2018-02-23 10:21:29 -05:00
parent b4d6db0ad9
commit d6bcfae526
2 changed files with 1 additions and 16 deletions

View file

@ -32,8 +32,7 @@ class Sprite {
* name: "Costume Name", * name: "Costume Name",
* bitmapResolution: 2, * bitmapResolution: 2,
* rotationCenterX: 0, * rotationCenterX: 0,
* rotationCenterY: 0, * rotationCenterY: 0
* costumeId: 0
* } * }
* @type {Array.<!Object>} * @type {Array.<!Object>}
*/ */
@ -47,10 +46,6 @@ class Sprite {
* @type {Array.<!RenderedTarget>} * @type {Array.<!RenderedTarget>}
*/ */
this.clones = []; this.clones = [];
/**
* A costume ID generator. Costumes within a sprite should each have a unique ID.
*/
this.nextCostumeId = 0;
} }
/** /**
@ -85,8 +80,6 @@ class Sprite {
} }
const usedNames = this.costumes_.map(costume => costume.name); const usedNames = this.costumes_.map(costume => costume.name);
costumeObject.name = StringUtil.unusedName(costumeObject.name, usedNames); costumeObject.name = StringUtil.unusedName(costumeObject.name, usedNames);
costumeObject.costumeId = this.nextCostumeId;
this.nextCostumeId++;
this.costumes_.splice(index, 0, costumeObject); this.costumes_.splice(index, 0, costumeObject);
} }

View file

@ -327,14 +327,6 @@ class VirtualMachine extends EventEmitter {
}); });
} }
duplicateCostume (costumeIndex) {
const currentCostume = this.editingTarget.getCostumes()[costumeIndex];
const clone = Object.assign({}, currentCostume);
this.editingTarget.addCostumeAt(clone, costumeIndex + 1);
this.editingTarget.setCostume(costumeIndex + 1);
this.emitTargetsUpdate();
}
/** /**
* Rename a costume on the current editing target. * Rename a costume on the current editing target.
* @param {int} costumeIndex - the index of the costume to be renamed. * @param {int} costumeIndex - the index of the costume to be renamed.