block search when p2 is loading song

This commit is contained in:
Bui 2022-03-06 14:55:54 +00:00
parent 38963479bc
commit b02dd02ad9

View File

@ -257,6 +257,7 @@ class SongSelect{
this.selectedSong = 0 this.selectedSong = 0
this.selectedDiff = 0 this.selectedDiff = 0
this.lastCurrentSong = {} this.lastCurrentSong = {}
this.searchEnabled = true
assets.sounds["bgm_songsel"].playLoop(0.1, false, 0, 1.442, 3.506) assets.sounds["bgm_songsel"].playLoop(0.1, false, 0, 1.442, 3.506)
if(!assets.customSongs && !fromTutorial && !("selectedSong" in localStorage) && !songId){ if(!assets.customSongs && !fromTutorial && !("selectedSong" in localStorage) && !songId){
@ -2855,6 +2856,9 @@ class SongSelect{
} }
displaySearch(fromButton=false){ displaySearch(fromButton=false){
if(!this.searchEnabled){
return
}
if(this.search){ if(this.search){
return this.removeSearch(true) return this.removeSearch(true)
} }
@ -3227,6 +3231,7 @@ class SongSelect{
} }
onusers(response){ onusers(response){
var p2InSong = false
this.songs.forEach(song => { this.songs.forEach(song => {
song.p2Cursor = null song.p2Cursor = null
}) })
@ -3252,11 +3257,18 @@ class SongSelect{
if(this.state.screen !== "difficulty"){ if(this.state.screen !== "difficulty"){
this.toSelectDifficulty({player: response.value.player}) this.toSelectDifficulty({player: response.value.player})
} }
this.searchEnabled = false
p2InSong = true
this.removeSearch()
} }
} }
} }
}) })
} }
if(!this.searchEnabled && !p2InSong){
this.searchEnabled = true
}
} }
onsongsel(response){ onsongsel(response){
if(response && response.value){ if(response && response.value){