From b02dd02ad9c8f17fe3dbfea5cc5f05bcaf31fbe3 Mon Sep 17 00:00:00 2001 From: Bui Date: Sun, 6 Mar 2022 14:55:54 +0000 Subject: [PATCH] block search when p2 is loading song --- public/src/js/songselect.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index 934dd9d..8445f6b 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -257,6 +257,7 @@ class SongSelect{ this.selectedSong = 0 this.selectedDiff = 0 this.lastCurrentSong = {} + this.searchEnabled = true assets.sounds["bgm_songsel"].playLoop(0.1, false, 0, 1.442, 3.506) if(!assets.customSongs && !fromTutorial && !("selectedSong" in localStorage) && !songId){ @@ -2855,6 +2856,9 @@ class SongSelect{ } displaySearch(fromButton=false){ + if(!this.searchEnabled){ + return + } if(this.search){ return this.removeSearch(true) } @@ -3227,6 +3231,7 @@ class SongSelect{ } onusers(response){ + var p2InSong = false this.songs.forEach(song => { song.p2Cursor = null }) @@ -3252,11 +3257,18 @@ class SongSelect{ if(this.state.screen !== "difficulty"){ this.toSelectDifficulty({player: response.value.player}) } + this.searchEnabled = false + p2InSong = true + this.removeSearch() } } } }) } + + if(!this.searchEnabled && !p2InSong){ + this.searchEnabled = true + } } onsongsel(response){ if(response && response.value){