move, copy, cut and paste blocks

This commit is contained in:
oc 2019-06-04 01:56:20 +08:00
parent 396b984ca5
commit f2796b1bd0
2 changed files with 10 additions and 4 deletions

View File

@ -403,19 +403,19 @@ editor.constructor.prototype.listen=function () {
return;
}
// Ctrl+C, Ctrl+X, Ctrl+V
if (e.ctrlKey && e.keyCode == 67) {
if (e.ctrlKey && e.keyCode == 67 && !selectBox.isSelected()) {
copyedInfo = editor.copyFromPos();
printf('该点事件已复制');
return;
}
if (e.ctrlKey && e.keyCode == 88) {
if (e.ctrlKey && e.keyCode == 88 && !selectBox.isSelected()) {
copyedInfo = editor.copyFromPos();
editor.clearPos(true, null, function () {
printf('该点事件已剪切');
})
return;
}
if (e.keyCode == 86) {
if (e.ctrlKey && e.keyCode == 86 && !selectBox.isSelected()) {
if (!copyedInfo) {
printe("没有复制的事件");
return;
@ -432,6 +432,12 @@ editor.constructor.prototype.listen=function () {
});
return;
}
// DELETE
if (e.keyCode == 46 && !selectBox.isSelected()) {
editor.clearPos(true);
return;
}
// ESC
if (e.keyCode == 27) {
if (selectBox.isSelected()) {
editor_mode.onmode('');

View File

@ -215,7 +215,7 @@ tip.showHelp = function(value) {
'ESC或点击空白处可以自动保存当前修改',
'H键可以打开操作帮助哦',
'tileset贴图模式下可以按选中tileset素材并在地图上拖动来一次绘制一个区域',
'可以拖动地图上的图块和事件或按Ctrl+C, Ctrl+X和Ctrl+V进行复制剪切和粘贴'
'可以拖动地图上的图块和事件或按Ctrl+C, Ctrl+X和Ctrl+V进行复制剪切和粘贴Delete删除'
];
if (value == null) value = Math.floor(Math.random() * tips.length);
printf('tips: ' + tips[value])