From d1fdc2825ddd7dbc55d4526eb67016fdedbbb04a Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 16 Sep 2018 00:08:29 +0800 Subject: [PATCH] editor: ban 48*32 blocks in fgmap/bgmap --- _server/editor.js | 14 ++++++++++---- libs/maps.js | 13 ++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/_server/editor.js b/_server/editor.js index 56b3f292..07741e42 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -178,13 +178,15 @@ editor.prototype.mapInit = function () { editor.currentFloorData.cannotMove = {}; } editor.prototype.drawMapBg = function (img) { - return - var bgc = bg.getContext('2d'); + return; + + //legacy if (!core.isset(editor.bgY) || editor.bgY == 0) { editor.main.editor.drawMapBg(); return; } + var bgc = bg.getContext('2d'); for (var ii = 0; ii < 13; ii++) for (var jj = 0; jj < 13; jj++) { bgc.clearRect(ii * 32, jj * 32, 32, 32); @@ -529,8 +531,12 @@ editor.prototype.listen = function () { currDrawData.info = JSON.parse(JSON.stringify(editor.info)); reDo = null; // console.log(stepPostfix); - for (var ii = 0; ii < stepPostfix.length; ii++) - editor[editor.layerMod][stepPostfix[ii].y][stepPostfix[ii].x] = editor.info; + if (editor.layerMod!='map' && editor.info.images && editor.info.images.indexOf('48')!==-1){ + printe('前景/背景不支持48的图块'); + } else { + for (var ii = 0; ii < stepPostfix.length; ii++) + editor[editor.layerMod][stepPostfix[ii].y][stepPostfix[ii].x] = editor.info; + } // console.log(editor.map); editor.updateMap(); holdingPath = 0; diff --git a/libs/maps.js b/libs/maps.js index da8c8fc7..6ad50ff5 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -433,11 +433,14 @@ maps.prototype.drawMap = function (mapName, callback) { } if (main.mode=='editor'){ - main.editor.drawMapBg = function(){ - core.clearMap('bg'); - core.clearMap('fg'); - drawBg(); - } + // just do not run drawBg + + // //---move to main.editor.updateMap + // main.editor.drawMapBg = function(){ + // core.clearMap('bg'); + // core.clearMap('fg'); + // drawBg(); + // } } else { drawBg(); }