From 663b2b3b1683cd5ae2d47ae3e70a5ed9880a1a1f Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Mon, 23 Feb 2026 17:22:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:PC=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=98=AF=E5=90=A6=E7=9B=91=E5=90=AConmove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/data.js | 1 + project/images/mousewheel.png | Bin 0 -> 391 bytes project/plugins.js | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 project/images/mousewheel.png diff --git a/project/data.js b/project/data.js index 41687d85..adf60bf1 100644 --- a/project/data.js +++ b/project/data.js @@ -10,6 +10,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "bg.jpg", "dragon.png", "hero.png", + "mousewheel.png", "winskin.png" ], "tilesets": [ diff --git a/project/images/mousewheel.png b/project/images/mousewheel.png new file mode 100644 index 0000000000000000000000000000000000000000..486566eff64997277b3ec180b0f34ed3e34ec7fc GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!1{qHm$B+p3x6=;xHX8`I?hlN*!BliKnB}-e zZw_bmEe}u0%oOg#9qWP^WZxXzd4#Jc=X`_mTBVPA2Y4P=-e}47;4yf*`njxgN@xNA5_6j7 literal 0 HcmV?d00001 diff --git a/project/plugins.js b/project/plugins.js index 1fa9cd3e..907d1f77 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -3161,6 +3161,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } + class NoHoverBtn extends IconBtn { + draw() { + super.draw(); + const ctx = this.ctx; + const { x, y, w, h } = this; + core.drawImage(ctx, "mousewheel.png", x, y, w, h); + } + } + class ArrowBtn extends ButtonBase { constructor(x, y, w, h, dir, config) { super(x, y, w, h); @@ -3424,6 +3433,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } else this.triggerItem(i); }.bind(this), onmove: function () { + if (UI.isNoHover) return; if (this.index !== i) { this.setIndex(i); } @@ -3598,6 +3608,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } onmoveEvent(_x, _y, px, py) { + if (UI.isNoHover) return; const index = Math.floor(py / this.oneItemHeight); if (index < 0 || index >= this.currItemList.length) return; if (UI.selectType !== 'toolBox' || this.index !== index) { @@ -3921,6 +3932,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = _itemInfo: undefined, /** @type {undefined|EquipSlots} 显示已穿戴装备的面板 */ _equipSlots: undefined, + /** 是否监听onMove事件 */ + isNoHover: core.getLocalStorage('itemBoxNoHover'), /** 物品页面的背景 */ get back() { if (!this._back) { @@ -3933,9 +3946,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = const allBtn = new ClassifyBtn(20, 10, 44, 24, "全部", "all"), toolsBtn = new ClassifyBtn(80, 10, 44, 24, "消耗", "tools"), constantsBtn = new ClassifyBtn(140, 10, 44, 24, "永久", "constants"); + const noHoverBtn = new NoHoverBtn(210, 10, 24, 24, null, { crossline1: this.isNoHover }); this._back.registerBtn('allBtn', allBtn, () => this.toolInv.classify('all')); this._back.registerBtn('toolsBtn', toolsBtn, () => this.toolInv.classify('tools')); this._back.registerBtn('constantsBtn', constantsBtn, () => this.toolInv.classify('constants')); + this._back.registerBtn('noHoverBtn', noHoverBtn, () => { + this.isNoHover = !this.isNoHover; + core.setLocalStorage('itemBoxNoHover', this.isNoHover); + noHoverBtn.config.crossline1 = this.isNoHover; + this._back?.drawButtonContent(); + }); + if (!core.platform.isPC) noHoverBtn.disable = true; // 非PC端本来就触发不了onmove事件,故隐藏此按钮 } return this._back; },