updated spawn block

This commit is contained in:
ocogeclub 2021-03-25 18:52:45 +09:00
parent 7abefa0954
commit b12cdc679c
2 changed files with 3 additions and 2 deletions

View File

@ -751,7 +751,7 @@
<block type="aquestalk_pi">
<value name="talk">
<shadow type="text">
<field name="TEXT">こんにちは</field>
<field name="TEXT">おはようございます。</field>
</shadow>
</value>
</block>

View File

@ -1923,6 +1923,7 @@ Blockly.Blocks['ugj_spawn'] = {
.setCheck(null);
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setStyle('special_blocks')
this.setTooltip("外部プログラムを実行して子プロセスを生成します。データを受け取る毎にステートメントが実行されます。");
this.setHelpUrl("");
@ -1984,7 +1985,7 @@ Blockly.Blocks['aquestalk_pi'] = {
};
Blockly.JavaScript['aquestalk_pi'] = function (block) {
var value_talk = Blockly.JavaScript.valueToCode(block, 'talk', Blockly.JavaScript.ORDER_ATOMIC);
var code = `'./bin/aquestalkpi/AquesTalkPi ' + ${value_talk} + ' | aplay', { shell: true }`;
var code = `'./bin/aquestalkpi/AquesTalkPi -g 50 ' + ${value_talk} + ' | aplay', { shell: true }`;
return [code, Blockly.JavaScript.ORDER_NONE];
};