diff --git a/_server/editor_file.js b/_server/editor_file.js index ae7dac9e..d87551a4 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -161,11 +161,25 @@ editor_file = function (editor, callback) { var image = info.images; + if (image=='autotile') { + callback('不能对自动元件进行自动注册!'); + return; + } + /* if (image!='items' && image.indexOf('enemy')!=0) { callback('只有怪物和道具才能自动注册!'); return; } - var c=image=='items'?'I':'M'; + */ + var c=image.toUpperCase().charAt(0); + + // terrains id + var terrainsId = []; + Object.keys(core.material.icons.terrains).forEach(function (id) { + terrainsId[core.material.icons.terrains[id]]=id; + }) + //console.log(terrainsId); + //return; var allIds = []; editor.ids.forEach(function (v) { @@ -180,17 +194,25 @@ editor_file = function (editor, callback) { for (var y=0; y0) + saveSetting('icons', iconActions, tempcallback); + else tempcallback(null); + saveSetting('maps', mapActions, tempcallback); + if (image=='items') saveSetting('items', templateActions, tempcallback); - else + else if (image.indexOf('enemy')==0) saveSetting('enemys', templateActions, tempcallback); + else tempcallback(null); } editor_file.changeIdAndIdnum = function (id, idnum, info, callback) { diff --git a/libs/core.js b/libs/core.js index 78d0a7fa..888725f0 100644 --- a/libs/core.js +++ b/libs/core.js @@ -889,8 +889,8 @@ core.prototype.debug = function() { } ////// 重置当前地图 ////// -core.prototype.resetMap = function() { - core.maps.resetMap(); +core.prototype.resetMap = function(floorId) { + core.maps.resetMap(floorId); } ////// 开始播放 ////// diff --git a/libs/maps.js b/libs/maps.js index 00ca6627..d631cf43 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -898,8 +898,15 @@ maps.prototype.drawAnimate = function (name, x, y, callback) { }, 50); } -maps.prototype.resetMap = function() { - var floorId = core.status.floorId; +maps.prototype.resetMap = function(floorId) { + var floorId = floorId||core.status.floorId; core.status.maps[floorId] = this.loadFloor(floorId); - this.drawMap(floorId) + if (floorId==core.status.floorId) { + this.drawMap(floorId, function () { + core.drawTip("地图重置成功"); + }) + } + else { + core.drawTip(floorId+"地图重置成功"); + } } \ No newline at end of file diff --git a/project/icons.js b/project/icons.js index 1b6208fe..b7461654 100644 --- a/project/icons.js +++ b/project/icons.js @@ -27,8 +27,8 @@ icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = 'white': 17, 'ground6': 18, 'soil': 19, - 'star': 20, - 'lava': 21, + 'ground7': 20, + 'ground8': 21, 'ice': 22, 'downFloor': 23, 'upFloor': 24, @@ -70,9 +70,9 @@ icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = 'lavaDoor': 13, 'starDoor': 14, 'starPortal': 15, - //'exclamation': 16, + 'fire': 16, 'portal': 17, - //'switch': 18, + 'switch': 18, 'lavaNet': 19, 'poisonNet': 20, 'weakNet': 21, diff --git a/project/images/animates.png b/project/images/animates.png index 0bfad0df..f6245285 100644 Binary files a/project/images/animates.png and b/project/images/animates.png differ diff --git a/project/images/terrains.png b/project/images/terrains.png index 246de0cb..55239f66 100644 Binary files a/project/images/terrains.png and b/project/images/terrains.png differ