增添cg中page的修改项与绘图功能

This commit is contained in:
sakuya 2024-12-06 15:00:10 +08:00
parent 2ae8119ae3
commit 93fade2337
3 changed files with 43 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -59,5 +59,11 @@ main.floors.MT6=
"fgmap": [
],
"areas": "研究所"
"areas": "研究所",
"bg2map": [
],
"fg2map": [
]
}

View File

@ -8663,6 +8663,7 @@ core.plugin.animate = {
CGUI.style.transform = "translate(-50%,-50%)"
const ctx = CGUI.getContext("2d");
main.dom.CGUI = CGUI;
if (core.getLocalStorage("page", null) == null) core.setLocalStorage("page", 0);
CGUI.onclick = function (e) {
try {
e.preventDefault();
@ -8763,9 +8764,18 @@ core.plugin.animate = {
constructor() {
//cg列表
this.UIMx = [ //空位用none填充当前ui至多4列6行
["none", "none", 'none'],
["none", "none", "none"],
["none", "none", "none"],
[
["background.png", "bg.jpg", 'bg_5043.png'],
["none", "none", "none"]
],
[
["none", "none", 'none'],
["none", "none", "none"]
],
[
["none", "none", 'none'],
["none", "none", "none"]
]
];
}
@ -8790,7 +8800,8 @@ core.plugin.animate = {
}
onclick(px, py) { //点击
console.log([px, py])
console.log([px, py]);
if (px >= 33 && px <= 177 && py >= 33 && py <= 177) { //离开按钮是一致的,其余的记区分横竖屏
CGUI.style.display = "none"
core.clearMap(ctx)
@ -8798,12 +8809,28 @@ core.plugin.animate = {
}
if (core.domStyle.isVertical) {
//竖屏
if (px >= 33 && px <= 177 && py >= 384 && py <= 520) {
//2代表当前最大页数-1
core.setLocalStorage("page", Math.min(2, core.getLocalStorage("page", 0) + 1));
console.log(core.getLocalStorage("page"));
} else if (px >= 33 && px <= 177 && py >= 1080 && py <= 1270) {
core.setLocalStorage("page", Math.max(0, core.getLocalStorage("page", 2) - 1));
console.log(core.getLocalStorage("page"));
}
} else {
if (px >= 33 && px <= 177 && py >= 342 && py <= 471) {
//下翻页
console.log(1);
//2代表当前最大页数-1
core.setLocalStorage("page", Math.min(2, core.getLocalStorage("page", 0) + 1));
console.log(core.getLocalStorage("page"));
} else if (px >= 33 && px <= 177 && py >= 837 && py <= 975) {
console.log(2);
core.setLocalStorage("page", Math.max(0, core.getLocalStorage("page", 2) - 1));
console.log(core.getLocalStorage("page"));
}
for (let i = 0; i < 2; i++) {
for (let j = 0; j < 3; j++) {
//这里是绘图脚本,然而我并不会写,交给草莓了
//drawImage(ctx, this.UIMx[core.getLocalStorage("page")][i * 3 - 3 + j], 480, 320, 300 + j * 500, 300 + i * 450);
}
}
}
}
@ -8870,14 +8897,13 @@ core.plugin.animate = {
core.strokeRect(ctx, 300 + j * 500, 300 + i * 450, 480, 320, "#444444", 2);
}
}
// 添加浏览模式和CG模式的字样
core.fillRoundRect(ctx, 550 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 550 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, '浏览模式', 600, 100, '#FFFFFF', core.ui._buildFont(24, true));
core.fillRoundRect(ctx, 1150 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
core.strokeRoundRect(ctx, 1150 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3);
core.fillText(ctx, 'CG模式', 1200, 100, '#FFFFFF', core.ui._buildFont(24, true));
core.fillText(ctx, 'CG模式', 1200, 100, '#FFFFFF', core.ui._buildFont(24, true))
}