From b2004c0eb0cae8f6a13e94477770ac98e9a5a5a5 Mon Sep 17 00:00:00 2001 From: Erdnase <1398341065@qq.com> Date: Sat, 10 Dec 2022 19:52:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=A3=85=E4=BA=86=E4=BB=BFRM=E6=A5=BC?= =?UTF-8?q?=E4=BC=A0=EF=BC=8C=E5=8F=AF=E9=80=9A=E8=BF=87=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=9B=9EH5=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 151 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 148 insertions(+), 3 deletions(-) diff --git a/project/plugins.js b/project/plugins.js index f68814e..3689fc6 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -800,7 +800,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.clearMap('bookBg'); ////清空手册Bg core.clearMap('itemBg'); ////清空道具栏Bg - core.clearMap('flyThumbnail'); ////清空fly略缩图 + core.clearMap('flyText'); ////清空fly对话框 core.clearUIEventSelector(1); ////清除绘制的光标 core.clearUIEventSelector(2); if (core.status.hero && core.status.hero.flags) { @@ -916,7 +916,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } - core.ui.drawFly = function (page) { + /*core.ui.drawFly = function (page) {/////已在别处(仿RM楼传)复写 core.status.event.data = page; var floorId = core.floorIds[page]; @@ -957,7 +957,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.drawThumbnail(floorId, null, { ctx: 'ui', x: 16, y: 64, size: size, damage: true, all: true }); - } + }*/ }, "drawLight": function () { @@ -3480,5 +3480,150 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }) +}, + "仿RM楼传": function () { + // 在此增加新插件 + + core.ui.drawFly = function (page) { + if (!core.getFlag("isRmFly")) { + ///////H5版楼传 + core.status.event.data = page; + var floorId = core.floorIds[page]; + var title = core.status.maps[floorId].title; + core.clearMap('ui'); + core.setAlpha('ui', 0.85); + core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000'); + core.setAlpha('ui', 1); + core.setTextAlign('ui', 'center'); + core.fillText('ui', '楼层跳跃', core._PX_ / 2, 48, '#FFFFFF', this._buildFont(28, true)); + core.fillText('ui', '返回游戏', core._PX_ / 2, core._PY_ - 13, null, this._buildFont(15, true)) + core.setTextAlign('ui', 'right'); + core.fillText('ui', '浏览地图时也', core._PX_ - 10, core._PY_ - 23, '#aaaaaa', this._buildFont(10, false)); + core.fillText('ui', '可楼层跳跃!', core._PX_ - 10, core._PY_ - 11, null, this._buildFont(10, false)); + core.setTextAlign('ui', 'center'); + + var middle = core._PY_ / 2 + 39; + + // 换行 + var lines = core.splitLines('ui', title, 120, this._buildFont(19, true)); + var start_y = middle - (lines.length - 1) * 11; + for (var i in lines) { + core.fillText('ui', lines[i], core._PX_ - 53, start_y, '#FFFFFF', this._buildFont(17, true)); + start_y += 22; + } + if (core.actions._getNextFlyFloor(1) != page) { + core.fillText('ui', '▲', core._PX_ - 60, middle - 64, null, this._buildFont(17, false)); + core.fillText('ui', '▲', core._PX_ - 60, middle - 96); + core.fillText('ui', '▲', core._PX_ - 60, middle - 96 - 7); + } + if (core.actions._getNextFlyFloor(-1) != page) { + core.fillText('ui', '▼', core._PX_ - 60, middle + 64, null, this._buildFont(17, false)); + core.fillText('ui', '▼', core._PX_ - 60, middle + 96); + core.fillText('ui', '▼', core._PX_ - 60, middle + 96 + 7); + } + var size = 0.75; + core.strokeRect('ui', 16, 64, size * core._PX_, size * core._PY_, '#FFFFFF', 2); + core.drawThumbnail(floorId, null, { ctx: 'ui', x: 16, y: 64, size: size, damage: true, all: true }); + } else { + //////RM版楼传 + core.status.event.data = page; + var floorId = core.floorIds[page]; + var title = core.status.maps[floorId].title; + var maxFloorId = 81; + var minFloorId = 49; + if (core.status.played) { + if (!core.status.thisMap.underGround) + while (core.hasVisitedFloor('MT' + maxFloorId) === false && maxFloorId >= 0) { + maxFloorId-- + } + else + while (core.hasVisitedFloor('UT' + minFloorId) === false && minFloorId >= 1) { + minFloorId-- + } + } + core.clearMap('ui'); + core.createCanvas('flyText', 0, 0, 480, 480, 141); + core.setOpacity("flyText", 0.7); + core.drawThumbnail(floorId, null, { ctx: 'ui', x: 0, y: 0, size: 1, damage: true, all: true }); + core.drawWindowSkin('winskin2.png', 'flyText', 0, 304, core._PX_ - 10, 160); + core.setTextAlign('flyText', 'left'); + if (!core.status.thisMap.underGround) + core.fillText('flyText', '请输入您要去的楼层(0~' + maxFloorId + '):', 20, 304 + 40, '#FFFFFF', this._buildFont(22, false)); + else { + core.fillText('flyText', '请输入您要去的', 20, 304 + 40, '#FFFFFF', this._buildFont(22, false)); + core.fillText('flyText', '地下楼层', 20 + 154, 304 + 40, '#aaaaaa', this._buildFont(22, false)); + core.fillText('flyText', '(1~' + minFloorId + '):', 20 + 242, 304 + 40, '#FFFFFF', this._buildFont(22, false)); + } + core.fillText('flyText', title, 20, 304 + 72, '#FFFFFF', this._buildFont(22, false)); + core.setTextAlign('ui', 'right'); + core.fillText('ui', '浏览地图时也', core._PX_ - 10, core._PY_ - 23, '#aaaaaa', this._buildFont(10, false)); + core.fillText('ui', '可楼层跳跃!', core._PX_ - 10, core._PY_ - 11, null, this._buildFont(10, false)); + core.setTextAlign('flyText', 'center'); + var middle = core._PY_ / 2 + 39; + if (core.actions._getNextFlyFloor(1) != page) { + core.fillText('flyText', '▲', core._PX_ - 112, middle + 64, null, this._buildFont(24, false)); + core.fillText('flyText', '◀', core._PX_ - 144, middle + 96); + + } + if (core.actions._getNextFlyFloor(-1) != page) { + core.fillText('flyText', '▼', core._PX_ - 112, middle + 128, null, this._buildFont(24, false)); + core.fillText('flyText', '▶', core._PX_ - 80, middle + 96); + + } + } + + } + + + + + ////// 楼层传送器界面时的点击操作 ////// + + actions.prototype._clickFly = function (x, y) { + if (!core.getFlag("isRmFly")) { ///H5版 + if ((x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && y == this._HY_ + 3) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(-1)); + } + if ((x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && y == this._HY_ - 1) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(1)); + } + if ((x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && y == this._HY_ + 4) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(-10)); + } + if ((x == core._WIDTH_ - 2 || x == core._WIDTH_ - 3) && y == this._HY_ - 2) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(10)); + } + if (x >= this._HX_ - 1 && x <= this._HX_ + 1 && y === core._HEIGHT_ - 1) { + core.playSound('取消'); + core.ui.closePanel(); + } + if (x >= 0 && x <= this._HX_ + 3 && y >= 3 && y <= core._HEIGHT_ - 1 - 1) + core.flyTo(core.floorIds[core.status.event.data]); + return; + } else { ////RM版 + if ((x == core._WIDTH_ - 4) && y == this._HY_ + 5) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(-1)); + } else if ((x == core._WIDTH_ - 4) && y == this._HY_ + 3) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(1)); + } else if ((x == core._WIDTH_ - 5) && y == this._HY_ + 4) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(-10)); + } else if ((x == core._WIDTH_ - 3) && y == this._HY_ + 4) { + core.playSound('光标移动'); + core.ui.drawFly(this._getNextFlyFloor(10)); + } else if (x >= this._HX_ - 1 && x <= this._HX_ + 1 && y === core._HEIGHT_ - 1) { + core.playSound('取消'); + core.ui.closePanel(); + } else if (x >= 0 && x <= this._HX_ + 3 && y >= 3 && y <= core._HEIGHT_ - 1 - 1) + core.flyTo(core.floorIds[core.status.event.data]); + return; + } + } } } \ No newline at end of file