From 7523611b878e08884936a78d0ed4f81417bd6867 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Sun, 22 Dec 2024 22:20:00 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/project/plugins.js b/project/plugins.js index f0f66b1..dbb2f87 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -9751,6 +9751,7 @@ core.plugin.animate = { this.time = 0; this.WindowSkin = false; this.sound = ""; + this.beforeSound = 0; } click(px, py) { //点击效果 @@ -9772,10 +9773,11 @@ core.plugin.animate = { const skipbox = makeBox([1400, 1100], [192, 96]); const skipboxVertical = makeBox([52, 1400], [96, 192]) const autobox = makeBox([1700, 900], [192, 96]); - const autoboxVertical = makeBox([352, 1700], [96, 192]) + const autoboxVertical = makeBox([256, 1700], [96, 192]) if ((core.domStyle.isVertical && inRect(pos, skipboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, skipbox))) { auto = false; let time = 0 + core.stopSound(this.beforeSound); core.registerAnimationFrame("skip", true, (timestamp) => { if (timestamp > time + 100) { time = timestamp @@ -9818,6 +9820,7 @@ core.plugin.animate = { if (core.status.event.animateUI) return; auto = false; const data = core.clone(core.status.event.data.current); + // 打字机效果显示全部文字 if (core.status.event.interval != null) { data.showAll = true; @@ -9827,6 +9830,8 @@ core.plugin.animate = { core.insertAction(data); core.doAction(); return; + } else { + core.stopSound(this.beforeSound); } cg.style.display = "none" @@ -9927,7 +9932,7 @@ core.plugin.animate = { if (config.time == 0) { while (_drawNext()); - if (auto && !this.WindowSkin && !this.sound) { + if (auto && !this.WindowSkin && !core.ui.cgText.sound || (core.ui.cgText.sound && !core.musicStatus.soundStatus)) { setTimeout(() => { if (auto) core.doAction() }, 2000) } } else { @@ -9936,7 +9941,7 @@ core.plugin.animate = { if (!_drawNext()) { clearInterval(core.status.event.interval); core.status.event.interval = null; - if (auto && !this.WindowSkin && !this.sound) setTimeout(() => { if (auto) core.doAction() }, 2000) + if (auto && !this.WindowSkin && !core.ui.cgText.sound || (core.ui.cgText.sound && !core.musicStatus.soundStatus)) setTimeout(() => { if (auto) core.doAction() }, 2000) } }, config.time); } @@ -9949,6 +9954,7 @@ core.plugin.animate = { } background() { const img = core.material.images.images?.[this.image] + if (core.domStyle.isVertical) { ctx.canvas.width = 1248; ctx.canvas.height = 2028; @@ -9990,9 +9996,9 @@ core.plugin.animate = { core.fillBoldText(ctx, autoText, 1722, 966, '#FFFFFF', '#000000', "bold 48px Verdana") } if (this.name) core.fillBoldText(ctx, `【${this.name}】`, 500, 880, '#FFFFFF', '#000000', "bold 48px Verdana") //绘制名字 - if (this.sound && core.material.sounds[this.sound] && !core.getFlag("skip", false)) { - core.playSound(this.sound, null, () => { - if (auto && !this.WindowSkin) { + if (this.sound && core.material.sounds[this.sound] && !core.getFlag("skip", false) && core.musicStatus.soundStatus) { + this.beforeSound = core.playSound(this.sound, null, () => { + if (this.sound && auto && !this.WindowSkin && core.musicStatus.soundStatus) { setTimeout(() => { if (auto) core.doAction() }, 2000) } })