From 633e248404f167a192124831995e6239e9bd1575 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Wed, 20 Dec 2017 12:46:00 +0800 Subject: [PATCH 1/2] bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加更多的鼠标滚轮支持 --- libs/core.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libs/core.js b/libs/core.js index 9532feb7..42f79220 100644 --- a/libs/core.js +++ b/libs/core.js @@ -597,7 +597,7 @@ core.prototype.onup = function () { core.canvas.ui.clearRect(0, 0, 416,416); core.canvas.ui.restore(); core.onclick(posx,posy,stepPostfix); - //posx,posy是之前寻路的目标点,stepPostfix是后续的移动 + //posx,posy是寻路的目标点,stepPostfix是后续的移动 } } @@ -626,7 +626,7 @@ core.prototype.getClickLoc = function (x, y) { } core.prototype.onclick = function (x, y, stepPostfix) { - // console.log("Click: (" + x + "," + y + ")"); + console.log("Click: (" + x + "," + y + ")"); // 非游戏屏幕内 if (x<0 || y<0 || x>12 || y>12) return; @@ -735,10 +735,26 @@ core.prototype.onclick = function (x, y, stepPostfix) { } core.prototype.onmousewheel = function (direct) { + // 向下滚动是 -1 ,向上是 1 + // 楼层飞行器 if (core.status.lockControl && core.status.event.id == 'fly') { - if (direct==-1) core.ui.drawFly(core.status.event.data-1); if (direct==1) core.ui.drawFly(core.status.event.data+1); + if (direct==-1) core.ui.drawFly(core.status.event.data-1); + return; + } + + // 怪物手册 + if (core.status.event.id == 'book') { + if (direct==1) core.ui.drawEnemyBook(core.status.event.data - 1); + if (direct==-1) core.ui.drawEnemyBook(core.status.event.data + 1); + return; + } + + // 存读档 + if (core.status.event.id == 'save' || core.status.event.id == 'load') { + if (direct==1) core.ui.drawSLPanel(core.status.event.data - 1); + if (direct==-1) core.ui.drawSLPanel(core.status.event.data + 1); return; } } From 99a9bdd327d0ebd2829c56ce61cd45c7dc8ac900 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Wed, 20 Dec 2017 12:59:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8A=8A=E9=BC=A0=E6=A0=87=E4=B8=AD?= =?UTF-8?q?=E9=94=AE=E7=BB=91=E5=AE=9A=E4=B8=BAESC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.js b/main.js index 4e7bcec1..2305a77f 100644 --- a/main.js +++ b/main.js @@ -224,6 +224,10 @@ document.ontouchstart = function() { main.dom.data.onmousedown = function (e) { try { e.stopPropagation(); + if(e.button==1){// 把鼠标中键绑定为ESC + core.keyUp(27); + return; + } var loc = main.core.getClickLoc(e.clientX, e.clientY); if (loc == null) return; var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);