From fe6a1626161ed4b88ef41d1337c5512f41321ccd Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 20 Jul 2021 17:13:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=92=8C=E6=8B=96=E5=8A=A8=E5=8F=AF=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_mappanel.js | 7 ++++--- _server/editor_ui.js | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js index e1c1474b..32998bdf 100644 --- a/_server/editor_mappanel.js +++ b/_server/editor_mappanel.js @@ -277,6 +277,7 @@ editor_mappanel_wrapper = function (editor) { // 后续的处理 } else { // 左键拖拽: 交换 + editor.savePreMap(); // editor.movePos(editor.uivalues.startPos, editor.uivalues.endPos); editor.exchangePos(editor.uivalues.startPos, editor.uivalues.endPos); editor.uifunctions.unhighlightSaveFloorButton(); @@ -640,9 +641,9 @@ editor_mappanel_wrapper = function (editor) { } }; bindSpecialDoor.enemys.forEach(function (loc) { - editor.currentFloorData.afterBattle[loc] = [ - {"type": "setValue", "name": doorFlag, "operator": "+=", "value": "1"} - ] + if (!editor.currentFloorData.afterBattle[loc]) + editor.currentFloorData.afterBattle[loc] = []; + editor.currentFloorData.afterBattle[loc].push({"type": "setValue", "name": doorFlag, "operator": "+=", "value": "1"}); }); editor.file.saveFloorFile(function (err) { if (err) { diff --git a/_server/editor_ui.js b/_server/editor_ui.js index aa7fa7aa..da16508f 100644 --- a/_server/editor_ui.js +++ b/_server/editor_ui.js @@ -222,6 +222,7 @@ editor_ui_wrapper = function (editor) { } if (e.ctrlKey && e.keyCode == 88 && !selectBox.isSelected()) { e.preventDefault(); + editor.savePreMap(); editor.uivalues.copyedInfo = editor.copyFromPos(editor.uivalues.selectedArea); editor.clearPos(true, editor.uivalues.selectedArea, function () { printf('该点事件已剪切;请注意右键地图拉框可以剪切一个区域;若有时剪切失灵请多点几下空白处'); @@ -235,6 +236,7 @@ editor_ui_wrapper = function (editor) { printe("没有复制的事件"); return; } + editor.savePreMap(); editor.pasteToPos(editor.uivalues.copyedInfo); editor.updateMap(); editor.file.saveFloorFile(function (err) { @@ -250,6 +252,7 @@ editor_ui_wrapper = function (editor) { } // DELETE if (e.keyCode == 46 && !selectBox.isSelected()) { + editor.savePreMap(); editor.clearPos(true, editor.uivalues.selectedArea, function () { printf('该点事件已删除;请注意右键地图拉框可以删除一个区域;;若有时删除失灵请多点几下空白处'); editor.uifunctions.unhighlightSaveFloorButton();