diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 4fe3294e..a350fc9c 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -1001,6 +1001,7 @@ function ActionParser(){ ActionParser.prototype.parse = function (obj,type) { switch (type) { case 'event': + if(!obj)obj={}; if(typeof(obj)===typeof('')) obj={'data':[obj]}; if(obj instanceof Array) obj={'data':obj}; return MotaActionBlocks['event_m'].xmlText([ @@ -1008,12 +1009,14 @@ ActionParser.prototype.parse = function (obj,type) { ]); case 'changeFloor': + if(!obj)obj={}; if(!this.isset(obj.loc))obj.loc=[0,0]; return MotaActionBlocks['changeFloor_m'].xmlText([ obj.floorId,obj.stair||'loc',obj.loc[0],obj.loc[1],this.Direction(obj.direction),obj.time||0,!this.isset(obj.portalWithoutTrigger) ]); case 'point': + if(!obj)obj={}; var text_choices = null; for(var ii=obj.choices.length-1,choice;choice=obj.choices[ii];ii--) { text_choices=MotaActionBlocks['choicesContext'].xmlText([ diff --git a/_server/editor.js b/_server/editor.js index a6dc7b18..e19309cd 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -11,8 +11,8 @@ editor.prototype.init = function(callback){ editor.reset(function(){ editor.drawMapBg(); - var mapArray = core.maps.getMapArray(core.status.maps[core.status.floorId].blocks); - editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[v][0]]]})}); + var mapArray = core.maps.save(core.status.maps,core.status.floorId); + editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[parseInt(v)][0]]]})}); editor.updateMap(); editor.currentFloorId=core.status.floorId; editor.currentFloorData = core.floors[core.status.floorId]; @@ -35,7 +35,7 @@ editor.prototype.init = function(callback){ }); core.events.setInitData(hard); } - setTimeout(afterMainInit, 300); + setTimeout(afterMainInit, 500); } editor.prototype.reset = function(callback){ @@ -298,8 +298,8 @@ editor.prototype.changeFloor = function(floorId,callback) { editor.currentFloorData.map = editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})}); core.changeFloor(floorId, null, core.firstData.hero.loc, null, function(){ editor.drawMapBg(); - var mapArray = core.maps.getMapArray(core.status.maps[core.status.floorId].blocks); - editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[v][0]]]})}); + var mapArray = core.maps.save(core.status.maps,core.status.floorId); + editor.map = mapArray.map(function(v){return v.map(function(v){return editor.ids[[editor.indexs[parseInt(v)][0]]]})}); editor.updateMap(); editor.currentFloorId=core.status.floorId; editor.currentFloorData = core.floors[core.status.floorId]; diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index 6e535c62..dee70dae 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -304,6 +304,9 @@ editor_blockly.import = function(id_){ "['firstData']['shops']":'shop', + "['firstArrive']":'firstArrive', + "['firstData']['startText']":'firstArrive', + "--point--未完成数据转移":'point', }[field]; if(!type)return; @@ -311,8 +314,11 @@ editor_blockly.import = function(id_){ document.getElementById('codeArea').value = input.value; document.getElementById('entryType').value = type; editor_blockly.parse(); + editor_blockly.show(); } +editor_blockly.show = function(){} + editor_blockly.confirm = function (){ if(!editor_blockly.id){ editor_blockly.id=''; @@ -346,6 +352,7 @@ editor_blockly.doubleClickBlock = function (blockId){ var f=textStringDict[b]; if(f){ var value = b.getFieldValue(f); + //多行编辑 //func(value,function(newvalue,b,f){b.setFieldValue(newvalue,f);}) } } diff --git a/editor.html b/editor.html index f0ecb527..7c2c5599 100644 --- a/editor.html +++ b/editor.html @@ -123,6 +123,7 @@ +