From 081ba80f9b49d37bd480172d3ff729e601cee7cf Mon Sep 17 00:00:00 2001 From: lizhuoyuan <2820814112@qq.com> Date: Mon, 20 Jan 2025 10:50:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=96=B0=E7=89=88=E9=81=93=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E6=8F=92=E4=BB=B6=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=8F=98?= =?UTF-8?q?=E9=87=8F=5F=5FdoNotCheckAutoEvents=5F=5F=E7=9A=84=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/project/plugins.js b/project/plugins.js index 0eb69074..05d5d23d 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -3057,10 +3057,24 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = var itemId = action.substring(6); var items = core.getToolboxItems('equips'); var index = items.indexOf(itemId) + 1; - if (index < 1) return false; + if (index < 1) { + core.removeFlag('__doNotCheckAutoEvents__'); + return false; + } + + var cb = function () { + var next = core.status.replay.toReplay[0] || ""; + if (!next.startsWith('equip:') && !next.startsWith('unEquip:')) { + core.removeFlag('__doNotCheckAutoEvents__'); + core.checkAutoEvents(); + } + core.replay(); + } + core.setFlag('__doNotCheckAutoEvents__', true); + core.status.route.push(action); if (core.material.items[itemId].hideInReplay || core.status.replay.speed == 24) { - core.loadEquip(itemId, core.replay); + core.loadEquip(itemId, cb); return true; } core.status.event.id = "equipbox"; @@ -3074,7 +3088,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.drawEquipbox(); setTimeout(function () { core.ui.closePanel(); - core.loadEquip(itemId, core.replay); + core.loadEquip(itemId, cb); }, core.control.__replay_getTimeout()); return true; } @@ -3082,10 +3096,24 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.control._replayAction_unEquip = function (action) { if (action.indexOf("unEquip:") != 0) return false; var equipType = parseInt(action.substring(8)); - if (!core.isset(equipType)) return false; + if (!core.isset(equipType)) { + core.removeFlag('__doNotCheckAutoEvents__'); + return false; + } + + var cb = function () { + var next = core.status.replay.toReplay[0] || ""; + if (!next.startsWith('equip:') && !next.startsWith('unEquip:')) { + core.removeFlag('__doNotCheckAutoEvents__'); + core.checkAutoEvents(); + } + core.replay(); + } + core.setFlag('__doNotCheckAutoEvents__', true); + core.status.route.push(action); if (core.status.replay.speed == 24) { - core.unloadEquip(equipType, core.replay); + core.unloadEquip(equipType, cb); return true; } core.status.event.id = "equipbox"; @@ -3097,7 +3125,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.drawEquipbox(); setTimeout(function () { core.ui.closePanel(); - core.unloadEquip(equipType, core.replay); + core.unloadEquip(equipType, cb); }, core.control.__replay_getTimeout()); return true; }