From ae8436457277b1c0b5396e14f97151693156715f Mon Sep 17 00:00:00 2001 From: yuuki <> Date: Thu, 9 Jan 2025 16:47:43 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E9=A0=86?= =?UTF-8?q?=E3=81=A7=E4=B8=A6=E3=81=B9=E6=9B=BF=E3=81=88=E3=82=8B=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/src/js/songselect.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index 8ab1702..62581f1 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -141,6 +141,9 @@ class SongSelect{ return a.id > b.id ? 1 : -1 } }) + if (localStorage.getItem("titlesort") ?? "false" === "true") { + this.songs.sort((a, b) => a.title.localeCompare(b.title)); + } if(assets.songs.length){ this.songs.push({ title: strings.back, @@ -262,6 +265,13 @@ class SongSelect{ action: "detarame", }); + + this.songs.push({ + title: "タイトル順で並べ替え", + skin: this.songSkin.customSettings, + action: "titlesort", + }); + this.songs.push({ title: strings.back, skin: this.songSkin.back, @@ -981,6 +991,20 @@ class SongSelect{ } localStorage.setItem("detarame", detarame); }, 100); + } else if (currentSong.action === "titlesort") { + this.playSound("se_don"); + setTimeout(() => { + let titlesort = localStorage.getItem("titlesort") ?? "false"; + const input = prompt("タイトル順で並べ替えするには\"true\"を入力してね!", titlesort); + if (input === null) { + // キャンセル + } else if (input === "") { + titlesort = "false"; + } else { + titlesort = input; + } + localStorage.setItem("titlesort", titlesort); + }, 100); } } this.pointer(false)