Bug fixes

- Change song select mouse wheel song scrolling to be instant
- Clicking on don chan in account settings toggles the animation
- If the music is too long for the chart, the results screen is shown earlier
- Fix weird BPM values freezing the browser (zero, negative, and very large)
- Add a warning to the page when JavaScript is disabled in the browser
- Fix Chrome auto dark mode by forcing light mode on the page
- Add a meta keywords tag to the page
- Fix plugin names getting cut off in the menu
- Delay the function editing of the EditFunction class in plugins to the start() function instead of load()
  - When stopping one of the plugins, all the plugins have to be stopped in reverse order and started again so that patched code of a stopped plugin does not linger around
- Fix importing plugins that have a SyntaxError
- Fix plugins getting the same internal name when added without one, causing them to not appear in the plugin settings
- Support editing args in EditFunction for plugins
- Prevent multiple websockets from being opened
- Fix page freezing after selecting Random song with no songs
- Fix the back button being repeated twice when there are no songs
- Fix /admin/users not accepting case insensitive usernames
- Pressing enter on the Delete Account field does the expected action instead of refreshing the page
- Better error message when custom folder access is denied
- Fix being able to start netplay in custom songs after refreshing the page (#383)
- Fix an error when importing songs from previous session and clicking on the white spot where you normally start multiplayer session
- Fix canvas elements becoming smaller than 1x1 resolution and crashing the game (#390)
- Fix song frame shadow cache on song select not being cleared when resizing the browser window, causing it to become blurry
- Fix a pause-restart error when you hit both confirm keys on the restart button
This commit is contained in:
KatieFrogs
2022-02-17 23:50:07 +03:00
parent eab03369c7
commit 0655b79293
21 changed files with 286 additions and 112 deletions

View File

@@ -46,6 +46,8 @@ class Account{
this.inputForms.push(this.displayname)
this.redrawRunning = true
this.redrawPaused = matchMedia("(prefers-reduced-motion: reduce)").matches
this.redrawForce = true
this.customdonRedrawBind = this.customdonRedraw.bind(this)
this.start = new Date().getTime()
this.frames = [
@@ -57,6 +59,7 @@ class Account{
this.customdonCache = new CanvasCache()
this.customdonCache.resize(723 * 2, 1858, 1)
this.customdonCanvas = this.getElement("customdon-canvas")
pageEvents.add(this.customdonCanvas, "click", this.customdonPause.bind(this))
this.customdonCtx = this.customdonCanvas.getContext("2d")
this.customdonBodyFill = this.getElement("customdon-bodyfill")
this.customdonBodyFill.value = account.don.body_fill
@@ -120,6 +123,11 @@ class Account{
pageEvents.add(this.inputForms[i], ["keydown", "keyup", "keypress"], this.onFormPress.bind(this))
}
}
customdonPause(){
this.redrawPaused = !this.redrawPaused
this.redrawForce = true
this.start = new Date().getTime()
}
customdonChange(){
var ctx = this.customdonCtx
this.customdonCache.clear()
@@ -148,6 +156,7 @@ class Account{
id: "bodyFill"
})
})
this.redrawForce = true
}
customdonReset(event){
if(event.type === "touchstart"){
@@ -162,12 +171,16 @@ class Account{
return
}
requestAnimationFrame(this.customdonRedrawBind)
if(!document.hasFocus()){
if(!document.hasFocus() || this.redrawPaused && !this.redrawForce){
return
}
var ms = new Date().getTime()
var ctx = this.customdonCtx
var frame = this.frames[Math.floor((ms - this.start) / 30) % this.frames.length]
if(this.redrawPaused){
var frame = 0
}else{
var frame = this.frames[Math.floor((ms - this.start) / 30) % this.frames.length]
}
var w = 360
var h = 184
var sx = Math.floor(frame / 10) * (w + 2)
@@ -183,6 +196,7 @@ class Account{
sx, sy, w, h,
-26, 0, w, h
)
this.redrawForce = false
}
showDiv(event, div){
if(event){
@@ -318,6 +332,7 @@ class Account{
onFormPress(event){
event.stopPropagation()
if(event.type === "keypress" && event.keyCode === 13){
event.preventDefault()
if(this.mode === "account"){
this.onSave()
}else{
@@ -611,6 +626,7 @@ class Account{
}
this.redrawRunning = false
this.customdonCache.clean()
pageEvents.remove(this.customdonCanvas, "click")
pageEvents.remove(this.customdonBodyFill, ["change", "input"])
pageEvents.remove(this.customdonFaceFill, ["change", "input"])
pageEvents.remove(this.customdonResetBtn, ["click", "touchstart"])