insertAction commonEvent do-while
This commit is contained in:
parent
8769668222
commit
9264e7dfe5
@ -1757,7 +1757,7 @@ return code;
|
||||
*/;
|
||||
|
||||
break_s
|
||||
: '跳出循环' Newline
|
||||
: '跳出当前循环或公共事件' Newline
|
||||
|
||||
/* break_s
|
||||
tooltip : break:跳出循环, 如果break事件不在任何循环中被执行,则和exit等价,即会立刻结束当前事件!
|
||||
|
||||
@ -843,7 +843,10 @@ events.prototype.insertAction = function (action, x, y, callback, addToLast) {
|
||||
|
||||
// ------ 判定commonEvent
|
||||
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 (core.status.event.id != 'action') {
|
||||
|
||||
@ -248,7 +248,7 @@ utils.prototype.removeLocalForage = function (key, successCallback, errorCallbac
|
||||
}
|
||||
|
||||
utils.prototype.setGlobal = function (key, value) {
|
||||
if (core.status.replay.replaying) return;
|
||||
if (core.isReplaying()) return;
|
||||
core.setLocalStorage(key, value);
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ utils.prototype.getGlobal = function (key, defaultValue) {
|
||||
}
|
||||
else {
|
||||
core.control._replay_error(action);
|
||||
return defaultValue;
|
||||
return core.getLocalStorage(key, defaultValue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user