bug修复

This commit is contained in:
草莓 2024-12-22 22:20:00 +08:00
parent 119570953e
commit 7523611b87

View File

@ -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)
}
})