diff --git a/_server/comment.js b/_server/comment.js index dd31f1ab..cceaf71f 100644 --- a/_server/comment.js +++ b/_server/comment.js @@ -211,7 +211,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "pushBox" ] }, - "_data": "图块的默认触发器" + "_data": "该图块的默认触发器" }, "noPass": { "_leaf": true, @@ -223,7 +223,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = false ] }, - "_data": "图块默认可通行状态" + "_data": "该图块是否不可通行;true代表不可通行,false代表可通行,null代表使用系统缺省值" } } }, diff --git a/libs/actions.js b/libs/actions.js index 7b259cad..706eac89 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -808,6 +808,12 @@ actions.prototype.keyUpConfirmBox = function (keycode) { actions.prototype.clickAction = function (x,y) { if (core.status.event.data.type=='text') { + + // 打字机效果显示全部文字 + if (core.status.event.interval!=null) { + core.insertAction({"type": "text", "text": core.status.event.ui, "showAll": true}); + } + // 文字 core.doAction(); return; @@ -859,6 +865,10 @@ actions.prototype.keyDownAction = function (keycode) { ////// 自定义事件时,放开某个键的操作 ////// actions.prototype.keyUpAction = function (keycode) { if (core.status.event.data.type=='text' && (keycode==13 || keycode==32 || keycode==67)) { + // 打字机效果显示全部文字 + if (core.status.event.interval!=null) { + core.insertAction({"type": "text", "text": core.status.event.ui, "showAll": true}); + } core.doAction(); return; } diff --git a/libs/events.js b/libs/events.js index 60f4b03c..b4c7919a 100644 --- a/libs/events.js +++ b/libs/events.js @@ -280,6 +280,7 @@ events.prototype.doAction = function() { // 清空boxAnimate和UI层 core.status.boxAnimateObjs = []; clearInterval(core.status.event.interval); + core.status.event.interval = null; core.clearMap('ui'); core.setAlpha('ui', 1.0); @@ -328,7 +329,7 @@ events.prototype.doAction = function() { if (core.status.replay.replaying) core.events.doAction(); else - core.ui.drawTextBox(data.text); + core.ui.drawTextBox(data.text, data.showAll); break; case "autoText": if (core.status.replay.replaying) diff --git a/libs/maps.js b/libs/maps.js index 6ad50ff5..69c138d7 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -74,7 +74,7 @@ maps.prototype.addInfo = function (block) { block.event.trigger = 'getItem'; } if (!core.isset(block.event.noPass)) { - if (block.event.cls.indexOf("enemy")==0 || block.event.cls.indexOf("npc")==0 || block.event.cls=='terrains') { + if (block.event.cls.indexOf("enemy")==0 || block.event.cls.indexOf("npc")==0 || block.event.cls=='terrains' || block.event.cls=='autotile') { block.event.noPass = true; } } diff --git a/libs/ui.js b/libs/ui.js index 78bf7692..4fe93ed2 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -282,9 +282,14 @@ ui.prototype.drawText = function (contents, callback) { } ////// 绘制一个对话框 ////// -ui.prototype.drawTextBox = function(content) { +ui.prototype.drawTextBox = function(content, showAll) { + + if (core.isset(core.status.event) && core.status.event.id=='action') { + core.status.event.ui = content; + } clearInterval(core.status.event.interval); + core.status.event.interval = null; // 获得name, image, icon var id=null, name=null, image=null, icon=null, iconHeight=32, animate=null; @@ -541,7 +546,7 @@ ui.prototype.drawTextBox = function(content) { } - if (textAttribute.time<=0 || core.status.event.id!='action') { + if (showAll || textAttribute.time<=0 || core.status.event.id!='action') { drawContent(content); } else { @@ -550,6 +555,7 @@ ui.prototype.drawTextBox = function(content) { drawContent(content.substring(0, ++index)); if (index==content.length) { clearInterval(core.status.event.interval); + core.status.event.interval = null; } }, textAttribute.time); }