A few leftover loadSound that werent updated

This commit is contained in:
Corey Frang 2018-06-22 09:45:23 -04:00
parent c268bbae47
commit 4431b43e45
3 changed files with 5 additions and 5 deletions

View file

@ -420,7 +420,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip)
// followed by the file ext // followed by the file ext
const assetFileName = `${soundSource.soundID}.${ext}`; const assetFileName = `${soundSource.soundID}.${ext}`;
soundPromises.push(deserializeSound(sound, runtime, zip, assetFileName) soundPromises.push(deserializeSound(sound, runtime, zip, assetFileName)
.then(() => loadSound(sound, runtime))); .then(() => loadSound(sound, runtime, sprite)));
} }
} }

View file

@ -155,7 +155,7 @@ class Sprite {
newSprite.sounds = this.sounds.map(sound => { newSprite.sounds = this.sounds.map(sound => {
const newSound = Object.assign({}, sound); const newSound = Object.assign({}, sound);
const soundAsset = this.runtime.storage.get(sound.assetId); const soundAsset = this.runtime.storage.get(sound.assetId);
assetPromises.push(loadSoundFromAsset(newSound, soundAsset, this.runtime)); assetPromises.push(loadSoundFromAsset(newSound, soundAsset, this.runtime, this));
return newSound; return newSound;
}); });

View file

@ -495,7 +495,7 @@ class VirtualMachine extends EventEmitter {
duplicateSound (soundIndex) { duplicateSound (soundIndex) {
const originalSound = this.editingTarget.getSounds()[soundIndex]; const originalSound = this.editingTarget.getSounds()[soundIndex];
const clone = Object.assign({}, originalSound); const clone = Object.assign({}, originalSound);
return loadSound(clone, this.runtime).then(() => { return loadSound(clone, this.runtime, this.editingTarget.sprite).then(() => {
this.editingTarget.addSound(clone, soundIndex + 1); this.editingTarget.addSound(clone, soundIndex + 1);
this.emitTargetsUpdate(); this.emitTargetsUpdate();
}); });
@ -966,8 +966,8 @@ class VirtualMachine extends EventEmitter {
shareSoundToTarget (soundIndex, targetId) { shareSoundToTarget (soundIndex, targetId) {
const originalSound = this.editingTarget.getSounds()[soundIndex]; const originalSound = this.editingTarget.getSounds()[soundIndex];
const clone = Object.assign({}, originalSound); const clone = Object.assign({}, originalSound);
return loadSound(clone, this.runtime).then(() => {
const target = this.runtime.getTargetById(targetId); const target = this.runtime.getTargetById(targetId);
return loadSound(clone, this.runtime, target.sprite).then(() => {
if (target) { if (target) {
target.addSound(clone); target.addSound(clone);
this.emitTargetsUpdate(); this.emitTargetsUpdate();