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