From 7134a2faba8999812183ae4ffd125ceb655b71f0 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Wed, 13 May 2020 22:47:54 +0800 Subject: [PATCH] =?UTF-8?q?drawConfirmBox=E5=85=89=E6=A0=87=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor.js | 6 +++++- _server/editor_mappanel.js | 4 ++-- libs/actions.js | 19 +++++++++++++++++++ project/functions.js | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/_server/editor.js b/_server/editor.js index 2b1d1f12..ab9abb3b 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -629,7 +629,7 @@ editor.prototype.buildMark = function(){ } } -editor.prototype.setSelectBoxFromInfo=function(thisevent){ +editor.prototype.setSelectBoxFromInfo=function(thisevent, scrollTo){ var pos={x: 0, y: 0, images: "terrains"}; var ysize = 32; if(thisevent==0){ @@ -646,6 +646,10 @@ editor.prototype.setSelectBoxFromInfo=function(thisevent){ } if(pos.x == 0) pos.y+=2; } + if (!editor.isMobile && scrollTo) { + editor.dom.iconLib.scrollLeft = pos.x * 32 - editor.dom.iconLib.offsetWidth / 2; + editor.dom.iconLib.scrollTop = pos.y * ysize - editor.dom.iconLib.offsetHeight / 2; + } editor.dom.dataSelection.style.left = pos.x * 32 + 'px'; editor.dom.dataSelection.style.top = pos.y * ysize + 'px'; editor.dom.dataSelection.style.height = ysize - 6 + 'px'; diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js index f810e748..996a66ea 100644 --- a/_server/editor_mappanel.js +++ b/_server/editor_mappanel.js @@ -48,7 +48,7 @@ editor_mappanel_wrapper = function (editor) { if (editor.uivalues.bindSpecialDoor.loc != null) return; var loc = editor.uifunctions.eToLoc(e); var pos = editor.uifunctions.locToPos(loc, true); - editor.setSelectBoxFromInfo(editor[editor.layerMod][pos.y][pos.x]); + editor.setSelectBoxFromInfo(editor[editor.layerMod][pos.y][pos.x], true); return; } @@ -514,7 +514,7 @@ editor_mappanel_wrapper = function (editor) { editor.uifunctions.hideMidMenu(); e.stopPropagation(); var thisevent = editor[editor.layerMod][editor.pos.y][editor.pos.x]; - editor.setSelectBoxFromInfo(thisevent); + editor.setSelectBoxFromInfo(thisevent, true); } /** diff --git a/libs/actions.js b/libs/actions.js index 4d391af5..0a9ed824 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -481,6 +481,9 @@ actions.prototype._sys_onmove_choices = function (x, y) { case 'gameInfo': this._onMoveChoices(x, y); return true; + case 'confirmBox': + this._onMoveConfirmBox(x, y); + return true; default: break; } @@ -925,6 +928,22 @@ actions.prototype._keyUpConfirmBox = function (keycode) { } } +////// 鼠标在确认框上移动时 ////// +actions.prototype._onMoveConfirmBox = function (x, y) { + if (y == this.HSIZE + 1) { + if (x == this.HSIZE - 2 || x == this.HSIZE - 1) { + core.status.event.selection = 0; + core.ui.drawConfirmBox(core.status.event.ui, core.status.event.data.yes, core.status.event.data.no); + return; + } + if (x == this.HSIZE + 2 || x == this.HSIZE + 1) { + core.status.event.selection = 1; + core.ui.drawConfirmBox(core.status.event.ui, core.status.event.data.yes, core.status.event.data.no); + return; + } + } +} + ////// 自定义事件时的点击操作 ////// actions.prototype._clickAction = function (x, y) { if (core.status.event.data.type == 'text') { diff --git a/project/functions.js b/project/functions.js index 0e7cba34..416459c5 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1190,7 +1190,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = if (value > 0) { damage[loc] = (damage[loc] || 0) + value; type[loc] = type[loc] || {}; - type[loc]["激光伤害"] = true; + type[loc]["夹击伤害"] = true; } } }