editor_file
This commit is contained in:
parent
2b9eadbe9f
commit
cb10654e58
@ -50,6 +50,7 @@ editor.prototype.init = function (callback) {
|
|||||||
main.init('editor', function () {
|
main.init('editor', function () {
|
||||||
editor_util_wrapper(editor);
|
editor_util_wrapper(editor);
|
||||||
editor_game_wrapper(editor, main, core);
|
editor_game_wrapper(editor, main, core);
|
||||||
|
editor_file_wrapper(editor);
|
||||||
editor_table_wrapper(editor);
|
editor_table_wrapper(editor);
|
||||||
editor_unsorted_1_wrapper(editor);
|
editor_unsorted_1_wrapper(editor);
|
||||||
afterMainInit();
|
afterMainInit();
|
||||||
|
|||||||
36
_server/editor_file.js
Normal file
36
_server/editor_file.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
editor_file_wrapper = function (editor) {
|
||||||
|
editor_file_proto = function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
editor_file_proto.prototype.loadCommentjs=function(callback){
|
||||||
|
var commentjs = {
|
||||||
|
'comment': 'comment',
|
||||||
|
'data.comment': 'dataComment',
|
||||||
|
'functions.comment': 'functionsComment',
|
||||||
|
'events.comment': 'eventsComment',
|
||||||
|
'plugins.comment': 'pluginsComment',
|
||||||
|
}
|
||||||
|
for (var key in commentjs) {
|
||||||
|
(function (key) {
|
||||||
|
var value = commentjs[key];
|
||||||
|
var script = document.createElement('script');
|
||||||
|
if (window.location.href.indexOf('_server') !== -1)
|
||||||
|
script.src = key + '.js';
|
||||||
|
else
|
||||||
|
script.src = '_server/table/' + key + '.js';
|
||||||
|
document.body.appendChild(script);
|
||||||
|
script.onload = function () {
|
||||||
|
editor.file[value] = eval(key.replace('.', '_') + '_c456ea59_6018_45ef_8bcc_211a24c627dc');
|
||||||
|
var loaded = Boolean(callback);
|
||||||
|
for (var key_ in commentjs) {
|
||||||
|
loaded = loaded && editor.file[commentjs[key_]]
|
||||||
|
}
|
||||||
|
if (loaded) callback();
|
||||||
|
}
|
||||||
|
})(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,37 +1,13 @@
|
|||||||
editor_file = function (editor, callback) {
|
editor_file = function (editor, callback) {
|
||||||
|
|
||||||
var editor_file = {};
|
var editor_file = new editor_file_proto();
|
||||||
|
editor.file=editor_file;
|
||||||
|
|
||||||
|
editor.file.loadCommentjs(callback);
|
||||||
|
|
||||||
var commentjs = {
|
///////////////////////////////////////////////////////////////////////////
|
||||||
'comment': 'comment',
|
|
||||||
'data.comment': 'dataComment',
|
|
||||||
'functions.comment': 'functionsComment',
|
|
||||||
'events.comment': 'eventsComment',
|
|
||||||
'plugins.comment': 'pluginsComment',
|
|
||||||
}
|
|
||||||
for (var key in commentjs) {
|
|
||||||
(function (key) {
|
|
||||||
var value = commentjs[key];
|
|
||||||
var script = document.createElement('script');
|
|
||||||
if (window.location.href.indexOf('_server') !== -1)
|
|
||||||
script.src = key + '.js';
|
|
||||||
else
|
|
||||||
script.src = '_server/table/' + key + '.js';
|
|
||||||
document.body.appendChild(script);
|
|
||||||
script.onload = function () {
|
|
||||||
editor_file[value] = eval(key.replace('.', '_') + '_c456ea59_6018_45ef_8bcc_211a24c627dc');
|
|
||||||
var loaded = Boolean(callback);
|
|
||||||
for (var key_ in commentjs) {
|
|
||||||
loaded = loaded && editor_file[commentjs[key_]]
|
|
||||||
}
|
|
||||||
if (loaded) callback();
|
|
||||||
}
|
|
||||||
})(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
editor.file.getFloorFileList = function (callback) {
|
||||||
editor_file.getFloorFileList = function (callback) {
|
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
/* var fs = editor.fs;
|
/* var fs = editor.fs;
|
||||||
fs.readdir('project/floors',function(err, data){
|
fs.readdir('project/floors',function(err, data){
|
||||||
@ -40,7 +16,7 @@ editor_file = function (editor, callback) {
|
|||||||
callback([editor.core.floorIds, null]);
|
callback([editor.core.floorIds, null]);
|
||||||
}
|
}
|
||||||
//callback([Array<String>,err:String])
|
//callback([Array<String>,err:String])
|
||||||
editor_file.loadFloorFile = function (filename, callback) {
|
editor.file.loadFloorFile = function (filename, callback) {
|
||||||
//filename不含'/'不含'.js'
|
//filename不含'/'不含'.js'
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
|
|
||||||
@ -48,7 +24,7 @@ editor_file = function (editor, callback) {
|
|||||||
editor.currentFloorData = editor.core.floors[editor.currentFloorId];
|
editor.currentFloorData = editor.core.floors[editor.currentFloorId];
|
||||||
}
|
}
|
||||||
//callback(err:String)
|
//callback(err:String)
|
||||||
editor_file.saveFloorFile = function (callback) {
|
editor.file.saveFloorFile = function (callback) {
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
/* if (!isset(editor.currentFloorId) || !isset(editor.currentFloorData)) {
|
/* if (!isset(editor.currentFloorId) || !isset(editor.currentFloorData)) {
|
||||||
callback('未选中文件或无数据');
|
callback('未选中文件或无数据');
|
||||||
@ -99,7 +75,7 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
//callback(err:String)
|
//callback(err:String)
|
||||||
editor_file.saveNewFile = function (saveFilename, callback) {
|
editor.file.saveNewFile = function (saveFilename, callback) {
|
||||||
//saveAsFilename不含'/'不含'.js'
|
//saveAsFilename不含'/'不含'.js'
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
var currData=editor.currentFloorData;
|
var currData=editor.currentFloorData;
|
||||||
@ -145,9 +121,9 @@ editor_file = function (editor, callback) {
|
|||||||
})
|
})
|
||||||
editor.currentFloorData.map = "new";
|
editor.currentFloorData.map = "new";
|
||||||
editor.currentFloorId = saveFilename;
|
editor.currentFloorId = saveFilename;
|
||||||
editor_file.saveFloorFile(callback);
|
editor.file.saveFloorFile(callback);
|
||||||
}
|
}
|
||||||
editor_file.saveNewFiles = function (floorIdList, from, to, callback) {
|
editor.file.saveNewFiles = function (floorIdList, from, to, callback) {
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
var currData=editor.currentFloorData;
|
var currData=editor.currentFloorData;
|
||||||
var saveStatus = document.getElementById('newMapsStatus').checked;
|
var saveStatus = document.getElementById('newMapsStatus').checked;
|
||||||
@ -224,7 +200,7 @@ editor_file = function (editor, callback) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
editor_file.autoRegister = function (info, callback) {
|
editor.file.autoRegister = function (info, callback) {
|
||||||
|
|
||||||
var iconActions = [];
|
var iconActions = [];
|
||||||
var mapActions = [];
|
var mapActions = [];
|
||||||
@ -269,9 +245,9 @@ editor_file = function (editor, callback) {
|
|||||||
}
|
}
|
||||||
mapActions.push(["add", "['" + idnum + "']", {'cls': image, 'id': id}])
|
mapActions.push(["add", "['" + idnum + "']", {'cls': image, 'id': id}])
|
||||||
if (image=='items')
|
if (image=='items')
|
||||||
templateActions.push(["add", "['items']['" + id + "']", editor_file.comment._data.items_template]);
|
templateActions.push(["add", "['items']['" + id + "']", editor.file.comment._data.items_template]);
|
||||||
else if (image.indexOf('enemy')==0)
|
else if (image.indexOf('enemy')==0)
|
||||||
templateActions.push(["add", "['" + id + "']", editor_file.comment._data.enemys_template]);
|
templateActions.push(["add", "['" + id + "']", editor.file.comment._data.enemys_template]);
|
||||||
idnum++;
|
idnum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +280,7 @@ editor_file = function (editor, callback) {
|
|||||||
else tempcallback(null);
|
else tempcallback(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
editor_file.registerAutotile = function (filename, callback) {
|
editor.file.registerAutotile = function (filename, callback) {
|
||||||
var idnum = 140;
|
var idnum = 140;
|
||||||
while (editor.core.maps.blocksInfo[idnum]) idnum++;
|
while (editor.core.maps.blocksInfo[idnum]) idnum++;
|
||||||
|
|
||||||
@ -330,7 +306,7 @@ editor_file = function (editor, callback) {
|
|||||||
saveSetting('maps', mapActions, tempcallback);
|
saveSetting('maps', mapActions, tempcallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
editor_file.changeIdAndIdnum = function (id, idnum, info, callback) {
|
editor.file.changeIdAndIdnum = function (id, idnum, info, callback) {
|
||||||
checkCallback(callback);
|
checkCallback(callback);
|
||||||
//检查maps中是否有重复的idnum或id
|
//检查maps中是否有重复的idnum或id
|
||||||
var change = -1;
|
var change = -1;
|
||||||
@ -379,7 +355,7 @@ editor_file = function (editor, callback) {
|
|||||||
saveSetting('maps', [["add", "['" + idnum + "']", {'cls': info.images, 'id': id}]], tempcallback);
|
saveSetting('maps', [["add", "['" + idnum + "']", {'cls': info.images, 'id': id}]], tempcallback);
|
||||||
saveSetting('icons', [["add", "['" + info.images + "']['" + id + "']", info.y]], tempcallback);
|
saveSetting('icons', [["add", "['" + info.images + "']['" + id + "']", info.y]], tempcallback);
|
||||||
if (info.images === 'items') {
|
if (info.images === 'items') {
|
||||||
saveSetting('items', [["add", "['items']['" + id + "']", editor_file.comment._data.items_template]], function (err) {
|
saveSetting('items', [["add", "['items']['" + id + "']", editor.file.comment._data.items_template]], function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
printe(err);
|
printe(err);
|
||||||
throw(err)
|
throw(err)
|
||||||
@ -387,7 +363,7 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (info.images === 'enemys' || info.images === 'enemy48') {
|
if (info.images === 'enemys' || info.images === 'enemy48') {
|
||||||
saveSetting('enemys', [["add", "['" + id + "']", editor_file.comment._data.enemys_template]], function (err) {
|
saveSetting('enemys', [["add", "['" + id + "']", editor.file.comment._data.enemys_template]], function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
printe(err);
|
printe(err);
|
||||||
throw(err)
|
throw(err)
|
||||||
@ -398,7 +374,7 @@ editor_file = function (editor, callback) {
|
|||||||
callback(null);
|
callback(null);
|
||||||
}
|
}
|
||||||
//callback(err:String)
|
//callback(err:String)
|
||||||
editor_file.editItem = function (id, actionList, callback) {
|
editor.file.editItem = function (id, actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['items']['name']","红宝石的新名字"],
|
["change","['items']['name']","红宝石的新名字"],
|
||||||
["add","['items']['新的和name同级的属性']",123],
|
["add","['items']['新的和name同级的属性']",123],
|
||||||
@ -419,7 +395,7 @@ editor_file = function (editor, callback) {
|
|||||||
callback([
|
callback([
|
||||||
(function () {
|
(function () {
|
||||||
var locObj_ = {};
|
var locObj_ = {};
|
||||||
Object.keys(editor_file.comment._data.items._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.items._data).forEach(function (v) {
|
||||||
if (isset(editor.core.items[v][id]) && v !== 'items')
|
if (isset(editor.core.items[v][id]) && v !== 'items')
|
||||||
locObj_[v] = editor.core.items[v][id];
|
locObj_[v] = editor.core.items[v][id];
|
||||||
else
|
else
|
||||||
@ -427,7 +403,7 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
locObj_['items'] = (function () {
|
locObj_['items'] = (function () {
|
||||||
var locObj = Object.assign({}, editor.core.items.items[id]);
|
var locObj = Object.assign({}, editor.core.items.items[id]);
|
||||||
Object.keys(editor_file.comment._data.items._data.items._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.items._data.items._data).forEach(function (v) {
|
||||||
if (!isset(editor.core.items.items[id][v]))
|
if (!isset(editor.core.items.items[id][v]))
|
||||||
locObj[v] = null;
|
locObj[v] = null;
|
||||||
});
|
});
|
||||||
@ -435,13 +411,13 @@ editor_file = function (editor, callback) {
|
|||||||
})();
|
})();
|
||||||
return locObj_;
|
return locObj_;
|
||||||
})(),
|
})(),
|
||||||
editor_file.comment._data.items,
|
editor.file.comment._data.items,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
//只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items
|
//只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items
|
||||||
}
|
}
|
||||||
//callback([obj,commentObj,err:String])
|
//callback([obj,commentObj,err:String])
|
||||||
editor_file.editEnemy = function (id, actionList, callback) {
|
editor.file.editEnemy = function (id, actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['name']","初级巫师的新名字"],
|
["change","['name']","初级巫师的新名字"],
|
||||||
["add","['新的和name同级的属性']",123],
|
["add","['新的和name同级的属性']",123],
|
||||||
@ -461,7 +437,7 @@ editor_file = function (editor, callback) {
|
|||||||
callback([
|
callback([
|
||||||
(function () {
|
(function () {
|
||||||
var locObj = Object.assign({}, editor.core.enemys.enemys[id]);
|
var locObj = Object.assign({}, editor.core.enemys.enemys[id]);
|
||||||
Object.keys(editor_file.comment._data.enemys._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.enemys._data).forEach(function (v) {
|
||||||
if (!isset(editor.core.enemys.enemys[id][v]))
|
if (!isset(editor.core.enemys.enemys[id][v]))
|
||||||
/* locObj[v]=editor.core.enemys.enemys[id][v];
|
/* locObj[v]=editor.core.enemys.enemys[id][v];
|
||||||
else */
|
else */
|
||||||
@ -469,13 +445,13 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.comment._data.enemys,
|
editor.file.comment._data.enemys,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//callback([obj,commentObj,err:String])
|
//callback([obj,commentObj,err:String])
|
||||||
|
|
||||||
editor_file.editMapBlocksInfo = function (idnum, actionList, callback) {
|
editor.file.editMapBlocksInfo = function (idnum, actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['events']",["\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值,可参见样板中初级巫师的写法。"]],
|
["change","['events']",["\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值,可参见样板中初级巫师的写法。"]],
|
||||||
["change","['afterBattle']",null],
|
["change","['afterBattle']",null],
|
||||||
@ -504,14 +480,14 @@ editor_file = function (editor, callback) {
|
|||||||
var sourceobj=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}
|
if(!isset(sourceobj) && idnum>=editor.core.icons.tilesetStartOffset)sourceobj={"cls": "tileset", "id": "X"+idnum, "noPass": true}
|
||||||
var locObj = Object.assign({}, sourceobj);
|
var locObj = Object.assign({}, sourceobj);
|
||||||
Object.keys(editor_file.comment._data.maps._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.maps._data).forEach(function (v) {
|
||||||
if (!isset(sourceobj[v]))
|
if (!isset(sourceobj[v]))
|
||||||
locObj[v] = null;
|
locObj[v] = null;
|
||||||
});
|
});
|
||||||
locObj.idnum = idnum;
|
locObj.idnum = idnum;
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.comment._data.maps,
|
editor.file.comment._data.maps,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,7 +495,7 @@ editor_file = function (editor, callback) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
editor_file.editLoc = function (x, y, actionList, callback) {
|
editor.file.editLoc = function (x, y, actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['events']",["\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值,可参见样板中初级巫师的写法。"]],
|
["change","['events']",["\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值,可参见样板中初级巫师的写法。"]],
|
||||||
["change","['afterBattle']",null],
|
["change","['afterBattle']",null],
|
||||||
@ -538,7 +514,7 @@ editor_file = function (editor, callback) {
|
|||||||
callback([
|
callback([
|
||||||
(function () {
|
(function () {
|
||||||
var locObj = {};
|
var locObj = {};
|
||||||
Object.keys(editor_file.comment._data.floors._data.loc._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.floors._data.loc._data).forEach(function (v) {
|
||||||
if (isset(editor.currentFloorData[v][x + ',' + y]))
|
if (isset(editor.currentFloorData[v][x + ',' + y]))
|
||||||
locObj[v] = editor.currentFloorData[v][x + ',' + y];
|
locObj[v] = editor.currentFloorData[v][x + ',' + y];
|
||||||
else
|
else
|
||||||
@ -546,7 +522,7 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.comment._data.floors._data.loc,
|
editor.file.comment._data.floors._data.loc,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,7 +531,7 @@ editor_file = function (editor, callback) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
editor_file.editFloor = function (actionList, callback) {
|
editor.file.editFloor = function (actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['title']",'样板 3 层'],
|
["change","['title']",'样板 3 层'],
|
||||||
["change","['color']",null],
|
["change","['color']",null],
|
||||||
@ -571,13 +547,13 @@ editor_file = function (editor, callback) {
|
|||||||
callback([
|
callback([
|
||||||
(function () {
|
(function () {
|
||||||
var locObj = Object.assign({}, editor.currentFloorData);
|
var locObj = Object.assign({}, editor.currentFloorData);
|
||||||
Object.keys(editor_file.comment._data.floors._data.floor._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.floors._data.floor._data).forEach(function (v) {
|
||||||
if (!isset(editor.currentFloorData[v]))
|
if (!isset(editor.currentFloorData[v]))
|
||||||
/* locObj[v]=editor.currentFloorData[v];
|
/* locObj[v]=editor.currentFloorData[v];
|
||||||
else */
|
else */
|
||||||
locObj[v] = null;
|
locObj[v] = null;
|
||||||
});
|
});
|
||||||
Object.keys(editor_file.comment._data.floors._data.loc._data).forEach(function (v) {
|
Object.keys(editor.file.comment._data.floors._data.loc._data).forEach(function (v) {
|
||||||
delete(locObj[v]);
|
delete(locObj[v]);
|
||||||
});
|
});
|
||||||
delete(locObj.map);
|
delete(locObj.map);
|
||||||
@ -585,7 +561,7 @@ editor_file = function (editor, callback) {
|
|||||||
delete(locObj.fgmap);
|
delete(locObj.fgmap);
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.comment._data.floors._data.floor,
|
editor.file.comment._data.floors._data.floor,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,7 +569,7 @@ editor_file = function (editor, callback) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
editor_file.editTower = function (actionList, callback) {
|
editor.file.editTower = function (actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['firstData']['version']",'Ver 1.0.1 (Beta)'],
|
["change","['firstData']['version']",'Ver 1.0.1 (Beta)'],
|
||||||
["change","['values']['lavaDamage']",200],
|
["change","['values']['lavaDamage']",200],
|
||||||
@ -611,7 +587,7 @@ editor_file = function (editor, callback) {
|
|||||||
(function () {
|
(function () {
|
||||||
//var locObj=Object.assign({'main':{}},editor.core.data);
|
//var locObj=Object.assign({'main':{}},editor.core.data);
|
||||||
var locObj = Object.assign({}, data_obj, {'main': {}});
|
var locObj = Object.assign({}, data_obj, {'main': {}});
|
||||||
Object.keys(editor_file.dataComment._data.main._data).forEach(function (v) {
|
Object.keys(editor.file.dataComment._data.main._data).forEach(function (v) {
|
||||||
if (isset(editor.main[v]))
|
if (isset(editor.main[v]))
|
||||||
locObj.main[v] = data_obj.main[v];
|
locObj.main[v] = data_obj.main[v];
|
||||||
else
|
else
|
||||||
@ -619,7 +595,7 @@ editor_file = function (editor, callback) {
|
|||||||
});
|
});
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.dataComment,
|
editor.file.dataComment,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -636,8 +612,8 @@ editor_file = function (editor, callback) {
|
|||||||
} else return v
|
} else return v
|
||||||
}, 4);
|
}, 4);
|
||||||
var fobj = JSON.parse(fjson);
|
var fobj = JSON.parse(fjson);
|
||||||
editor_file.functionsMap = fmap;
|
editor.file.functionsMap = fmap;
|
||||||
editor_file.functionsJSON = fjson;
|
editor.file.functionsJSON = fjson;
|
||||||
var buildlocobj = function (locObj) {
|
var buildlocobj = function (locObj) {
|
||||||
for (var key in locObj) {
|
for (var key in locObj) {
|
||||||
if (typeof(locObj[key]) !== typeof('')) buildlocobj(locObj[key]);
|
if (typeof(locObj[key]) !== typeof('')) buildlocobj(locObj[key]);
|
||||||
@ -645,7 +621,7 @@ editor_file = function (editor, callback) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
editor_file.editFunctions = function (actionList, callback) {
|
editor.file.editFunctions = function (actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['events']['afterChangeLight']","function(x,y){console.log(x,y)}"],
|
["change","['events']['afterChangeLight']","function(x,y){console.log(x,y)}"],
|
||||||
["change","['ui']['drawAbout']","function(){...}"],
|
["change","['ui']['drawAbout']","function(){...}"],
|
||||||
@ -664,7 +640,7 @@ editor_file = function (editor, callback) {
|
|||||||
buildlocobj(locObj);
|
buildlocobj(locObj);
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.functionsComment,
|
editor.file.functionsComment,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,7 +648,7 @@ editor_file = function (editor, callback) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
editor_file.editCommonEvent = function (actionList, callback) {
|
editor.file.editCommonEvent = function (actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['test']",['123']],
|
["change","['test']",['123']],
|
||||||
]
|
]
|
||||||
@ -690,7 +666,7 @@ editor_file = function (editor, callback) {
|
|||||||
} else {
|
} else {
|
||||||
callback([
|
callback([
|
||||||
Object.assign({},data_obj),
|
Object.assign({},data_obj),
|
||||||
editor_file.eventsComment._data.commonEvent,
|
editor.file.eventsComment._data.commonEvent,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -711,8 +687,8 @@ editor_file = function (editor, callback) {
|
|||||||
} return v
|
} return v
|
||||||
}, 4);
|
}, 4);
|
||||||
var plobj = JSON.parse(pljson);
|
var plobj = JSON.parse(pljson);
|
||||||
editor_file.pluginsMap = plmap;
|
editor.file.pluginsMap = plmap;
|
||||||
editor_file.pluginsObj = plobj;
|
editor.file.pluginsObj = plobj;
|
||||||
var buildpllocobj = function (locObj) {
|
var buildpllocobj = function (locObj) {
|
||||||
for (var key in locObj) {
|
for (var key in locObj) {
|
||||||
if (typeof(locObj[key]) !== typeof('')) buildpllocobj(locObj[key]);
|
if (typeof(locObj[key]) !== typeof('')) buildpllocobj(locObj[key]);
|
||||||
@ -720,7 +696,7 @@ editor_file = function (editor, callback) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
editor_file.editPlugins = function (actionList, callback) {
|
editor.file.editPlugins = function (actionList, callback) {
|
||||||
/*actionList:[
|
/*actionList:[
|
||||||
["change","['test']","function(x,y){console.log(x,y)}"],
|
["change","['test']","function(x,y){console.log(x,y)}"],
|
||||||
]
|
]
|
||||||
@ -738,7 +714,7 @@ editor_file = function (editor, callback) {
|
|||||||
buildpllocobj(locObj);
|
buildpllocobj(locObj);
|
||||||
return locObj;
|
return locObj;
|
||||||
})(),
|
})(),
|
||||||
editor_file.pluginsComment,
|
editor.file.pluginsComment,
|
||||||
null]);
|
null]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -904,14 +880,14 @@ editor_file = function (editor, callback) {
|
|||||||
else
|
else
|
||||||
eval("editor.currentFloorData" + value[1] + '=' + JSON.stringify(value[2]));
|
eval("editor.currentFloorData" + value[1] + '=' + JSON.stringify(value[2]));
|
||||||
});
|
});
|
||||||
editor_file.saveFloorFile(callback);
|
editor.file.saveFloorFile(callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (file == 'floors') {
|
if (file == 'floors') {
|
||||||
actionList.forEach(function (value) {
|
actionList.forEach(function (value) {
|
||||||
eval("editor.currentFloorData" + value[1] + '=' + JSON.stringify(value[2]));
|
eval("editor.currentFloorData" + value[1] + '=' + JSON.stringify(value[2]));
|
||||||
});
|
});
|
||||||
editor_file.saveFloorFile(callback);
|
editor.file.saveFloorFile(callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (file == 'events') {
|
if (file == 'events') {
|
||||||
|
|||||||
@ -473,7 +473,7 @@ editor_unsorted_2_wrapper=function(editor_mode){
|
|||||||
throw(err);
|
throw(err);
|
||||||
}
|
}
|
||||||
// Step 4: 自动注册
|
// Step 4: 自动注册
|
||||||
editor_file.registerAutotile(filename, function (err) {
|
editor.file.registerAutotile(filename, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
printe(err);
|
printe(err);
|
||||||
throw(err);
|
throw(err);
|
||||||
|
|||||||
@ -524,6 +524,7 @@
|
|||||||
<script src='_server/fs.js'></script>
|
<script src='_server/fs.js'></script>
|
||||||
<script src='_server/editor_util.js'></script>
|
<script src='_server/editor_util.js'></script>
|
||||||
<script src='_server/editor_game.js'></script>
|
<script src='_server/editor_game.js'></script>
|
||||||
|
<script src='_server/editor_file.js'></script>
|
||||||
<script src='_server/editor_file_unsorted.js'></script>
|
<script src='_server/editor_file_unsorted.js'></script>
|
||||||
<script src='_server/editor_table.js'></script>
|
<script src='_server/editor_table.js'></script>
|
||||||
<script src='_server/editor_mode.js'></script>
|
<script src='_server/editor_mode.js'></script>
|
||||||
|
|||||||
@ -507,6 +507,7 @@
|
|||||||
<script src='_server/fs.js'></script>
|
<script src='_server/fs.js'></script>
|
||||||
<script src='_server/editor_util.js'></script>
|
<script src='_server/editor_util.js'></script>
|
||||||
<script src='_server/editor_game.js'></script>
|
<script src='_server/editor_game.js'></script>
|
||||||
|
<script src='_server/editor_file.js'></script>
|
||||||
<script src='_server/editor_file_unsorted.js'></script>
|
<script src='_server/editor_file_unsorted.js'></script>
|
||||||
<script src='_server/editor_table.js'></script>
|
<script src='_server/editor_table.js'></script>
|
||||||
<script src='_server/editor_mode.js'></script>
|
<script src='_server/editor_mode.js'></script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user