mota-js/_server/editor_file_test.html
2018-01-07 22:14:51 +08:00

39 lines
1.5 KiB
HTML

<!doctype html>
<html>
<head><meta charset="utf-8"></head>
<body>
<pre id='pout'>
</pre>
<script src="fs.js"></script>
<script src="editor_file.js"></script>
<script>
pout.innerHTML='waiting\nwaiting waiting';
var editor={};
editor.fs=fs;
editor.file=editor_file;
/* editor.file.loadFloorFile(editor,'sample0',function(err){console.log(err);
editor.file.saveFloorFileAs(editor,'aaa',function(err){console.log(err)});
}); */
//查询
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.editFloor(editor,[],function(a){console.log(a)});
editor.file.editTower(editor,[],function(a){console.log(a)});
//编辑
editor.info={images: "terrains", y: 9};
editor.file.changeIdAndIdnum(editor,'huangqiang',16,editor.info,function(a){console.log(a)});
editor_file.editItem(editor,'redJewel',[["change","['items']['name']","红宝石的新名字"]],function(a){console.log(a)});
editor_file.editEnemy(editor,'redBat',[['change',"['atk']",20]],function(a){console.log(a)});
editor_file.editLoc(editor,2,0,[["change","['afterBattle']",null]],function(a){console.log(a)});
editor_file.editFloor(editor,[["change","['title']",'样板 3 层']],function(a){console.log(a)});
editor.file.editTower(editor,[["change","['values']['lavaDamage']",200]],function(a){console.log(a)});
pout.innerHTML='succeed\nsucceed succeed';
</script>
</body>
</html>