From 74b6f48a01d0fd9db941490a7076bf3a00d91561 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Thu, 27 Sep 2018 18:01:38 +0800 Subject: [PATCH] editor-airwall --- _server/editor.js | 22 +++++++++++++++++----- _server/editor_mode.js | 2 +- _server/vm.js | 6 ++++++ editor-mobile.html | 1 + editor.html | 1 + project/images/airwall.png | Bin 0 -> 19108 bytes 6 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 project/images/airwall.png diff --git a/_server/editor.js b/_server/editor.js index 3f8c17db..7ef50d6a 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -97,6 +97,12 @@ editor.prototype.idsInit = function (maps, icons) { var id = indexBlock.event.id; var indexId = indexBlock.id; var allCls = Object.keys(icons); + if(i==17){ + editor.ids.push({'idnum': 17, 'id': id, 'images': 'terrains'}); + point++; + editor.indexs[i].push(point); + continue; + } for (var j = 0; j < allCls.length; j++) { if (id in icons[allCls[j]]) { editor.ids.push({'idnum': indexId, 'id': id, 'images': allCls[j], 'y': icons[allCls[j]][id]}); @@ -332,9 +338,9 @@ editor.prototype.drawInitData = function (icons) { continue; } if (img == 'terrains') { - editor.widthsX[img] = [img, sumWidth / 32, (sumWidth + images[img].width) / 32, images[img].height + 32] + editor.widthsX[img] = [img, sumWidth / 32, (sumWidth + images[img].width) / 32, images[img].height + 32*2] sumWidth += images[img].width; - maxHeight = Math.max(maxHeight, images[img].height + 32); + maxHeight = Math.max(maxHeight, images[img].height + 32*2); continue; } editor.widthsX[img] = [img, sumWidth / 32, (sumWidth + images[img].width) / 32, images[img].height]; @@ -360,7 +366,7 @@ editor.prototype.drawInitData = function (icons) { for (var ii = 0; ii < imgNames.length; ii++) { var img = imgNames[ii]; if (img == 'terrains') { - dc.drawImage(images[img], nowx, 32); + dc.drawImage(images[img], nowx, 32*2); nowx += images[img].width; continue; } @@ -820,9 +826,11 @@ editor.prototype.listen = function () { if (pos.x == 0 && pos.y == 0) { // editor.info={idnum:0, id:'empty','images':'清除块', 'y':0}; editor.info = 0; + } else if(pos.x == 0 && pos.y == 1){ + editor.info = editor.ids[editor.indexs[17]]; } else { if (hasOwnProp(autotiles, pos.images)) editor.info = {'images': pos.images, 'y': 0}; - else if (pos.images == 'terrains') editor.info = {'images': pos.images, 'y': pos.y - 1}; + else if (pos.images == 'terrains') editor.info = {'images': pos.images, 'y': pos.y - 2}; else if (core.tilesets.indexOf(pos.images)!=-1) editor.info = {'images': pos.images, 'y': pos.y, 'x': pos.x-editor.widthsX[spriter][1]}; else editor.info = {'images': pos.images, 'y': pos.y}; @@ -897,13 +905,17 @@ editor.prototype.listen = function () { //选中清除块 editor.info = 0; editor.pos=pos; + } else if (thisevent.idnum==17){ + editor.info = editor.ids[editor.indexs[17]]; + pos.y=1; + editor.pos=pos; } else { var ids=editor.indexs[thisevent.idnum]; ids=ids[0]?ids[0]:ids; editor.info=editor.ids[ids]; pos.x=editor.widthsX[thisevent.images][1]; pos.y=editor.info.y; - if(thisevent.images=='terrains')pos.y++; + if(thisevent.images=='terrains')pos.y+=2; ysize = thisevent.images.indexOf('48') === -1 ? 32 : 48; } setTimeout(function(){selectBox.isSelected = true;}); diff --git a/_server/editor_mode.js b/_server/editor_mode.js index ad0ba74f..9bbf0c0b 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -315,7 +315,7 @@ editor_mode = function (editor) { //editor.info=editor.ids[editor.indexs[201]]; if (!core.isset(editor.info)) return; - if (Object.keys(editor.info).length !== 0) editor_mode.info = editor.info;//避免editor.info被清空导致无法获得是物品还是怪物 + if (Object.keys(editor.info).length !== 0 && editor.info.idnum!=17) editor_mode.info = editor.info;//避免editor.info被清空导致无法获得是物品还是怪物 if (!core.isset(editor_mode.info.id)) { // document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML = ''; diff --git a/_server/vm.js b/_server/vm.js index afd49b90..6707dea0 100644 --- a/_server/vm.js +++ b/_server/vm.js @@ -241,6 +241,7 @@ var tip = new Vue({ isAutotile: false, isSelectedBlock: false, isClearBlock: false, + isAirwall: false, geneMapSuccess: false, timer: null, msgs: [ //分别编号1,2,3,4,5,6,7,8,9,10;奇数警告,偶数成功 @@ -264,12 +265,17 @@ var tip = new Vue({ infos: { handler: function (val, oldval) { this.isClearBlock = false; + this.isAirwall = false; if (typeof(val) != 'undefined') { if (val == 0) { this.isClearBlock = true; return; } if ('id' in val) { + if (val.idnum == 17) { + this.isAirwall = true; + return; + } this.hasId = true; } else { this.hasId = false; diff --git a/editor-mobile.html b/editor-mobile.html index 992e6053..75c4de36 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -234,6 +234,7 @@

当前选择为清除块,可擦除地图上块

+

当前选择为空气墙, 在编辑器中可视, 在游戏中隐藏的墙, 用来配合前景/背景的贴图

图块编号:{{ infos['idnum'] }}

图块ID:{{ infos['id'] }}

diff --git a/editor.html b/editor.html index 425a16f1..90c2716f 100644 --- a/editor.html +++ b/editor.html @@ -221,6 +221,7 @@

当前选择为清除块,可擦除地图上块

+

当前选择为空气墙, 在编辑器中可视, 在游戏中隐藏的墙, 用来配合前景/背景的贴图

图块编号:{{ infos['idnum'] }}

图块ID:{{ infos['id'] }}

diff --git a/project/images/airwall.png b/project/images/airwall.png new file mode 100644 index 0000000000000000000000000000000000000000..e1607d65b9531f76e1a06dc8217f124d15f5608c GIT binary patch literal 19108 zcmeI3&u`;I6vw9s5L8;R;)1jntSm?%aQrJjYAeZVX?AHPvQ*t7x+iuz9=Fyewz1t! z+S3Y79N_{t{saC24xG5{Ubz8hIItHkoXXhF59cMBR_elDo~0yy^PTtJ_%rjy&cR>p z-1+dz`n7dJ$d&D_?ymS%vd=3oi|^$0^l$O=YP5APA>{Qm`>g%uy*VPp{>$InPxpHt zIV>DhsT&^f>Sz#&-h{Mnj3UY&@KibAhknqmJpJ*fisHNN%BS_7-itQ*k-v2s^Sh^a z_SoqIX1kReo%Pnp5dj7~rOIf~4-#k8uHv#$2ga z>nhVtLuuMoqh4<|&G!{kH)@)0Xoj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