Add custom Don

- Registered users can customise the colour of their Don and it will appear for other players
- Bug fixes:
  - Add lyrics checkbox to admin page
  - 2P shows above "creative" or "with lyrics" labels
  - Prevent accidental alt and menu keyboard presses from triggering browser menus
  - Fixed mouse hitboxes on difficulty selection
  - Clean cached sounds and lyrics when another song is loading
  - Fixed debug jumping to the top-left of the screen when hidden
  - Fixed server volume not being applied to songs
This commit is contained in:
LoveEevee
2020-04-04 16:48:58 +03:00
parent ed97f9c593
commit cd288d4fa4
46 changed files with 448 additions and 57 deletions

View File

@@ -37,7 +37,18 @@ class LoadSong{
this.promises = []
if(song.folder !== "calibration"){
assets.sounds["v_start"].play()
var songObj = assets.songs.find(song => song.id === id)
var songObj
assets.songs.forEach(song => {
if(song.id === id){
songObj = song
}else{
if(song.sound){
song.sound.clean()
delete song.sound
}
delete song.lyricsData
}
})
}else{
var songObj = {
"music": "muted",
@@ -167,6 +178,9 @@ class LoadSong{
}), url)
img.src = url
}
if(songObj.volume && songObj.volume !== 1){
this.promises.push(new Promise(resolve => setTimeout(resolve, 500)))
}
Promise.all(this.promises).then(() => {
if(!this.error){
this.setupMultiplayer()
@@ -338,7 +352,8 @@ class LoadSong{
p2.send("join", {
id: song.folder,
diff: song.difficulty,
name: account.loggedIn ? account.displayName : null
name: account.loggedIn ? account.displayName : null,
don: account.loggedIn ? account.don : null
})
}else{
this.clean()