From b06d6d8412b35cc3a0980788d85ff6044b79c899 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Tue, 6 Nov 2018 22:26:58 +0300 Subject: [PATCH] View: Blue gauge for second player --- public/src/js/canvasdraw.js | 10 +++++----- public/src/js/scoresheet.js | 3 ++- public/src/js/songselect.js | 2 +- public/src/js/view.js | 6 ++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/public/src/js/canvasdraw.js b/public/src/js/canvasdraw.js index 50cbbb9..71bf916 100644 --- a/public/src/js/canvasdraw.js +++ b/public/src/js/canvasdraw.js @@ -998,19 +998,19 @@ ctx.fill() if(gaugeFilled <= gaugeClear){ - ctx.fillStyle = "#680000" + ctx.fillStyle = config.blue ? "#184d55" : "#680000" var x = Math.max(0, gaugeFilled - 5) ctx.fillRect(x, firstTop, gaugeClear - x + 2, 22) } if(gaugeFilled > 0){ var w = Math.min(gaugeClear + 1, gaugeFilled - 4) - ctx.fillStyle = "#ff3508" + ctx.fillStyle = config.blue ? "#00edff" : "#ff3408" ctx.fillRect(0, firstTop + 2, w, 20) - ctx.fillStyle = "#ff9e94" + ctx.fillStyle = config.blue ? "#9cffff" : "#ffa191" ctx.fillRect(0, firstTop, w, 3) } if(gaugeFilled < gaugeW - 4){ - ctx.fillStyle = "#684c00" + ctx.fillStyle = "#684900" var x = Math.max(gaugeClear + 9, gaugeFilled - gaugeClear + 9) ctx.fillRect(x, secondTop, gaugeW - 4 - x, 44) } @@ -1021,7 +1021,7 @@ ctx.fillStyle = "#fff" ctx.fillRect(gaugeClear + 9, secondTop, w, 3) } - ctx.fillStyle = cleared ? "#ff0" : "#684c00" + ctx.fillStyle = cleared ? "#ff0" : "#684900" ctx.beginPath() if(config.multiplayer){ this.roundedCorner(ctx, gaugeClear, secondTop + 44, 10, 3) diff --git a/public/src/js/scoresheet.js b/public/src/js/scoresheet.js index fe283db..bdecc6b 100644 --- a/public/src/js/scoresheet.js +++ b/public/src/js/scoresheet.js @@ -454,7 +454,8 @@ class Scoresheet{ percentage: gaugePercent, font: this.font, scale: w / 788, - scoresheet: true + scoresheet: true, + blue: p === 1 }) this.draw.soul({ ctx: ctx, diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index d273867..15d8463 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -1621,7 +1621,7 @@ class SongSelect{ return song.id === id }) currentSong.p2Cursor = diffId - if(currentSong.stars){ + if(p2.session && currentSong.stars){ this.selectedSong = index this.state.move = 0 if(this.state.screen !== "difficulty"){ diff --git a/public/src/js/view.js b/public/src/js/view.js index 4000517..c148370 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -339,7 +339,8 @@ percentage: gaugePercent, font: this.font, scale: 0.7, - multiplayer: this.multiplayer === 2 + multiplayer: this.multiplayer === 2, + blue: this.multiplayer === 2 }) this.draw.soul({ ctx: ctx, @@ -411,7 +412,8 @@ clear: 25 / 50, percentage: gaugePercent, font: this.font, - multiplayer: this.multiplayer === 2 + multiplayer: this.multiplayer === 2, + blue: this.multiplayer === 2 }) this.draw.soul({ ctx: ctx,