手册背景

This commit is contained in:
strawberry 2025-07-12 11:49:53 +08:00
parent 44d4c98a82
commit 25fee47279
5 changed files with 212 additions and 176 deletions

View File

@ -747,7 +747,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
mon_turn = 0; mon_turn = 0;
let equipInfo = [] //回合生效的装备列表 let equipInfo = [] //回合生效的装备列表
if (core.hasSpecial(mon_special, 13)) equipInfo.push({ if (core.hasSpecial(mon_special, 13)) equipInfo.push({
id: "献祭", //需注册图标 id: "A374", //需注册图标
speed: mon_hp speed: mon_hp
}) })
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {

View File

@ -152,7 +152,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
"rightPortal": 25, "rightPortal": 25,
"upPortal": 26, "upPortal": 26,
"ice": 27, "ice": 27,
"magentaWall": 28 "magentaWall": 28,
"A437": 29
}, },
"npcs": { "npcs": {
"man": 0, "man": 0,

View File

@ -335,6 +335,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"434": {"cls":"enemys","id":"E434"}, "434": {"cls":"enemys","id":"E434"},
"435": {"cls":"enemys","id":"E435"}, "435": {"cls":"enemys","id":"E435"},
"436": {"cls":"enemys","id":"E436"}, "436": {"cls":"enemys","id":"E436"},
"437": {"cls":"animates","id":"A437"},
"20034": {"cls":"tileset","id":"X20034","canPass":true}, "20034": {"cls":"tileset","id":"X20034","canPass":true},
"20154": {"cls":"tileset","id":"X20154","canPass":true}, "20154": {"cls":"tileset","id":"X20154","canPass":true},
"20216": {"cls":"tileset","id":"X20216","canPass":true}, "20216": {"cls":"tileset","id":"X20216","canPass":true},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -323,7 +323,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
data.sound : data.sound :
core.plugin[core.ui.cgText.textList][data.index][2] || ""; core.plugin[core.ui.cgText.textList][data.index][2] || "";
core.ui.cgText.bodyList = core.clone(data.bodyList); core.ui.cgText.bodyList = core.clone(data.bodyList);
main.dom.cgText.style.display = "block"; main.dom.cg.style.display = "block";
core.ui.cgText.update(); core.ui.cgText.update();
} else { } else {
core.doAction(); core.doAction();
@ -2785,9 +2785,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.music.style.width = obj.totalWidth + "px"; main.dom.music.style.width = obj.totalWidth + "px";
main.dom.music.style.height = obj.totalHeight + "px"; main.dom.music.style.height = obj.totalHeight + "px";
} }
if (main.dom.cgText) { if (main.dom.cg) {
main.dom.cgText.style.width = obj.totalWidth + "px"; main.dom.cg.style.width = obj.totalWidth + "px";
main.dom.cgText.style.height = obj.totalHeight + "px"; main.dom.cg.style.height = obj.totalHeight + "px";
} }
if (main.dom.logcanvas) { if (main.dom.logcanvas) {
main.dom.logcanvas.style.width = obj.totalWidth + "px"; main.dom.logcanvas.style.width = obj.totalWidth + "px";
@ -2804,17 +2804,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (main.dom.video) { if (main.dom.video) {
main.dom.video.style.width = obj.totalWidth + "px"; main.dom.video.style.width = obj.totalWidth + "px";
main.dom.video.style.height = obj.totalHeight + "px"; main.dom.video.style.height = obj.totalHeight + "px";
if (core.domStyle.isVertical)
main.dom.video.style.width = obj.totalHeight + "px";
if (core.domStyle.isVertical)
main.dom.video.style.height = obj.totalWidth + "px";
main.dom.video.style.top = "50%";
main.dom.video.style.left = "50%";
main.dom.video.style.transform = "translate(-50%,-50%)";
if (core.domStyle.isVertical)
main.dom.video.style.transform = "translate(-50%,-50%) rotate(90deg)";
} }
if (main.dom.video1) { if (main.dom.video1) {
main.dom.video1.style.width = obj.totalWidth + "px"; main.dom.video1.style.width = obj.totalWidth + "px";
@ -13102,76 +13092,75 @@ let time=0
}; };
}, },
"墓碑(编辑器)": function () { "墓碑(编辑器)": function () {
// 在此增加新插件 // 在此增加新插件
if (main.mode != "editor") return; // 编辑器模式下使用 if (main.mode != "editor") return; // 编辑器模式下使用
var mapData = null; var mapData = null;
var drawMap = core.maps._drawMap_drawAll; var drawMap = core.maps._drawMap_drawAll;
core.maps._drawMap_drawAll = function (floorId) { core.maps._drawMap_drawAll = function (floorId) {
floorId = floorId || core.status.floorId; floorId = floorId || core.status.floorId;
if (!main.useCompress) { if (!main.useCompress) {
core.getLocalForage( core.getLocalForage(
"autoSave", "autoSave", { maps: [] },
{ maps: [] }, function (v) {
function (v) { mapData = v.maps[floorId]?.map;
mapData = v.maps[floorId]?.map; drawMap.call(core.maps, floorId);
drawMap.call(core.maps, floorId); },
}, function (e) {
function (e) { console.log(e);
console.log(e); }
} );
); }
} };
};
maps.prototype._drawBlockInfo = function (blockInfo, x, y) { maps.prototype._drawBlockInfo = function (blockInfo, x, y) {
var alpha = 1.0; var alpha = 1.0;
if (mapData && !!mapData[y] && mapData[y][x] == 0) { if (mapData && !!mapData[y] && mapData[y][x] == 0) {
core.setAlpha("event", 0.5); core.setAlpha("event", 0.5);
core.setAlpha("event2", 0.5); core.setAlpha("event2", 0.5);
} }
var image = blockInfo.image, var image = blockInfo.image,
posX = blockInfo.posX, posX = blockInfo.posX,
posY = blockInfo.posY, posY = blockInfo.posY,
height = blockInfo.height; height = blockInfo.height;
core.clearMap("event", x * 32, y * 32, 32, 32); core.clearMap("event", x * 32, y * 32, 32, 32);
if (blockInfo.bigImage) { if (blockInfo.bigImage) {
this._drawBlockInfo_bigImage(blockInfo, x, y, "event"); this._drawBlockInfo_bigImage(blockInfo, x, y, "event");
core.setAlpha("event", alpha); core.setAlpha("event", alpha);
core.setAlpha("event2", alpha); core.setAlpha("event2", alpha);
return; return;
} }
core.drawImage( core.drawImage(
"event", "event",
image, image,
posX * 32, posX * 32,
posY * height + height - 32, posY * height + height - 32,
32, 32,
32, 32,
x * 32, x * 32,
y * 32, y * 32,
32, 32,
32 32
); );
if (height > 32) { if (height > 32) {
core.clearMap("event2", x * 32, y * 32 + 32 - height, 32, height - 32); core.clearMap("event2", x * 32, y * 32 + 32 - height, 32, height - 32);
core.drawImage( core.drawImage(
"event2", "event2",
image, image,
posX * 32, posX * 32,
posY * height, posY * height,
32, 32,
height - 32, height - 32,
x * 32, x * 32,
y * 32 + 32 - height, y * 32 + 32 - height,
32, 32,
height - 32 height - 32
); );
} }
core.setAlpha("event", alpha); core.setAlpha("event", alpha);
core.setAlpha("event2", alpha); core.setAlpha("event2", alpha);
}; };
}, },
"小地图": function () { "小地图": function () {
// 在此增加新插件 // 在此增加新插件
// ----- 不可自定义 杂七杂八的变量 // ----- 不可自定义 杂七杂八的变量
@ -13622,10 +13611,7 @@ let time=0
CGUI.style.zIndex = 300; CGUI.style.zIndex = 300;
CGUI.style.display = "none"; CGUI.style.display = "none";
CGUI.id = "CGUI"; CGUI.id = "CGUI";
main.dom.gameGroup.insertAdjacentElement("afterend", CGUI); main.dom.startPanel.insertAdjacentElement("afterend", CGUI)
CGUI.style.top = "50%";
CGUI.style.left = "50%";
CGUI.style.transform = "translate(-50%,-50%)";
const ctx = CGUI.getContext("2d"); const ctx = CGUI.getContext("2d");
main.dom.CGUI = CGUI; main.dom.CGUI = CGUI;
let page = 0; //初始页面 let page = 0; //初始页面
@ -14582,22 +14568,16 @@ let time=0
cg.style.position = "absolute"; cg.style.position = "absolute";
cg.style.zIndex = 320; cg.style.zIndex = 320;
cg.style.display = "none"; cg.style.display = "none";
cg.id = "cgText"; cg.id = "cg";
main.dom.gameGroup.insertAdjacentElement("afterend", cg); main.dom.startPanel.insertAdjacentElement("afterend", cg)
cg.style.top = "50%";
cg.style.left = "50%";
cg.style.transform = "translate(-50%,-50%)";
const ctx = cg.getContext("2d"); const ctx = cg.getContext("2d");
main.dom.cgText = cg; main.dom.cg = cg;
const logcanvas = document.createElement("canvas"); //cg画布设置 const logcanvas = document.createElement("canvas"); //cg画布设置
logcanvas.style.position = "absolute"; logcanvas.style.position = "absolute";
logcanvas.style.zIndex = 321; logcanvas.style.zIndex = 321;
logcanvas.style.display = "none"; logcanvas.style.display = "none";
logcanvas.id = "cgText"; logcanvas.id = "logcanvas";
main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas); main.dom.startPanel.insertAdjacentElement("afterend", logcanvas)
logcanvas.style.top = "50%";
logcanvas.style.left = "50%";
logcanvas.style.transform = "translate(-50%,-50%)";
const logctx = logcanvas.getContext("2d"); const logctx = logcanvas.getContext("2d");
main.dom.logcanvas = logcanvas; main.dom.logcanvas = logcanvas;
logcanvas.onmouseup = function (e) { logcanvas.onmouseup = function (e) {
@ -14855,7 +14835,7 @@ let time=0
core.status.event.data.type == "cgtext" core.status.event.data.type == "cgtext"
) { ) {
core.setFlag("skip", true); core.setFlag("skip", true);
main.dom.cgText.style.display = "none"; main.dom.cg.style.display = "none";
core.doAction(); core.doAction();
} }
}); });
@ -15477,10 +15457,7 @@ let time=0
over.style.zIndex = 310; over.style.zIndex = 310;
over.style.display = "none"; over.style.display = "none";
over.id = "over"; over.id = "over";
main.dom.gameGroup.insertAdjacentElement("afterend", over); main.dom.startPanel.insertAdjacentElement("afterend", over)
over.style.top = "50%";
over.style.left = "50%";
over.style.transform = "translate(-50%,-50%)";
const ctx1 = over.getContext("2d"); const ctx1 = over.getContext("2d");
main.dom.over = over; main.dom.over = over;
@ -16036,10 +16013,7 @@ let time=0
boss.style.zIndex = 310; boss.style.zIndex = 310;
boss.style.display = "none"; boss.style.display = "none";
boss.id = "boss"; boss.id = "boss";
main.dom.gameGroup.insertAdjacentElement("afterend", boss); main.dom.startPanel.insertAdjacentElement("afterend", boss)
boss.style.top = "50%";
boss.style.left = "50%";
boss.style.transform = "translate(-50%,-50%)";
const ctx = boss.getContext("2d"); const ctx = boss.getContext("2d");
main.dom.boss = boss; main.dom.boss = boss;
const boss1 = document.createElement("canvas"); //boss战画布设置 const boss1 = document.createElement("canvas"); //boss战画布设置
@ -16047,10 +16021,7 @@ let time=0
boss1.style.zIndex = 300; boss1.style.zIndex = 300;
boss1.style.display = "none"; boss1.style.display = "none";
boss1.id = "boss1"; boss1.id = "boss1";
main.dom.gameGroup.insertAdjacentElement("afterend", boss1); main.dom.startPanel.insertAdjacentElement("afterend", boss1)
boss1.style.top = "50%";
boss1.style.left = "50%";
boss1.style.transform = "translate(-50%,-50%)";
const ctx1 = boss1.getContext("2d"); const ctx1 = boss1.getContext("2d");
main.dom.boss1 = boss1; main.dom.boss1 = boss1;
const boss2 = document.createElement("canvas"); //boss战画布设置 const boss2 = document.createElement("canvas"); //boss战画布设置
@ -16058,10 +16029,7 @@ let time=0
boss2.style.zIndex = 301; boss2.style.zIndex = 301;
boss2.style.display = "none"; boss2.style.display = "none";
boss2.id = "boss2"; boss2.id = "boss2";
main.dom.gameGroup.insertAdjacentElement("afterend", boss2); main.dom.startPanel.insertAdjacentElement("afterend", boss2)
boss2.style.top = "50%";
boss2.style.left = "50%";
boss2.style.transform = "translate(-50%,-50%)";
main.dom.boss2 = boss2; main.dom.boss2 = boss2;
const ctx2 = boss2.getContext("2d"); const ctx2 = boss2.getContext("2d");
const boss3 = document.createElement("canvas"); //boss战画布设置 const boss3 = document.createElement("canvas"); //boss战画布设置
@ -16069,10 +16037,7 @@ let time=0
boss3.style.zIndex = 302; boss3.style.zIndex = 302;
boss3.style.display = "none"; boss3.style.display = "none";
boss3.id = "boss3"; boss3.id = "boss3";
main.dom.gameGroup.insertAdjacentElement("afterend", boss3); main.dom.startPanel.insertAdjacentElement("afterend", boss3)
boss3.style.top = "50%";
boss3.style.left = "50%";
boss3.style.transform = "translate(-50%,-50%)";
main.dom.boss3 = boss3; main.dom.boss3 = boss3;
const ctx3 = boss3.getContext("2d"); const ctx3 = boss3.getContext("2d");
const boss4 = document.createElement("canvas"); //boss战画布设置 const boss4 = document.createElement("canvas"); //boss战画布设置
@ -16080,10 +16045,7 @@ let time=0
boss4.style.zIndex = 303; boss4.style.zIndex = 303;
boss4.style.display = "none"; boss4.style.display = "none";
boss4.id = "boss4"; boss4.id = "boss4";
main.dom.gameGroup.insertAdjacentElement("afterend", boss4); main.dom.startPanel.insertAdjacentElement("afterend", boss4)
boss4.style.top = "50%";
boss4.style.left = "50%";
boss4.style.transform = "translate(-50%,-50%)";
const ctx4 = boss4.getContext("2d"); const ctx4 = boss4.getContext("2d");
main.dom.boss4 = boss4; main.dom.boss4 = boss4;
const boss5 = document.createElement("canvas"); //boss战画布设置 const boss5 = document.createElement("canvas"); //boss战画布设置
@ -16091,10 +16053,7 @@ let time=0
boss5.style.zIndex = 304; boss5.style.zIndex = 304;
boss5.style.display = "none"; boss5.style.display = "none";
boss5.id = "boss5"; boss5.id = "boss5";
main.dom.gameGroup.insertAdjacentElement("afterend", boss5); main.dom.startPanel.insertAdjacentElement("afterend", boss5)
boss5.style.top = "50%";
boss5.style.left = "50%";
boss5.style.transform = "translate(-50%,-50%)";
const ctx5 = boss5.getContext("2d"); const ctx5 = boss5.getContext("2d");
main.dom.boss5 = boss5; main.dom.boss5 = boss5;
@ -16103,10 +16062,7 @@ let time=0
boss6.style.zIndex = 305; boss6.style.zIndex = 305;
boss6.style.display = "none"; boss6.style.display = "none";
boss6.id = "boss6"; boss6.id = "boss6";
main.dom.gameGroup.insertAdjacentElement("afterend", boss6); main.dom.startPanel.insertAdjacentElement("afterend", boss6)
boss6.style.top = "50%";
boss6.style.left = "50%";
boss6.style.transform = "translate(-50%,-50%)";
const ctx6 = boss6.getContext("2d"); const ctx6 = boss6.getContext("2d");
main.dom.boss6 = boss6; main.dom.boss6 = boss6;
const boss7 = document.createElement("canvas"); //boss战画布设置 const boss7 = document.createElement("canvas"); //boss战画布设置
@ -16114,10 +16070,7 @@ let time=0
boss7.style.zIndex = 306; boss7.style.zIndex = 306;
boss7.style.display = "none"; boss7.style.display = "none";
boss7.id = "boss7"; boss7.id = "boss7";
main.dom.gameGroup.insertAdjacentElement("afterend", boss7); main.dom.startPanel.insertAdjacentElement("afterend", boss7)
boss7.style.top = "50%";
boss7.style.left = "50%";
boss7.style.transform = "translate(-50%,-50%)";
const ctx7 = boss7.getContext("2d"); const ctx7 = boss7.getContext("2d");
main.dom.boss7 = boss7; main.dom.boss7 = boss7;
const boss8 = document.createElement("canvas"); //boss战画布设置 const boss8 = document.createElement("canvas"); //boss战画布设置
@ -16125,10 +16078,7 @@ let time=0
boss8.style.zIndex = 307; boss8.style.zIndex = 307;
boss8.style.display = "none"; boss8.style.display = "none";
boss8.id = "boss8"; boss8.id = "boss8";
main.dom.gameGroup.insertAdjacentElement("afterend", boss8); main.dom.startPanel.insertAdjacentElement("afterend", boss8)
boss8.style.top = "50%";
boss8.style.left = "50%";
boss8.style.transform = "translate(-50%,-50%)";
const ctx8 = boss8.getContext("2d"); const ctx8 = boss8.getContext("2d");
main.dom.boss8 = boss8; main.dom.boss8 = boss8;
const { imagelighter } = core.plugin.utils; const { imagelighter } = core.plugin.utils;
@ -18196,10 +18146,7 @@ let time=0
video.style.zIndex = 320; video.style.zIndex = 320;
video.style.display = "block"; video.style.display = "block";
video.id = "video"; video.id = "video";
main.dom.gameGroup.insertAdjacentElement("afterend", video); main.dom.startPanel.insertAdjacentElement("afterend", video)
video.style.top = "50%";
video.style.left = "50%";
video.style.transform = "translate(-50%,-50%)";
main.dom.video = video; main.dom.video = video;
const ctx2 = video.getContext('2d') const ctx2 = video.getContext('2d')
const video1 = document.createElement("canvas"); //video1画布设置 const video1 = document.createElement("canvas"); //video1画布设置
@ -18207,10 +18154,7 @@ let time=0
video1.style.zIndex = 330; video1.style.zIndex = 330;
video1.style.display = "block"; video1.style.display = "block";
video1.id = "video1"; video1.id = "video1";
main.dom.gameGroup.insertAdjacentElement("afterend", video1); main.dom.startPanel.insertAdjacentElement("afterend", video1)
video1.style.top = "50%";
video1.style.left = "50%";
video1.style.transform = "translate(-50%,-50%)";
const ctx = video1.getContext("2d"); const ctx = video1.getContext("2d");
main.dom.video1 = video1; main.dom.video1 = video1;
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
@ -18487,10 +18431,7 @@ let time=0
music.style.zIndex = 300; music.style.zIndex = 300;
music.style.display = "none"; music.style.display = "none";
music.id = "music"; music.id = "music";
main.dom.gameGroup.insertAdjacentElement("afterend", music); main.dom.startPanel.insertAdjacentElement("afterend", music)
music.style.top = "50%";
music.style.left = "50%";
music.style.transform = "translate(-50%,-50%)";
const ctx = music.getContext("2d"); const ctx = music.getContext("2d");
main.dom.music = music; main.dom.music = music;
@ -19208,18 +19149,19 @@ let time=0
this.musics.includes(this.musicMx[page][i]) || this.musics.includes(this.musicMx[page][i]) ||
page !== this.musicMx.length - 1 page !== this.musicMx.length - 1
) { ) {
core.fillBoldText1( core.fillBoldText(
ctx, ctx,
text, text,
50, 50,
posy - 100, posy - 10,
page === this.selection[0] && i === this.selection[1] ? page === this.selection[0] && i === this.selection[1] ?
"#FFFFFF" : "#FFFFFF" :
"#444444", "#444444",
"#000000", "#000000",
6,
core.ui._buildFont(22, true) core.ui._buildFont(22, true)
); )
ctx.strokeStyle = "#FFFFFF"; ctx.strokeStyle = "#FFFFFF";
ctx.lineWidth = 1; ctx.lineWidth = 1;
@ -19297,7 +19239,7 @@ let time=0
core.fillText( core.fillText(
ctx, ctx,
"|", "|",
278, 282,
566, 566,
"#FFFFFF", "#FFFFFF",
core.ui._buildFont(32, true) core.ui._buildFont(32, true)
@ -19506,7 +19448,7 @@ let time=0
core.fillText( core.fillText(
ctx, ctx,
"|", "|",
165, 169,
232, 232,
"#FFFFFF", "#FFFFFF",
core.ui._buildFont(32, true) core.ui._buildFont(32, true)
@ -20837,7 +20779,6 @@ let time=0
text = "暴击" + herodamage text = "暴击" + herodamage
else else
text = herodamage === 0 ? "抵抗" : herodamage; text = herodamage === 0 ? "抵抗" : herodamage;
console.log([enemyDiffList[turn].hp, heroDiffList[turn].hp])
Dove.MorePerform.ShowDamagePop.PopDamage( Dove.MorePerform.ShowDamagePop.PopDamage(
ctx, // 默认画布名称 ctx, // 默认画布名称
270, // 英雄位置 x 270, // 英雄位置 x
@ -22121,10 +22062,7 @@ let time=0
book.style.zIndex = 400; book.style.zIndex = 400;
book.style.display = "none"; book.style.display = "none";
book.id = "book"; book.id = "book";
main.dom.gameGroup.insertAdjacentElement("afterend", book); main.dom.startPanel.insertAdjacentElement("afterend", book)
book.style.top = "50%";
book.style.left = "50%";
book.style.transform = "translate(-50%,-50%)";
const ctx = book.getContext("2d"); const ctx = book.getContext("2d");
main.dom.book = book main.dom.book = book
@ -22138,11 +22076,11 @@ let time=0
let x, y; let x, y;
if (core.domStyle.isVertical) { //对竖屏进行坐标转换 if (core.domStyle.isVertical) { //对竖屏进行坐标转换
x = py * 3; x = py;
y = 1248 - px * 3; y = 416 - px;
} else { } else {
x = px * 3; x = px;
y = py * 3; y = py;
} }
bookclick(x, y) bookclick(x, y)
} catch (ee) { } catch (ee) {
@ -22172,19 +22110,118 @@ let time=0
} }
this.drawBook = function (floorId = core.status.floorId) { this.drawBook = function (floorId = core.status.floorId) {
if (core.domStyle.isVertical) { //对竖屏进行绘制坐标变换,只需要考虑横屏绘制,竖屏将自适应转置 if (core.domStyle.isVertical) { //对竖屏进行绘制坐标变换,只需要考虑横屏绘制,竖屏将自适应转置
ctx.canvas.width = 1248; core.maps._setHDCanvasSize(ctx, 416, 676)
ctx.canvas.height = 2028;
ctx.save(); //保存设置 ctx.save(); //保存设置
ctx.translate(1248, 0); //重新定位右上角为基准 ctx.translate(416, 0); //重新定位右上角为基准
ctx.rotate(Math.PI / 2); //旋转90度 ctx.rotate(Math.PI / 2); //旋转90度
} else { } else {
ctx.canvas.width = 2028; core.maps._setHDCanvasSize(ctx, 676, 676)
ctx.canvas.height = 1248;
} }
//在这里写绘制内容,只写横屏就行 //在这里写绘制内容,只写横屏就行
ctx.restore(); //恢复变换前的坐标,否则将连续转置 ctx.restore(); //恢复变换前的坐标,否则将连续转置
} }
class Book {
constructor() {
this.width = 325
this.height = 400
this.pagemax = 1
this.page = 0
this.paper = this.paperTexture()
}
paperTexture() {
const paperleft = document.createElement('canvas')
paperleft.width = 64
paperleft.height = 64
const paperright = document.createElement('canvas')
paperright.width = 64
paperright.height = 64
const textureCanvas = document.createElement('canvas');
textureCanvas.width = 64;
textureCanvas.height = 64;
const textureCtx = textureCanvas.getContext('2d');
// 填充浅色背景
textureCtx.fillStyle = '#f8f4e8';
textureCtx.fillRect(0, 0, 64, 64);
// 添加纸张纹理
textureCtx.globalAlpha = 0.03;
for (let i = 0; i < 100; i++) {
const x = Math.random() * 64;
const y = Math.random() * 64;
const radius = Math.random() * 3;
textureCtx.beginPath();
textureCtx.arc(x, y, radius, 0, Math.PI * 2);
textureCtx.fillStyle = '#000000';
textureCtx.fill();
}
const right = paperright.getContext('2d'),
left = paperleft.getContext('2d')
right.translate(64, 0)
right.scale(-1, 1)
right.drawImage(textureCanvas, 0, 0, 64, 64)
left.drawImage(textureCanvas, 0, 0, 64, 64)
return [paperleft, paperright];
}
background() {
book.style.display = "block"
if (core.domStyle.isVertical) { //对竖屏进行绘制坐标变换,只需要考虑横屏绘制,竖屏将自适应转置
core.maps._setHDCanvasSize(ctx, 416, 676)
ctx.save(); //保存设置
ctx.translate(416, 0); //重新定位右上角为基准
ctx.rotate(Math.PI / 2); //旋转90度
} else {
core.maps._setHDCanvasSize(ctx, 676, 416)
ctx.save(); //保存设置
}
core.fillRect(ctx, 0, 0, 676, 416, "#000000")
//在这里写绘制内容,只写横屏就行
ctx.beginPath()
const dx = (676 - this.width * 2) / 2,
dy = 416 - this.height
ctx.moveTo(0, 416)
ctx.lineTo(dx, this.height)
ctx.lineTo(dx, 0)
ctx.lineTo(0, dy)
ctx.closePath()
ctx.fillStyle = "#e0d6c2"
ctx.fill()
ctx.beginPath()
ctx.moveTo(676, 416)
ctx.lineTo(676 - dx, this.height)
ctx.lineTo(676 - dx, 0)
ctx.lineTo(676, dy)
ctx.closePath()
ctx.fillStyle = "#e0d6c2"
ctx.fill()
core.drawImage(ctx, this.paper[0], 0, 0, this.paper[0].width, this.paper[0].height, dx, 0, this.width, this.height)
core.drawImage(ctx, this.paper[1], 0, 0, this.paper[1].width, this.paper[1].height, dx + this.width, 0, this.width, this.height)
ctx.beginPath()
ctx.moveTo(0, 416)
ctx.lineTo(dx, this.height)
ctx.lineTo(338, this.height)
ctx.lineTo(this.width, 416)
ctx.closePath()
ctx.fillStyle = '#706b61'
ctx.fill()
ctx.beginPath()
ctx.moveTo(676, 416)
ctx.lineTo(676 - dx, this.height)
ctx.lineTo(338, this.height)
ctx.lineTo(338 + dx, 416)
ctx.closePath()
ctx.fillStyle = '#706b61'
ctx.fill()
ctx.restore(); //恢复变换前的坐标,否则将连续转置
}
}
core.book = new Book()
}, },
"存读档": function () { "存读档": function () {
// 在此增加新插件 // 在此增加新插件
@ -22193,10 +22230,7 @@ let time=0
saveLoad.style.zIndex = 390; saveLoad.style.zIndex = 390;
saveLoad.style.display = "none"; saveLoad.style.display = "none";
saveLoad.id = "saveLoad"; saveLoad.id = "saveLoad";
main.dom.gameGroup.insertAdjacentElement("afterend", saveLoad); main.dom.startPanel.insertAdjacentElement("afterend", saveLoad)
saveLoad.style.top = "50%";
saveLoad.style.left = "50%";
saveLoad.style.transform = "translate(-50%,-50%)";
const ctx = saveLoad.getContext("2d"); const ctx = saveLoad.getContext("2d");
main.dom.saveLoad = saveLoad main.dom.saveLoad = saveLoad
let cg = false let cg = false