diff --git a/components.d.ts b/components.d.ts index 4e8ab88..ac5744e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,6 +7,7 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AButton: typeof import('ant-design-vue/es')['Button'] ADivider: typeof import('ant-design-vue/es')['Divider'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] diff --git a/index.html b/index.html index d07aadf..99ee08a 100644 --- a/index.html +++ b/index.html @@ -170,11 +170,11 @@
- - - - - + + + + + diff --git a/public/maps/智慧小径.png b/public/maps/智慧小径.png new file mode 100644 index 0000000..bb687d9 Binary files /dev/null and b/public/maps/智慧小径.png differ diff --git a/public/project/data.js b/public/project/data.js index 7362058..d7e2220 100644 --- a/public/project/data.js +++ b/public/project/data.js @@ -288,10 +288,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "startBackground": "project/images/bg.jpg", "startVerticalBackground": "project/images/bg.jpg", "startLogoStyle": " ", - "startButtonsStyle": "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;", - "statusLeftBackground": "url(project/images/cave1.jpg)", - "statusTopBackground": "url(project/images/cave2.jpg) no-repeat", - "toolsBackground": "url(project/images/cave2.jpg) no-repeat", + "startButtonsStyle": " ", + "statusLeftBackground": " ", + "statusTopBackground": " ", + "toolsBackground": "#ddd4", "floorChangingStyle": " ", "statusBarColor": [ 255, diff --git a/public/project/enemys.js b/public/project/enemys.js index c3c6442..813e770 100644 --- a/public/project/enemys.js +++ b/public/project/enemys.js @@ -74,7 +74,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "grayPriest": {"name":"智慧法王","hp":3000,"atk":600,"def":250,"money":1,"exp":40,"point":0,"special":[13]}, "greenGateKeeper": {"name":"睿智雕像","hp":5000,"atk":1250,"def":900,"money":1,"exp":65,"point":0,"special":[1],"crit":1000}, "ghostSoldier": {"name":"山间骷髅","hp":750,"atk":180,"def":40,"money":0,"exp":18,"point":0,"special":[]}, - "frostBat": {"name":"寒蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "frostBat": {"name":"寒霜蝙蝠","hp":20000,"atk":3200,"def":2000,"money":2,"exp":2000,"point":0,"special":[4,20],"ice":90}, "blackKing": {"name":"黑衣魔王","hp":1000,"atk":500,"def":0,"money":1000,"exp":1000,"point":0,"special":[],"notBomb":true}, "yellowKing": {"name":"黄衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "greenKing": {"name":"青衣武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, @@ -159,7 +159,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "E608": {"name":"寒冰护卫","hp":25000,"atk":3500,"def":2250,"money":3,"exp":225,"point":0,"special":[]}, "E609": {"name":"具形雪人","hp":7500,"atk":2250,"def":1000,"money":2,"exp":90,"point":0,"special":[25],"melt":15}, "E610": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, - "E611": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "E611": {"name":"具形雪人法师","hp":12500,"atk":2750,"def":1750,"money":2,"exp":175,"point":0,"special":[13,25],"melt":30}, "E612": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E613": {"name":"寒冰核心","hp":20000,"atk":3000,"def":1500,"money":3,"exp":150,"point":0,"special":[26],"iceCore":20}, "E614": {"name":"火焰核心","hp":15000,"atk":2750,"def":1750,"money":3,"exp":140,"point":0,"special":[27],"fireCore":20}, diff --git a/public/project/floors/MT37.js b/public/project/floors/MT37.js index 3b5cd76..e5505ce 100644 --- a/public/project/floors/MT37.js +++ b/public/project/floors/MT37.js @@ -44,7 +44,7 @@ main.floors.MT37= [147,147,147,147,147,147,147,147,147,147,147,147,147,147,70072], [147, 0,147, 34, 0,147, 29, 0,274, 0,147,147,147,147,70072], [147, 0,600, 0, 34,603, 0, 32, 0, 0,376, 33,381, 0,70080], - [147,378,147, 27,484,376,617,390, 0,494,484,378,603,604,604], + [147,378,147, 27,484,376,617,390, 0,494,484,378,602,604,604], [147,482,147,602,378,441,70007, 0,484,586,376,403, 0, 0, 94], [147,381,492, 0,604,494,70015,613,586,586,586,614, 32, 0,604], [147, 0,595, 0, 33, 0,609,482,609,376, 0, 33,595, 21,587], diff --git a/public/project/floors/MT39.js b/public/project/floors/MT39.js index efc88fe..f6e8b03 100644 --- a/public/project/floors/MT39.js +++ b/public/project/floors/MT39.js @@ -63,8 +63,8 @@ main.floors.MT39= "cannotMoveIn": {}, "map": [ [ 0, 0, 0, 0, 0,604,604, 91,604,604, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0,472,604,487,604,472, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0,613,466,608,467,614, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0,472,604,609,604,472, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0,613,420,608,430,614, 0, 0, 0, 0, 0], [604, 21,390,403,482,584,584,584,584,584,600,403,396,482, 94], [484,587, 34, 34,617, 0, 0, 0, 0, 0, 0,70022,70023,70022,70023], [491,494, 34, 34, 33, 0, 0, 0, 0, 0, 33,376,482,600,604], @@ -73,7 +73,7 @@ main.floors.MT39= [482,595, 33,274,482, 34,587, 27,70007,376,484,584,584,584,584], [584,584,492,584,584, 28,587,403,70015,586,595, 0, 0,70126, 0], [70007, 21, 0,586,586, 0,609, 33, 0,274, 27, 0, 0,543, 0], - [70015, 0,403,603, 0,274,604,587,70022,70023,609, 0, 32, 0, 94], + [70015, 0,403,595, 0,274,604,587,70022,70023,609, 0, 32, 0, 94], [584,584,584,584,587,376,587, 0,590, 0, 0,584,584,584,584], [ 0, 0, 0, 0,482,492, 0,381,604, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0,604,604,604,604,604, 93,604, 0, 0, 0, 0] diff --git a/public/project/floors/MT40.js b/public/project/floors/MT40.js index 696860e..e6f7be3 100644 --- a/public/project/floors/MT40.js +++ b/public/project/floors/MT40.js @@ -66,6 +66,20 @@ main.floors.MT40= 6, 4 ] + }, + "8,0": { + "floorId": "MT42", + "loc": [ + 8, + 14 + ] + }, + "5,0": { + "floorId": "MT42", + "loc": [ + 5, + 14 + ] } }, "beforeBattle": {}, @@ -83,7 +97,7 @@ main.floors.MT40= [604,604, 0,492, 0,586, 0,492, 0,70179,603,70181, 27, 28, 94], [604, 34,602, 0, 27,586, 0, 34,584,70187,381,70189,584,584,584], [ 92,403,584,590,70022,70023,604, 0, 0,70187,376,70189, 0, 0, 0], - [604, 34,584,381, 34,603, 0, 34, 0,70187,378,70189, 0, 0, 0], + [604, 34,584,381, 34,592, 0, 34, 0,70187,378,70189, 0, 0, 0], [584,584,584,592,584,584,584,584, 0,70187,484,70189, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0,70195,600,70197,482,482,492], [ 0, 0, 0,381, 0, 0, 0, 0,376,604, 0,584,584,584, 94], diff --git a/public/project/floors/MT42.js b/public/project/floors/MT42.js index cc357cd..c3e7ce0 100644 --- a/public/project/floors/MT42.js +++ b/public/project/floors/MT42.js @@ -17,18 +17,108 @@ main.floors.MT42= "eachArrive": [], "parallelDo": "", "events": {}, - "changeFloor": {}, + "changeFloor": { + "8,14": { + "floorId": "MT40", + "loc": [ + 8, + 0 + ] + }, + "5,14": { + "floorId": "MT40", + "loc": [ + 5, + 0 + ] + } + }, "beforeBattle": {}, - "afterBattle": {}, + "afterBattle": { + "4,9": [ + { + "type": "setValue", + "name": "flag:door_MT42_5_10", + "operator": "+=", + "value": "1" + } + ], + "6,9": [ + { + "type": "setValue", + "name": "flag:door_MT42_5_10", + "operator": "+=", + "value": "1" + } + ] + }, "afterGetItem": {}, "afterOpenDoor": {}, - "autoEvent": {}, + "autoEvent": { + "5,10": { + "0": { + "condition": "flag:door_MT42_5_10==2", + "currentFloor": true, + "priority": 0, + "delayExecute": false, + "multiExecute": false, + "data": [ + { + "type": "openDoor" + }, + { + "type": "setValue", + "name": "flag:door_MT42_5_10", + "operator": "=", + "value": "null" + } + ] + } + } + }, "cannotMove": {}, "cannotMoveIn": {}, "map": [ - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [604, 0,617,604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 92,611,604,604, 0, 0, 0, 0, 0,543, 0, 0, 0, 0, 94], + [604, 0, 0, 0, 0, 0, 0,604, 0, 0,588,588,588,614,584], + [584,584,584,584,584,595,604,604, 0, 0, 0,592, 0, 0,584], + [ 0, 0, 0, 0, 0, 0, 0,604,608,604,584,588, 0,584,584], + [ 0, 0, 0, 0, 0, 0, 0,274, 0, 0, 0,588, 0, 0, 0], + [ 92, 0, 0, 0,617, 0,587,587, 0, 0,586,588,617,586,586], + [584,584,617,70022,70023,611,70022,70023, 0,600,587, 0, 0, 0,586], + [584, 0, 0,584,608, 0,608,584, 0, 0,587,587,587,614,586], + [584, 0, 0,584,584, 85,584,584, 0,602, 0, 0, 0, 0,586], + [584,584,584,584,466,491,467,584,602, 0,604,604,604,277,586], + [584, 0, 0,584,584,468,585,585, 0, 0,604, 0,604, 0,586], + [ 0, 0, 0,584,584,497,585,585, 0, 0,600, 0,604, 0, 94], + [ 0, 0, 0,584,584, 93,585,585, 93,584,584,584,584,584,584] +], + "bgmap": [ + [70073,70073,70073,70073,70073,70073,70073,70073,70073,70073,70073,70073,70073,70097,70073], + [70049,70049, 0,70049,70073,70073,70073,70097,70073,70073,70073,70073,70073,70073,70073], + [ 0, 0, 0, 0,70058,70105,70081,70081,70081,70081,70105,70049,70049,70049,70049], + [ 0, 0, 0, 0,70058, 0, 0, 0, 0, 0,70056, 0, 0, 0, 0], + [70065,70065,70065,70065,70066, 0, 0, 0, 0, 0,70056, 0, 0, 0, 0], + [70073,70073,70073,70073,70074, 0, 0, 0, 0, 0,70064,70083,70084,70065,70065], + [70081,70081,70081,70081,70082, 0, 0, 0, 0, 0,70080,70090,70091,70081,70081], + [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70098,70099, 0, 0], + [ 0, 0, 0, 0, 0, 0, 0,70060,70116,70059, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0, 0,70058,70124,70056, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0, 0,70058,70132,70056, 0, 0, 0, 0, 0], + [70060,70065,70065,70059, 0, 0, 0,70058, 0,70056, 0, 0, 0, 0, 0], + [70066,70073,70073,70056, 0, 0, 0,70058, 0,70056, 0, 0, 0, 0, 0], + [70074,70073,70073,70056, 0, 0, 0,70058, 0,70056, 0, 0, 0, 0, 0], + [70074,70073,70073,70056, 0, 0, 0,70058, 0,70064,70065,70065,70065,70065,70065] +], + "fgmap": [ + +], + "bg2map": [ + [ 0,70120,70121,70122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [ 0,70128,70129,70130,70050, 0, 0, 0, 0,70126, 0, 0, 0, 0, 0], + [ 0, 0, 0, 0, 0, 0, 0, 0, 0,70134,70048, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -41,15 +131,6 @@ main.floors.MT42= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -], - "bgmap": [ - -], - "fgmap": [ - -], - "bg2map": [ - ], "fg2map": [ diff --git a/public/project/floors/snowTown.js b/public/project/floors/snowTown.js index 7a2454c..8cb8bd7 100644 --- a/public/project/floors/snowTown.js +++ b/public/project/floors/snowTown.js @@ -128,7 +128,7 @@ main.floors.snowTown= "map": [ [ 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0,70187, 91,70189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70187, 0,70189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [604,381,376, 33,609, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70195, 0,70197, 0, 0, 0,70160,70161,70162,70163, 0, 0, 0, 0, 0,80296,80297,80298,80299,80300, 0, 0, 0, 0, 0, 0, 0, 0], + [604,381,376, 33,611, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70195, 0,70197, 0, 0, 0,70160,70161,70162,70163, 0, 0, 0, 0, 0,80296,80297,80298,80299,80300, 0, 0, 0, 0, 0, 0, 0, 0], [604,595,584,584,584,274,604,604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70019,70168,70169,70170,70171, 0, 0, 0, 0, 0,80304,80305,80306,80307,80308, 0, 0, 0, 0, 0, 0, 0, 0], [ 92, 0,492,484,584, 33,378,381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,80312,80313,80314,80315,80316, 0, 0, 0, 0, 0, 0, 0, 0], [584,584,584,584,584,584,584,584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,70019, 0, 0, 0, 0,80320,80321,80325,80326,80327, 0, 0, 0, 0, 0, 0, 0, 0], diff --git a/public/project/maps.js b/public/project/maps.js index 593e05e..d7589f0 100644 --- a/public/project/maps.js +++ b/public/project/maps.js @@ -625,13 +625,22 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "70080": {"cls":"tileset","id":"X70080","cannotOut":[],"cannotIn":["up","down","left","right"]}, "70081": {"cls":"tileset","id":"X70081","cannotIn":["up","down","left","right"]}, "70082": {"cls":"tileset","id":"X70082","cannotIn":["up","down","left","right"]}, + "70083": {"cls":"tileset","id":"X70083","cannotIn":["left"],"cannotOut":["left"]}, + "70084": {"cls":"tileset","id":"X70084","cannotIn":["right"],"cannotOut":["right"]}, + "70090": {"cls":"tileset","id":"X70090","cannotOut":["left"],"cannotIn":["left"]}, + "70091": {"cls":"tileset","id":"X70091","cannotIn":["right"],"cannotOut":["right"]}, + "70098": {"cls":"tileset","id":"X70098","cannotIn":["left"],"cannotOut":["left"]}, + "70099": {"cls":"tileset","id":"X70099","cannotIn":["right"],"cannotOut":["right"]}, "70112": {"cls":"tileset","id":"X70112","cannotIn":["down"],"cannotOut":["down"]}, "70114": {"cls":"tileset","id":"X70114","cannotIn":["down"],"cannotOut":["down"]}, - "70116": {"cls":"tileset","id":"X70116","canPass":true}, + "70116": {"cls":"tileset","id":"X70116","canPass":true,"cannotOut":["left","right"],"cannotIn":["left","right"]}, "70120": {"cls":"tileset","id":"X70120","cannotIn":["up","down","left","right"]}, "70122": {"cls":"tileset","id":"X70122","cannotIn":["up","down","left","right"]}, + "70124": {"cls":"tileset","id":"X70124","cannotOut":["left","right"],"cannotIn":["left","right"]}, "70128": {"cls":"tileset","id":"X70128","cannotIn":[]}, "70130": {"cls":"tileset","id":"X70130","cannotIn":[]}, + "70131": {"cls":"tileset","id":"X70131","cannotOut":["left","right"],"cannotIn":["left","right"]}, + "70132": {"cls":"tileset","id":"X70132","cannotOut":["left","right"],"cannotIn":["left","right"]}, "70184": {"cls":"tileset","id":"X70184","canPass":true}, "70185": {"cls":"tileset","id":"X70185","canPass":true}, "70186": {"cls":"tileset","id":"X70186","canPass":true}, diff --git a/public/project/plugins.js b/public/project/plugins.js index cbd9a61..3a392b9 100644 --- a/public/project/plugins.js +++ b/public/project/plugins.js @@ -749,12 +749,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { } this._updateDamage_damage(floorId, onMap); this._updateDamage_extraDamage(floorId, onMap); - core.getItemDetail(floorId); // 宝石血瓶详细信息 + core.getItemDetail(floorId, onMap); // 宝石血瓶详细信息 this.drawDamage(ctx); }; // 获取宝石信息 并绘制 - this.getItemDetail = function (floorId) { + this.getItemDetail = function (floorId, onMap) { if (!core.getFlag('itemDetail')) return; floorId ??= core.status.thisMap.floorId; let diff = {}; @@ -779,7 +779,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { const x = block.x, y = block.y; // v2优化,只绘制范围内的部分 - if (core.bigmap.v2) { + if (onMap && core.bigmap.v2) { if ( x < core.bigmap.posX - core.bigmap.extend || x > core.bigmap.posX + core._PX_ + core.bigmap.extend || diff --git a/public/styles.css b/public/styles.css index 08701b5..5ea4e24 100644 --- a/public/styles.css +++ b/public/styles.css @@ -439,6 +439,10 @@ p#name { image-rendering: pixelated; } +/* .draw-canvas { + filter: contrast(120%) brightness(80%); +} */ + #inputDiv { display: none; width: 100%; diff --git a/src/plugin/utils.ts b/src/plugin/utils.ts index 3c72aa5..62d9e2f 100644 --- a/src/plugin/utils.ts +++ b/src/plugin/utils.ts @@ -163,3 +163,30 @@ export function nextFrame(cb: (time: number) => void) { requestAnimationFrame(cb); }); } + +/** + * 下载一个画布对应的图片 + * @param canvas 画布 + * @param name 图片名称 + */ +export function downloadCanvasImage( + canvas: HTMLCanvasElement, + name: string +): void { + const data = canvas.toDataURL('image/png'); + download(data, name); +} + +/** + * 下载一个文件 + * @param content 下载的内容 + * @param name 文件名称 + */ +export function download(content: string, name: string) { + const a = document.createElement('a'); + a.download = `${name}.png`; + a.href = content; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); +} diff --git a/src/source/cls.d.ts b/src/source/cls.d.ts index a7cf8b7..17047bf 100644 --- a/src/source/cls.d.ts +++ b/src/source/cls.d.ts @@ -624,13 +624,22 @@ interface IdToCls { X70080: 'tileset'; X70081: 'tileset'; X70082: 'tileset'; + X70083: 'tileset'; + X70084: 'tileset'; + X70090: 'tileset'; + X70091: 'tileset'; + X70098: 'tileset'; + X70099: 'tileset'; X70112: 'tileset'; X70114: 'tileset'; X70116: 'tileset'; X70120: 'tileset'; X70122: 'tileset'; + X70124: 'tileset'; X70128: 'tileset'; X70130: 'tileset'; + X70131: 'tileset'; + X70132: 'tileset'; X70184: 'tileset'; X70185: 'tileset'; X70186: 'tileset'; diff --git a/src/source/maps.d.ts b/src/source/maps.d.ts index 0d49941..8da6bfe 100644 --- a/src/source/maps.d.ts +++ b/src/source/maps.d.ts @@ -624,13 +624,22 @@ interface IdToNumber { X70080: 70080; X70081: 70081; X70082: 70082; + X70083: 70083; + X70084: 70084; + X70090: 70090; + X70091: 70091; + X70098: 70098; + X70099: 70099; X70112: 70112; X70114: 70114; X70116: 70116; X70120: 70120; X70122: 70122; + X70124: 70124; X70128: 70128; X70130: 70130; + X70131: 70131; + X70132: 70132; X70184: 70184; X70185: 70185; X70186: 70186; @@ -1267,13 +1276,22 @@ interface NumberToId { 70080: 'X70080'; 70081: 'X70081'; 70082: 'X70082'; + 70083: 'X70083'; + 70084: 'X70084'; + 70090: 'X70090'; + 70091: 'X70091'; + 70098: 'X70098'; + 70099: 'X70099'; 70112: 'X70112'; 70114: 'X70114'; 70116: 'X70116'; 70120: 'X70120'; 70122: 'X70122'; + 70124: 'X70124'; 70128: 'X70128'; 70130: 'X70130'; + 70131: 'X70131'; + 70132: 'X70132'; 70184: 'X70184'; 70185: 'X70185'; 70186: 'X70186'; diff --git a/src/ui/fly.vue b/src/ui/fly.vue index 98b3d62..a281bdc 100644 --- a/src/ui/fly.vue +++ b/src/ui/fly.vue @@ -24,6 +24,13 @@ un-checked-children="OFF" >
+ 下载地图图片
@@ -86,7 +93,7 @@ import { DoubleRightOutlined } from '@ant-design/icons-vue'; import { debounce } from 'lodash'; -import { keycode, tip } from '../plugin/utils'; +import { downloadCanvasImage, keycode, tip } from '../plugin/utils'; import { sleep } from 'mutate-animate'; import { KeyCode } from '../plugin/keyCodes'; @@ -94,7 +101,7 @@ type Loc2 = [number, number, number, number]; const area = getArea(); const nowArea = ref( - Object.keys(area).find(v => area[v].includes(core.status.floorId))! + Object.keys(area).find(v => area[v].includes(core.status.floorId)) ?? '' ); const nowFloor = ref(core.status.floorId); const noBorder = ref(true); @@ -137,6 +144,7 @@ let map: HTMLCanvasElement; let mapCtx: CanvasRenderingContext2D; let thumb: HTMLCanvasElement; let thumbCtx: CanvasRenderingContext2D; +let downloadMode = false; function exit() { core.plugin.flyOpened.value = false; @@ -279,7 +287,7 @@ function drawThumbnail( y: number, noCheck: boolean = false ) { - if (!noCheck && !checkThumbnail(floorId, x, y)) return; + if (!downloadMode && !noCheck && !checkThumbnail(floorId, x, y)) return; const floor = core.status.maps[floorId]; drawedThumbnail[floorId] = true; @@ -295,25 +303,27 @@ function drawThumbnail( ctx, damage: scale > 7 }); - if (!core.hasVisitedFloor(floorId)) { - ctx.fillStyle = '#d0d6'; - ctx.fillRect( - x - floor.width / 2, - y - floor.height / 2, - floor.width, - floor.height - ); - ctx.fillStyle = '#000'; - } - if (nowFloor.value === floorId) { - ctx.fillStyle = '#ff04'; - ctx.fillRect( - x - floor.width / 2, - y - floor.height / 2, - floor.width, - floor.height - ); - ctx.fillStyle = '#000'; + if (!downloadMode) { + if (!core.hasVisitedFloor(floorId)) { + ctx.fillStyle = '#d0d6'; + ctx.fillRect( + x - floor.width / 2, + y - floor.height / 2, + floor.width, + floor.height + ); + ctx.fillStyle = '#000'; + } + if (nowFloor.value === floorId) { + ctx.fillStyle = '#ff04'; + ctx.fillRect( + x - floor.width / 2, + y - floor.height / 2, + floor.width, + floor.height + ); + ctx.fillStyle = '#000'; + } } } @@ -369,6 +379,22 @@ function draw() { drawRight(); } +function download() { + if (nowArea.value === '') { + tip('error', '当前地图不再任意一个区域内!'); + return; + } + downloadMode = true; + const before = scale; + scale = 32; + drawMap(); + downloadCanvasImage(temp, nowArea.value); + scale = before; + downloadMode = false; + draw(); + tip('success', '图片下载成功!'); +} + function fly() { if (core.flyTo(nowFloor.value)) exit(); else tip('error', `无法飞往${floor.value.title}`);