Fix drawTextBox animation

This commit is contained in:
ckcz123 2021-08-07 23:32:09 +08:00
parent 5e78501f84
commit e3e8546d03
2 changed files with 11 additions and 6 deletions

View File

@ -1024,10 +1024,14 @@ actions.prototype._clickAction = function (x, y, px, py) {
if (core.status.event.data.type == 'text') {
// 正在淡入淡出的话不执行
if (core.status.event.animateUI) return;
var data = core.clone(core.status.event.data.current);
if (typeof data == 'string') data = { "type": "text", "text": data };
// 打字机效果显示全部文字
if (core.status.event.interval != null) {
core.insertAction({"type": "text", "text": core.status.event.ui, "showAll": true});
data.showAll = true;
core.insertAction(data);
core.doAction();
return;
}
@ -1124,10 +1128,13 @@ actions.prototype._keyUpAction = function (keycode) {
// 正在淡入淡出的话不执行
if (core.status.event.animateUI) return;
var data = core.clone(core.status.event.data.current);
if (typeof data == 'string') data = { "type": "text", "text": data };
// 打字机效果显示全部文字
if (core.status.event.interval != null) {
core.insertAction({"type": "text", "text": core.status.event.ui, "showAll": true});
core.doAction();
data.showAll = true;
core.insertAction(data);
return;
}
core.ui._animateUI('hide', core.doAction);

View File

@ -814,7 +814,7 @@ ui.prototype._getPosition = function (content) {
px = core.status.event.data.x;
py = core.status.event.data.y;
}
if (editor.mode != 'play') {
if (main.mode != 'play') {
px = editor.pos.x;
py = editor.pos.y;
}
@ -1413,8 +1413,6 @@ ui.prototype._animateUI = function (type, callback) {
////// 绘制一个对话框 //////
ui.prototype.drawTextBox = function(content, config) {
config = config || {};
if (core.status.event && core.status.event.id == 'action')
core.status.event.ui = content;
this.clearUI();