diff --git a/_server/editor.js b/_server/editor.js index c94747e7..0df9b22c 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -511,6 +511,24 @@ editor.prototype.listen = function () { } } + /* + document.getElementById('mid').onkeydown = function (e) { + console.log(e); + if (e.keyCode==37) { + editor.moveViewport(-1, 0); + } + if (e.keyCode==38) { + editor.moveViewport(0, -1); + } + if (e.keyCode==39) { + editor.moveViewport(1, 0); + } + if (e.keyCode==40) { + editor.moveViewport(0, 1); + } + } + */ + document.getElementById('mid').onmousewheel = function (e) { e.preventDefault(); var wheel = function (direct) { @@ -591,18 +609,6 @@ editor.prototype.listen = function () { editor.changeFloor(toId); } } - if (e.keyCode==37) { - editor.moveViewport(-1, 0); - } - if (e.keyCode==38) { - editor.moveViewport(0, -1); - } - if (e.keyCode==39) { - editor.moveViewport(1, 0); - } - if (e.keyCode==40) { - editor.moveViewport(0, 1); - } } var dataSelection = document.getElementById('dataSelection'); diff --git a/_server/editor_file.js b/_server/editor_file.js index 46b2fe6b..4f534d2a 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -83,12 +83,21 @@ editor_file = function (editor, callback) { } */ var filename = 'project/floors/' + editor.currentFloorId + '.js'; var datastr = ['main.floors.', editor.currentFloorId, '=\n{']; - if (editor.currentFloorData.map == 'new') + if (editor.currentFloorData.map == 'new') { + /* editor.currentFloorData.map = editor.map.map(function (v) { return v.map(function () { return 0 }) }); + */ + var width = parseInt(document.getElementById('newMapWidth').value); + var height = parseInt(document.getElementById('newMapHeight').value); + var row = []; + for (var i=0;i1000) { + printe("新建地图的宽高都不得小于13,且宽高之积不能超过1000"); + return; + } editor_mode.onmode(''); editor.file.saveNewFile(newFileName.value, function (err) { diff --git a/editor.html b/editor.html index c52708fb..32610082 100644 --- a/editor.html +++ b/editor.html @@ -23,7 +23,11 @@
- + + + + + 保留楼层属性