From ab1835aa485a464f5f99b90457db7f4e0d9c8288 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Mon, 1 Oct 2018 13:02:28 +0300 Subject: [PATCH] Fix results not showing in Firefox --- public/src/js/controller.js | 4 +++- public/src/js/scoresheet.js | 12 +++++++----- public/src/js/view.js | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/public/src/js/controller.js b/public/src/js/controller.js index 715b135..2ddf853 100644 --- a/public/src/js/controller.js +++ b/public/src/js/controller.js @@ -132,7 +132,9 @@ class Controller{ this.view.displayScore(score, notPlayed) } songSelection(fadeIn){ - this.clean() + if(!fadeIn){ + this.clean() + } new SongSelect(false, fadeIn) } restartSong(){ diff --git a/public/src/js/scoresheet.js b/public/src/js/scoresheet.js index 97e9adc..e2382b3 100644 --- a/public/src/js/scoresheet.js +++ b/public/src/js/scoresheet.js @@ -132,7 +132,7 @@ class Scoresheet{ var frameTop = winH / 2 - 720 / 2 var frameLeft = winW / 2 - 1280 / 2 - var players = p2.results ? 2 : 1 + var players = this.multiplayer && p2.results ? 2 : 1 var p2Offset = 298 var bgOffset = 0 @@ -372,10 +372,12 @@ class Scoresheet{ 552, 120, 688, 48 ) var gauge = results.gauge / 100 - ctx.drawImage(assets.image["hp-bar-colour"], - 0, 0, 650 * gauge, 40, - 557, 127, 635 * gauge, 37, - ) + if(gauge > 0){ + ctx.drawImage(assets.image["hp-bar-colour"], + 0, 0, 650 * gauge, 40, + 557, 127, 635 * gauge, 37, + ) + } } ctx.restore() } diff --git a/public/src/js/view.js b/public/src/js/view.js index 4fd0043..8e93dfe 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -820,6 +820,7 @@ class View{ if(this.controller.multiplayer === 2){ this.canvas.canvas.parentNode.removeChild(this.canvas.canvas) } + this.cursor.parentNode.removeChild(this.cursor) delete this.pauseMenu delete this.cursor delete this.canvas