mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
A few leftover loadSound that werent updated
This commit is contained in:
parent
c268bbae47
commit
4431b43e45
3 changed files with 5 additions and 5 deletions
|
@ -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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue