From edd76b55a46185f4c64c5bd7984661c67eb8e150 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Fri, 23 Nov 2018 22:44:14 +0300 Subject: [PATCH] Fix backgrounds in multiplayer --- public/src/css/songbg.css | 12 ++++++++++++ public/src/js/view.js | 11 +++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/public/src/css/songbg.css b/public/src/css/songbg.css index 71be6af..7819f97 100644 --- a/public/src/css/songbg.css +++ b/public/src/css/songbg.css @@ -26,6 +26,18 @@ } .portrait #songbg{ height: 63.4%; + max-height: calc(50% + 24vw); +} +.touchp2 #songbg{ + height: calc(50% - 5.5vw); +} +.multiplayer.portrait #songbg{ + height: calc(50% - 37vw); + min-height: calc(29% + 1px); +} +.multiplayer:not(.touchp2):not(.portrait) #songbg, +.multiplayer:not(.touchp2):not(.portrait) #song-stage{ + display: none; } .game-paused *{ animation-play-state: paused !important; diff --git a/public/src/js/view.js b/public/src/js/view.js index 9f36b6f..ad4b69f 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -113,12 +113,16 @@ } } } - if(!this.multiplayer){ + if(this.multiplayer){ + this.gameDiv.classList.add("multiplayer") + }else{ pageEvents.add(this.canvas, "mousedown", this.onmousedown.bind(this)) } } run(){ - this.setBackground() + if(this.multiplayer !== 2){ + this.setBackground() + } this.lastMousemove = this.controller.getElapsedTime() pageEvents.mouseAdd(this, this.onmousemove.bind(this)) @@ -952,7 +956,6 @@ } } setBackground(){ - var gameDiv = document.getElementById("game") var songBg = document.getElementById("songbg") var songStage = document.getElementById("song-stage") @@ -962,7 +965,7 @@ }else{ var catId = this.categories.default.sort } - this.setBgImage(gameDiv, assets.image["bg_genre_" + catId].src) + this.setBgImage(this.gameDiv, assets.image["bg_genre_" + catId].src) if(selectedSong.customBg){ var bg = gameConfig.songs_baseurl + selectedSong.folder + "/bg.png"