Multiplayer improvements and reupload score on error

- In multiplayer you will play at the bottom if you joined second
- Add a dialog to song select that score has not been saved
- Uploads the score when logged in again
- Translate error messages from the server
This commit is contained in:
LoveEevee
2020-03-14 07:50:04 +03:00
parent ad62ac800c
commit 7f1bb9d357
21 changed files with 543 additions and 211 deletions

View File

@@ -155,10 +155,16 @@ class Controller{
if(this.mainLoopRunning){
if(this.multiplayer !== 2){
requestAnimationFrame(() => {
this.viewLoop()
var player = this.multiplayer ? p2.player : 1
if(player === 1){
this.viewLoop()
}
if(this.multiplayer === 1){
this.syncWith.viewLoop()
}
if(player === 2){
this.viewLoop()
}
if(this.scoresheet){
if(this.view.ctx){
this.view.ctx.save()
@@ -197,14 +203,14 @@ class Controller{
displayScore(score, notPlayed, bigNote){
this.view.displayScore(score, notPlayed, bigNote)
}
songSelection(fadeIn){
songSelection(fadeIn, scoreSaveFailed){
if(!fadeIn){
this.clean()
}
if(this.calibrationMode){
new SettingsView(this.touchEnabled, false, null, "latency")
}else{
new SongSelect(false, fadeIn, this.touchEnabled)
new SongSelect(false, fadeIn, this.touchEnabled, null, scoreSaveFailed)
}
}
restartSong(){