Update uievent onKeyDown

This commit is contained in:
ckcz123 2020-06-02 00:17:13 +08:00
parent 8f9d28aab9
commit 57ef15745c

View File

@ -137,13 +137,7 @@ editor_ui_wrapper = function (editor) {
// UI预览 & 地图选点
if (editor.uievent && editor.uievent.isOpen) {
e.preventDefault();
if (e.keyCode == 27) editor.uievent.close();
else if (e.keyCode == 13) editor.uievent.confirm();
else if (e.keyCode == 87) editor.uievent.move(0, -1)
else if (e.keyCode == 65) editor.uievent.move(-1, 0)
else if (e.keyCode == 83) editor.uievent.move(0, 1);
else if (e.keyCode == 68) editor.uievent.move(1, 0);
editor.uievent.onKeyDown(e);
return;
}
@ -572,6 +566,17 @@ editor_ui_wrapper = function (editor) {
uievent.setPoint(core.floorIds[index]);
}
uievent.onKeyDown = function (e) {
if (e.keyCode == 27) editor.uievent.close();
else if (e.keyCode == 13) editor.uievent.confirm();
if (uievent.mode == 'selectPoint') {
if (e.keyCode == 87) editor.uievent.move(0, -1)
if (e.keyCode == 65) editor.uievent.move(-1, 0)
if (e.keyCode == 83) editor.uievent.move(0, 1);
if (e.keyCode == 68) editor.uievent.move(1, 0);
}
}
// ------ 搜索变量出现的位置也放在uievent好了 ------ //
uievent.searchUsedFlags = function () {