タイトル順で並べ替える機能を実装
This commit is contained in:
@@ -141,6 +141,9 @@ class SongSelect{
|
|||||||
return a.id > b.id ? 1 : -1
|
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){
|
if(assets.songs.length){
|
||||||
this.songs.push({
|
this.songs.push({
|
||||||
title: strings.back,
|
title: strings.back,
|
||||||
@@ -262,6 +265,13 @@ class SongSelect{
|
|||||||
action: "detarame",
|
action: "detarame",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.songs.push({
|
||||||
|
title: "タイトル順で並べ替え",
|
||||||
|
skin: this.songSkin.customSettings,
|
||||||
|
action: "titlesort",
|
||||||
|
});
|
||||||
|
|
||||||
this.songs.push({
|
this.songs.push({
|
||||||
title: strings.back,
|
title: strings.back,
|
||||||
skin: this.songSkin.back,
|
skin: this.songSkin.back,
|
||||||
@@ -981,6 +991,20 @@ class SongSelect{
|
|||||||
}
|
}
|
||||||
localStorage.setItem("detarame", detarame);
|
localStorage.setItem("detarame", detarame);
|
||||||
}, 100);
|
}, 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)
|
this.pointer(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user