editor 全GUI编辑
This commit is contained in:
parent
eb8a045816
commit
8977ac5137
119
_server/css/editor_mode.css
Normal file
119
_server/css/editor_mode.css
Normal file
@ -0,0 +1,119 @@
|
||||
.leftTab {
|
||||
border-radius: 2px;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.leftTab {
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
height: 630px;
|
||||
}
|
||||
.leftTab > *{margin:2.5px 5px;}
|
||||
.leftTab > :first-child{margin-top:5px;}
|
||||
.leftTab > :last-child{margin-bottom:5px;}
|
||||
|
||||
#left99 {
|
||||
left: 5px;
|
||||
top: 650px;
|
||||
width: 435px;
|
||||
}
|
||||
|
||||
#left2 {
|
||||
left: 448px;
|
||||
top: 650px;
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
#left3 {
|
||||
left: 900px;
|
||||
top: 650px;
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
#left4 {
|
||||
left: 5px;
|
||||
top: 1290px;
|
||||
width: 435px;
|
||||
}
|
||||
|
||||
#left5 {
|
||||
left: 448px;
|
||||
top: 1290px;
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
.etable table,
|
||||
.etable table td {
|
||||
color: #000;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
/* copy from github-css https://github.com/sindresorhus/github-markdown-css */
|
||||
.etable table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.etable table {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.etable table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.etable table th {
|
||||
font-weight: 600;
|
||||
}
|
||||
.etable table th,
|
||||
.etable table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #dfe2e5;
|
||||
}
|
||||
.etable table tr {
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #c6cbd1;
|
||||
}
|
||||
.etable table tr:nth-child(2n) {
|
||||
background-color: #f6f8fa;
|
||||
}
|
||||
/* copy end --------------------------------------------- */
|
||||
.etable tr {width:100%}
|
||||
.etable tr > :nth-child(1) {width:20%}
|
||||
.etable tr > :nth-child(2) {width:20%}
|
||||
.etable tr > :nth-child(3) {width:60%}
|
||||
|
||||
.etable table {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) :last-child {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) input:last-child {
|
||||
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) select:last-child {
|
||||
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) textarea:last-child {
|
||||
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) > :last-child:hover {
|
||||
border: 1px solid rgb(87, 198, 232);
|
||||
box-shadow: 0px 0px 3px rgb(87, 198, 232);
|
||||
}
|
||||
|
||||
.etable tr:not(:first-child) > :nth-child(2):hover,
|
||||
.etable tr:not(:first-child) > :nth-child(1):hover {
|
||||
border: 1px solid rgb(87, 232, 198);
|
||||
box-shadow: 0px 0px 3px rgb(87, 232, 198);
|
||||
}
|
||||
@ -295,6 +295,7 @@ editor.prototype.changeFloor = function(floorId,callback) {
|
||||
editor.updateMap();
|
||||
editor.currentFloorId=core.status.floorId;
|
||||
editor.currentFloorData = core.floors[core.status.floorId];
|
||||
editor_mode.floor();
|
||||
if (core.isset(callback))callback();
|
||||
});
|
||||
}
|
||||
@ -338,6 +339,11 @@ editor.prototype.listen = function() {
|
||||
|
||||
eui.onmousedown = function (e) {
|
||||
if(!selectBox.isSelected) {
|
||||
var loc = eToLoc(e);
|
||||
var pos = locToPos(loc);
|
||||
editor_mode.onmode('');//为了强制触发doAction
|
||||
editor_mode.onmode('loc');
|
||||
editor_mode.loc();
|
||||
tip.whichShow = 1;
|
||||
return;
|
||||
}
|
||||
@ -348,7 +354,7 @@ editor.prototype.listen = function() {
|
||||
e.stopPropagation();
|
||||
uc.clearRect(0, 0, 416, 416);
|
||||
var loc = eToLoc(e);
|
||||
var pos = locToPos(loc)
|
||||
var pos = locToPos(loc);
|
||||
stepPostfix = [];
|
||||
stepPostfix.push(pos);
|
||||
fillPos(pos);
|
||||
@ -491,6 +497,9 @@ editor.prototype.listen = function() {
|
||||
}
|
||||
}
|
||||
tip.infos = JSON.parse(JSON.stringify(editor.info));
|
||||
editor_mode.onmode('');//为了强制触发doAction
|
||||
editor_mode.onmode('emenyitem');
|
||||
editor_mode.emenyitem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,16 +30,17 @@
|
||||
|
||||
editor_file.getFloorFileList = function(editor,callback){
|
||||
if (!isset(callback)) throw('未设置callback');
|
||||
var fs = editor.fs;
|
||||
/* var fs = editor.fs;
|
||||
fs.readdir('project/floors',function(err, data){
|
||||
callback([data,err]);
|
||||
});
|
||||
}); */
|
||||
callback([editor.core.floorIds,null]);
|
||||
}
|
||||
//callback([Array<String>,err:String])
|
||||
editor_file.loadFloorFile = function(editor,filename,callback){
|
||||
//filename不含'/'不含'.js'
|
||||
if (!isset(callback)) throw('未设置callback');
|
||||
var fs = editor.fs;
|
||||
/* var fs = editor.fs;
|
||||
fs.readFile('project/floors/'+filename+'.js','utf-8',function(err, data){
|
||||
if (err!=null){callback(err);return;}
|
||||
data=data.split('=');
|
||||
@ -57,7 +58,9 @@
|
||||
editor.currentFloorId = floorId;
|
||||
editor.currentFloorData = floorData;
|
||||
callback(null)
|
||||
});
|
||||
}); */
|
||||
editor.currentFloorId=editor.core.status.floorId;
|
||||
editor.currentFloorData = editor.core.floors[editor.currentFloorId];
|
||||
}
|
||||
//callback(err:String)
|
||||
editor_file.saveFloorFile = function(editor,callback){
|
||||
@ -87,6 +90,7 @@
|
||||
if (!isset(editor.currentFloorData)) {
|
||||
callback('无数据');
|
||||
}
|
||||
editor.currentFloorData=JSON.parse(JSON.stringify(editor.currentFloorData));
|
||||
editor.currentFloorData.floorId=saveAsFilename;
|
||||
editor.currentFloorId=saveAsFilename;
|
||||
editor_file.saveFloorFile(editor,callback);
|
||||
@ -465,19 +469,13 @@
|
||||
}
|
||||
|
||||
/*
|
||||
$range(thiseval in ['keys','items','constants','tools'])$end
|
||||
$select({\"values\":[\"keys\",\"items\",\"constants\",\"tools\"]})$end
|
||||
$range(thiseval==~~thiseval &&thiseval>0)$end
|
||||
$range(thiseval in [true,false])$end
|
||||
$range(false)$end
|
||||
$leaf(true)$end
|
||||
$select({\"values\":[true]})$end
|
||||
$select({\"values\":[false]})$end
|
||||
$select({\"values\":[true,false]})$end
|
||||
|
||||
//$range((function(){typeof(thiseval)==typeof(0)||})())$end
|
||||
|
||||
if( 注释.indexof('$range(')!= -1){
|
||||
var thiseval = 新值;
|
||||
evalstr = 注释.split('$range')[1].split('$end')[0];
|
||||
if(eval(evalstr) !== true)alert('不在取值范围内')
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -487,19 +485,16 @@
|
||||
$leaf(evalstr:thiseval)$end
|
||||
强制指定为叶节点,如果eval(evalstr)为true
|
||||
|
||||
todo:
|
||||
//以下几个中选一个 [
|
||||
$select(evalstr)$end
|
||||
渲染成<select>,选项为数组eval(evalstr)['values']
|
||||
$input
|
||||
渲染成<input>,此为默认选项
|
||||
$input(evalstr)$end
|
||||
渲染成<input>
|
||||
$textarea(evalstr)$end
|
||||
渲染成<textarea>,行数为正整数eval(evalstr)['rows']
|
||||
渲染成<textarea>
|
||||
默认选项为$textarea()$end
|
||||
// ]
|
||||
|
||||
?:
|
||||
//$childLeaf(evalstr:thiseval)$end
|
||||
// 强制指定直接后代为叶节点,如果evalstr的值为true,此处thiseval为后代的值
|
||||
*/
|
||||
|
||||
})();
|
||||
@ -22,7 +22,7 @@ pout.innerHTML='waiting\nwaiting waiting';
|
||||
/*
|
||||
editor_file.editItem(editor,'redJewel',[],function(a){console.log(a)});
|
||||
editor_file.editEnemy(editor,'redBat',[],function(a){console.log(a)});
|
||||
editor_file.editLoc(editor,2,0,[],function(a){console.log(a)});
|
||||
editor_file.editLoc(editor,2,6,[],function(a){console.log(a)});
|
||||
editor_file.editFloor(editor,[],function(a){console.log(a)});
|
||||
editor.file.editTower(editor,[],function(a){console.log(a)});
|
||||
*/
|
||||
|
||||
210
_server/editor_mode.js
Normal file
210
_server/editor_mode.js
Normal file
@ -0,0 +1,210 @@
|
||||
function editor_mode(){
|
||||
this.ids={
|
||||
'loc':'left2',
|
||||
'emenyitem':'left3',
|
||||
'floor':'left4',
|
||||
'tower':'left5',
|
||||
'test':'left99'
|
||||
}
|
||||
this._ids={}
|
||||
this.dom={}
|
||||
this.actionList=[];
|
||||
this.mode='';
|
||||
this.info={};
|
||||
}
|
||||
|
||||
editor_mode.prototype.init = function(callback){
|
||||
|
||||
Object.keys(editor_mode.ids).forEach(function(v){
|
||||
editor_mode.dom[v]=document.getElementById(editor_mode.ids[v]);
|
||||
editor_mode._ids[editor_mode.ids[v]]=v;
|
||||
});
|
||||
|
||||
if (Boolean(callback))callback();
|
||||
}
|
||||
|
||||
editor_mode.prototype.objToTable = function(obj,commentObj){
|
||||
var outstr=["\n<tr><td>条目</td><td>注释</td><td>值</td></tr>\n"];
|
||||
var guids=[];
|
||||
//深度优先遍历
|
||||
var recursionParse = function(tfield) {
|
||||
for(var ii in eval("obj"+tfield)){
|
||||
var field = tfield+"['"+ii+"']";
|
||||
var isleaf = editor_mode.checkIsLeaf(obj,commentObj,field);
|
||||
if (isleaf) {
|
||||
var leafnode = editor_mode.objToTr(obj,commentObj,field);
|
||||
outstr.push(leafnode[0]);
|
||||
guids.push(leafnode[1]);
|
||||
} else {
|
||||
outstr.push(["<tr><td>----</td><td>----</td><td>",field,"</td></tr>\n"].join(''));
|
||||
recursionParse(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
recursionParse("");
|
||||
var listen = function(guids) {
|
||||
guids.forEach(function(guid){
|
||||
// tr>td[title=field]
|
||||
// >td[title=comment]
|
||||
// >td>div>input[value=thsieval]
|
||||
var thisTr = document.getElementById(guid);
|
||||
var input = thisTr.children[2].children[0].children[0];
|
||||
var field = thisTr.children[0].getAttribute('title');
|
||||
var comment = thisTr.children[1].getAttribute('title');
|
||||
input.onchange = function(){
|
||||
var node = thisTr.parentNode;
|
||||
while (!editor_mode._ids.hasOwnProperty(node.getAttribute('id'))) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
editor_mode.onmode(editor_mode._ids[node.getAttribute('id')]);
|
||||
editor_mode.addAction(['change',field,JSON.parse(input.value)]);
|
||||
//尚未完成,目前没做$range的检查
|
||||
};
|
||||
});
|
||||
}
|
||||
return {"HTML":outstr.join(''),"guids":guids,"listen":listen};
|
||||
}
|
||||
|
||||
editor_mode.prototype.checkIsLeaf = function(obj,commentObj,field){
|
||||
var thiseval = eval('obj'+field);
|
||||
if (thiseval == null || thiseval == undefined)return true;//null,undefined
|
||||
if (typeof(thiseval) == typeof(''))return true;//字符串
|
||||
if (Object.keys(thiseval).length == 0)return true;//数字,true,false,空数组,空对象
|
||||
try {
|
||||
var comment = eval('commentObj'+field);
|
||||
if( comment.indexOf('$leaf') != -1){
|
||||
evalstr = comment.split('$leaf')[1].split('$end')[0];
|
||||
if(eval(evalstr) === true)return true;
|
||||
}
|
||||
} catch (error) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
editor_mode.prototype.objToTr = function(obj,commentObj,field){
|
||||
var guid = editor_mode.guid();
|
||||
var thiseval = eval('obj'+field);
|
||||
var comment = '';
|
||||
try {
|
||||
comment = eval('commentObj'+field);
|
||||
} catch (error) {}
|
||||
|
||||
var charlength=10;
|
||||
|
||||
var shortField = field.split("']").slice(-2)[0].split("['").slice(-1)[0];
|
||||
shortField = (shortField.length<charlength?shortField:shortField.slice(0,charlength)+'...');
|
||||
|
||||
var commentHTMLescape=comment.split('').map(function(v){return '&#'+v.charCodeAt(0)+';'}).join('');
|
||||
var shortCommentHTMLescape=(comment.length<charlength?commentHTMLescape:comment.slice(0,charlength).split('').map(function(v){return '&#'+v.charCodeAt(0)+';'}).join('')+'...');
|
||||
|
||||
var outstr=['<tr id="',guid,'"><td title="',field,'">',shortField,'</td>',
|
||||
'<td title="',commentHTMLescape,'">',shortCommentHTMLescape,'</td>',
|
||||
'<td><div>',editor_mode.objToTd(thiseval,comment),'</div></td></tr>\n',
|
||||
];
|
||||
return [outstr.join(''),guid];
|
||||
}
|
||||
|
||||
editor_mode.prototype.objToTd = function(thiseval,comment){
|
||||
if( comment.indexOf('$select') != -1){
|
||||
var evalstr = comment.split('$select')[1].split('$end')[0];
|
||||
var values = eval(evalstr)['values'];
|
||||
var outstr = ['<select>\n',"<option value='",JSON.stringify(thiseval),"'>",JSON.stringify(thiseval),'</option>\n'];
|
||||
values.forEach(function(v){
|
||||
outstr.push(["<option value='",JSON.stringify(v),"'>",JSON.stringify(v),'</option>\n'].join(''))
|
||||
});
|
||||
outstr.push('</select>');
|
||||
return outstr.join('');
|
||||
} else if( comment.indexOf('$input') != -1){
|
||||
return ["<input spellcheck='false' value='",JSON.stringify(thiseval),"'/>\n"].join('');
|
||||
} else {
|
||||
//rows='",rows,"'
|
||||
return ["<textarea spellcheck='false' >",JSON.stringify(thiseval,null,4),'</textarea>\n'].join('');
|
||||
}
|
||||
}
|
||||
|
||||
editor_mode.prototype.guid = function() {
|
||||
return 'id_'+'xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
editor_mode.prototype.addAction = function(action){
|
||||
editor_mode.actionList.push(action);
|
||||
}
|
||||
|
||||
editor_mode.prototype.doActionList = function(mode,actionList){
|
||||
if (actionList.length==0)return;
|
||||
//尚未完成
|
||||
}
|
||||
|
||||
editor_mode.prototype.onmode = function (mode) {
|
||||
if (editor_mode.mode!=mode) {
|
||||
console.log('change mode into : '+mode);
|
||||
editor_mode.doActionList(editor_mode.mode,editor_mode.actionList);
|
||||
editor_mode.mode=mode;
|
||||
editor_mode.actionList=[];
|
||||
}
|
||||
}
|
||||
|
||||
editor_mode.prototype.loc = function(callback){
|
||||
//editor.pos={x: 0, y: 0};
|
||||
if (!core.isset(editor.pos))return;
|
||||
document.getElementById('pos_a6771a78_a099_417c_828f_0a24851ebfce').innerText=editor.pos.x+','+editor.pos.y;
|
||||
|
||||
var objs=[];
|
||||
editor_file.editLoc(editor,editor.pos.x,editor.pos.y,[],function(objs_){objs=objs_;console.log(objs_)});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo=editor_mode.objToTable(objs[0],objs[1]);
|
||||
document.getElementById('table_3d846fc4_7644_44d1_aa04_433d266a73df').innerHTML=tableinfo.HTML;
|
||||
tableinfo.listen(tableinfo.guids);
|
||||
|
||||
if (Boolean(callback))callback();
|
||||
}
|
||||
|
||||
editor_mode.prototype.emenyitem = function(callback){
|
||||
//editor.info=editor.ids[editor.indexs[201]];
|
||||
if (!core.isset(editor.info))return;
|
||||
editor_mode.info=editor.info;//避免editor.info被清空导致无法获得是物品还是怪物
|
||||
|
||||
if (!core.isset(editor_mode.info.id)){
|
||||
return;
|
||||
}//尚未完成
|
||||
|
||||
var objs=[];
|
||||
if (editor_mode.info.images=='enemys'){
|
||||
editor_file.editEnemy(editor,editor_mode.info.id,[],function(objs_){objs=objs_;console.log(objs_)});
|
||||
} else if (editor_mode.info.images=='items'){
|
||||
editor_file.editItem(editor,editor_mode.info.id,[],function(objs_){objs=objs_;console.log(objs_)});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo=editor_mode.objToTable(objs[0],objs[1]);
|
||||
document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML=tableinfo.HTML;
|
||||
tableinfo.listen(tableinfo.guids);
|
||||
|
||||
if (Boolean(callback))callback();
|
||||
}
|
||||
|
||||
editor_mode.prototype.floor = function(callback){
|
||||
var objs=[];
|
||||
editor_file.editFloor(editor,[],function(objs_){objs=objs_;console.log(objs_)});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo=editor_mode.objToTable(objs[0],objs[1]);
|
||||
document.getElementById('table_4a3b1b09_b2fb_4bdf_b9ab_9f4cdac14c74').innerHTML=tableinfo.HTML;
|
||||
tableinfo.listen(tableinfo.guids);
|
||||
if (Boolean(callback))callback();
|
||||
}
|
||||
|
||||
editor_mode.prototype.tower = function(callback){
|
||||
var objs=[];
|
||||
editor.file.editTower(editor,[],function(objs_){objs=objs_;console.log(objs_)});
|
||||
//只查询不修改时,内部实现不是异步的,所以可以这么写
|
||||
var tableinfo=editor_mode.objToTable(objs[0],objs[1]);
|
||||
document.getElementById('table_b6a03e4c_5968_4633_ac40_0dfdd2c9cde5').innerHTML=tableinfo.HTML;
|
||||
tableinfo.listen(tableinfo.guids);
|
||||
if (Boolean(callback))callback();
|
||||
}
|
||||
|
||||
editor_mode = new editor_mode();
|
||||
editor_mode.init();
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
document.body.onmousedown = function(e){
|
||||
selectBox.isSelected = false;
|
||||
editor_mode.onmode('');
|
||||
editor.info = {};
|
||||
}
|
||||
iconLib.onmousedown = function(e){
|
||||
|
||||
92
editor.html
92
editor.html
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="_server/css/editor.css" rel="stylesheet">
|
||||
<link href="_server/css/editor_mode.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
@ -26,6 +27,85 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="left99" class='leftTab'><!-- 可以直接删掉,在editor_mode.js中,把ids中的'test':'left99'也要删掉 -->
|
||||
<div >
|
||||
<h3>测试用标签页</h3>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='test_tbody'>
|
||||
<tr><td id='test_td' title="['aa']['bb']">条目</td><td>注释<span title='abc 中文 aaa'>aaa</span></td><td>值</td></tr>
|
||||
<tr><td></td><td></td><td></td></tr>
|
||||
<tr><td></td><td></td><td></td></tr>
|
||||
<tr><td>变量名字符串</td><td title='abc 中文 aaa'>可能显示不全但是hover时通过span title='xxx'来显示</td><td>高度以此为准</td></tr>
|
||||
<tr><td></td><td></td><td>此处是利用slice实现</td></tr>
|
||||
<tr><td></td><td></td><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='test_tbody2'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
<tr><td></td><td></td><td><textarea spellcheck='false' id='temp_text' rows="2">abc</textarea></td></tr>
|
||||
<tr><td></td><td></td><td><input spellcheck='false' id='temp_input' value='abc' /></td></tr>
|
||||
<tr><td></td><td></td><td><select id="temp_select">
|
||||
<option value="abc">abc</option>
|
||||
<option value="ground2">ground2</option>
|
||||
</select></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div >
|
||||
<input type="button" value="保存"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="left2" class='leftTab'><div><!-- loc -->
|
||||
<h3>地图选点</h3>
|
||||
<p id='pos_a6771a78_a099_417c_828f_0a24851ebfce'>0,0</p>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_3d846fc4_7644_44d1_aa04_433d266a73df'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="left3" class='leftTab'><div><!-- emenyitem -->
|
||||
<h3>图块属性</h3>
|
||||
<div><!-- id and idnum -->
|
||||
<!-- 尚未完成 -->
|
||||
</div>
|
||||
<div><!-- enemy and item -->
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_a3f03d4c_55b8_4ef6_b362_b345783acd72'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="left4" class='leftTab'><div><!-- floor -->
|
||||
<h3>楼层属性</h3>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_4a3b1b09_b2fb_4bdf_b9ab_9f4cdac14c74'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="left5" class='leftTab'><div><!-- tower -->
|
||||
<h3>全塔属性</h3>
|
||||
<div class='etable'>
|
||||
<table>
|
||||
<tbody id='table_b6a03e4c_5968_4633_ac40_0dfdd2c9cde5'>
|
||||
<tr><td>条目</td><td>注释</td><td>值</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div></div>
|
||||
<div id="mid">
|
||||
<table class="col" id='mapColMark'></table>
|
||||
<table class="row" id='mapRowMark'></table>
|
||||
@ -201,11 +281,12 @@
|
||||
<!-- <script src="https://cdn.bootcss.com/vue/2.5.13/vue.js"></script> -->
|
||||
<script src='_server/fs.js'></script>
|
||||
<script src='_server/editor_file.js'></script>
|
||||
<script src='_server/editor_mode.js'></script>
|
||||
<script src='_server/vm.js'></script>
|
||||
<script id='mainScript' src='main.js'></script>
|
||||
<script>
|
||||
//所有全局量
|
||||
__all__=['Vue','fs','editor_file','main','core','hasOwnProp','editor'];
|
||||
__all__=['Vue','fs','editor_file','editor_mode','main','core','hasOwnProp','editor'];
|
||||
__id__=['editArea','arrRowMark','mapRowMark','data','bg','dataSelection'];
|
||||
__Vue__=['exportM','editArea','editTip','clear','tip','selectBox'];
|
||||
//var event = document.getElementById('event');
|
||||
@ -218,7 +299,14 @@ function hasOwnProp (obj, key) {
|
||||
<script src='_server/editor.js'></script>
|
||||
<script>
|
||||
main.init('editor');
|
||||
editor.init();
|
||||
editor.init(function(){
|
||||
editor.pos={x: 0, y: 0};
|
||||
editor_mode.loc();
|
||||
editor.info=editor.ids[editor.indexs[201]];
|
||||
editor_mode.emenyitem();
|
||||
editor_mode.floor();
|
||||
editor_mode.tower();
|
||||
});
|
||||
//main.listen();
|
||||
//core.setHeroMoveTriggerInterval();
|
||||
</script>
|
||||
|
||||
@ -2,7 +2,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
{
|
||||
"items" : {
|
||||
'items':{
|
||||
'cls': "只能取keys(钥匙) items(宝石、血瓶) constants(物品) tools(道具)\n$range(thiseval in ['keys','items','constants','tools'])$end",
|
||||
'cls': "只能取keys(钥匙) items(宝石、血瓶) constants(物品) tools(道具)\n$select({\"values\":[\"keys\",\"items\",\"constants\",\"tools\"]})$end",
|
||||
'name': '名称',
|
||||
'text': '道具在道具栏中显示的描述'
|
||||
},
|
||||
@ -16,21 +16,21 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
'def': '防御力',
|
||||
'money': '金币',
|
||||
'experience': '经验',
|
||||
'special': '特殊属性\n0:无,1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:n连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨,18:阻击,19:自爆,20:无敌\n多个属性例如用[1,4,11]表示先攻2连击吸血\n模仿怪的攻防设为0就好\n$leaf(true)$end',
|
||||
'special': '特殊属性\n\n0:无,1:先攻,2:魔攻,3:坚固,4:2连击,\n5:3连击,6:n连击,7:破甲,8:反击,9:净化,\n10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,\n15:领域,16:夹击,17:仇恨,18:阻击,19:自爆,\n20:无敌\n\n多个属性例如用[1,4,11]表示先攻2连击吸血\n模仿怪的攻防设为0就好\n$leaf(true)$end',
|
||||
'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例',
|
||||
'zoneSquare': '领域怪zoneSquare代表是否九宫格伤害',
|
||||
'range': 'range可选,代表领域伤害的范围;不加默认为1\n$range(thiseval==~~thiseval &&thiseval>0)$end',
|
||||
'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉\n$range(thiseval in [true,false])$end',
|
||||
'point': 'point可以在打败怪物后进行加点,详见文档说明\n$range(thiseval==~~thiseval && thiseval>0)$end',
|
||||
'n': '多连击需要在后面指定n代表是几连击\n$range(thiseval==~~thiseval &&thiseval>0)$end',
|
||||
'range': 'range可选,代表领域伤害的范围;不加默认为1\n$range((thiseval==~~thiseval && thiseval>0)||thiseval==null)$end',
|
||||
'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉\n$select({\"values\":[true,false]})$end',
|
||||
'point': 'point可以在打败怪物后进行加点,详见文档说明\n$range((thiseval==~~thiseval && thiseval>0)||thiseval==null)$end',
|
||||
'n': '多连击需要在后面指定n代表是几连击\n$range((thiseval==~~thiseval && thiseval>0)||thiseval==null)$end',
|
||||
},
|
||||
"floors" : {
|
||||
'floor' : {
|
||||
"floorId": "文件名和floorId需要保持完全一致 \n楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头 \n推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等 \n楼层唯一标识符,需要和名字完全一致 \n这里不能更改floorId,请通过另存为来实现\n$range(false)$end",
|
||||
"title": "楼层中文名 ",
|
||||
"name": "显示在状态栏中的层数 ",
|
||||
"canFlyTo": "该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) \n$range(thiseval in [true,false])$end",
|
||||
"canUseQuickShop": "该层是否允许使用快捷商店 \n$range(thiseval in [true,false])$end",
|
||||
"canFlyTo": "该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) \n$select({\"values\":[true,false]})$end",
|
||||
"canUseQuickShop": "该层是否允许使用快捷商店 \n$select({\"values\":[true,false]})$end",
|
||||
"defaultGround": "默认地面的图块ID(terrains中) ",
|
||||
"png": "背景图;你可以选择一张png图片来作为背景素材。详细用法请参见文档“自定义素材”中的说明。 ",
|
||||
"color": "该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。 \n$leaf(true)$end",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
data_comment_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
{
|
||||
"main": {
|
||||
"useCompress": " 是否使用压缩文件 \n 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 \n 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 \n 如果要进行剧本的修改请务必将其改成false。 ",
|
||||
"useCompress": " 是否使用压缩文件 \n 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 \n 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 \n 如果要进行剧本的修改请务必将其改成false。 \n$select({\"values\":[false]})$end",
|
||||
"floorIds": " 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 \n$leaf(true)$end",
|
||||
"pngs": " 在此存放所有可能的背景图片;背景图片最好是416*416像素,其他分辨率会被强制缩放成416*416 \n 建议对于较大的图片,在网上使用在线的“图片压缩工具”来进行压缩,以节省流量 \n 有关使用自定义背景图,请参见文档的“自定义素材”说明 \n\n 依次向后添加 \n$leaf(true)$end",
|
||||
"bgms": " 在此存放所有的bgm,和文件名一致。第一项为默认播放项 \n 音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好 \n$leaf(true)$end",
|
||||
@ -14,7 +14,7 @@ data_comment_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"floorId": " 初始楼层ID ",
|
||||
"hero": {
|
||||
"name": " 勇士初始数据 \n 勇士名;可以改成喜欢的 ",
|
||||
"lv": " 初始等级,该项必须为正整数 ",
|
||||
"lv": " 初始等级,该项必须为正整数 \n$range(thiseval==~~thiseval &&thiseval>0)$end",
|
||||
"hp": " 初始生命值 ",
|
||||
"atk": " 初始攻击 ",
|
||||
"def": " 初始防御 ",
|
||||
@ -139,27 +139,27 @@ data_comment_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"animateSpeed": " /****** 系统相关 ******/ \n 动画时间 "
|
||||
},
|
||||
"flags": {
|
||||
"enableFloor": " 系统FLAG,在游戏运行中中请不要修改它。 /****** 状态栏相关 ******/ \n 是否在状态栏显示当前楼层 ",
|
||||
"enableLv": " 是否在状态栏显示当前等级 ",
|
||||
"enableMDef": " 是否在状态栏及战斗界面显示魔防(护盾) ",
|
||||
"enableMoney": " 是否在状态栏、怪物手册及战斗界面显示金币 ",
|
||||
"enableExperience": " 是否在状态栏、怪物手册及战斗界面显示经验 ",
|
||||
"enableLevelUp": " 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false ",
|
||||
"enableDebuff": " 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// ",
|
||||
"flyNearStair": " /****** 道具相关 ******/ \n 是否需要在楼梯边使用传送器 ",
|
||||
"pickaxeFourDirections": " 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 ",
|
||||
"bombFourDirections": " 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) ",
|
||||
"bigKeyIsBox": " 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 ",
|
||||
"enableNegativeDamage": " /****** 怪物相关 ******/ \n 是否支持负伤害(回血) ",
|
||||
"zoneSquare": " 领域类型。如果此项为true则为九宫格伤害,为false则为十字伤害 ",
|
||||
"startDirectly": " /****** 系统相关 ******/ \n 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 ",
|
||||
"canOpenBattleAnimate": " 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false ",
|
||||
"showBattleAnimateConfirm": " 是否在游戏开始时提供“是否开启战斗动画”的选项 ",
|
||||
"battleAnimate": " 是否默认显示战斗动画;用户可以手动在菜单栏中开关 ",
|
||||
"displayEnemyDamage": " 是否地图怪物显伤;用户可以手动在菜单栏中开关 ",
|
||||
"displayExtraDamage": " 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 ",
|
||||
"enableGentleClick": " 是否允许轻触(获得面前物品) ",
|
||||
"portalWithoutTrigger": " 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 ",
|
||||
"potionWhileRouting": " 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 "
|
||||
"enableFloor": " 系统FLAG,在游戏运行中中请不要修改它。 /****** 状态栏相关 ******/ \n 是否在状态栏显示当前楼层 \n$select({\"values\":[true,false]})$end",
|
||||
"enableLv": " 是否在状态栏显示当前等级 \n$select({\"values\":[true,false]})$end",
|
||||
"enableMDef": " 是否在状态栏及战斗界面显示魔防(护盾) \n$select({\"values\":[true,false]})$end",
|
||||
"enableMoney": " 是否在状态栏、怪物手册及战斗界面显示金币 \n$select({\"values\":[true,false]})$end",
|
||||
"enableExperience": " 是否在状态栏、怪物手册及战斗界面显示经验 \n$select({\"values\":[true,false]})$end",
|
||||
"enableLevelUp": " 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false \n$select({\"values\":[true,false]})$end",
|
||||
"enableDebuff": " 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// \n$select({\"values\":[true,false]})$end",
|
||||
"flyNearStair": " /****** 道具相关 ******/ \n 是否需要在楼梯边使用传送器 \n$select({\"values\":[true,false]})$end",
|
||||
"pickaxeFourDirections": " 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 \n$select({\"values\":[true,false]})$end",
|
||||
"bombFourDirections": " 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) \n$select({\"values\":[true,false]})$end",
|
||||
"bigKeyIsBox": " 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 \n$select({\"values\":[true,false]})$end",
|
||||
"enableNegativeDamage": " /****** 怪物相关 ******/ \n 是否支持负伤害(回血) \n$select({\"values\":[true,false]})$end",
|
||||
"zoneSquare": " 领域类型。如果此项为true则为九宫格伤害,为false则为十字伤害 \n$select({\"values\":[true,false]})$end",
|
||||
"startDirectly": " /****** 系统相关 ******/ \n 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 \n$select({\"values\":[true,false]})$end",
|
||||
"canOpenBattleAnimate": " 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false \n$select({\"values\":[true,false]})$end",
|
||||
"showBattleAnimateConfirm": " 是否在游戏开始时提供“是否开启战斗动画”的选项 \n$select({\"values\":[true,false]})$end",
|
||||
"battleAnimate": " 是否默认显示战斗动画;用户可以手动在菜单栏中开关 \n$select({\"values\":[true,false]})$end",
|
||||
"displayEnemyDamage": " 是否地图怪物显伤;用户可以手动在菜单栏中开关 \n$select({\"values\":[true,false]})$end",
|
||||
"displayExtraDamage": " 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 \n$select({\"values\":[true,false]})$end",
|
||||
"enableGentleClick": " 是否允许轻触(获得面前物品) \n$select({\"values\":[true,false]})$end",
|
||||
"portalWithoutTrigger": " 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 \n$select({\"values\":[true,false]})$end",
|
||||
"potionWhileRouting": " 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 \n$select({\"values\":[true,false]})$end"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user