if_1_s
This commit is contained in:
parent
3ee88eddea
commit
a60b6ff3db
@ -324,6 +324,7 @@ action
|
|||||||
| win_s
|
| win_s
|
||||||
| lose_s
|
| lose_s
|
||||||
| if_s
|
| if_s
|
||||||
|
| if_1_s
|
||||||
| switch_s
|
| switch_s
|
||||||
| while_s
|
| while_s
|
||||||
| break_s
|
| break_s
|
||||||
@ -1588,6 +1589,20 @@ var code = ['{"type": "if", "condition": "',expression_0,'",\n',
|
|||||||
return code;
|
return code;
|
||||||
*/;
|
*/;
|
||||||
|
|
||||||
|
if_1_s
|
||||||
|
: '如果' ':' expression BGNL? Newline action+ BEND Newline
|
||||||
|
|
||||||
|
|
||||||
|
/* if_1_s
|
||||||
|
tooltip : if: 条件判断
|
||||||
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=if%EF%BC%9A%E6%9D%A1%E4%BB%B6%E5%88%A4%E6%96%AD
|
||||||
|
colour : this.eventColor
|
||||||
|
var code = ['{"type": "if", "condition": "',expression_0,'",\n',
|
||||||
|
'"true": [\n',action_0,'],\n',
|
||||||
|
'},\n'].join('');
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
switch_s
|
switch_s
|
||||||
: '多重分歧 条件判定' ':' expression BGNL? Newline switchCase+ BEND Newline
|
: '多重分歧 条件判定' ':' expression BGNL? Newline switchCase+ BEND Newline
|
||||||
|
|
||||||
@ -2583,12 +2598,19 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
data.text,this.next]);
|
data.text,this.next]);
|
||||||
break;
|
break;
|
||||||
case "if": // 条件判断
|
case "if": // 条件判断
|
||||||
|
if (data["false"]) {
|
||||||
this.next = MotaActionBlocks['if_s'].xmlText([
|
this.next = MotaActionBlocks['if_s'].xmlText([
|
||||||
// MotaActionBlocks['evalString_e'].xmlText([data.condition]),
|
|
||||||
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
||||||
this.insertActionList(data["true"]),
|
this.insertActionList(data["true"]),
|
||||||
this.insertActionList(data["false"]),
|
this.insertActionList(data["false"]),
|
||||||
this.next]);
|
this.next]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.next = MotaActionBlocks['if_1_s'].xmlText([
|
||||||
|
this.tryToUseEvFlag_e('evalString_e', [data.condition]),
|
||||||
|
this.insertActionList(data["true"]),
|
||||||
|
this.next]);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "confirm": // 显示确认框
|
case "confirm": // 显示确认框
|
||||||
this.next = MotaActionBlocks['confirm_s'].xmlText([
|
this.next = MotaActionBlocks['confirm_s'].xmlText([
|
||||||
|
|||||||
@ -111,6 +111,7 @@ editor_blockly = function () {
|
|||||||
],
|
],
|
||||||
'事件控制':[
|
'事件控制':[
|
||||||
MotaActionBlocks['if_s'].xmlText(),
|
MotaActionBlocks['if_s'].xmlText(),
|
||||||
|
MotaActionBlocks['if_1_s'].xmlText(),
|
||||||
MotaActionFunctions.actionParser.parseList({"type": "switch", "condition": "判别值", "caseList": [
|
MotaActionFunctions.actionParser.parseList({"type": "switch", "condition": "判别值", "caseList": [
|
||||||
{"action": [{"type": "comment", "text": "当判别值是值的场合执行此事件"}]},
|
{"action": [{"type": "comment", "text": "当判别值是值的场合执行此事件"}]},
|
||||||
{"action": [], "nobreak": true},
|
{"action": [], "nobreak": true},
|
||||||
|
|||||||
@ -323,6 +323,7 @@ control.prototype._showStartAnimate_resetDom = function () {
|
|||||||
core.dom.levelChooseButtons.style.display = 'none';
|
core.dom.levelChooseButtons.style.display = 'none';
|
||||||
core.status.played = false;
|
core.status.played = false;
|
||||||
core.clearStatus();
|
core.clearStatus();
|
||||||
|
core.clearMap('all');
|
||||||
core.dom.musicBtn.style.display = 'block';
|
core.dom.musicBtn.style.display = 'block';
|
||||||
core.setMusicBtn();
|
core.setMusicBtn();
|
||||||
// 重置音量
|
// 重置音量
|
||||||
@ -360,7 +361,6 @@ control.prototype.clearStatus = function() {
|
|||||||
}
|
}
|
||||||
core.status = {};
|
core.status = {};
|
||||||
core.clearStatusBar();
|
core.clearStatusBar();
|
||||||
core.clearMap('all');
|
|
||||||
core.deleteAllCanvas();
|
core.deleteAllCanvas();
|
||||||
core.status.played = false;
|
core.status.played = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1683,6 +1683,7 @@ events.prototype.load = function (fromUserAction) {
|
|||||||
if (!core.isPlaying()) {
|
if (!core.isPlaying()) {
|
||||||
core.dom.startPanel.style.display = 'none';
|
core.dom.startPanel.style.display = 'none';
|
||||||
core.clearStatus();
|
core.clearStatus();
|
||||||
|
core.clearMap('all');
|
||||||
core.status.event = {'id': 'load', 'data': null};
|
core.status.event = {'id': 'load', 'data': null};
|
||||||
core.status.lockControl = true;
|
core.status.lockControl = true;
|
||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
|
|||||||
@ -1084,6 +1084,7 @@ ui.prototype.drawConfirmBox = function (text, yesCallback, noCallback) {
|
|||||||
// 处理自定义事件
|
// 处理自定义事件
|
||||||
if (core.status.event.id != 'action') {
|
if (core.status.event.id != 'action') {
|
||||||
core.status.event.id = 'confirmBox';
|
core.status.event.id = 'confirmBox';
|
||||||
|
core.status.event.ui = text;
|
||||||
core.status.event.data = {'yes': yesCallback, 'no': noCallback};
|
core.status.event.data = {'yes': yesCallback, 'no': noCallback};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user