Lyrics, search, and other fixes

- #LYRIC
  - Parse #LYRIC commands and apply them to all difficulties that do not have them
  - #LYRIC command now supports branches
  - Fix last #LYRIC at the end of the chart getting ignored
- Fix the glitchy dragging and dropping of files on the custom song importing page
- Fix Ctrl and Shift keys getting stuck on song select when switching tabs with Ctrl(+Shift)+Tab
- Search
  - Fix the search box "random:yes" query to randomize the entire results and not just the first 50
  - Add "all:yes" query to the search box to remove the result limit and display all of the results
  - Fix searching for an invalid query (like "cleared:yes" or ":") unexpectedly returning all the songs
  - Fix pressing Q then jumping to a song through search not unmuting the sound
  - Pressing the search key on mobile will hide the keyboard
  - Fix search tips changing rapidly when the window is resized
- Use comments instead of `######` in the issue template so that the warning does not appear in the issue
- Fix TJA MAKER: url between angle brackets not working
- Add a check for Class field declarations in the browser support warning
- Fix gpicker getting stuck if a network error occurs
- Fix not being able to replace some assets using a "taiko-web assets" folder
- Fix selectable song title not being aligned with the game if the game window is too wide
- Allow plugin developers to use the "select" type for the settings options
  - It uses "options" array and "options_lang" object
- Fix plugins not getting removed from the plugin list on syntax error
- Fix error messages not working if a default plugin is broken
- Fix the start of default plugins not stopping the page from loading on error
- Fix not being able to scroll the plugins screen on mobile
This commit is contained in:
KatieFrogs
2022-07-15 16:00:43 +02:00
parent 7722813879
commit e43c4afceb
16 changed files with 354 additions and 180 deletions

View File

@@ -9,6 +9,7 @@ class Loader{
this.screen = document.getElementById("screen")
this.startTime = Date.now()
this.errorMessages = []
this.songSearchGradient = "linear-gradient(to top, rgba(245, 246, 252, 0.08), #ff5963), "
var promises = []
@@ -105,7 +106,7 @@ class Loader{
if(selector === ".pattern-bg"){
loader.screen.style.backgroundImage = "url(\"" + blobUrl + "\")"
}else if(selector === "#song-search"){
gradient = "linear-gradient(to top, rgba(245, 246, 252, 0.08), #ff5963), "
gradient = this.songSearchGradient
}
css.push(this.cssRuleset({
[selector]: {
@@ -377,9 +378,9 @@ class Loader{
plugin.loadErrors = true
promises.push(plugin.load(true).then(() => {
if(obj.start){
plugin.start()
return plugin.start(false, true)
}
}, response => {
}).catch(response => {
return this.errorMsg(response, obj.url)
}))
}
@@ -394,14 +395,14 @@ class Loader{
this.callback(songId)
this.ready = true
pageEvents.send("ready", readyEvent)
}, () => this.errorMsg())
}, () => this.errorMsg())
}, e => this.errorMsg(e))
}, e => this.errorMsg(e))
})
}
addPromise(promise, url){
this.promises.push(promise)
promise.then(this.assetLoaded.bind(this), response => {
this.errorMsg(response, url)
return this.errorMsg(response, url)
})
}
soundUrl(name){
@@ -417,9 +418,20 @@ class Loader{
return name.slice(0, name.lastIndexOf("."))
}
errorMsg(error, url){
var rethrow
if(url || error){
if(typeof error === "object" && error.constructor === Error){
rethrow = error
error = error.stack || ""
var index = error.indexOf("\n ")
if(index !== -1){
error = error.slice(0, index)
}
}else if(Array.isArray(error)){
error = error[0]
}
if(url){
error = (Array.isArray(error) ? error[0] + ": " : (error ? error + ": " : "")) + url
error = (error ? error + ": " : "") + url
}
this.errorMessages.push(error)
pageEvents.send("loader-error", url || error)
@@ -495,7 +507,10 @@ class Loader{
}
var percentage = Math.floor(this.loadedAssets * 100 / (this.promises.length + this.afterJSCount))
this.errorTxt.element[this.errorTxt.method] = "```\n" + this.errorMessages.join("\n") + "\nPercentage: " + percentage + "%\n```"
return Promise.reject(error)
if(rethrow || error){
console.error(rethrow || error)
}
return Promise.reject()
}
assetLoaded(){
if(!this.error){