@@ -184,14 +184,19 @@ Blockly.Blocks['coderbot_audio_say'] = {
184
184
// Block for text to speech.
185
185
init : function ( ) {
186
186
this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Say' ) ;
187
- this . setColour ( 290 ) ;
187
+ this . setColour ( 220 ) ;
188
188
var vi = this . appendValueInput ( 'TEXT' ) ;
189
189
vi . setCheck ( [ "String" , "Number" , "Date" ] ) ;
190
190
if ( CODERBOT_PROG_LEVEL . indexOf ( "basic" ) >= 0 ) {
191
191
vi . appendField ( new Blockly . FieldImage ( '/images/blocks/say.png' , 32 , 32 , '*' ) ) ;
192
192
} else {
193
193
vi . appendField ( Blockly . Msg . CODERBOT_SAY ) ;
194
194
}
195
+ vi . appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_LOCALE_EN , 'en' ] ,
196
+ [ Blockly . Msg . CODERBOT_LOCALE_IT , 'it' ] ,
197
+ [ Blockly . Msg . CODERBOT_LOCALE_FR , 'fr' ] ,
198
+ [ Blockly . Msg . CODERBOT_LOCALE_ES , 'es' ] ] ) , 'LOCALE' )
199
+
195
200
this . setPreviousStatement ( true ) ;
196
201
this . setNextStatement ( true ) ;
197
202
this . setTooltip ( ( 'CoderBot_sayTooltip' ) ) ;
@@ -202,7 +207,8 @@ Blockly.Python['coderbot_audio_say'] = function(block) {
202
207
// Generate Python for turning left or right.
203
208
var text = Blockly . Python . valueToCode ( block , 'TEXT' ,
204
209
Blockly . Python . ORDER_NONE ) || '\'\'' ;
205
- return 'get_audio().say(' + text + ')\n' ;
210
+ var locale = block . getFieldValue ( 'LOCALE' ) ;
211
+ return 'get_audio().say(' + text + ', locale="' + locale + '")\n' ;
206
212
} ;
207
213
208
214
Blockly . Blocks [ 'coderbot_sleep' ] = {
@@ -464,7 +470,7 @@ Blockly.Blocks['coderbot_adv_pathAhead'] = {
464
470
*/
465
471
init : function ( ) {
466
472
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
467
- this . setColour ( 290 ) ;
473
+ this . setColour ( 250 ) ;
468
474
this . appendDummyInput ( )
469
475
. appendField ( Blockly . Msg . CODERBOT_SENSOR_PATHAHEAD ) ;
470
476
this . setOutput ( true , 'Number' ) ;
@@ -485,7 +491,7 @@ Blockly.Blocks['coderbot_adv_findLine'] = {
485
491
*/
486
492
init : function ( ) {
487
493
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
488
- this . setColour ( 290 ) ;
494
+ this . setColour ( 250 ) ;
489
495
this . appendDummyInput ( )
490
496
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDLINE ) ;
491
497
this . setOutput ( true , 'Number' ) ;
@@ -506,7 +512,7 @@ Blockly.Blocks['coderbot_adv_findSignal'] = {
506
512
*/
507
513
init : function ( ) {
508
514
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
509
- this . setColour ( 290 ) ;
515
+ this . setColour ( 250 ) ;
510
516
this . appendDummyInput ( )
511
517
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDSIGNAL ) ;
512
518
this . setOutput ( true , 'Number' ) ;
@@ -527,7 +533,7 @@ Blockly.Blocks['coderbot_adv_findFace'] = {
527
533
*/
528
534
init : function ( ) {
529
535
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
530
- this . setColour ( 290 ) ;
536
+ this . setColour ( 250 ) ;
531
537
this . appendDummyInput ( )
532
538
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDFACE )
533
539
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_SENSOR_FINDFACE_X , 'X' ] , [ Blockly . Msg . CODERBOT_SENSOR_FINDFACE_Y , 'Y' ] , [ Blockly . Msg . CODERBOT_SENSOR_FINDFACE_SIZE , 'SIZE' ] , [ Blockly . Msg . CODERBOT_SENSOR_FINDFACE_ALL , 'ALL' ] ] ) , 'RETVAL' )
@@ -552,7 +558,7 @@ Blockly.Blocks['coderbot_adv_findColor'] = {
552
558
*/
553
559
init : function ( ) {
554
560
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
555
- this . setColour ( 290 ) ;
561
+ this . setColour ( 250 ) ;
556
562
this . appendDummyInput ( )
557
563
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDCOLOR_FIND )
558
564
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_SENSOR_FINDCOLOR_DIST , 'DIST' ] , [ Blockly . Msg . CODERBOT_SENSOR_FINDCOLOR_ANGLE , 'ANGLE' ] , [ Blockly . Msg . CODERBOT_SENSOR_FINDCOLOR_BOTH , 'BOTH' ] ] ) , 'RETVAL' )
@@ -581,7 +587,7 @@ Blockly.Blocks['coderbot_cam_average'] = {
581
587
*/
582
588
init : function ( ) {
583
589
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
584
- this . setColour ( 290 ) ;
590
+ this . setColour ( 250 ) ;
585
591
this . appendDummyInput ( )
586
592
. appendField ( Blockly . Msg . CODERBOT_SENSOR_AVERAGE )
587
593
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_SENSOR_AVERAGE_HUE , 'H' ] ,
@@ -609,7 +615,7 @@ Blockly.Blocks['coderbot_adv_findText'] = {
609
615
*/
610
616
init : function ( ) {
611
617
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
612
- this . setColour ( 290 ) ;
618
+ this . setColour ( 250 ) ;
613
619
this . appendDummyInput ( )
614
620
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDTEXT_FIND )
615
621
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_SENSOR_FINDTEXT_ACCEPT_ALPHA , 'alpha' ] ,
@@ -640,7 +646,7 @@ Blockly.Blocks['coderbot_adv_findCode'] = {
640
646
*/
641
647
init : function ( ) {
642
648
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
643
- this . setColour ( 290 ) ;
649
+ this . setColour ( 250 ) ;
644
650
this . appendDummyInput ( )
645
651
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDCODE ) ;
646
652
this . setOutput ( true , 'String' ) ;
@@ -662,7 +668,7 @@ Blockly.Blocks['coderbot_adv_findLogo'] = {
662
668
*/
663
669
init : function ( ) {
664
670
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
665
- this . setColour ( 290 ) ;
671
+ this . setColour ( 250 ) ;
666
672
this . appendDummyInput ( )
667
673
. appendField ( Blockly . Msg . CODERBOT_SENSOR_FINDLOGO ) ;
668
674
this . setOutput ( true , 'Number' ) ;
@@ -683,7 +689,7 @@ Blockly.Blocks['coderbot_audio_record'] = {
683
689
*/
684
690
init : function ( ) {
685
691
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
686
- this . setColour ( 290 ) ;
692
+ this . setColour ( 220 ) ;
687
693
this . appendValueInput ( 'FILENAME' )
688
694
. setCheck ( 'String' )
689
695
. appendField ( Blockly . Msg . CODERBOT_AUDIO_RECORD_FILE_NAME ) ;
@@ -693,7 +699,7 @@ Blockly.Blocks['coderbot_audio_record'] = {
693
699
this . setInputsInline ( true ) ;
694
700
this . setPreviousStatement ( true ) ;
695
701
this . setNextStatement ( true ) ;
696
- this . setTooltip ( ( 'CoderBot_audio_say_Tooltip ' ) ) ;
702
+ this . setTooltip ( ( 'CoderBot_audio_record_Tooltip ' ) ) ;
697
703
}
698
704
} ;
699
705
@@ -711,7 +717,7 @@ Blockly.Blocks['coderbot_audio_play'] = {
711
717
// Block for text to speech.
712
718
init : function ( ) {
713
719
this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Play' ) ;
714
- this . setColour ( 290 ) ;
720
+ this . setColour ( 220 ) ;
715
721
var vi = this . appendValueInput ( 'FILENAME' ) ;
716
722
vi . setCheck ( "String" ) ;
717
723
if ( CODERBOT_PROG_LEVEL . indexOf ( "basic" ) >= 0 ) {
@@ -739,7 +745,7 @@ Blockly.Blocks['coderbot_audio_hear'] = {
739
745
*/
740
746
init : function ( ) {
741
747
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
742
- this . setColour ( 290 ) ;
748
+ this . setColour ( 220 ) ;
743
749
this . appendValueInput ( 'LEVEL' )
744
750
. setCheck ( [ "Number" ] )
745
751
. appendField ( Blockly . Msg . CODERBOT_AUDIO_HEAR + Blockly . Msg . CODERBOT_AUDIO_HEAR_LEVEL ) ;
@@ -767,7 +773,7 @@ Blockly.Blocks['coderbot_audio_listen'] = {
767
773
*/
768
774
init : function ( ) {
769
775
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
770
- this . setColour ( 290 ) ;
776
+ this . setColour ( 220 ) ;
771
777
this . appendDummyInput ( )
772
778
. appendField ( Blockly . Msg . CODERBOT_AUDIO_LISTEN )
773
779
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_AUDIO_LISTEN_MODEL_SIMPLE , 'model_simple' ] ,
@@ -793,7 +799,7 @@ Blockly.Blocks['coderbot_sonar_get_distance'] = {
793
799
*/
794
800
init : function ( ) {
795
801
this . setHelpUrl ( Blockly . Msg . LOGIC_BOOLEAN_HELPURL ) ;
796
- this . setColour ( 290 ) ;
802
+ this . setColour ( 250 ) ;
797
803
this . appendDummyInput ( )
798
804
. appendField ( Blockly . Msg . CODERBOT_SONAR_GET_DISTANCE )
799
805
. appendField ( new Blockly . FieldDropdown ( [ [ Blockly . Msg . CODERBOT_SONAR_SENSOR_1 , 0 ] ,
0 commit comments