Add .tja file support

This commit is contained in:
LoveEevee
2018-10-11 01:13:24 +03:00
parent 9b2c740b9d
commit 39655fc534
11 changed files with 395 additions and 70 deletions

View File

@@ -40,7 +40,7 @@ class loadSong{
}, reject)
}
}))
promises.push(loader.ajax(this.getOsuPath(this.selectedSong)).then(data => {
promises.push(loader.ajax(this.getSongPath(this.selectedSong)).then(data => {
this.songData = data.replace(/\0/g, "").split("\n")
}))
Promise.all(promises).then(() => {
@@ -50,8 +50,13 @@ class loadSong{
alert("An error occurred, please refresh")
})
}
getOsuPath(selectedSong){
return "/songs/" + selectedSong.folder + "/" + selectedSong.difficulty + ".osu"
getSongPath(selectedSong){
var directory = "/songs/" + selectedSong.folder + "/"
if(selectedSong.type === "tja"){
return directory + "main.tja"
}else{
return directory + selectedSong.difficulty + ".osu"
}
}
setupMultiplayer(){
if(this.multiplayer){