insertAction commonEvent do-while

This commit is contained in:
oc 2019-04-29 20:10:42 +08:00
parent 8769668222
commit 9264e7dfe5
3 changed files with 7 additions and 4 deletions

View File

@ -1757,7 +1757,7 @@ return code;
*/; */;
break_s break_s
: '跳出循环' Newline : '跳出当前循环或公共事件' Newline
/* break_s /* break_s
tooltip : break跳出循环, 如果break事件不在任何循环中被执行则和exit等价即会立刻结束当前事件 tooltip : break跳出循环, 如果break事件不在任何循环中被执行则和exit等价即会立刻结束当前事件

View File

@ -843,7 +843,10 @@ events.prototype.insertAction = function (action, x, y, callback, addToLast) {
// ------ 判定commonEvent // ------ 判定commonEvent
var commonEvent = this.getCommonEvent(action); var commonEvent = this.getCommonEvent(action);
if (commonEvent instanceof Array) action = commonEvent; if (commonEvent instanceof Array) {
// 将公共事件视为一个do-while事件插入执行可被break跳出
action = [{"type": "dowhile", "condition": "false", "data": commonEvent}];
}
if (!action) return; if (!action) return;
if (core.status.event.id != 'action') { if (core.status.event.id != 'action') {

View File

@ -248,7 +248,7 @@ utils.prototype.removeLocalForage = function (key, successCallback, errorCallbac
} }
utils.prototype.setGlobal = function (key, value) { utils.prototype.setGlobal = function (key, value) {
if (core.status.replay.replaying) return; if (core.isReplaying()) return;
core.setLocalStorage(key, value); core.setLocalStorage(key, value);
} }
@ -262,7 +262,7 @@ utils.prototype.getGlobal = function (key, defaultValue) {
} }
else { else {
core.control._replay_error(action); core.control._replay_error(action);
return defaultValue; return core.getLocalStorage(key, defaultValue);
} }
} }
else { else {