Merge pull request #161 from zhaouv/v2.x

hide point_m
This commit is contained in:
Zhang Chen 2018-06-29 23:20:06 +08:00 committed by GitHub
commit c5ea1c23d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,17 +18,17 @@ editor_blockly = function () {
{"type": "hide", "time": 500}, {"type": "hide", "time": 500},
],'event'), ],'event'),
MotaActionBlocks['changeFloor_m'].xmlText(), MotaActionBlocks['changeFloor_m'].xmlText(),
MotaActionFunctions.actionParser.parse({"type": "choices", "choices": [ //MotaActionFunctions.actionParser.parse({"type": "choices", "choices": [
{"text": "攻击+\${point}", "action": [ // {"text": "攻击+\${point}", "action": [
{"type": "setValue", "name": "status:atk", "value": "status:atk+\${point}"}, // {"type": "setValue", "name": "status:atk", "value": "status:atk+\${point}"},
]}, // ]},
{"text": "防御+\${2*point}", "action": [ // {"text": "防御+\${2*point}", "action": [
{"type": "setValue", "name": "status:def", "value": "status:def+\${2*point}"}, // {"type": "setValue", "name": "status:def", "value": "status:def+\${2*point}"},
]}, // ]},
{"text": "生命+\${200*point}", "action": [ // {"text": "生命+\${200*point}", "action": [
{"type": "setValue", "name": "status:hp", "value": "status:hp+\${200*point}"}, // {"type": "setValue", "name": "status:hp", "value": "status:hp+\${200*point}"},
]}, // ]},
]},'point'), //]},'point'),
MotaActionFunctions.actionParser.parse([{ MotaActionFunctions.actionParser.parse([{
"id": "moneyShop1", "id": "moneyShop1",
"name": "贪婪之神", "name": "贪婪之神",
@ -269,6 +269,18 @@ document.getElementById('blocklyDiv').onmousewheel = function(e){
} }
} }
} }
if(editor_blockly.workspace.topBlocks_.length>=2){
codeAreaHL.setValue('入口方块只能有一个');
return;
}
var eventType = document.getElementById('entryType').value;
if(editor_blockly.workspace.topBlocks_.length==1){
var blockType = editor_blockly.workspace.topBlocks_[0].type;
if(blockType!==eventType+'_m'){
codeAreaHL.setValue('入口方块类型错误');
return;
}
}
try { try {
var code = Blockly.JavaScript.workspaceToCode(workspace); var code = Blockly.JavaScript.workspaceToCode(workspace);
codeAreaHL.setValue(code); codeAreaHL.setValue(code);