Merge pull request #68 from LoveEevee/view-blue-gauge

View: Blue gauge for second player
This commit is contained in:
Bui 2018-11-06 19:33:43 +00:00 committed by GitHub
commit 5d4d69be71
4 changed files with 12 additions and 9 deletions

View File

@ -998,19 +998,19 @@
ctx.fill() ctx.fill()
if(gaugeFilled <= gaugeClear){ if(gaugeFilled <= gaugeClear){
ctx.fillStyle = "#680000" ctx.fillStyle = config.blue ? "#184d55" : "#680000"
var x = Math.max(0, gaugeFilled - 5) var x = Math.max(0, gaugeFilled - 5)
ctx.fillRect(x, firstTop, gaugeClear - x + 2, 22) ctx.fillRect(x, firstTop, gaugeClear - x + 2, 22)
} }
if(gaugeFilled > 0){ if(gaugeFilled > 0){
var w = Math.min(gaugeClear + 1, gaugeFilled - 4) 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.fillRect(0, firstTop + 2, w, 20)
ctx.fillStyle = "#ff9e94" ctx.fillStyle = config.blue ? "#9cffff" : "#ffa191"
ctx.fillRect(0, firstTop, w, 3) ctx.fillRect(0, firstTop, w, 3)
} }
if(gaugeFilled < gaugeW - 4){ if(gaugeFilled < gaugeW - 4){
ctx.fillStyle = "#684c00" ctx.fillStyle = "#684900"
var x = Math.max(gaugeClear + 9, gaugeFilled - gaugeClear + 9) var x = Math.max(gaugeClear + 9, gaugeFilled - gaugeClear + 9)
ctx.fillRect(x, secondTop, gaugeW - 4 - x, 44) ctx.fillRect(x, secondTop, gaugeW - 4 - x, 44)
} }
@ -1021,7 +1021,7 @@
ctx.fillStyle = "#fff" ctx.fillStyle = "#fff"
ctx.fillRect(gaugeClear + 9, secondTop, w, 3) ctx.fillRect(gaugeClear + 9, secondTop, w, 3)
} }
ctx.fillStyle = cleared ? "#ff0" : "#684c00" ctx.fillStyle = cleared ? "#ff0" : "#684900"
ctx.beginPath() ctx.beginPath()
if(config.multiplayer){ if(config.multiplayer){
this.roundedCorner(ctx, gaugeClear, secondTop + 44, 10, 3) this.roundedCorner(ctx, gaugeClear, secondTop + 44, 10, 3)

View File

@ -454,7 +454,8 @@ class Scoresheet{
percentage: gaugePercent, percentage: gaugePercent,
font: this.font, font: this.font,
scale: w / 788, scale: w / 788,
scoresheet: true scoresheet: true,
blue: p === 1
}) })
this.draw.soul({ this.draw.soul({
ctx: ctx, ctx: ctx,

View File

@ -1621,7 +1621,7 @@ class SongSelect{
return song.id === id return song.id === id
}) })
currentSong.p2Cursor = diffId currentSong.p2Cursor = diffId
if(currentSong.stars){ if(p2.session && currentSong.stars){
this.selectedSong = index this.selectedSong = index
this.state.move = 0 this.state.move = 0
if(this.state.screen !== "difficulty"){ if(this.state.screen !== "difficulty"){

View File

@ -339,7 +339,8 @@
percentage: gaugePercent, percentage: gaugePercent,
font: this.font, font: this.font,
scale: 0.7, scale: 0.7,
multiplayer: this.multiplayer === 2 multiplayer: this.multiplayer === 2,
blue: this.multiplayer === 2
}) })
this.draw.soul({ this.draw.soul({
ctx: ctx, ctx: ctx,
@ -411,7 +412,8 @@
clear: 25 / 50, clear: 25 / 50,
percentage: gaugePercent, percentage: gaugePercent,
font: this.font, font: this.font,
multiplayer: this.multiplayer === 2 multiplayer: this.multiplayer === 2,
blue: this.multiplayer === 2
}) })
this.draw.soul({ this.draw.soul({
ctx: ctx, ctx: ctx,