editor: ban 48*32 blocks in fgmap/bgmap

This commit is contained in:
YouWei Zhao 2018-09-16 00:08:29 +08:00
parent f0d5c04db5
commit d1fdc2825d
2 changed files with 18 additions and 9 deletions

View File

@ -178,13 +178,15 @@ editor.prototype.mapInit = function () {
editor.currentFloorData.cannotMove = {}; editor.currentFloorData.cannotMove = {};
} }
editor.prototype.drawMapBg = function (img) { editor.prototype.drawMapBg = function (img) {
return return;
var bgc = bg.getContext('2d');
//legacy
if (!core.isset(editor.bgY) || editor.bgY == 0) { if (!core.isset(editor.bgY) || editor.bgY == 0) {
editor.main.editor.drawMapBg(); editor.main.editor.drawMapBg();
return; return;
} }
var bgc = bg.getContext('2d');
for (var ii = 0; ii < 13; ii++) for (var ii = 0; ii < 13; ii++)
for (var jj = 0; jj < 13; jj++) { for (var jj = 0; jj < 13; jj++) {
bgc.clearRect(ii * 32, jj * 32, 32, 32); bgc.clearRect(ii * 32, jj * 32, 32, 32);
@ -529,8 +531,12 @@ editor.prototype.listen = function () {
currDrawData.info = JSON.parse(JSON.stringify(editor.info)); currDrawData.info = JSON.parse(JSON.stringify(editor.info));
reDo = null; reDo = null;
// console.log(stepPostfix); // console.log(stepPostfix);
for (var ii = 0; ii < stepPostfix.length; ii++) if (editor.layerMod!='map' && editor.info.images && editor.info.images.indexOf('48')!==-1){
editor[editor.layerMod][stepPostfix[ii].y][stepPostfix[ii].x] = editor.info; 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); // console.log(editor.map);
editor.updateMap(); editor.updateMap();
holdingPath = 0; holdingPath = 0;

View File

@ -433,11 +433,14 @@ maps.prototype.drawMap = function (mapName, callback) {
} }
if (main.mode=='editor'){ if (main.mode=='editor'){
main.editor.drawMapBg = function(){ // just do not run drawBg
core.clearMap('bg');
core.clearMap('fg'); // //---move to main.editor.updateMap
drawBg(); // main.editor.drawMapBg = function(){
} // core.clearMap('bg');
// core.clearMap('fg');
// drawBg();
// }
} else { } else {
drawBg(); drawBg();
} }