commit
a4183554b1
@ -68,7 +68,6 @@ body{
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mid{
|
#mid{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 448px;
|
left: 448px;
|
||||||
|
|||||||
@ -1,23 +1,12 @@
|
|||||||
// vue 相关处理
|
// vue 相关处理
|
||||||
|
|
||||||
document.body.onmousedown = function(e){
|
|
||||||
selectBox.isSelected = false;
|
|
||||||
editor.info = {};
|
|
||||||
}
|
|
||||||
iconLib.onmousedown = function(e){
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
var exportM = new Vue({
|
var exportM = new Vue({
|
||||||
el: '#exportM',
|
el: '#exportM',
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
exportMap: function(){
|
exportMap: function(){
|
||||||
editor.updateMap();
|
editor.updateMap();
|
||||||
if(editArea.error) {
|
|
||||||
tip.whichShow = 3;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var filestr='';
|
var filestr='';
|
||||||
for (var yy = 0; yy < 13; yy++){
|
for (var yy = 0; yy < 13; yy++){
|
||||||
filestr+='['
|
filestr+='['
|
||||||
@ -42,7 +31,8 @@ var exportM = new Vue({
|
|||||||
filestr += ']'+(yy==12?'':',\n');
|
filestr += ']'+(yy==12?'':',\n');
|
||||||
}
|
}
|
||||||
pout.value = filestr;
|
pout.value = filestr;
|
||||||
|
editArea.mapArr = filestr;
|
||||||
|
editArea.error = 0;
|
||||||
tip.whichShow = 2;
|
tip.whichShow = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,31 +77,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// 生成定位编号
|
// 生成定位编号
|
||||||
(function(){
|
(function(){
|
||||||
var colNum = ' ';
|
var colNum = ' ';
|
||||||
for(var i=0; i<13; i++){
|
for(var i=0; i<13; i++){
|
||||||
var tpl = '<td>'+i+'<div class="colBlock" style="left:'+(i*32+1)+'px;"></div></td>';
|
var tpl = '<td>'+i+'<div class="colBlock" style="left:'+(i*32+1)+'px;"></div></td>';
|
||||||
colNum += tpl;
|
colNum += tpl;
|
||||||
}
|
}
|
||||||
arrColMark.innerHTML = '<tr>'+colNum+'</tr>';
|
arrColMark.innerHTML = '<tr>'+colNum+'</tr>';
|
||||||
mapColMark.innerHTML = '<tr>'+colNum+'</tr>';
|
mapColMark.innerHTML = '<tr>'+colNum+'</tr>';
|
||||||
var rowNum = ' ';
|
var rowNum = ' ';
|
||||||
for(var i=0; i<13; i++){
|
for(var i=0; i<13; i++){
|
||||||
var tpl = '<tr><td>'+i+'<div class="rowBlock" style="top:'+(i*32+1)+'px;"></div></td></tr>';
|
var tpl = '<tr><td>'+i+'<div class="rowBlock" style="top:'+(i*32+1)+'px;"></div></td></tr>';
|
||||||
rowNum += tpl;
|
rowNum += tpl;
|
||||||
}
|
}
|
||||||
arrRowMark.innerHTML = rowNum;
|
arrRowMark.innerHTML = rowNum;
|
||||||
mapRowMark.innerHTML = rowNum;
|
mapRowMark.innerHTML = rowNum;
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
|
|
||||||
<script src='_server/vendor/vue.min.js'></script>
|
<!-- <script src='_server/vendor/vue.min.js'></script> -->
|
||||||
<!-- <script src="https://cdn.bootcss.com/vue/2.5.13/vue.js"></script> -->
|
<script src="https://cdn.bootcss.com/vue/2.5.13/vue.js"></script>
|
||||||
<script src='_server/fs.js'></script>
|
<script src='_server/fs.js'></script>
|
||||||
|
<script src='_server/editor_file.js'></script>
|
||||||
<script src='_server/vm.js'></script>
|
<script src='_server/vm.js'></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
@ -176,7 +178,6 @@ editor.prototype.loadImg = function(url){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype.loadAllImgs = function(icons){
|
editor.prototype.loadAllImgs = function(icons){
|
||||||
editor.material.images = {};
|
editor.material.images = {};
|
||||||
var imgs = Object.keys(icons);
|
var imgs = Object.keys(icons);
|
||||||
@ -317,7 +318,6 @@ editor.prototype.drawMapBg = function(img){
|
|||||||
bgc.drawImage(img, 0, 0, 416, 416);
|
bgc.drawImage(img, 0, 0, 416, 416);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype.updateMap = function(){
|
editor.prototype.updateMap = function(){
|
||||||
|
|
||||||
var drawTile = function(ctx, x, y, tileInfo){ // 绘制一个普通块
|
var drawTile = function(ctx, x, y, tileInfo){ // 绘制一个普通块
|
||||||
@ -439,7 +439,6 @@ editor.prototype.updateMap = function(){
|
|||||||
}
|
}
|
||||||
// 绘制地图 end
|
// 绘制地图 end
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype.listen = function() {
|
editor.prototype.listen = function() {
|
||||||
|
|
||||||
var uc = ui.getContext('2d');
|
var uc = ui.getContext('2d');
|
||||||
@ -635,9 +634,17 @@ editor.prototype.listen = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
document.body.onmousedown = function(e){
|
||||||
|
selectBox.isSelected = false;
|
||||||
|
editor.info = {};
|
||||||
|
}
|
||||||
|
iconLib.onmousedown = function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
}//绑定事件
|
}//绑定事件
|
||||||
|
editor.prototype.locInfo = function(){
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
editor.updateMap
|
editor.updateMap
|
||||||
|
|
||||||
@ -649,14 +656,37 @@ editor.info
|
|||||||
*/
|
*/
|
||||||
var editor = new editor();
|
var editor = new editor();
|
||||||
editor.init();
|
editor.init();
|
||||||
|
editor.fs=fs;
|
||||||
|
editor.file=editor_file;
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
//Vue
|
// 文件相关操作
|
||||||
//var listenByVue = function() {
|
// var promisify = function (fn, receiver) {
|
||||||
|
// return function () {
|
||||||
//}
|
// for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||||
//listenByVue()
|
// args[_key] = arguments[_key];
|
||||||
|
// }
|
||||||
|
// return new Promise(function (resolve, reject) {
|
||||||
|
// fn.apply(receiver, [].concat(args, [function (res, err) {
|
||||||
|
// return err ? reject(err) : resolve(res);
|
||||||
|
// }]));
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
// var fns = Object.keys(editor.file);
|
||||||
|
// var promiseFns = {};
|
||||||
|
// fns.forEach(function(fn){
|
||||||
|
// promiseFns[fn] = promisify(editor.file[fn], editor.file)
|
||||||
|
// });
|
||||||
|
// editor.promiseFiles = Object.assign(promiseFns);
|
||||||
|
|
||||||
|
// editor.promiseFiles.getFloorFileList(editor)
|
||||||
|
// .then(function(filelist){
|
||||||
|
// editFile4map.filelist = filelist;
|
||||||
|
// })
|
||||||
|
// .catch(function(err){
|
||||||
|
// console.log(err);
|
||||||
|
// })
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user