隐藏歌单

This commit is contained in:
草莓 2025-01-23 22:25:18 +08:00
parent c1263db1af
commit 38979d5040
2 changed files with 238 additions and 209 deletions

View File

@ -2647,7 +2647,7 @@ return code;
*/; */;
setmusics_s setmusics_s
: '音乐鉴赏music 文件名'EvalString?'不填为清空cg获取记录' Newline : '音乐鉴赏music 文件名'EvalString?'不填为清空music获取记录' Newline
/* setmusics_s /* setmusics_s
tooltip : setmusics音乐鉴赏中的隐藏music获取 tooltip : setmusics音乐鉴赏中的隐藏music获取

View File

@ -16444,6 +16444,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
class musicclass { class musicclass {
constructor() { constructor() {
this.musics = ["theme.opus"]
//music列表 //music列表
//需全塔属性注册并保存在bgms文件夹,每个数组为显示的一页内容 //需全塔属性注册并保存在bgms文件夹,每个数组为显示的一页内容
this.musicMx = [ this.musicMx = [
@ -16558,24 +16559,26 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
break; break;
case "xunhuan": case "xunhuan":
if (this.selection[1] === 0) { for (;;) {
if (this.selection[0] === 0) { if (this.selection[1] === 0) {
this.selection[0] = this.musicMx.length - 1; if (this.selection[0] === 0) {
this.selection[1] = this.selection[0] = this.musicMx.length - 1;
this.musicMx[this.selection[0]].length - 1; this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
} else {
this.selection[0] -= 1;
this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
}
} else { } else {
this.selection[0] -= 1; this.selection[1] -= 1;
this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
} }
} else { this.random = this.randomList.indexOf(
this.selection[1] -= 1; this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
} }
this.randomList.indexOf(
this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
@ -16584,20 +16587,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
break; break;
case "suiji": case "suiji":
if (this.random > 0) { for (;;) {
this.random -= 1; if (this.random > 0) {
} else { this.random -= 1;
this.random = this.randomList.length - 1; } else {
this.random = this.randomList.length - 1;
}
this.selection[0] = this.musicMx.findIndex((v) =>
v.includes(this.randomList[this.random])
);
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
this.randomList[this.random]
);
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
} }
this.selection[0] = this.musicMx.findIndex((v) =>
v.includes(this.randomList[this.random])
);
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
this.randomList[this.random]
);
page = this.selection[0];
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
@ -16621,25 +16626,27 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
page = this.selection[0]; page = this.selection[0];
break; break;
case "xunhuan": case "xunhuan":
if ( for (;;) {
this.selection[1] === if (
this.musicMx[this.selection[0]].length - 1 this.selection[1] ===
) { this.musicMx[this.selection[0]].length - 1
if (this.selection[0] === this.musicMx.length - 1) { ) {
this.selection[0] = 0; if (this.selection[0] === this.musicMx.length - 1) {
this.selection[1] = 0; this.selection[0] = 0;
this.selection[1] = 0;
} else {
this.selection[0] += 1;
this.selection[1] = 0;
}
} else { } else {
this.selection[0] += 1; this.selection[1] += 1;
this.selection[1] = 0;
} }
} else { this.random = this.randomList.indexOf(
this.selection[1] += 1; this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
} }
this.random = this.randomList.indexOf(
this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
@ -16648,19 +16655,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
break; break;
case "suiji": case "suiji":
if (this.random < this.randomList.length - 1) { for (;;) {
this.random += 1; if (this.random < this.randomList.length - 1) {
} else { this.random += 1;
this.random = 0; } else {
} this.random = 0;
this.selection[0] = this.musicMx.findIndex((v) => }
v.includes(this.randomList[this.random]) this.selection[0] = this.musicMx.findIndex((v) =>
); v.includes(this.randomList[this.random])
this.selection[1] = this.musicMx[this.selection[0]].indexOf( );
this.randomList[this.random] this.selection[1] = this.musicMx[this.selection[0]].indexOf(
); this.randomList[this.random]
);
page = this.selection[0]; page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
}
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
@ -16688,19 +16698,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (inRect(pos, musicbox)) { if (inRect(pos, musicbox)) {
const index = Math.floor((py - 200) / 100); const index = Math.floor((py - 200) / 100);
if (page !== this.selection[0] || index !== this.selection[1]) { if (page !== this.selection[0] || index !== this.selection[1]) {
this.selection[0] = page; if (this.musics.includes(this.musicMx[page][index]) || page !== this.musicMx.length - 1) {
this.selection[1] = index; this.selection[0] = page;
this.randomList.indexOf(
this.musicMx[this.selection[0]][this.selection[1]]
);
core.playBgm( this.selection[1] = index;
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ this.randomList.indexOf(
main.core.ui.music.selection[1] this.musicMx[this.selection[0]][this.selection[1]]
] );
);
this.stop = false; core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
);
this.stop = false;
}
} else { } else {
if (this.stop) { if (this.stop) {
this.stop = !this.stop; this.stop = !this.stop;
@ -16755,64 +16768,68 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.stop = false; this.stop = false;
switch (this.type) { switch (this.type) {
case "danqu": case "danqu":
if (!this.stop)
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
] ]
); );
page = this.selection[0]; page = this.selection[0];
break; break;
case "xunhuan": case "xunhuan":
if (this.selection[1] === 0) { for (;;) {
if (this.selection[0] === 0) { if (this.selection[1] === 0) {
this.selection[0] = this.musicMx.length - 1; if (this.selection[0] === 0) {
this.selection[1] = this.selection[0] = this.musicMx.length - 1;
this.musicMx[this.selection[0]].length - 1; this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
} else {
this.selection[0] -= 1;
this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
}
} else { } else {
this.selection[0] -= 1; this.selection[1] -= 1;
this.selection[1] =
this.musicMx[this.selection[0]].length - 1;
} }
} else { this.random = this.randomList.indexOf(
this.selection[1] -= 1; this.musicMx[this.selection[0]][this.selection[1]]
}
this.random = this.randomList.indexOf(
this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
if (!this.stop)
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
); );
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
}
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
);
break; break;
case "suiji": case "suiji":
if (this.random > 0) { for (;;) {
this.random -= 1; if (this.random > 0) {
} else { this.random -= 1;
this.random = this.randomList.length - 1; } else {
} this.random = this.randomList.length - 1;
this.selection[0] = this.musicMx.findIndex((v) => }
v.includes(this.randomList[this.random]) this.selection[0] = this.musicMx.findIndex((v) =>
); v.includes(this.randomList[this.random])
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
this.randomList[this.random]
);
page = this.selection[0];
if (!this.stop)
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
); );
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
this.randomList[this.random]
);
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
}
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
);
break; break;
} }
@ -16822,64 +16839,68 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.stop = false; this.stop = false;
switch (this.type) { switch (this.type) {
case "danqu": case "danqu":
if (!this.stop)
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
] ]
); );
page = this.selection[0]; page = this.selection[0];
break; break;
case "xunhuan": case "xunhuan":
if ( for (;;) {
this.selection[1] === if (
this.musicMx[this.selection[0]].length - 1 this.selection[1] ===
) { this.musicMx[this.selection[0]].length - 1
if (this.selection[0] === this.musicMx.length - 1) { ) {
this.selection[0] = 0; if (this.selection[0] === this.musicMx.length - 1) {
this.selection[1] = 0; this.selection[0] = 0;
this.selection[1] = 0;
} else {
this.selection[0] += 1;
this.selection[1] = 0;
}
} else { } else {
this.selection[0] += 1; this.selection[1] += 1;
this.selection[1] = 0;
} }
} else { this.randomList.findIndex(
this.selection[1] += 1; (v) =>
} v === this.musicMx[this.selection[0]][this.selection[1]]
this.randomList.findIndex(
(v) =>
v === this.musicMx[this.selection[0]][this.selection[1]]
);
page = this.selection[0];
if (!this.stop)
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
); );
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
}
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
);
break; break;
case "suiji": case "suiji":
if (this.random < this.randomList.length - 1) { for (;;) {
this.random += 1; if (this.random < this.randomList.length - 1) {
} else { this.random += 1;
this.random = 0; } else {
} this.random = 0;
this.selection[0] = this.musicMx.findIndex((v) => }
v.includes(this.randomList[this.random]) this.selection[0] = this.musicMx.findIndex((v) =>
); v.includes(this.randomList[this.random])
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
main.core.ui.music.randomList[main.core.ui.music.random]
);
page = this.selection[0];
if (!this.stop)
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
); );
this.selection[1] = this.musicMx[this.selection[0]].indexOf(
main.core.ui.music.randomList[main.core.ui.music.random]
);
page = this.selection[0];
if (this.musics.includes(this.musicMx[this.selection[0]][this.selection[1]]) || page !== this.musicMx.length - 1) break
}
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
);
break; break;
} }
@ -16902,18 +16923,20 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (inRect(pos, musicbox)) { if (inRect(pos, musicbox)) {
const index = Math.floor((py - 100) / 100); const index = Math.floor((py - 100) / 100);
if (page !== this.selection[0] || index !== this.selection[1]) { if (page !== this.selection[0] || index !== this.selection[1]) {
this.selection[0] = page; if (this.musics.includes(this.musicMx[page][index]) || page !== this.musicMx.length - 1) {
this.selection[1] = index; this.selection[0] = page;
this.randomList.indexOf( this.selection[1] = index;
(v) => v === this.musicMx[this.selection[0]][this.selection[1]] this.randomList.indexOf(
); (v) => v === this.musicMx[this.selection[0]][this.selection[1]]
);
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]
] ]
); );
this.stop = false; this.stop = false;
}
} else { } else {
if (this.stop) { if (this.stop) {
this.stop = !this.stop; this.stop = !this.stop;
@ -16986,24 +17009,27 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.setTextAlign(ctx, "left"); core.setTextAlign(ctx, "left");
for (let i = 0; i < indexList.length; i++) { for (let i = 0; i < indexList.length; i++) {
const text = this.musicname[indexList[i]]; const text = this.musicname[indexList[i]];
core.fillBoldText1( if (this.musics.includes(this.musicMx[page][i]) || page !== this.musicMx.length - 1) {
ctx, core.fillBoldText1(
text, ctx,
150, text,
posy - 30, 150,
page === this.selection[0] && i === this.selection[1] ? posy - 30,
"#FFFFFF" : page === this.selection[0] && i === this.selection[1] ?
"#444444", "#FFFFFF" :
"#000000", "#444444",
6, "#000000",
core.ui._buildFont(66, true) 6,
); core.ui._buildFont(66, true)
ctx.strokeStyle = "#FFFFFF"; );
ctx.lineWidth = 3;
ctx.beginPath(); ctx.strokeStyle = "#FFFFFF";
ctx.moveTo(100, posy); ctx.lineWidth = 3;
ctx.lineTo(1148, posy); ctx.beginPath();
ctx.stroke(); ctx.moveTo(100, posy);
ctx.lineTo(1148, posy);
ctx.stroke();
}
posy += 100; posy += 100;
} }
ctx.beginPath(); ctx.beginPath();
@ -17136,24 +17162,27 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.setTextAlign(ctx, "left"); core.setTextAlign(ctx, "left");
for (let i = 0; i < indexList.length; i++) { for (let i = 0; i < indexList.length; i++) {
const text = this.musicname[indexList[i]]; const text = this.musicname[indexList[i]];
core.fillBoldText1( if (this.musics.includes(this.musicMx[page][i]) || page !== this.musicMx.length - 1) {
ctx, core.fillBoldText1(
text, ctx,
950, text,
posy - 30, 950,
page === this.selection[0] && i === this.selection[1] ? posy - 30,
"#FFFFFF" : page === this.selection[0] && i === this.selection[1] ?
"#444444", "#FFFFFF" :
"#000000", "#444444",
6, "#000000",
core.ui._buildFont(66, true) 6,
); core.ui._buildFont(66, true)
ctx.strokeStyle = "#FFFFFF"; );
ctx.lineWidth = 3;
ctx.beginPath(); ctx.strokeStyle = "#FFFFFF";
ctx.moveTo(900, posy); ctx.lineWidth = 3;
ctx.lineTo(1900, posy); ctx.beginPath();
ctx.stroke(); ctx.moveTo(900, posy);
ctx.lineTo(1900, posy);
ctx.stroke();
}
posy += 100; posy += 100;
} }
core.fillBoldText1( core.fillBoldText1(
@ -17248,7 +17277,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.ui.music = new musicclass(); core.ui.music = new musicclass();
main.dom.musicMode.onclick = function () { main.dom.musicMode.onclick = function () {
//点击开始页面的CG MODE进入cg回廊 //点击开始页面的CG MODE进入cg回廊
main.core.ui.music.musics = core.getLocalStorage("musics", ["theme.opus"])
core.playBgm( core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1] main.core.ui.music.selection[1]