From dca4948548a0287eb44f7ea82eb7e1b75dc5b9b5 Mon Sep 17 00:00:00 2001 From: mnvdk Date: Fri, 17 Apr 2020 18:35:39 +0200 Subject: [PATCH] reintroduced infoFill, moved infoFill to mongo --- public/src/js/loader.js | 5 +++-- public/src/js/view.js | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public/src/js/loader.js b/public/src/js/loader.js index 4ff9173..7df3928 100644 --- a/public/src/js/loader.js +++ b/public/src/js/loader.js @@ -109,7 +109,7 @@ class Loader{ assets.categories = JSON.parse(categories) assets.categories.forEach(cat => { let title = cat.title - translations.categories[title] = cat.title_lang + translations.categories[title] = cat.title_lang }); separateStrings() //load categories into strings.js to handle multi language assets.categories.push({ @@ -117,7 +117,8 @@ class Loader{ songSkin: { background: "#ececec", border: ["#fbfbfb", "#8b8b8b"], - outline: "#656565" + outline: "#656565", + infoFill: "#656565" } }) }), "/api/categories") diff --git a/public/src/js/view.js b/public/src/js/view.js index 5c32505..0da8b18 100644 --- a/public/src/js/view.js +++ b/public/src/js/view.js @@ -295,10 +295,12 @@ var _h = 22 var _x = 628 - _w var _y = 88 - _h - if(assets.categories.find(cat=>cat.title == selectedSong.category)){ - ctx.fillStyle = assets.categories.find(cat=>cat.title == selectedSong.category).songSkin.outline + + let category = assets.categories.find(cat=>cat.title == selectedSong.category) + if(category != null && category.songSkin != null && category.songSkin.infoFill != null){ + ctx.fillStyle = assets.categories.find(cat=>cat.title == selectedSong.category).songSkin.infoFill }else{ - ctx.fillStyle = assets.categories.find(cat=>cat.title == 'default').songSkin.outline + ctx.fillStyle = assets.categories.find(cat=>cat.title == 'default').songSkin.infoFill } this.draw.roundedRect({ ctx: ctx,