自动cg剧情

This commit is contained in:
草莓 2024-12-21 22:43:57 +08:00
parent 63708720dc
commit d8d9809da6
3 changed files with 25 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,12 @@ main.floors.jiuguan=
], ],
"direction": "down" "direction": "down"
} }
],
"4,10": [
{
"type": "insert",
"name": "chapter0"
}
] ]
}, },
"changeFloor": {}, "changeFloor": {},

View File

@ -9715,6 +9715,7 @@ core.plugin.animate = {
main.log(ee); main.log(ee);
} }
} }
let auto = false;
class cgText { class cgText {
constructor() { //绘制需要的变量 constructor() { //绘制需要的变量
this.image = "" this.image = ""
@ -9744,7 +9745,10 @@ core.plugin.animate = {
const saveboxVertical = makeBox([52, 1700], [96, 192]) const saveboxVertical = makeBox([52, 1700], [96, 192])
const skipbox = makeBox([1400, 1100], [192, 96]); const skipbox = makeBox([1400, 1100], [192, 96]);
const skipboxVertical = makeBox([52, 1400], [96, 192]) const skipboxVertical = makeBox([52, 1400], [96, 192])
const autobox = makeBox([1700, 900], [192, 96]);
const autoboxVertical = makeBox([352, 1700], [96, 192])
if ((core.domStyle.isVertical && inRect(pos, skipboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, skipbox))) { if ((core.domStyle.isVertical && inRect(pos, skipboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, skipbox))) {
auto = false;
let time = 0 let time = 0
core.registerAnimationFrame("skip", true, (timestamp) => { core.registerAnimationFrame("skip", true, (timestamp) => {
if (timestamp > time + 100) { if (timestamp > time + 100) {
@ -9755,7 +9759,11 @@ core.plugin.animate = {
} }
} }
}) })
} else if ((core.domStyle.isVertical && inRect(pos, autoboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, autobox))) {
auto = !auto;
} else if ((core.domStyle.isVertical && inRect(pos, saveboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, savebox))) { //存档 } else if ((core.domStyle.isVertical && inRect(pos, saveboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, savebox))) { //存档
auto = false;
if (core.status.event.animateUI) return; if (core.status.event.animateUI) return;
if (core.status.event.interval != null) return; if (core.status.event.interval != null) return;
const current = core.clone(core.status.event.data.current) const current = core.clone(core.status.event.data.current)
@ -9768,9 +9776,10 @@ core.plugin.animate = {
core.doAction(); core.doAction();
} else { } else {
// 正在淡入淡出的话不执行 // 正在淡入淡出的话不执行
if (core.status.event.animateUI) return; if (core.status.event.animateUI) return;
auto = false;
var data = core.clone(core.status.event.data.current); var data = core.clone(core.status.event.data.current);
// 打字机效果显示全部文字 // 打字机效果显示全部文字
if (core.status.event.interval != null) { if (core.status.event.interval != null) {
@ -9881,12 +9890,16 @@ core.plugin.animate = {
if (config.time == 0) { if (config.time == 0) {
while (_drawNext()); while (_drawNext());
if (auto && core.ui.cgText.WindowSkin) {
setTimeout(() => { if (auto) core.doAction() }, 2000)
}
} else { } else {
clearInterval(core.status.event.interval); clearInterval(core.status.event.interval);
core.status.event.interval = setInterval(function () { core.status.event.interval = setInterval(function () {
if (!_drawNext()) { if (!_drawNext()) {
clearInterval(core.status.event.interval); clearInterval(core.status.event.interval);
core.status.event.interval = null; core.status.event.interval = null;
setTimeout(() => { if (auto) core.doAction() }, 2000)
} }
}, config.time); }, config.time);
} }
@ -9934,6 +9947,10 @@ core.plugin.animate = {
core.fillBoldText(ctx, '存 档', 1736, 1166, '#FFFFFF', '#000000', "bold 48px Verdana") core.fillBoldText(ctx, '存 档', 1736, 1166, '#FFFFFF', '#000000', "bold 48px Verdana")
core.drawWindowSkin("winskin.png", ctx, 1400, 1100, 192, 96) core.drawWindowSkin("winskin.png", ctx, 1400, 1100, 192, 96)
core.fillBoldText(ctx, '▶▶', 1456, 1166, '#FFFFFF', '#000000', "bold 48px Verdana") core.fillBoldText(ctx, '▶▶', 1456, 1166, '#FFFFFF', '#000000', "bold 48px Verdana")
core.drawWindowSkin("winskin.png", ctx, 1700, 900, 192, 96)
let autoText = "AUTO";
if (auto) autoText = "STOP";
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.name) core.fillBoldText(ctx, `${this.name}`, 500, 880, '#FFFFFF', '#000000', "bold 48px Verdana") //绘制名字
if (this.text) { //绘制对话 if (this.text) { //绘制对话