cg音频重置

This commit is contained in:
草莓 2025-02-01 09:23:06 +08:00
parent 3f53086c9f
commit eb19824d50

View File

@ -113,8 +113,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
data.image, data.image,
data.memory, data.memory,
data.hidetime || 30, data.hidetime || 30,
data.list || [ data.list || [{
{
text: "", text: "",
sound: "", sound: "",
time: 50, time: 50,
@ -122,8 +121,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "#000000", boldColor: "#000000",
font: "bold 48px Verdana", font: "bold 48px Verdana",
frame: 0, frame: 0,
}, }, ]
]
); );
} else { } else {
core.doAction(); core.doAction();
@ -203,13 +201,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.ui.cgText.head = core.clone(data.head); core.ui.cgText.head = core.clone(data.head);
core.ui.cgText.index = data.index; core.ui.cgText.index = data.index;
core.ui.cgText.name = core.ui.cgText.textList[data.index][0]; core.ui.cgText.name = core.ui.cgText.textList[data.index][0];
core.ui.cgText.text = data.text core.ui.cgText.text = data.text ?
? data.text data.text :
: core.ui.cgText.textList[data.index][1]; core.ui.cgText.textList[data.index][1];
core.ui.cgText.time = data.time; core.ui.cgText.time = data.time;
core.ui.cgText.wait = data.wait; core.ui.cgText.wait = data.wait;
core.ui.cgText.WindowSkin = data.WindowSkin; core.ui.cgText.WindowSkin = data.WindowSkin;
core.ui.cgText.sound = data.sound || ""; core.ui.cgText.sound = data.sound === "" ? data.sound : core.ui.cgText.textList[data.index][3] || "";
core.ui.cgText.bodyList = core.clone(data.bodyList); core.ui.cgText.bodyList = core.clone(data.bodyList);
main.dom.cgText.style.display = "block"; main.dom.cgText.style.display = "block";
core.ui.cgText.update(); core.ui.cgText.update();
@ -15184,7 +15182,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
[x + w, y + h], [x + w, y + h],
]; ];
}; };
const inRect = ([x, y], [[sx, sy], [dx, dy]]) => { const inRect = ([x, y], [
[sx, sy],
[dx, dy]
]) => {
return sx <= x && x <= dx && sy <= y && y <= dy; return sx <= x && x <= dx && sy <= y && y <= dy;
}; };
const pos = [px, py]; const pos = [px, py];
@ -15365,9 +15366,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
config.defaultFont = config.font = config.font || globalAttribute.font; config.defaultFont = config.font = config.font || globalAttribute.font;
config.time = config.time || 0; config.time = config.time || 0;
config.letterSpacing = config.letterSpacing =
config.letterSpacing == null config.letterSpacing == null ?
? textAttribute.letterSpacing || 0 textAttribute.letterSpacing || 0 :
: config.letterSpacing; config.letterSpacing;
config.index = 0; config.index = 0;
config.currcolor = config.color; config.currcolor = config.color;
@ -15421,9 +15422,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var block = config.blocks[config.index++]; var block = config.blocks[config.index++];
if (block != null) { if (block != null) {
// It works, why? // It works, why?
const scale = config.isHD const scale = config.isHD ?
? devicePixelRatio * core.domStyle.scale devicePixelRatio * core.domStyle.scale :
: 1; 1;
ctx.restore(); ctx.restore();
ctx.save(); //保存设置 ctx.save(); //保存设置
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
@ -15526,17 +15527,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const indexList = this.textList; const indexList = this.textList;
core.setTextAlign(logctx, "left"); core.setTextAlign(logctx, "left");
for ( for (
let i = (page - 1) * 6; let i = (page - 1) * 6; i <= Math.min(this.index, page * 6 - 1); i++
i <= Math.min(this.index, page * 6 - 1);
i++
) { ) {
const text = this.textList[i][1].replaceAll( const text = this.textList[i][1].replaceAll(
/(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g, /(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g,
"" ""
); //取消打字机 ); //取消打字机
const name = this.textList[i][0] const name = this.textList[i][0] ?
? "【" + this.textList[i][0] + "】" "【" + this.textList[i][0] + "】" :
: ""; "";
if (name) { if (name) {
core.fillBoldText1( core.fillBoldText1(
logctx, logctx,