@@ -714,11 +714,7 @@ Blockly.Blocks.coderbot_camera_photoTake = {
714
714
this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
715
715
this . setColour ( 120 ) ;
716
716
const di = this . appendDummyInput ( ) ;
717
- if ( Blockly . Blocks . CoderBotSettings . CODERBOT_PROG_LEVEL . indexOf ( 'basic' ) >= 0 ) {
718
- di . appendField ( new Blockly . FieldImage ( '/static/images/blocks/photo_take.png' , 32 , 32 , '*' ) ) ;
719
- } else {
720
- di . appendField ( Blockly . Msg . CODERBOT_PHOTO_TAKE ) ;
721
- }
717
+ di . appendField ( Blockly . Msg . CODERBOT_PHOTO_TAKE ) ;
722
718
this . setPreviousStatement ( true ) ;
723
719
this . setNextStatement ( true ) ;
724
720
this . setTooltip ( ( 'CoderBot_PhotoTooltip' ) ) ;
@@ -730,18 +726,32 @@ Blockly.Python.coderbot_camera_photoTake = function (block) {
730
726
return `${ sbsPrefix } get_cam().photo_take()\n` ;
731
727
} ;
732
728
729
+ Blockly . Blocks . coderbot_basic_camera_photoTake = {
730
+ // Block for taking a picture.
731
+ init ( ) {
732
+ this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
733
+ this . setColour ( 120 ) ;
734
+ const di = this . appendDummyInput ( ) ;
735
+ di . appendField ( new Blockly . FieldImage ( '/static/images/blocks/photo_take.png' , 32 , 32 , '*' ) ) ;
736
+ this . setPreviousStatement ( true ) ;
737
+ this . setNextStatement ( true ) ;
738
+ this . setTooltip ( ( 'CoderBot_PhotoTooltip' ) ) ;
739
+ } ,
740
+ } ;
741
+
742
+ Blockly . Python . coderbot_camera_basic_photoTake = function ( block ) {
743
+ // Generate Python for turning left or right.
744
+ return `${ sbsPrefix } get_cam().photo_take()\n` ;
745
+ } ;
746
+
733
747
Blockly . Blocks . coderbot_camera_videoRec = {
734
748
// Block for recording a video (start).
735
749
init ( ) {
736
750
this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
737
751
this . setColour ( 120 ) ;
738
752
739
753
const di = this . appendDummyInput ( ) ;
740
- if ( Blockly . Blocks . CoderBotSettings . CODERBOT_PROG_LEVEL . indexOf ( 'basic' ) >= 0 ) {
741
- di . appendField ( new Blockly . FieldImage ( '/static/images/blocks/video_rec.png' , 32 , 32 , '*' ) ) ;
742
- } else {
743
- di . appendField ( Blockly . Msg . CODERBOT_VIDEO_REC ) ;
744
- }
754
+ di . appendField ( Blockly . Msg . CODERBOT_VIDEO_REC ) ;
745
755
this . setPreviousStatement ( true ) ;
746
756
this . setNextStatement ( true ) ;
747
757
this . setTooltip ( ( 'CoderBot_VideoTooltip' ) ) ;
@@ -753,18 +763,33 @@ Blockly.Python.coderbot_camera_videoRec = function (block) {
753
763
return `${ sbsPrefix } get_cam().video_rec()\n` ;
754
764
} ;
755
765
766
+ Blockly . Blocks . coderbot_basic_camera_videoRec = {
767
+ // Block for recording a video (start).
768
+ init ( ) {
769
+ this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
770
+ this . setColour ( 120 ) ;
771
+
772
+ const di = this . appendDummyInput ( ) ;
773
+ di . appendField ( new Blockly . FieldImage ( '/static/images/blocks/video_rec.png' , 32 , 32 , '*' ) ) ;
774
+ this . setPreviousStatement ( true ) ;
775
+ this . setNextStatement ( true ) ;
776
+ this . setTooltip ( ( 'CoderBot_VideoTooltip' ) ) ;
777
+ } ,
778
+ } ;
779
+
780
+ Blockly . Python . coderbot_basic_camera_videoRec = function ( block ) {
781
+ // Generate Python for turning left or right.
782
+ return `${ sbsPrefix } get_cam().video_rec()\n` ;
783
+ } ;
784
+
756
785
Blockly . Blocks . coderbot_camera_videoStop = {
757
786
// Block for recording a video (stop).
758
787
init ( ) {
759
788
this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
760
789
this . setColour ( 120 ) ;
761
790
762
791
const di = this . appendDummyInput ( ) ;
763
- if ( Blockly . Blocks . CoderBotSettings . CODERBOT_PROG_LEVEL . indexOf ( 'basic' ) >= 0 ) {
764
- di . appendField ( new Blockly . FieldImage ( '/static/images/blocks/video_stop.png' , 32 , 32 , '*' ) ) ;
765
- } else {
766
- di . appendField ( Blockly . Msg . CODERBOT_VIDEO_STOP ) ;
767
- }
792
+ di . appendField ( Blockly . Msg . CODERBOT_VIDEO_STOP ) ;
768
793
this . setPreviousStatement ( true ) ;
769
794
this . setNextStatement ( true ) ;
770
795
this . setTooltip ( ( 'CoderBot_VideoTooltip' ) ) ;
@@ -776,6 +801,25 @@ Blockly.Python.coderbot_camera_videoStop = function (block) {
776
801
return `${ sbsPrefix } get_cam().video_stop()\n` ;
777
802
} ;
778
803
804
+ Blockly . Blocks . coderbot_basic_camera_videoStop = {
805
+ // Block for recording a video (stop).
806
+ init ( ) {
807
+ this . setHelpUrl ( 'http://code.google.com/p/blockly/wiki/Turn' ) ;
808
+ this . setColour ( 120 ) ;
809
+
810
+ const di = this . appendDummyInput ( ) ;
811
+ di . appendField ( Blockly . Msg . CODERBOT_VIDEO_STOP ) ;
812
+ this . setPreviousStatement ( true ) ;
813
+ this . setNextStatement ( true ) ;
814
+ this . setTooltip ( ( 'CoderBot_VideoTooltip' ) ) ;
815
+ } ,
816
+ } ;
817
+
818
+ Blockly . Python . coderbot_basic_camera_videoStop = function ( block ) {
819
+ // Generate Python for turning left or right.
820
+ return `${ sbsPrefix } get_cam().video_stop()\n` ;
821
+ } ;
822
+
779
823
Blockly . Blocks . coderbot_adv_pathAhead = {
780
824
/**
781
825
* Block for pathAhead function.
@@ -1278,11 +1322,7 @@ Blockly.Blocks.coderbot_audio_play = {
1278
1322
this . setColour ( 220 ) ;
1279
1323
const vi = this . appendValueInput ( 'FILENAME' ) ;
1280
1324
vi . setCheck ( 'String' ) ;
1281
- if ( Blockly . Blocks . CoderBotSettings . CODERBOT_PROG_LEVEL . indexOf ( 'basic' ) >= 0 ) {
1282
- vi . appendField ( new Blockly . FieldImage ( '/static/images/blocks/play.png' , 32 , 32 , '*' ) ) ;
1283
- } else {
1284
- vi . appendField ( Blockly . Msg . CODERBOT_AUDIO_PLAY_FILE ) ;
1285
- }
1325
+ vi . appendField ( Blockly . Msg . CODERBOT_AUDIO_PLAY_FILE ) ;
1286
1326
this . setPreviousStatement ( true ) ;
1287
1327
this . setNextStatement ( true ) ;
1288
1328
this . setTooltip ( ( 'CoderBot_audio_play_Tooltip' ) ) ;
0 commit comments