drawConfirmBox光标跟随

This commit is contained in:
ckcz123 2020-05-13 22:47:54 +08:00
parent 299440e04a
commit 7134a2faba
4 changed files with 27 additions and 4 deletions

View File

@ -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';

View File

@ -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);
}
/**

View File

@ -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') {

View File

@ -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;
}
}
}