removed hardcoded categories from stringsjs and moved the language block to mongo

This commit is contained in:
mnvdk
2020-04-16 21:39:23 +02:00
parent 7d810a27ce
commit 2c4fdab4f9
3 changed files with 14 additions and 58 deletions

View File

@@ -256,8 +256,7 @@ class SongSelect{
this.songSelect = document.getElementById("song-select")
var cat = this.songs[this.selectedSong].category
var sort = cat in this.songSkin ? this.songSkin[cat].sort : 7
this.drawBackground(cat, sort)
this.drawBackground(cat)
this.previewId = 0
this.previewList = Array(5)
@@ -1165,9 +1164,7 @@ class SongSelect{
if(this.songs[this.selectedSong].action !== "back"){
var cat = this.songs[this.selectedSong].category
var sort = cat in this.songSkin ? this.songSkin[cat].sort : 7
this.drawBackground(cat, sort)
this.drawBackground(cat)
}
}
if(this.state.moveMS && ms < this.state.moveMS + changeSpeed){
@@ -2273,18 +2270,14 @@ class SongSelect{
}
}
drawBackground(cat, sort){
drawBackground(cat){
if(this.songSkin[cat] && this.songSkin[cat].bg_img){
let filename = this.songSkin[cat].bg_img.slice(0, this.songSkin[cat].bg_img.lastIndexOf("."))
this.songSelect.style.backgroundImage = "url('" + assets.image[filename].src + "')"
}else{
if(assets.image["bg_genre_" + sort]){
this.songSelect.style.backgroundImage = "url('" + assets.image["bg_genre_" + sort].src + "')"
}else{
this.songSelect.style.backgroundImage = "url('" + assets.image["bg_genre_def"].src + "')"
this.songSelect.style.backgroundImage = "url('" + assets.image["bg_genre_def"].src + "')"
}
}
}
drawClosedSong(config){
var ctx = config.ctx