From da209cdbac06e5b4289368b11eea9fc0f50e5a8e Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Sat, 19 Apr 2025 13:25:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E6=89=8B=E6=84=9F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8CPC=E6=94=AF=E6=8C=81=E9=BC=A0=E6=A0=87=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E4=BF=AE=E6=94=B9=E9=80=89=E4=B8=AD=E7=9A=84=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/plugins.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/project/plugins.js b/project/plugins.js index 6fe43297..8deb2b75 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -3896,6 +3896,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = this.name = name; this.btnList = new Map(); this.keyEvent = () => { }; + this.onMoveEvent = undefined; this.clickEvent = (x, y, px, py) => { this.btnList.forEach((btn) => { if (btn.disable) return; @@ -3925,12 +3926,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } beginListen() { + if (core.platform.isPC && this.onMoveEvent) core.registerAction('onmove', this.name, this.onMoveEvent, 100); core.registerAction('keyDown', this.name, this.keyEvent, 100); core.registerAction('ondown', this.name, this.clickEvent, 100); - } endListen() { + core.unregisterAction('onmove', this.name); core.unregisterAction('keyDown', this.name); core.unregisterAction('ondown', this.name); } @@ -4808,6 +4810,20 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }); } + this.onMoveEvent = (x, y, px, py) => { + if (!core.platform.isPC) return; + const btnNow = this.selectedBtn; + if (btnNow) { + if (px >= btnNow.x && px <= btnNow.x + btnNow.w && py > btnNow.y && py <= btnNow.y + btnNow.h) + return; + } + this.btnList.forEach((btn, pos) => { + if (btn.disable) return; + if (px >= btn.x && px <= btn.x + btn.w && py > btn.y && py <= btn.y + btn.h) { + if (btnNow !== btn) this.focus(btn, pos); + } + }); + } this.keyEvent = (keyCode) => { let x, y; const changePos = (newPos) => {