editor-tilesets
This commit is contained in:
parent
00e2a79840
commit
94ae7f3a33
@ -228,14 +228,9 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
},
|
||||
"canBreak": {
|
||||
"_leaf": true,
|
||||
"_type": "select",
|
||||
"_select": {
|
||||
"values": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"_data": "该图块是否可被破炸;true代表可以,false代表不可以"
|
||||
"_type": "checkbox",
|
||||
"_bool": "bool",
|
||||
"_data": "该图块是否可被破炸"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -81,7 +81,12 @@ editor.prototype.init = function (callback) {
|
||||
editor.prototype.idsInit = function (maps, icons) {
|
||||
editor.ids = [0];
|
||||
editor.indexs = [];
|
||||
var MAX_NUM = Math.max.apply(null,Object.keys(maps_90f36752_8815_4be8_b32b_d7fad1d0542e));
|
||||
var MAX_NUM = 0;
|
||||
var keys=Object.keys(maps_90f36752_8815_4be8_b32b_d7fad1d0542e);
|
||||
for(var ii=0;ii<keys.length;ii++){
|
||||
var v=~~keys[ii];
|
||||
if(v>MAX_NUM && v<core.icons.tilesetStartOffset)MAX_NUM=v;
|
||||
}
|
||||
editor.MAX_NUM=MAX_NUM;
|
||||
var getInfoById = function (id) {
|
||||
var block = maps.initBlock(0, 0, id);
|
||||
|
||||
@ -476,15 +476,24 @@ editor_file = function (editor, callback) {
|
||||
}
|
||||
;
|
||||
if (isset(actionList) && actionList.length > 0) {
|
||||
actionList.forEach(function (value) {
|
||||
var tempmap=[];
|
||||
for(var ii=0;ii<actionList.length;ii++){
|
||||
var value=actionList[ii];
|
||||
// 是tilesets 且未定义 且在这里是第一次定义
|
||||
if(idnum>=editor.core.icons.tilesetStartOffset && !isset(editor.core.maps.blocksInfo[idnum]) && tempmap.indexOf(idnum)===-1){
|
||||
actionList.splice(ii,0,["add","['" + idnum + "']",{"cls": "tileset", "id": "X"+idnum, "noPass": true}]);
|
||||
ii++;
|
||||
}
|
||||
value[1] = "['" + idnum + "']" + value[1];
|
||||
});
|
||||
}
|
||||
saveSetting('maps', actionList, function (err) {
|
||||
callback([
|
||||
(function () {
|
||||
var locObj = Object.assign({}, editor.core.maps.blocksInfo[idnum]);
|
||||
var sourceobj=editor.core.maps.blocksInfo[idnum];
|
||||
if(!isset(sourceobj) && idnum>=editor.core.icons.tilesetStartOffset)sourceobj={"cls": "tileset", "id": "X"+idnum, "noPass": true}
|
||||
var locObj = Object.assign({}, sourceobj);
|
||||
Object.keys(editor_file.comment._data.maps._data).forEach(function (v) {
|
||||
if (!isset(editor.core.maps.blocksInfo[idnum][v]))
|
||||
if (!isset(sourceobj[v]))
|
||||
locObj[v] = null;
|
||||
});
|
||||
locObj.idnum = idnum;
|
||||
@ -496,9 +505,11 @@ editor_file = function (editor, callback) {
|
||||
} else {
|
||||
callback([
|
||||
(function () {
|
||||
var locObj = Object.assign({}, editor.core.maps.blocksInfo[idnum]);
|
||||
var sourceobj=editor.core.maps.blocksInfo[idnum];
|
||||
if(!isset(sourceobj) && idnum>=editor.core.icons.tilesetStartOffset)sourceobj={"cls": "tileset", "id": "X"+idnum, "noPass": true}
|
||||
var locObj = Object.assign({}, sourceobj);
|
||||
Object.keys(editor_file.comment._data.maps._data).forEach(function (v) {
|
||||
if (!isset(editor.core.maps.blocksInfo[idnum][v]))
|
||||
if (!isset(sourceobj[v]))
|
||||
locObj[v] = null;
|
||||
});
|
||||
locObj.idnum = idnum;
|
||||
|
||||
@ -320,18 +320,11 @@ editor_mode = function (editor) {
|
||||
if (!core.isset(editor_mode.info.id)) {
|
||||
// document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML = '';
|
||||
document.getElementById('enemyItemTable').style.display = 'none';
|
||||
document.getElementById('tilesetsDiv').style.display = 'none';
|
||||
document.getElementById('newIdIdnum').style.display = 'block';
|
||||
return;
|
||||
}
|
||||
if (editor_mode.info.isTile) {
|
||||
document.getElementById('enemyItemTable').style.display = 'none';
|
||||
document.getElementById('tilesetsDiv').style.display = 'block';
|
||||
document.getElementById('newIdIdnum').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('newIdIdnum').style.display = 'none';
|
||||
document.getElementById('tilesetsDiv').style.display = 'none';
|
||||
document.getElementById('enemyItemTable').style.display = 'block';
|
||||
|
||||
var objs = [];
|
||||
|
||||
@ -95,9 +95,6 @@
|
||||
<h3 class="leftTabHeader">图块属性 <button onclick="editor.mode.onmode('save')">保存</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div id='tilesetsDiv'><!-- tilesets -->
|
||||
<p>tilesets不允许编辑图块属性</p>
|
||||
</div>
|
||||
<div id='newIdIdnum'><!-- id and idnum -->
|
||||
<input placeholder="新id(唯一标识符)"/>
|
||||
<input placeholder="新idnum(1000以内数字)"/>
|
||||
|
||||
@ -94,9 +94,6 @@
|
||||
<h3 class="leftTabHeader">图块属性 <button onclick="editor.mode.onmode('save')">保存</button>
|
||||
</h3>
|
||||
<div class="leftTabContent">
|
||||
<div id='tilesetsDiv'><!-- tilesets -->
|
||||
<p>tilesets不允许编辑图块属性</p>
|
||||
</div>
|
||||
<div id='newIdIdnum'><!-- id and idnum -->
|
||||
<input placeholder="新id(唯一标识符)"/>
|
||||
<input placeholder="新idnum(1000以内数字)"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user