Typing effect: display all on click
This commit is contained in:
parent
bc5d4efcf7
commit
c57e734b97
@ -211,7 +211,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"pushBox"
|
"pushBox"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_data": "图块的默认触发器"
|
"_data": "该图块的默认触发器"
|
||||||
},
|
},
|
||||||
"noPass": {
|
"noPass": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
@ -223,7 +223,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_data": "图块默认可通行状态"
|
"_data": "该图块是否不可通行;true代表不可通行,false代表可通行,null代表使用系统缺省值"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -808,6 +808,12 @@ actions.prototype.keyUpConfirmBox = function (keycode) {
|
|||||||
actions.prototype.clickAction = function (x,y) {
|
actions.prototype.clickAction = function (x,y) {
|
||||||
|
|
||||||
if (core.status.event.data.type=='text') {
|
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();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
@ -859,6 +865,10 @@ actions.prototype.keyDownAction = function (keycode) {
|
|||||||
////// 自定义事件时,放开某个键的操作 //////
|
////// 自定义事件时,放开某个键的操作 //////
|
||||||
actions.prototype.keyUpAction = function (keycode) {
|
actions.prototype.keyUpAction = function (keycode) {
|
||||||
if (core.status.event.data.type=='text' && (keycode==13 || keycode==32 || keycode==67)) {
|
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();
|
core.doAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -280,6 +280,7 @@ events.prototype.doAction = function() {
|
|||||||
// 清空boxAnimate和UI层
|
// 清空boxAnimate和UI层
|
||||||
core.status.boxAnimateObjs = [];
|
core.status.boxAnimateObjs = [];
|
||||||
clearInterval(core.status.event.interval);
|
clearInterval(core.status.event.interval);
|
||||||
|
core.status.event.interval = null;
|
||||||
|
|
||||||
core.clearMap('ui');
|
core.clearMap('ui');
|
||||||
core.setAlpha('ui', 1.0);
|
core.setAlpha('ui', 1.0);
|
||||||
@ -328,7 +329,7 @@ events.prototype.doAction = function() {
|
|||||||
if (core.status.replay.replaying)
|
if (core.status.replay.replaying)
|
||||||
core.events.doAction();
|
core.events.doAction();
|
||||||
else
|
else
|
||||||
core.ui.drawTextBox(data.text);
|
core.ui.drawTextBox(data.text, data.showAll);
|
||||||
break;
|
break;
|
||||||
case "autoText":
|
case "autoText":
|
||||||
if (core.status.replay.replaying)
|
if (core.status.replay.replaying)
|
||||||
|
|||||||
@ -74,7 +74,7 @@ maps.prototype.addInfo = function (block) {
|
|||||||
block.event.trigger = 'getItem';
|
block.event.trigger = 'getItem';
|
||||||
}
|
}
|
||||||
if (!core.isset(block.event.noPass)) {
|
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;
|
block.event.noPass = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
libs/ui.js
10
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);
|
clearInterval(core.status.event.interval);
|
||||||
|
core.status.event.interval = null;
|
||||||
|
|
||||||
// 获得name, image, icon
|
// 获得name, image, icon
|
||||||
var id=null, name=null, image=null, icon=null, iconHeight=32, animate=null;
|
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);
|
drawContent(content);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -550,6 +555,7 @@ ui.prototype.drawTextBox = function(content) {
|
|||||||
drawContent(content.substring(0, ++index));
|
drawContent(content.substring(0, ++index));
|
||||||
if (index==content.length) {
|
if (index==content.length) {
|
||||||
clearInterval(core.status.event.interval);
|
clearInterval(core.status.event.interval);
|
||||||
|
core.status.event.interval = null;
|
||||||
}
|
}
|
||||||
}, textAttribute.time);
|
}, textAttribute.time);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user