From 5d51d0f2a9962c77aa23c26b848adbe85631a4e7 Mon Sep 17 00:00:00 2001 From: firebingo Date: Wed, 30 May 2018 20:24:01 -0700 Subject: [PATCH] Fixed audio not loading if tsv file didn't load any audio. Made list of mstids an array of allowed mstids instead of making a weird if block for allowed ids. --- Js/Audio.js | 14 ++++++++++---- Js/Main.js | 5 ++--- Js/Translations | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Js/Audio.js b/Js/Audio.js index 2aff8ad..c767bc4 100644 --- a/Js/Audio.js +++ b/Js/Audio.js @@ -153,12 +153,18 @@ class audioController { } loadSounds(soundMap, callback) { - this.loader = new bufferLoader(this.audioCtx, soundMap, (percent) => { + if(!soundMap || soundMap.length === 0) { if (callback) { - callback(percent); + callback(100); } - }); - this.loader.load(); + } else { + this.loader = new bufferLoader(this.audioCtx, soundMap, (percent) => { + if (callback) { + callback(percent); + } + }); + this.loader.load(); + } } resetAll() { diff --git a/Js/Main.js b/Js/Main.js index 1280765..5ba8800 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -26,6 +26,7 @@ let screenSizeTimeout = undefined; let isMuted = false; let volume = 0.5; let prevMission = '{Select}'; +const availableMstIds = [202070, 202013]; function onBodyLoaded() { bodyLoaded = true; @@ -119,9 +120,7 @@ function buildMissionSelectList() { opt.innerText = 'Select Mission'; } else { let m = utage.missionsList[i]; - //Only allowing 3.5 right now - //if(!(m.MstId >= 104001 && m.MstId <= 104008)) { - if(m.MstId !== 202070) { + if(!availableMstIds.includes(m.MstId)) { continue; } opt.setAttribute('value', m.MstId); diff --git a/Js/Translations b/Js/Translations index 802d85f..33001c7 160000 --- a/Js/Translations +++ b/Js/Translations @@ -1 +1 @@ -Subproject commit 802d85f23c63a92df9a8e9e9acf73c96ecc599b0 +Subproject commit 33001c747cc5bad3ce398f72058088fad34124be