From 95eef4e8db690a1c1f8105b42dc713a45aa924b2 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Mon, 16 Mar 2020 19:00:32 +0300 Subject: [PATCH] Fix bgm_songsel playing on error --- public/src/js/loadsong.js | 17 ++++++++++------- public/src/js/songselect.js | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/public/src/js/loadsong.js b/public/src/js/loadsong.js index 033c405..769d64e 100644 --- a/public/src/js/loadsong.js +++ b/public/src/js/loadsong.js @@ -177,13 +177,16 @@ class LoadSong{ if(title !== this.selectedSong.originalTitle){ title += " (" + this.selectedSong.originalTitle + ")" } - this.clean() - new SongSelect(false, false, this.touchEnabled, null, { - name: "loadSongError", - title: title, - id: this.selectedSong.folder, - error: error - }) + assets.sounds["v_start"].stop() + setTimeout(() => { + this.clean() + new SongSelect(false, false, this.touchEnabled, null, { + name: "loadSongError", + title: title, + id: this.selectedSong.folder, + error: error + }) + }, 500) } this.error = true } diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index f2c6c63..01f6e36 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -278,7 +278,9 @@ class SongSelect{ }else if((!p2.session || fadeIn) && "selectedSong" in localStorage){ this.selectedSong = Math.min(Math.max(0, localStorage["selectedSong"] |0), this.songs.length - 1) } - this.playSound(songIdIndex !== -1 ? "v_diffsel" : "v_songsel") + if(!this.showWarning){ + this.playSound(songIdIndex !== -1 ? "v_diffsel" : "v_songsel") + } snd.musicGain.fadeOut() this.playBgm(false) }