draw event block
This commit is contained in:
parent
b04b45070f
commit
579c57dc03
@ -20,7 +20,7 @@ editor.prototype.init = function (callback) {
|
|||||||
editor.updateMap();
|
editor.updateMap();
|
||||||
editor.currentFloorId = core.status.floorId;
|
editor.currentFloorId = core.status.floorId;
|
||||||
editor.currentFloorData = core.floors[core.status.floorId];
|
editor.currentFloorData = core.floors[core.status.floorId];
|
||||||
|
editor.drawEventBlock();
|
||||||
if (Boolean(callback)) callback();
|
if (Boolean(callback)) callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -193,7 +193,33 @@ editor.prototype.drawMapBg = function (img) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype
|
editor.prototype.drawEventBlock = function () {
|
||||||
|
var fg=document.getElementById('efg').getContext('2d');
|
||||||
|
|
||||||
|
fg.clearRect(0, 0, 416, 416);
|
||||||
|
for (var i=0;i<13;i++) {
|
||||||
|
for (var j=0;j<13;j++) {
|
||||||
|
var color=null;
|
||||||
|
var loc=i+","+j;
|
||||||
|
if (core.isset(editor.currentFloorData.events[loc]))
|
||||||
|
color = '#FF0000';
|
||||||
|
else if (core.isset(editor.currentFloorData.changeFloor[loc]))
|
||||||
|
color = '#00FF00';
|
||||||
|
else if (core.isset(editor.currentFloorData.afterBattle[loc]))
|
||||||
|
color = '#0000FF';
|
||||||
|
else if (core.isset(editor.currentFloorData.afterGetItem[loc]))
|
||||||
|
color = '#FFFF00';
|
||||||
|
else if (core.isset(editor.currentFloorData.afterOpenDoor[loc]))
|
||||||
|
color = '#FF00FF';
|
||||||
|
else if (core.isset(editor.currentFloorData.cannotMove[loc]))
|
||||||
|
color = '#00FFFF';
|
||||||
|
if (color!=null) {
|
||||||
|
fg.fillStyle = color;
|
||||||
|
fg.fillRect(32*i, 32*j+32-12, 12, 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
editor.prototype.updateMap = function () {
|
editor.prototype.updateMap = function () {
|
||||||
var blocks = main.editor.mapIntoBlocks(editor.map.map(function (v) {
|
var blocks = main.editor.mapIntoBlocks(editor.map.map(function (v) {
|
||||||
@ -342,6 +368,7 @@ editor.prototype.changeFloor = function (floorId, callback) {
|
|||||||
editor.currentFloorId = core.status.floorId;
|
editor.currentFloorId = core.status.floorId;
|
||||||
editor.currentFloorData = core.floors[core.status.floorId];
|
editor.currentFloorData = core.floors[core.status.floorId];
|
||||||
editor_mode.floor();
|
editor_mode.floor();
|
||||||
|
editor.drawEventBlock();
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,7 +195,8 @@ editor_mode = function (editor) {
|
|||||||
printe(objs_.slice(-1)[0]);
|
printe(objs_.slice(-1)[0]);
|
||||||
throw(objs_.slice(-1)[0])
|
throw(objs_.slice(-1)[0])
|
||||||
}
|
}
|
||||||
;printf('修改成功')
|
;printf('修改成功');
|
||||||
|
editor.drawEventBlock();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'emenyitem':
|
case 'emenyitem':
|
||||||
@ -222,7 +223,7 @@ editor_mode = function (editor) {
|
|||||||
printe(objs_.slice(-1)[0]);
|
printe(objs_.slice(-1)[0]);
|
||||||
throw(objs_.slice(-1)[0])
|
throw(objs_.slice(-1)[0])
|
||||||
}
|
}
|
||||||
;printf('修改成功')
|
;printf('修改成功');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -233,7 +234,7 @@ editor_mode = function (editor) {
|
|||||||
printe(objs_.slice(-1)[0]);
|
printe(objs_.slice(-1)[0]);
|
||||||
throw(objs_.slice(-1)[0])
|
throw(objs_.slice(-1)[0])
|
||||||
}
|
}
|
||||||
;printf('修改成功')
|
;printf('修改成功');
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'tower':
|
case 'tower':
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user