editor-airwall
This commit is contained in:
parent
02c7f86977
commit
74b6f48a01
@ -97,6 +97,12 @@ editor.prototype.idsInit = function (maps, icons) {
|
|||||||
var id = indexBlock.event.id;
|
var id = indexBlock.event.id;
|
||||||
var indexId = indexBlock.id;
|
var indexId = indexBlock.id;
|
||||||
var allCls = Object.keys(icons);
|
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++) {
|
for (var j = 0; j < allCls.length; j++) {
|
||||||
if (id in icons[allCls[j]]) {
|
if (id in icons[allCls[j]]) {
|
||||||
editor.ids.push({'idnum': indexId, 'id': id, 'images': allCls[j], 'y': icons[allCls[j]][id]});
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
if (img == 'terrains') {
|
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;
|
sumWidth += images[img].width;
|
||||||
maxHeight = Math.max(maxHeight, images[img].height + 32);
|
maxHeight = Math.max(maxHeight, images[img].height + 32*2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
editor.widthsX[img] = [img, sumWidth / 32, (sumWidth + images[img].width) / 32, images[img].height];
|
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++) {
|
for (var ii = 0; ii < imgNames.length; ii++) {
|
||||||
var img = imgNames[ii];
|
var img = imgNames[ii];
|
||||||
if (img == 'terrains') {
|
if (img == 'terrains') {
|
||||||
dc.drawImage(images[img], nowx, 32);
|
dc.drawImage(images[img], nowx, 32*2);
|
||||||
nowx += images[img].width;
|
nowx += images[img].width;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -820,9 +826,11 @@ editor.prototype.listen = function () {
|
|||||||
if (pos.x == 0 && pos.y == 0) {
|
if (pos.x == 0 && pos.y == 0) {
|
||||||
// editor.info={idnum:0, id:'empty','images':'清除块', 'y':0};
|
// editor.info={idnum:0, id:'empty','images':'清除块', 'y':0};
|
||||||
editor.info = 0;
|
editor.info = 0;
|
||||||
|
} else if(pos.x == 0 && pos.y == 1){
|
||||||
|
editor.info = editor.ids[editor.indexs[17]];
|
||||||
} else {
|
} else {
|
||||||
if (hasOwnProp(autotiles, pos.images)) editor.info = {'images': pos.images, 'y': 0};
|
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 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};
|
else editor.info = {'images': pos.images, 'y': pos.y};
|
||||||
|
|
||||||
@ -897,13 +905,17 @@ editor.prototype.listen = function () {
|
|||||||
//选中清除块
|
//选中清除块
|
||||||
editor.info = 0;
|
editor.info = 0;
|
||||||
editor.pos=pos;
|
editor.pos=pos;
|
||||||
|
} else if (thisevent.idnum==17){
|
||||||
|
editor.info = editor.ids[editor.indexs[17]];
|
||||||
|
pos.y=1;
|
||||||
|
editor.pos=pos;
|
||||||
} else {
|
} else {
|
||||||
var ids=editor.indexs[thisevent.idnum];
|
var ids=editor.indexs[thisevent.idnum];
|
||||||
ids=ids[0]?ids[0]:ids;
|
ids=ids[0]?ids[0]:ids;
|
||||||
editor.info=editor.ids[ids];
|
editor.info=editor.ids[ids];
|
||||||
pos.x=editor.widthsX[thisevent.images][1];
|
pos.x=editor.widthsX[thisevent.images][1];
|
||||||
pos.y=editor.info.y;
|
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;
|
ysize = thisevent.images.indexOf('48') === -1 ? 32 : 48;
|
||||||
}
|
}
|
||||||
setTimeout(function(){selectBox.isSelected = true;});
|
setTimeout(function(){selectBox.isSelected = true;});
|
||||||
|
|||||||
@ -315,7 +315,7 @@ editor_mode = function (editor) {
|
|||||||
//editor.info=editor.ids[editor.indexs[201]];
|
//editor.info=editor.ids[editor.indexs[201]];
|
||||||
if (!core.isset(editor.info)) return;
|
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)) {
|
if (!core.isset(editor_mode.info.id)) {
|
||||||
// document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML = '';
|
// document.getElementById('table_a3f03d4c_55b8_4ef6_b362_b345783acd72').innerHTML = '';
|
||||||
|
|||||||
@ -241,6 +241,7 @@ var tip = new Vue({
|
|||||||
isAutotile: false,
|
isAutotile: false,
|
||||||
isSelectedBlock: false,
|
isSelectedBlock: false,
|
||||||
isClearBlock: false,
|
isClearBlock: false,
|
||||||
|
isAirwall: false,
|
||||||
geneMapSuccess: false,
|
geneMapSuccess: false,
|
||||||
timer: null,
|
timer: null,
|
||||||
msgs: [ //分别编号1,2,3,4,5,6,7,8,9,10;奇数警告,偶数成功
|
msgs: [ //分别编号1,2,3,4,5,6,7,8,9,10;奇数警告,偶数成功
|
||||||
@ -264,12 +265,17 @@ var tip = new Vue({
|
|||||||
infos: {
|
infos: {
|
||||||
handler: function (val, oldval) {
|
handler: function (val, oldval) {
|
||||||
this.isClearBlock = false;
|
this.isClearBlock = false;
|
||||||
|
this.isAirwall = false;
|
||||||
if (typeof(val) != 'undefined') {
|
if (typeof(val) != 'undefined') {
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
this.isClearBlock = true;
|
this.isClearBlock = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ('id' in val) {
|
if ('id' in val) {
|
||||||
|
if (val.idnum == 17) {
|
||||||
|
this.isAirwall = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.hasId = true;
|
this.hasId = true;
|
||||||
} else {
|
} else {
|
||||||
this.hasId = false;
|
this.hasId = false;
|
||||||
|
|||||||
@ -234,6 +234,7 @@
|
|||||||
<div id="tip" v-cloak>
|
<div id="tip" v-cloak>
|
||||||
<div v-if="isSelectedBlock">
|
<div v-if="isSelectedBlock">
|
||||||
<p v-if="isClearBlock" class="infoText">当前选择为清除块,可擦除地图上块</p>
|
<p v-if="isClearBlock" class="infoText">当前选择为清除块,可擦除地图上块</p>
|
||||||
|
<p v-if="isAirwall" class="infoText">当前选择为空气墙, 在编辑器中可视, 在游戏中隐藏的墙, 用来配合前景/背景的贴图</p>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p v-if="hasId">图块编号:<span class="infoText">{{ infos['idnum'] }}</span></p>
|
<p v-if="hasId">图块编号:<span class="infoText">{{ infos['idnum'] }}</span></p>
|
||||||
<p v-if="hasId">图块ID:<span class="infoText">{{ infos['id'] }}</span></p>
|
<p v-if="hasId">图块ID:<span class="infoText">{{ infos['id'] }}</span></p>
|
||||||
|
|||||||
@ -221,6 +221,7 @@
|
|||||||
<div id="tip" v-cloak>
|
<div id="tip" v-cloak>
|
||||||
<div v-if="isSelectedBlock">
|
<div v-if="isSelectedBlock">
|
||||||
<p v-if="isClearBlock" class="infoText">当前选择为清除块,可擦除地图上块</p>
|
<p v-if="isClearBlock" class="infoText">当前选择为清除块,可擦除地图上块</p>
|
||||||
|
<p v-else-if="isAirwall" class="infoText">当前选择为空气墙, 在编辑器中可视, 在游戏中隐藏的墙, 用来配合前景/背景的贴图</p>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p v-if="hasId">图块编号:<span class="infoText">{{ infos['idnum'] }}</span></p>
|
<p v-if="hasId">图块编号:<span class="infoText">{{ infos['idnum'] }}</span></p>
|
||||||
<p v-if="hasId">图块ID:<span class="infoText">{{ infos['id'] }}</span></p>
|
<p v-if="hasId">图块ID:<span class="infoText">{{ infos['id'] }}</span></p>
|
||||||
|
|||||||
BIN
project/images/airwall.png
Normal file
BIN
project/images/airwall.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Loading…
Reference in New Issue
Block a user