commit
34035b2b8a
@ -167,7 +167,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
height: 95%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@ -553,15 +553,15 @@ return code;
|
||||
*/
|
||||
|
||||
showImage_0_s
|
||||
: '显示图片' IdString '起点像素位置' 'x' Int 'y' Int Newline
|
||||
: '显示图片' EvalString '起点像素位置' 'x' Int 'y' Int Newline
|
||||
;
|
||||
|
||||
/* showImage_0_s
|
||||
tooltip : showImage:显示图片
|
||||
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showimage%ef%bc%9a%e6%98%be%e7%a4%ba%e5%9b%be%e7%89%87
|
||||
default : ["bg",0,0]
|
||||
default : ["bg.jpg",0,0]
|
||||
colour : this.printColor
|
||||
var code = '{"type": "showImage", "name": "'+IdString_0+'", "loc": ['+Int_0+','+Int_1+']},\n';
|
||||
var code = '{"type": "showImage", "name": "'+EvalString_0+'", "loc": ['+Int_0+','+Int_1+']},\n';
|
||||
return code;
|
||||
*/
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ editor.prototype.reset = function(callback){
|
||||
editor.prototype.idsInit = function(maps, icons){
|
||||
editor.ids = [0];
|
||||
editor.indexs = [];
|
||||
var MAX_NUM = 400;
|
||||
var MAX_NUM = 1000;
|
||||
var getInfoById = function(id){
|
||||
var block = maps.initBlock(0, 0, id);
|
||||
if(hasOwnProp(block, 'event')){
|
||||
@ -143,6 +143,7 @@ editor.prototype.drawInitData = function (icons) {
|
||||
editor.prototype.mapInit = function(){
|
||||
var ec = document.getElementById('event').getContext('2d');
|
||||
ec.clearRect(0, 0, 416, 416);
|
||||
document.getElementById('event2').getContext('2d').clearRect(0,0,416,416);
|
||||
editor.map = [];
|
||||
for(var y=0; y<13; y++){
|
||||
editor.map[y] = [];
|
||||
|
||||
@ -196,7 +196,6 @@ initscript=String.raw`
|
||||
|
||||
var doubleClickCheck=[[0,'abc']];
|
||||
function omitedcheckUpdateFunction(event) {
|
||||
//console.log(event);
|
||||
if(event.type==='ui'){
|
||||
var newClick = [new Date().getTime(),event.blockId];
|
||||
var lastClick = doubleClickCheck.shift();
|
||||
@ -245,7 +244,7 @@ editor_blockly.runOne = function (){
|
||||
//converter.generToolbox();
|
||||
converter.generMainFile();
|
||||
//printf(converter.mainFile.join(''));
|
||||
console.log(converter);
|
||||
//console.log(converter);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -151,8 +151,8 @@ editor_file = function(editor, callback){
|
||||
if(info.images==='items'){
|
||||
saveSetting('items',[["change"/*其实应该是add*/,"['items']['"+id+"']",editor_file.comment.items_template]],function(err){if(err){printe(err);throw(err)}});
|
||||
}
|
||||
if(info.images==='enemys'){
|
||||
saveSetting('enemys',[["change"/*其实应该是add*/,"['enemys']['"+id+"']",editor_file.comment.enemys_template]],function(err){if(err){printe(err);throw(err)}});
|
||||
if(info.images==='enemys' || info.images==='enemy48'){
|
||||
saveSetting('enemys',[["change"/*其实应该是add*/,"['"+id+"']",editor_file.comment.enemys_template]],function(err){if(err){printe(err);throw(err)}});
|
||||
}
|
||||
|
||||
callback(null);
|
||||
@ -501,7 +501,15 @@ editor_file = function(editor, callback){
|
||||
eval("maps_90f36752_8815_4be8_b32b_d7fad1d0542e"+value[1]+'='+JSON.stringify(value[2]));
|
||||
});
|
||||
var datastr='maps_90f36752_8815_4be8_b32b_d7fad1d0542e = \n';
|
||||
datastr+=JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,null,4);
|
||||
//datastr+=JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,null,4);
|
||||
|
||||
var emap={};
|
||||
var estr = JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,function(k,v){if(v.id!=null){var id_ = editor.guid();emap[id_]=JSON.stringify(v);return id_;}else return v},4);
|
||||
for(var id_ in emap){
|
||||
estr = estr.replace('"'+id_+'"',emap[id_])
|
||||
}
|
||||
datastr+=estr;
|
||||
|
||||
fs.writeFile('project/maps.js',encode(datastr),'base64',function(err, data){
|
||||
callback(err);
|
||||
});
|
||||
|
||||
@ -178,7 +178,7 @@ editor_mode.prototype.doActionList = function(mode,actionList){
|
||||
break;
|
||||
case 'emenyitem':
|
||||
|
||||
if (editor_mode.info.images=='enemys'){
|
||||
if (editor_mode.info.images=='enemys'||editor_mode.info.images=='enemy48'){
|
||||
editor.file.editEnemy(editor_mode.info.id,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
} else if (editor_mode.info.images=='items'){
|
||||
editor.file.editItem(editor_mode.info.id,actionList,function(objs_){/*console.log(objs_);*/if(objs_.slice(-1)[0]!=null){printe(objs_.slice(-1)[0]);throw(objs_.slice(-1)[0])};printf('修改成功')});
|
||||
@ -203,7 +203,6 @@ editor_mode.prototype.doActionList = function(mode,actionList){
|
||||
|
||||
editor_mode.prototype.onmode = function (mode) {
|
||||
if (editor_mode.mode!=mode) {
|
||||
console.log('change mode into : '+mode);
|
||||
if(mode==='save')editor_mode.doActionList(editor_mode.mode,editor_mode.actionList);
|
||||
if(editor_mode.mode==='nextChange' && mode)editor_mode.showMode(mode);
|
||||
editor_mode.mode=mode;
|
||||
@ -252,7 +251,7 @@ editor_mode.prototype.emenyitem = function(callback){
|
||||
document.getElementById('newIdIdnum').style.display='none';
|
||||
|
||||
var objs=[];
|
||||
if (editor_mode.info.images=='enemys'){
|
||||
if (editor_mode.info.images=='enemys' || editor_mode.info.images=='enemy48'){
|
||||
editor.file.editEnemy(editor_mode.info.id,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
} else if (editor_mode.info.images=='items'){
|
||||
editor.file.editItem(editor_mode.info.id,[],function(objs_){objs=objs_;/*console.log(objs_)*/});
|
||||
@ -307,6 +306,10 @@ editor_mode.prototype.listen = function(callback){
|
||||
if (newIdIdnum.children[0].value && newIdIdnum.children[1].value){
|
||||
var id = newIdIdnum.children[0].value;
|
||||
var idnum = parseInt(newIdIdnum.children[1].value);
|
||||
if (!core.isset(idnum)) {
|
||||
printe('不合法的idnum');
|
||||
return;
|
||||
}
|
||||
editor.file.changeIdAndIdnum(id,idnum,editor_mode.info,function(err){
|
||||
if(err){printe(err);throw(err)}
|
||||
printe('添加id的idnum成功,请F5刷新编辑器');
|
||||
@ -463,7 +466,7 @@ editor_mode.prototype.listen = function(callback){
|
||||
picClick.onclick = function(e){
|
||||
var loc = eToLoc(e);
|
||||
var pos = locToPos(loc);
|
||||
console.log(e,loc,pos);
|
||||
/*console.log(e,loc,pos);*/
|
||||
var num = editor_mode.appendPic.num;
|
||||
var ii = editor_mode.appendPic.index;
|
||||
if(ii+1>=num)editor_mode.appendPic.index=ii+1-num;
|
||||
|
||||
@ -112,7 +112,7 @@ var editArea = new Vue({
|
||||
var num = mapArray[y][x];
|
||||
if(num == 0 )
|
||||
editor.map[y][x] = 0;
|
||||
else if(num >= 400){
|
||||
else if(num >= 1000){
|
||||
that.error = 3;
|
||||
editor.map[y][x] = undefined;
|
||||
}else if(typeof(editor.indexs[num][0]) == 'undefined'){
|
||||
|
||||
@ -373,6 +373,7 @@ maps.prototype.drawMap = function (mapName, callback) {
|
||||
main.editor.updateMap = function(){
|
||||
core.removeGlobalAnimate(null, null, true);
|
||||
core.clearMap('event', 0, 0, 416, 416);
|
||||
core.clearMap('event2', 0, 0, 416, 416);
|
||||
drawEvent();
|
||||
core.setGlobalAnimate(core.values.animateSpeed);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user