From 7b0244a3cae9e5935a12a6276e41d6a53b2d1b21 Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Mon, 2 Jun 2025 22:40:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=AD=A3=E6=96=B0=E9=81=93?= =?UTF-8?q?=E5=85=B7=E6=A0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/project/plugins.js b/project/plugins.js index 3bb6642b..491f19a0 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -3004,7 +3004,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = // 道具栏/装备栏的背景 class ItemBoxBack extends MenuBase { constructor() { - super('itemBoxBase'); // 装备栏和道具栏共用同一个光标,故所有按键事件全部写在这里处理 + super('itemBoxBack'); // 装备栏和道具栏共用同一个光标,故所有按键事件全部写在这里处理 this.keyEvent = (keyCode) => { const { itemId, type, selectType, itemInv, equipChangeBoard } = globalUI; if (keyCode === 37) { // left @@ -3150,7 +3150,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (btn.disable) return; if (btn.inRange(px, py)) { if (btn instanceof ItemBox || btn instanceof EquipBox) { - if (btn.key !== this.index || globalUI.selectType !== 'toolBox') this.focus(btn.key); + if (btn.key !== this.index || + (this instanceof EquipChangeBoard && globalUI.type !== 'equips') || + (this instanceof ItemBoxBase && globalUI.type !== 'all')) this.focus(btn.key); } } }); @@ -3323,7 +3325,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } triggerItem() { - const itemId = globalUI.itemId; + const itemId = this.itemId; if (!core.canUseItem(itemId)) { core.drawFailTip("当前无法使用" + core.material.items[itemId].name, itemId); return; @@ -3346,7 +3348,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } triggerItem() { - const equip = globalUI.itemId; + const equip = this.itemId; if (!core.canEquip(equip, true)) return; core.loadEquip(equip); core.status.route.push("equip:" + equip); // 注意focus会导致itemId改变