From 14aa4d61097f5d7ed502cf4a968b77a23c74f69b Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sat, 11 Oct 2025 14:23:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E5=9B=BE=E5=9D=97?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=93=8D=E4=BD=9C=E6=B2=A1=E6=9C=89=E8=A2=AB?= =?UTF-8?q?=E6=8D=95=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/libs/maps.js | 32 ++++++++++++++++++++++++++++++++ public/project/data.js | 4 ++++ public/project/floors/sample0.js | 6 +++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/public/libs/maps.js b/public/libs/maps.js index 13c5d7c..02bbb6f 100644 --- a/public/libs/maps.js +++ b/public/libs/maps.js @@ -3104,6 +3104,14 @@ maps.prototype.showBlock = function (x, y, floorId) { block.disable = false; core.setMapBlockDisabled(floorId, x, y, false); this._updateMapArray(floorId, block.x, block.y); + Mota.require('@user/data-base').hook.emit( + 'setBlock', + x, + y, + floorId, + block?.id ?? 0, + 0 + ); // 在本层,添加动画 if (floorId == core.status.floorId) { if (block.event.cls == 'autotile') { @@ -3128,6 +3136,14 @@ maps.prototype.hideBlock = function (x, y, floorId) { block.disable = true; core.setMapBlockDisabled(floorId, block.x, block.y, true); this._updateMapArray(floorId, block.x, block.y); + Mota.require('@user/data-base').hook.emit( + 'setBlock', + x, + y, + floorId, + 0, + block?.id ?? 0 + ); // 删除动画,清除地图 this._removeBlockFromMap(floorId, block); @@ -3143,6 +3159,14 @@ maps.prototype.hideBlockByIndex = function (index, floorId) { block.disable = true; core.setMapBlockDisabled(floorId, block.x, block.y, true); this._updateMapArray(floorId, block.x, block.y); + Mota.require('@user/data-base').hook.emit( + 'setBlock', + x, + y, + floorId, + 0, + block?.id ?? 0 + ); }; ////// 一次性隐藏多个block ////// @@ -3562,6 +3586,14 @@ maps.prototype.replaceBlock = function (fromNumber, toNumber, floorId) { block.event[one] = core.clone(toBlock.event[one]); } this._updateMapArray(floorId, block.x, block.y); + Mota.require('@user/data-base').hook.emit( + 'setBlock', + x, + y, + floorId, + fromNumber, + toNumber + ); } }, this); if (floorId == core.status.floorId) core.redrawMap(); diff --git a/public/project/data.js b/public/project/data.js index baa7954..05bd288 100644 --- a/public/project/data.js +++ b/public/project/data.js @@ -361,6 +361,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "type": "text", "text": "同时 2.B 样板也新增了很多接口,在造塔时可以提供非常大的帮助!" }, + { + "type": "text", + "text": "不过由于重构并不简单,有一些 2.x 有的功能在 2.B 中暂时被移除,将会在 2.B 的后续更新中重新添加回来。" + }, { "type": "text", "text": "这里是开场剧情,可以在编辑器全塔属性中修改,试着修改一下吧!" diff --git a/public/project/floors/sample0.js b/public/project/floors/sample0.js index e5c34dd..df30027 100644 --- a/public/project/floors/sample0.js +++ b/public/project/floors/sample0.js @@ -8,7 +8,7 @@ main.floors.sample0= "canUseQuickShop": true, "defaultGround": "ground", "images": [], - "bgm": "bgm.opus", + "bgm": "bgm.mp3", "ratio": 1, "map": [ [ 0, 0,220, 0, 0, 20, 87, 3, 58, 59, 60, 61, 64], @@ -57,6 +57,10 @@ main.floors.sample0= { "type": "text", "text": "除此之外还有一些因为各种原因在 2.B 中暂时删除的功能,将会在之后的版本中逐步重新添加。" + }, + { + "type": "text", + "text": "由于一些原因,当前版本中隐藏图块的动画也无法显示,将会在 2.B.1 中修复。" } ], "events": {