mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Remove costume ID
This commit is contained in:
parent
b4d6db0ad9
commit
d6bcfae526
2 changed files with 1 additions and 16 deletions
|
@ -32,8 +32,7 @@ class Sprite {
|
|||
* name: "Costume Name",
|
||||
* bitmapResolution: 2,
|
||||
* rotationCenterX: 0,
|
||||
* rotationCenterY: 0,
|
||||
* costumeId: 0
|
||||
* rotationCenterY: 0
|
||||
* }
|
||||
* @type {Array.<!Object>}
|
||||
*/
|
||||
|
@ -47,10 +46,6 @@ class Sprite {
|
|||
* @type {Array.<!RenderedTarget>}
|
||||
*/
|
||||
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);
|
||||
costumeObject.name = StringUtil.unusedName(costumeObject.name, usedNames);
|
||||
costumeObject.costumeId = this.nextCostumeId;
|
||||
this.nextCostumeId++;
|
||||
this.costumes_.splice(index, 0, costumeObject);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
* @param {int} costumeIndex - the index of the costume to be renamed.
|
||||
|
|
Loading…
Reference in a new issue