Fix (now legacy) 'playAudioLoop' property

This commit is contained in:
PizZaKatZe 2021-03-11 22:39:45 +01:00
parent fdbcd98a9a
commit 5bd6f49846
1 changed files with 2 additions and 3 deletions

View File

@ -668,11 +668,10 @@ export class GameScene extends ResizableScene implements CenterListener {
const loop = allProps.get(AUDIO_LOOP_PROPERTY) as boolean|undefined; const loop = allProps.get(AUDIO_LOOP_PROPERTY) as boolean|undefined;
newValue === undefined ? audioManager.unloadAudio() : audioManager.playAudio(newValue, this.getMapDirUrl(), volume, loop); newValue === undefined ? audioManager.unloadAudio() : audioManager.playAudio(newValue, this.getMapDirUrl(), volume, loop);
}); });
// TODO: This legacy property should be removed at some point
this.gameMap.onPropertyChange('playAudioLoop', (newValue, oldValue) => { this.gameMap.onPropertyChange('playAudioLoop', (newValue, oldValue) => {
newValue === undefined ? audioManager.unloadAudio() : audioManager.playAudio(newValue, this.getMapDirUrl()); newValue === undefined ? audioManager.unloadAudio() : audioManager.playAudio(newValue, this.getMapDirUrl(), undefined, true);
}); });
} }
private getMapDirUrl(): string { private getMapDirUrl(): string {