smalruby-editor 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smalruby-editor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/application.js +1 -1
- data/app/assets/javascripts/blocks/control.js.coffee.erb +14 -4
- data/app/assets/javascripts/blocks/events.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +24 -18
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +1 -1
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +1 -1
- data/app/assets/javascripts/fix_blockly.js +12 -0
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +1 -1
- data/app/assets/javascripts/smalruby.js.coffee +12 -0
- data/app/assets/javascripts/views/main_menu_view.js.coffee +5 -1
- data/app/assets/javascripts/views/reset_modal_view.js.coffee +11 -0
- data/app/assets/stylesheets/toolbox.css.scss.erb +29 -19
- data/app/controllers/source_codes_controller.rb +26 -20
- data/app/helpers/application_helper.rb +3 -0
- data/app/models/concerns/ruby_to_block/block/motion_turn_xy.rb +2 -1
- data/app/views/editor/_block_tab.html.haml +0 -1
- data/app/views/editor/_character_modal.html.haml +1 -1
- data/app/views/editor/_load_modal.html.haml +1 -1
- data/app/views/editor/_reset_modal.html.haml +15 -0
- data/app/views/editor/_signin_modal.html.haml +1 -1
- data/app/views/editor/_toolbox.html.haml +264 -257
- data/app/views/editor/index.html.haml +4 -2
- data/lib/smalruby_editor/version.rb +3 -3
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js → application-c8991557a0789ac1bc9220f409e7f1c1.js} +175 -110
- data/public/assets/{application-acf953339e4b5c31b5d6060375b13a44.js.gz → application-c8991557a0789ac1bc9220f409e7f1c1.js.gz} +0 -0
- data/public/assets/{application-e9d089df8f23954c49647ab7af8481dc.css → application-d4fe6c0f970efe8eab9267fd08718d96.css} +182 -104
- data/public/assets/application-d4fe6c0f970efe8eab9267fd08718d96.css.gz +0 -0
- data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
- data/smalruby-editor.gemspec +1 -1
- data/spec/acceptance/base.feature +59 -0
- data/spec/acceptance/block_mode/blocks/control/await.feature +49 -2
- data/spec/acceptance/block_mode/blocks/control/await_until.feature +67 -6
- data/spec/acceptance/block_mode/blocks/control/break.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/next.feature +0 -3
- data/spec/acceptance/block_mode/blocks/control/redo.feature +0 -3
- data/spec/acceptance/standalone/signin.feature +12 -10
- data/spec/steps/base_steps.rb +13 -0
- data/spec/steps/global_variable.rb +11 -0
- metadata +10 -8
- data/public/assets/application-e9d089df8f23954c49647ab7af8481dc.css.gz +0 -0
@@ -9131,22 +9131,6 @@ Blockly.getMainWorkspaceMetrics_=function(){var a=Blockly.svgSize();a.width-=Blo
|
|
9131
9131
|
viewWidth:a.width,contentHeight:c-g,contentWidth:b-f,viewTop:-Blockly.mainWorkspace.scrollY,viewLeft:-Blockly.mainWorkspace.scrollX,contentTop:g,contentLeft:f,absoluteTop:0,absoluteLeft:Blockly.RTL?0:Blockly.Toolbox.width}};
|
9132
9132
|
Blockly.setMainWorkspaceMetrics_=function(a){if(!Blockly.mainWorkspace.scrollbar)throw"Attempt to set main workspace scroll without scrollbars.";var b=Blockly.getMainWorkspaceMetrics_();goog.isNumber(a.x)&&(Blockly.mainWorkspace.scrollX=-b.contentWidth*a.x-b.contentLeft);goog.isNumber(a.y)&&(Blockly.mainWorkspace.scrollY=-b.contentHeight*a.y-b.contentTop);a="translate("+(Blockly.mainWorkspace.scrollX+b.absoluteLeft)+","+(Blockly.mainWorkspace.scrollY+b.absoluteTop)+")";Blockly.mainWorkspace.getCanvas().setAttribute("transform",
|
9133
9133
|
a);Blockly.mainWorkspace.getBubbleCanvas().setAttribute("transform",a)};Blockly.addChangeListener=function(a){return Blockly.bindEvent_(Blockly.mainWorkspace.getCanvas(),"blocklyWorkspaceChange",null,a)};Blockly.removeChangeListener=function(a){Blockly.unbindEvent_(a)};Blockly.getMainWorkspace=function(){return Blockly.mainWorkspace};window.Blockly=Blockly;Blockly.getMainWorkspace=Blockly.getMainWorkspace;Blockly.addChangeListener=Blockly.addChangeListener;Blockly.removeChangeListener=Blockly.removeChangeListener;
|
9134
|
-
Blockly.Names.prototype.safeName_ = function(name) {
|
9135
|
-
if (!name) {
|
9136
|
-
name = 'unnamed';
|
9137
|
-
} else {
|
9138
|
-
// Unfortunately names in non-latin characters will look like
|
9139
|
-
// _E9_9F_B3_E4_B9_90 which is pretty meaningless.
|
9140
|
-
// HACK: Rubyでは日本語の変数名を許可しているためencodeURIを行わない。
|
9141
|
-
// また、使えない記号を置換する。
|
9142
|
-
name = name.replace(/[ !"#$%&'()=\-~^\\|`@{\[+;*:}\]<>,.?\/]/g, '_')
|
9143
|
-
// Most languages don't allow names with leading numbers.
|
9144
|
-
if ('0123456789'.indexOf(name[0]) != -1) {
|
9145
|
-
name = '_' + name;
|
9146
|
-
}
|
9147
|
-
}
|
9148
|
-
return name;
|
9149
|
-
};
|
9150
9134
|
// Do not edit this file; automatically generated by build.py.
|
9151
9135
|
"use strict";
|
9152
9136
|
|
@@ -9653,6 +9637,34 @@ Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
|
9653
9637
|
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
|
9654
9638
|
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
9655
9639
|
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
9640
|
+
Blockly.Names.prototype.safeName_ = function(name) {
|
9641
|
+
if (!name) {
|
9642
|
+
name = 'unnamed';
|
9643
|
+
} else {
|
9644
|
+
// Unfortunately names in non-latin characters will look like
|
9645
|
+
// _E9_9F_B3_E4_B9_90 which is pretty meaningless.
|
9646
|
+
// HACK: Rubyでは日本語の変数名を許可しているためencodeURIを行わない。
|
9647
|
+
// また、使えない記号を置換する。
|
9648
|
+
name = name.replace(/[ !"#$%&'()=\-~^\\|`@{\[+;*:}\]<>,.?\/]/g, '_')
|
9649
|
+
// Most languages don't allow names with leading numbers.
|
9650
|
+
if ('0123456789'.indexOf(name[0]) != -1) {
|
9651
|
+
name = '_' + name;
|
9652
|
+
}
|
9653
|
+
}
|
9654
|
+
return name;
|
9655
|
+
};
|
9656
|
+
|
9657
|
+
var originalBlocksMathNumberInit = Blockly.Blocks['math_number'].init;
|
9658
|
+
Blockly.Blocks['math_number'].init = function() {
|
9659
|
+
originalBlocksMathNumberInit.call(this);
|
9660
|
+
this.setColour(100);
|
9661
|
+
};
|
9662
|
+
|
9663
|
+
var originalBlocksTextInit = Blockly.Blocks['text'].init;
|
9664
|
+
Blockly.Blocks['text'].init = function() {
|
9665
|
+
originalBlocksTextInit.call(this);
|
9666
|
+
this.setColour(100);
|
9667
|
+
};
|
9656
9668
|
// Underscore.js 1.5.2
|
9657
9669
|
// http://underscorejs.org
|
9658
9670
|
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
@@ -12592,6 +12604,9 @@ Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
|
12592
12604
|
this.Views.LoadModalView = new Smalruby.LoadModalView({
|
12593
12605
|
el: $('#load-modal')
|
12594
12606
|
});
|
12607
|
+
this.Views.ResetModalView = new Smalruby.ResetModalView({
|
12608
|
+
el: $('#reset-modal')
|
12609
|
+
});
|
12595
12610
|
Smalruby.downloading = false;
|
12596
12611
|
window.onbeforeunload = function(event) {
|
12597
12612
|
if (!Smalruby.downloading && window.changed) {
|
@@ -12700,6 +12715,15 @@ Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
|
12700
12715
|
return true;
|
12701
12716
|
}
|
12702
12717
|
});
|
12718
|
+
},
|
12719
|
+
reset: function() {
|
12720
|
+
this.blocklyLoading = true;
|
12721
|
+
Blockly.mainWorkspace.clear();
|
12722
|
+
this.Collections.CharacterSet.reset();
|
12723
|
+
$('#filename').val('');
|
12724
|
+
window.textEditor.getSession().getDocument().setValue('');
|
12725
|
+
window.textEditor.moveCursorTo(0, 0);
|
12726
|
+
return window.changed = false;
|
12703
12727
|
}
|
12704
12728
|
};
|
12705
12729
|
|
@@ -13746,7 +13770,12 @@ Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
|
13746
13770
|
},
|
13747
13771
|
onReset: function(e) {
|
13748
13772
|
e.preventDefault();
|
13749
|
-
|
13773
|
+
if (window.changed) {
|
13774
|
+
Smalruby.Views.ResetModalView.render();
|
13775
|
+
} else {
|
13776
|
+
Smalruby.reset();
|
13777
|
+
}
|
13778
|
+
return true;
|
13750
13779
|
},
|
13751
13780
|
onSignin: function(e) {
|
13752
13781
|
e.preventDefault();
|
@@ -13855,6 +13884,21 @@ Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
|
13855
13884
|
}
|
13856
13885
|
});
|
13857
13886
|
|
13887
|
+
}).call(this);
|
13888
|
+
(function() {
|
13889
|
+
Smalruby.ResetModalView = Backbone.View.extend({
|
13890
|
+
events: {
|
13891
|
+
'click #reset-modal-ok-button': 'onOk'
|
13892
|
+
},
|
13893
|
+
render: function() {
|
13894
|
+
return this.$el.modal('show');
|
13895
|
+
},
|
13896
|
+
onOk: function(e) {
|
13897
|
+
Smalruby.reset();
|
13898
|
+
return this.$el.modal('hide');
|
13899
|
+
}
|
13900
|
+
});
|
13901
|
+
|
13858
13902
|
}).call(this);
|
13859
13903
|
(function() {
|
13860
13904
|
Smalruby.SigninModalView = Backbone.View.extend({
|
@@ -14476,7 +14520,11 @@ case end next return until\
|
|
14476
14520
|
};
|
14477
14521
|
|
14478
14522
|
Blockly.Ruby['control_break'] = function(block) {
|
14479
|
-
|
14523
|
+
if (Blockly.Ruby.receiver() === 'main') {
|
14524
|
+
return '';
|
14525
|
+
} else {
|
14526
|
+
return 'break\n';
|
14527
|
+
}
|
14480
14528
|
};
|
14481
14529
|
|
14482
14530
|
Blockly.Blocks['control_next'] = {
|
@@ -14491,7 +14539,11 @@ case end next return until\
|
|
14491
14539
|
};
|
14492
14540
|
|
14493
14541
|
Blockly.Ruby['control_next'] = function(block) {
|
14494
|
-
|
14542
|
+
if (Blockly.Ruby.receiver() === 'main') {
|
14543
|
+
return '';
|
14544
|
+
} else {
|
14545
|
+
return 'next\n';
|
14546
|
+
}
|
14495
14547
|
};
|
14496
14548
|
|
14497
14549
|
Blockly.Blocks['control_redo'] = {
|
@@ -14506,7 +14558,11 @@ case end next return until\
|
|
14506
14558
|
};
|
14507
14559
|
|
14508
14560
|
Blockly.Ruby['control_redo'] = function(block) {
|
14509
|
-
|
14561
|
+
if (Blockly.Ruby.receiver() === 'main') {
|
14562
|
+
return '';
|
14563
|
+
} else {
|
14564
|
+
return 'redo\n';
|
14565
|
+
}
|
14510
14566
|
};
|
14511
14567
|
|
14512
14568
|
Blockly.Blocks['control_if'] = {
|
@@ -14587,9 +14643,14 @@ case end next return until\
|
|
14587
14643
|
};
|
14588
14644
|
|
14589
14645
|
Blockly.Ruby['control_await_until'] = function(block) {
|
14590
|
-
var cond;
|
14591
|
-
|
14592
|
-
|
14646
|
+
var await, cond;
|
14647
|
+
if (Blockly.Ruby.receiver() === 'main') {
|
14648
|
+
return '';
|
14649
|
+
} else {
|
14650
|
+
await = Blockly.Ruby.characterMethodCallInput_('await')[0];
|
14651
|
+
cond = Blockly.Ruby.valueToCode(this, 'COND', Blockly.Ruby.ORDER_CONDITIONAL) || 'true';
|
14652
|
+
return "" + await + " until " + cond + "\n";
|
14653
|
+
}
|
14593
14654
|
};
|
14594
14655
|
|
14595
14656
|
Blockly.Blocks['control_until'] = {
|
@@ -14625,7 +14686,11 @@ case end next return until\
|
|
14625
14686
|
};
|
14626
14687
|
|
14627
14688
|
Blockly.Ruby['control_await'] = function(block) {
|
14628
|
-
|
14689
|
+
if (Blockly.Ruby.receiver() === 'main') {
|
14690
|
+
return '';
|
14691
|
+
} else {
|
14692
|
+
return Blockly.Ruby.characterMethodCall_('await');
|
14693
|
+
}
|
14629
14694
|
};
|
14630
14695
|
|
14631
14696
|
}).call(this);
|
@@ -14642,7 +14707,7 @@ case end next return until\
|
|
14642
14707
|
init: function() {
|
14643
14708
|
this.setHelpUrl('');
|
14644
14709
|
this.setColour(33);
|
14645
|
-
this.appendDummyInput().appendField('
|
14710
|
+
this.appendDummyInput().appendField('実行ボタンがクリックされたとき');
|
14646
14711
|
this.appendStatementInput('DO');
|
14647
14712
|
this.setPreviousStatement(true);
|
14648
14713
|
this.setNextStatement(true);
|
@@ -14779,7 +14844,7 @@ case end next return until\
|
|
14779
14844
|
Blockly.Blocks['hardware_init_hardware'] = {
|
14780
14845
|
init: function() {
|
14781
14846
|
this.setHelpUrl('');
|
14782
|
-
this.setColour(
|
14847
|
+
this.setColour(340);
|
14783
14848
|
this.appendDummyInput().appendField('ハードウェアを準備する');
|
14784
14849
|
return this.setTooltip('');
|
14785
14850
|
}
|
@@ -14793,7 +14858,7 @@ case end next return until\
|
|
14793
14858
|
Blockly.Blocks['hardware_led_on'] = {
|
14794
14859
|
init: function() {
|
14795
14860
|
this.setHelpUrl('');
|
14796
|
-
this.setColour(
|
14861
|
+
this.setColour(270);
|
14797
14862
|
this.appendDummyInput().appendField('LED').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('をオンにする');
|
14798
14863
|
this.setPreviousStatement(true);
|
14799
14864
|
this.setNextStatement(true);
|
@@ -14811,7 +14876,7 @@ case end next return until\
|
|
14811
14876
|
Blockly.Blocks['hardware_led_off'] = {
|
14812
14877
|
init: function() {
|
14813
14878
|
this.setHelpUrl('');
|
14814
|
-
this.setColour(
|
14879
|
+
this.setColour(270);
|
14815
14880
|
this.appendDummyInput().appendField('LED').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('をオフにする');
|
14816
14881
|
this.setPreviousStatement(true);
|
14817
14882
|
this.setNextStatement(true);
|
@@ -14829,7 +14894,7 @@ case end next return until\
|
|
14829
14894
|
Blockly.Blocks['hardware_rgb_led_on'] = {
|
14830
14895
|
init: function() {
|
14831
14896
|
this.setHelpUrl('');
|
14832
|
-
this.setColour(
|
14897
|
+
this.setColour(270);
|
14833
14898
|
this.appendDummyInput().appendField('RGB LED').appendField(new Blockly.FieldDropdown(acDropdown), 'AC').appendField('コモン').appendField(new Blockly.FieldDropdown(rgbLedPinDropdown), 'PIN').appendField('を').appendField(new Blockly.FieldColour('#ff0000'), 'COLOUR').appendField('にする');
|
14834
14899
|
this.setPreviousStatement(true);
|
14835
14900
|
this.setNextStatement(true);
|
@@ -14851,7 +14916,7 @@ case end next return until\
|
|
14851
14916
|
Blockly.Blocks['hardware_rgb_led_off'] = {
|
14852
14917
|
init: function() {
|
14853
14918
|
this.setHelpUrl('');
|
14854
|
-
this.setColour(
|
14919
|
+
this.setColour(270);
|
14855
14920
|
this.appendDummyInput().appendField('RGB LED').appendField(new Blockly.FieldDropdown(acDropdown), 'AC').appendField('コモン').appendField(new Blockly.FieldDropdown(rgbLedPinDropdown), 'PIN').appendField('をオフにする');
|
14856
14921
|
this.setPreviousStatement(true);
|
14857
14922
|
this.setNextStatement(true);
|
@@ -14878,7 +14943,7 @@ case end next return until\
|
|
14878
14943
|
return _results;
|
14879
14944
|
})();
|
14880
14945
|
this.setHelpUrl('');
|
14881
|
-
this.setColour(
|
14946
|
+
this.setColour(270);
|
14882
14947
|
this.appendDummyInput().appendField('7セグディスプレイに').appendField(new Blockly.FieldDropdown(dropdown), 'NUM').appendField('を表示する');
|
14883
14948
|
this.setPreviousStatement(true);
|
14884
14949
|
this.setNextStatement(true);
|
@@ -14895,7 +14960,7 @@ case end next return until\
|
|
14895
14960
|
Blockly.Blocks['hardware_seven_segment_display_off'] = {
|
14896
14961
|
init: function() {
|
14897
14962
|
this.setHelpUrl('');
|
14898
|
-
this.setColour(
|
14963
|
+
this.setColour(270);
|
14899
14964
|
this.appendDummyInput().appendField('7セグディスプレイをオフにする');
|
14900
14965
|
this.setPreviousStatement(true);
|
14901
14966
|
this.setNextStatement(true);
|
@@ -14910,7 +14975,7 @@ case end next return until\
|
|
14910
14975
|
Blockly.Blocks['hardware_lcd_puts'] = {
|
14911
14976
|
init: function() {
|
14912
14977
|
this.setHelpUrl('');
|
14913
|
-
this.setColour(
|
14978
|
+
this.setColour(270);
|
14914
14979
|
this.appendValueInput('TEXT').appendField('LCDに').setCheck('String');
|
14915
14980
|
this.appendDummyInput().appendField('を表示する');
|
14916
14981
|
this.setInputsInline(true);
|
@@ -14929,7 +14994,7 @@ case end next return until\
|
|
14929
14994
|
Blockly.Blocks['hardware_lcd_clear'] = {
|
14930
14995
|
init: function() {
|
14931
14996
|
this.setHelpUrl('');
|
14932
|
-
this.setColour(
|
14997
|
+
this.setColour(270);
|
14933
14998
|
this.appendDummyInput().appendField('LCDをクリアする');
|
14934
14999
|
this.setPreviousStatement(true);
|
14935
15000
|
this.setNextStatement(true);
|
@@ -14944,7 +15009,7 @@ case end next return until\
|
|
14944
15009
|
Blockly.Blocks['hardware_seven_segment_display_off'] = {
|
14945
15010
|
init: function() {
|
14946
15011
|
this.setHelpUrl('');
|
14947
|
-
this.setColour(
|
15012
|
+
this.setColour(270);
|
14948
15013
|
this.appendDummyInput().appendField('7セグディスプレイをオフにする');
|
14949
15014
|
this.setPreviousStatement(true);
|
14950
15015
|
this.setNextStatement(true);
|
@@ -15156,7 +15221,7 @@ case end next return until\
|
|
15156
15221
|
Blockly.Blocks['hardware_button_down'] = {
|
15157
15222
|
init: function() {
|
15158
15223
|
this.setHelpUrl('');
|
15159
|
-
this.setColour(
|
15224
|
+
this.setColour(190);
|
15160
15225
|
this.appendDummyInput().appendField('ボタン').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('を押している');
|
15161
15226
|
this.setOutput(true, 'Boolean');
|
15162
15227
|
return this.setTooltip('');
|
@@ -15172,7 +15237,7 @@ case end next return until\
|
|
15172
15237
|
Blockly.Blocks['hardware_button_up'] = {
|
15173
15238
|
init: function() {
|
15174
15239
|
this.setHelpUrl('');
|
15175
|
-
this.setColour(
|
15240
|
+
this.setColour(190);
|
15176
15241
|
this.appendDummyInput().appendField('ボタン').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('を離している');
|
15177
15242
|
this.setOutput(true, 'Boolean');
|
15178
15243
|
return this.setTooltip('');
|
@@ -15188,7 +15253,7 @@ case end next return until\
|
|
15188
15253
|
Blockly.Blocks['hardware_on_button_down'] = {
|
15189
15254
|
init: function() {
|
15190
15255
|
this.setHelpUrl('');
|
15191
|
-
this.setColour(
|
15256
|
+
this.setColour(33);
|
15192
15257
|
this.appendDummyInput().appendField('ボタン').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('を押したとき');
|
15193
15258
|
this.appendStatementInput('DO');
|
15194
15259
|
this.setPreviousStatement(true);
|
@@ -15211,7 +15276,7 @@ case end next return until\
|
|
15211
15276
|
Blockly.Blocks['hardware_on_button_up'] = {
|
15212
15277
|
init: function() {
|
15213
15278
|
this.setHelpUrl('');
|
15214
|
-
this.setColour(
|
15279
|
+
this.setColour(33);
|
15215
15280
|
this.appendDummyInput().appendField('ボタン').appendField(new Blockly.FieldDropdown(dioPinDropdown), 'PIN').appendField('を離したとき');
|
15216
15281
|
this.appendStatementInput('DO');
|
15217
15282
|
this.setPreviousStatement(true);
|
@@ -15234,7 +15299,7 @@ case end next return until\
|
|
15234
15299
|
Blockly.Blocks['hardware_sensor_value'] = {
|
15235
15300
|
init: function() {
|
15236
15301
|
this.setHelpUrl('');
|
15237
|
-
this.setColour(
|
15302
|
+
this.setColour(190);
|
15238
15303
|
this.appendDummyInput().appendField('センサー').appendField(new Blockly.FieldDropdown(aiPinDropdown), 'PIN');
|
15239
15304
|
this.setOutput(true, 'Number');
|
15240
15305
|
return this.setTooltip('');
|
@@ -15250,7 +15315,7 @@ case end next return until\
|
|
15250
15315
|
Blockly.Blocks['hardware_on_sensor_change'] = {
|
15251
15316
|
init: function() {
|
15252
15317
|
this.setHelpUrl('');
|
15253
|
-
this.setColour(
|
15318
|
+
this.setColour(33);
|
15254
15319
|
this.appendDummyInput().appendField('センサー').appendField(new Blockly.FieldDropdown(aiPinDropdown), 'PIN').appendField('が変化したとき');
|
15255
15320
|
this.appendStatementInput('DO');
|
15256
15321
|
this.setPreviousStatement(true);
|
@@ -15270,7 +15335,7 @@ case end next return until\
|
|
15270
15335
|
Blockly.Blocks['looks_say_second'] = {
|
15271
15336
|
init: function() {
|
15272
15337
|
this.setHelpUrl('');
|
15273
|
-
this.setColour(
|
15338
|
+
this.setColour(270);
|
15274
15339
|
this.interpolateMsg('%1と%2秒言う', ['TEXT', null, Blockly.ALIGN_RIGHT], ['SEC', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15275
15340
|
this.setInputsInline(true);
|
15276
15341
|
this.setPreviousStatement(true);
|
@@ -15289,7 +15354,7 @@ case end next return until\
|
|
15289
15354
|
Blockly.Blocks['looks_say'] = {
|
15290
15355
|
init: function() {
|
15291
15356
|
this.setHelpUrl('');
|
15292
|
-
this.setColour(
|
15357
|
+
this.setColour(270);
|
15293
15358
|
this.interpolateMsg('%1と言う', ['TEXT', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15294
15359
|
this.setInputsInline(true);
|
15295
15360
|
this.setPreviousStatement(true);
|
@@ -15307,7 +15372,7 @@ case end next return until\
|
|
15307
15372
|
Blockly.Blocks['looks_think_second'] = {
|
15308
15373
|
init: function() {
|
15309
15374
|
this.setHelpUrl('');
|
15310
|
-
this.setColour(
|
15375
|
+
this.setColour(270);
|
15311
15376
|
this.interpolateMsg('%1と%2秒考える', ['TEXT', null, Blockly.ALIGN_RIGHT], ['SEC', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15312
15377
|
this.setInputsInline(true);
|
15313
15378
|
this.setPreviousStatement(true);
|
@@ -15326,7 +15391,7 @@ case end next return until\
|
|
15326
15391
|
Blockly.Blocks['looks_think'] = {
|
15327
15392
|
init: function() {
|
15328
15393
|
this.setHelpUrl('');
|
15329
|
-
this.setColour(
|
15394
|
+
this.setColour(270);
|
15330
15395
|
this.interpolateMsg('%1と考える', ['TEXT', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15331
15396
|
this.setInputsInline(true);
|
15332
15397
|
this.setPreviousStatement(true);
|
@@ -15344,7 +15409,7 @@ case end next return until\
|
|
15344
15409
|
Blockly.Blocks['looks_show'] = {
|
15345
15410
|
init: function() {
|
15346
15411
|
this.setHelpUrl('');
|
15347
|
-
this.setColour(
|
15412
|
+
this.setColour(270);
|
15348
15413
|
this.appendDummyInput().appendField('表示する');
|
15349
15414
|
this.setPreviousStatement(true);
|
15350
15415
|
this.setNextStatement(true);
|
@@ -15359,7 +15424,7 @@ case end next return until\
|
|
15359
15424
|
Blockly.Blocks['looks_hide'] = {
|
15360
15425
|
init: function() {
|
15361
15426
|
this.setHelpUrl('');
|
15362
|
-
this.setColour(
|
15427
|
+
this.setColour(270);
|
15363
15428
|
this.appendDummyInput().appendField('隠す');
|
15364
15429
|
this.setPreviousStatement(true);
|
15365
15430
|
this.setNextStatement(true);
|
@@ -15374,7 +15439,7 @@ case end next return until\
|
|
15374
15439
|
Blockly.Blocks['looks_vanish'] = {
|
15375
15440
|
init: function() {
|
15376
15441
|
this.setHelpUrl('');
|
15377
|
-
this.setColour(
|
15442
|
+
this.setColour(270);
|
15378
15443
|
this.appendDummyInput().appendField('消滅する');
|
15379
15444
|
this.setPreviousStatement(true);
|
15380
15445
|
this.setNextStatement(true);
|
@@ -15389,7 +15454,7 @@ case end next return until\
|
|
15389
15454
|
Blockly.Blocks['looks_change_scale_by'] = {
|
15390
15455
|
init: function() {
|
15391
15456
|
this.setHelpUrl('');
|
15392
|
-
this.setColour(
|
15457
|
+
this.setColour(270);
|
15393
15458
|
this.interpolateMsg('大きさを%1%ずつ変える', ['SCALE', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15394
15459
|
this.setInputsInline(true);
|
15395
15460
|
this.setPreviousStatement(true);
|
@@ -15408,7 +15473,7 @@ case end next return until\
|
|
15408
15473
|
Blockly.Blocks['looks_set_scale'] = {
|
15409
15474
|
init: function() {
|
15410
15475
|
this.setHelpUrl('');
|
15411
|
-
this.setColour(
|
15476
|
+
this.setColour(270);
|
15412
15477
|
this.interpolateMsg('大きさを%1%にする', ['SCALE', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15413
15478
|
this.setInputsInline(true);
|
15414
15479
|
this.setPreviousStatement(true);
|
@@ -15427,7 +15492,7 @@ case end next return until\
|
|
15427
15492
|
Blockly.Blocks['looks_self_scale'] = {
|
15428
15493
|
init: function() {
|
15429
15494
|
this.setHelpUrl('');
|
15430
|
-
this.setColour(
|
15495
|
+
this.setColour(270);
|
15431
15496
|
this.appendDummyInput().appendField('大きさ');
|
15432
15497
|
this.setOutput(true, 'Number');
|
15433
15498
|
return this.setTooltip('');
|
@@ -15443,7 +15508,7 @@ case end next return until\
|
|
15443
15508
|
var images;
|
15444
15509
|
images = [['車1', 'car1.png'], ['車2', 'car2.png'], ['車3', 'car3.png'], ['車4', 'car4.png'], ['ボール1', 'ball1.png'], ['ボール2', 'ball2.png'], ['ボール3', 'ball3.png'], ['ボール4', 'ball4.png'], ['ボール5', 'ball5.png'], ['ボール6', 'ball6.png'], ['猫1', 'cat1.png'], ['猫2', 'cat2.png'], ['猫3', 'cat3.png'], ['かえる1', 'frog1.png'], ['コウガ リュウ1', 'ryu1.png'], ['コウガ リュウ2', 'ryu2.png'], ['イタチのタイチ', 'taichi1.png'], ['イタチのタイチ', 'taichi2.png']];
|
15445
15510
|
this.setHelpUrl('');
|
15446
|
-
this.setColour(
|
15511
|
+
this.setColour(270);
|
15447
15512
|
this.appendDummyInput().appendField(new Blockly.FieldDropdown(images), 'NAME');
|
15448
15513
|
this.setOutput(true, 'String');
|
15449
15514
|
return this.setTooltip('');
|
@@ -15461,7 +15526,7 @@ case end next return until\
|
|
15461
15526
|
Blockly.Blocks['motion_move'] = {
|
15462
15527
|
init: function() {
|
15463
15528
|
this.setHelpUrl('');
|
15464
|
-
this.setColour(
|
15529
|
+
this.setColour(208);
|
15465
15530
|
this.interpolateMsg('%1歩動かす', ['STEP', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15466
15531
|
this.setInputsInline(true);
|
15467
15532
|
this.setPreviousStatement(true);
|
@@ -15479,7 +15544,7 @@ case end next return until\
|
|
15479
15544
|
Blockly.Blocks['motion_rotate_right'] = {
|
15480
15545
|
init: function() {
|
15481
15546
|
this.setHelpUrl('');
|
15482
|
-
this.setColour(
|
15547
|
+
this.setColour(208);
|
15483
15548
|
this.interpolateMsg('時計回りに%1度回す', ['ANGLE', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15484
15549
|
this.setInputsInline(true);
|
15485
15550
|
this.setPreviousStatement(true);
|
@@ -15497,7 +15562,7 @@ case end next return until\
|
|
15497
15562
|
Blockly.Blocks['motion_rotate_left'] = {
|
15498
15563
|
init: function() {
|
15499
15564
|
this.setHelpUrl('');
|
15500
|
-
this.setColour(
|
15565
|
+
this.setColour(208);
|
15501
15566
|
this.interpolateMsg('反時計回りに%1度回す', ['ANGLE', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15502
15567
|
this.setInputsInline(true);
|
15503
15568
|
this.setPreviousStatement(true);
|
@@ -15515,7 +15580,7 @@ case end next return until\
|
|
15515
15580
|
Blockly.Blocks['motion_set_angle'] = {
|
15516
15581
|
init: function() {
|
15517
15582
|
this.setHelpUrl('');
|
15518
|
-
this.setColour(
|
15583
|
+
this.setColour(208);
|
15519
15584
|
this.interpolateMsg('%1度に向ける', ['ANGLE', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15520
15585
|
this.setInputsInline(true);
|
15521
15586
|
this.setPreviousStatement(true);
|
@@ -15533,7 +15598,7 @@ case end next return until\
|
|
15533
15598
|
Blockly.Blocks['motion_point_towards_mouse'] = {
|
15534
15599
|
init: function() {
|
15535
15600
|
this.setHelpUrl('');
|
15536
|
-
this.setColour(
|
15601
|
+
this.setColour(208);
|
15537
15602
|
this.appendDummyInput().appendField('マウスポインターへ向ける');
|
15538
15603
|
this.setPreviousStatement(true);
|
15539
15604
|
this.setNextStatement(true);
|
@@ -15548,7 +15613,7 @@ case end next return until\
|
|
15548
15613
|
Blockly.Blocks['motion_point_towards_character'] = {
|
15549
15614
|
init: function() {
|
15550
15615
|
this.setHelpUrl('');
|
15551
|
-
this.setColour(
|
15616
|
+
this.setColour(208);
|
15552
15617
|
this.appendDummyInput().appendField(new Smalruby.FieldCharacter(), 'CHAR').appendField('へ向ける');
|
15553
15618
|
this.setPreviousStatement(true);
|
15554
15619
|
this.setNextStatement(true);
|
@@ -15565,7 +15630,7 @@ case end next return until\
|
|
15565
15630
|
Blockly.Blocks['motion_set_x_y'] = {
|
15566
15631
|
init: function() {
|
15567
15632
|
this.setHelpUrl('');
|
15568
|
-
this.setColour(
|
15633
|
+
this.setColour(208);
|
15569
15634
|
this.appendDummyInput().appendField('X座標を');
|
15570
15635
|
this.appendValueInput('X').setCheck('Number');
|
15571
15636
|
this.appendDummyInput().appendField('、Y座標を');
|
@@ -15588,7 +15653,7 @@ case end next return until\
|
|
15588
15653
|
Blockly.Blocks['motion_go_to_mouse'] = {
|
15589
15654
|
init: function() {
|
15590
15655
|
this.setHelpUrl('');
|
15591
|
-
this.setColour(
|
15656
|
+
this.setColour(208);
|
15592
15657
|
this.appendDummyInput().appendField('マウスポインターへ行く');
|
15593
15658
|
this.setPreviousStatement(true);
|
15594
15659
|
this.setNextStatement(true);
|
@@ -15603,7 +15668,7 @@ case end next return until\
|
|
15603
15668
|
Blockly.Blocks['motion_go_to_character'] = {
|
15604
15669
|
init: function() {
|
15605
15670
|
this.setHelpUrl('');
|
15606
|
-
this.setColour(
|
15671
|
+
this.setColour(208);
|
15607
15672
|
this.appendDummyInput().appendField(new Smalruby.FieldCharacter(), 'CHAR').appendField('へ行く');
|
15608
15673
|
this.setPreviousStatement(true);
|
15609
15674
|
this.setNextStatement(true);
|
@@ -15620,7 +15685,7 @@ case end next return until\
|
|
15620
15685
|
Blockly.Blocks['motion_glide_to_x_y'] = {
|
15621
15686
|
init: function() {
|
15622
15687
|
this.setHelpUrl('');
|
15623
|
-
this.setColour(
|
15688
|
+
this.setColour(208);
|
15624
15689
|
this.interpolateMsg('%1秒でx座標を%2、y座標を%3に変える', ['SEC', ['Number'], Blockly.ALIGN_RIGHT], ['X', ['Number'], Blockly.ALIGN_RIGHT], ['Y', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15625
15690
|
this.setInputsInline(true);
|
15626
15691
|
this.setPreviousStatement(true);
|
@@ -15640,7 +15705,7 @@ case end next return until\
|
|
15640
15705
|
Blockly.Blocks['motion_change_x_by'] = {
|
15641
15706
|
init: function() {
|
15642
15707
|
this.setHelpUrl('');
|
15643
|
-
this.setColour(
|
15708
|
+
this.setColour(208);
|
15644
15709
|
this.interpolateMsg('x座標を%1ずつ変える', ['X', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15645
15710
|
this.setInputsInline(true);
|
15646
15711
|
this.setPreviousStatement(true);
|
@@ -15658,7 +15723,7 @@ case end next return until\
|
|
15658
15723
|
Blockly.Blocks['motion_set_x'] = {
|
15659
15724
|
init: function() {
|
15660
15725
|
this.setHelpUrl('');
|
15661
|
-
this.setColour(
|
15726
|
+
this.setColour(208);
|
15662
15727
|
this.interpolateMsg('x座標を%1にする', ['X', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15663
15728
|
this.setInputsInline(true);
|
15664
15729
|
this.setPreviousStatement(true);
|
@@ -15676,7 +15741,7 @@ case end next return until\
|
|
15676
15741
|
Blockly.Blocks['motion_change_y_by'] = {
|
15677
15742
|
init: function() {
|
15678
15743
|
this.setHelpUrl('');
|
15679
|
-
this.setColour(
|
15744
|
+
this.setColour(208);
|
15680
15745
|
this.interpolateMsg('y座標を%1ずつ変える', ['Y', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15681
15746
|
this.setInputsInline(true);
|
15682
15747
|
this.setPreviousStatement(true);
|
@@ -15694,7 +15759,7 @@ case end next return until\
|
|
15694
15759
|
Blockly.Blocks['motion_set_y'] = {
|
15695
15760
|
init: function() {
|
15696
15761
|
this.setHelpUrl('');
|
15697
|
-
this.setColour(
|
15762
|
+
this.setColour(208);
|
15698
15763
|
this.interpolateMsg('y座標を%1にする', ['Y', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15699
15764
|
this.setInputsInline(true);
|
15700
15765
|
this.setPreviousStatement(true);
|
@@ -15712,7 +15777,7 @@ case end next return until\
|
|
15712
15777
|
Blockly.Blocks['motion_turn_if_reach_wall'] = {
|
15713
15778
|
init: function() {
|
15714
15779
|
this.setHelpUrl('');
|
15715
|
-
this.setColour(
|
15780
|
+
this.setColour(208);
|
15716
15781
|
this.appendDummyInput().appendField('もし端に着いたら、跳ね返る');
|
15717
15782
|
this.setPreviousStatement(true);
|
15718
15783
|
this.setNextStatement(true);
|
@@ -15727,7 +15792,7 @@ case end next return until\
|
|
15727
15792
|
Blockly.Blocks['motion_reach_wall'] = {
|
15728
15793
|
init: function() {
|
15729
15794
|
this.setHelpUrl('');
|
15730
|
-
this.setColour(
|
15795
|
+
this.setColour(208);
|
15731
15796
|
this.appendDummyInput().appendField('端に着いた');
|
15732
15797
|
this.setOutput(true, 'Boolean');
|
15733
15798
|
return this.setTooltip('');
|
@@ -15741,7 +15806,7 @@ case end next return until\
|
|
15741
15806
|
Blockly.Blocks['motion_turn'] = {
|
15742
15807
|
init: function() {
|
15743
15808
|
this.setHelpUrl('');
|
15744
|
-
this.setColour(
|
15809
|
+
this.setColour(208);
|
15745
15810
|
this.appendDummyInput().appendField('跳ね返る');
|
15746
15811
|
this.setPreviousStatement(true);
|
15747
15812
|
this.setNextStatement(true);
|
@@ -15758,7 +15823,7 @@ case end next return until\
|
|
15758
15823
|
var dropdown;
|
15759
15824
|
dropdown = [['水平(X)', 'x'], ['垂直(Y)', 'y']];
|
15760
15825
|
this.setHelpUrl('');
|
15761
|
-
this.setColour(
|
15826
|
+
this.setColour(208);
|
15762
15827
|
this.appendDummyInput().appendField(new Blockly.FieldDropdown(dropdown), 'XY').appendField('方向に跳ね返る');
|
15763
15828
|
this.setPreviousStatement(true);
|
15764
15829
|
this.setNextStatement(true);
|
@@ -15777,7 +15842,7 @@ case end next return until\
|
|
15777
15842
|
var dropdown;
|
15778
15843
|
dropdown = [['左右のみ', 'left_right'], ['回転しない', 'none'], ['自由に回転', 'free']];
|
15779
15844
|
this.setHelpUrl('');
|
15780
|
-
this.setColour(
|
15845
|
+
this.setColour(208);
|
15781
15846
|
this.appendDummyInput().appendField('回転方法を').appendField(new Blockly.FieldDropdown(dropdown), 'STYLE').appendField('にする');
|
15782
15847
|
this.setPreviousStatement(true);
|
15783
15848
|
this.setNextStatement(true);
|
@@ -15794,7 +15859,7 @@ case end next return until\
|
|
15794
15859
|
Blockly.Blocks['motion_self_x'] = {
|
15795
15860
|
init: function() {
|
15796
15861
|
this.setHelpUrl('');
|
15797
|
-
this.setColour(
|
15862
|
+
this.setColour(208);
|
15798
15863
|
this.appendDummyInput().appendField('x座標');
|
15799
15864
|
this.setOutput(true, 'Number');
|
15800
15865
|
return this.setTooltip('');
|
@@ -15808,7 +15873,7 @@ case end next return until\
|
|
15808
15873
|
Blockly.Blocks['motion_self_y'] = {
|
15809
15874
|
init: function() {
|
15810
15875
|
this.setHelpUrl('');
|
15811
|
-
this.setColour(
|
15876
|
+
this.setColour(208);
|
15812
15877
|
this.appendDummyInput().appendField('y座標');
|
15813
15878
|
this.setOutput(true, 'Number');
|
15814
15879
|
return this.setTooltip('');
|
@@ -15822,7 +15887,7 @@ case end next return until\
|
|
15822
15887
|
Blockly.Blocks['motion_self_angle'] = {
|
15823
15888
|
init: function() {
|
15824
15889
|
this.setHelpUrl('');
|
15825
|
-
this.setColour(
|
15890
|
+
this.setColour(208);
|
15826
15891
|
this.appendDummyInput().appendField('向き');
|
15827
15892
|
this.setOutput(true, 'Number');
|
15828
15893
|
return this.setTooltip('');
|
@@ -15838,7 +15903,7 @@ case end next return until\
|
|
15838
15903
|
Blockly.Blocks['operators_add'] = {
|
15839
15904
|
init: function() {
|
15840
15905
|
this.setHelpUrl('');
|
15841
|
-
this.setColour(
|
15906
|
+
this.setColour(100);
|
15842
15907
|
this.interpolateMsg('%1+%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15843
15908
|
this.setInputsInline(true);
|
15844
15909
|
this.setOutput(true, null);
|
@@ -15857,7 +15922,7 @@ case end next return until\
|
|
15857
15922
|
Blockly.Blocks['operators_minus'] = {
|
15858
15923
|
init: function() {
|
15859
15924
|
this.setHelpUrl('');
|
15860
|
-
this.setColour(
|
15925
|
+
this.setColour(100);
|
15861
15926
|
this.interpolateMsg('%1ー%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15862
15927
|
this.setInputsInline(true);
|
15863
15928
|
this.setOutput(true, null);
|
@@ -15876,7 +15941,7 @@ case end next return until\
|
|
15876
15941
|
Blockly.Blocks['operators_multiply'] = {
|
15877
15942
|
init: function() {
|
15878
15943
|
this.setHelpUrl('');
|
15879
|
-
this.setColour(
|
15944
|
+
this.setColour(100);
|
15880
15945
|
this.interpolateMsg('%1×%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15881
15946
|
this.setInputsInline(true);
|
15882
15947
|
this.setOutput(true, null);
|
@@ -15895,7 +15960,7 @@ case end next return until\
|
|
15895
15960
|
Blockly.Blocks['operators_divide'] = {
|
15896
15961
|
init: function() {
|
15897
15962
|
this.setHelpUrl('');
|
15898
|
-
this.setColour(
|
15963
|
+
this.setColour(100);
|
15899
15964
|
this.interpolateMsg('%1÷%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15900
15965
|
this.setInputsInline(true);
|
15901
15966
|
this.setOutput(true, null);
|
@@ -15914,7 +15979,7 @@ case end next return until\
|
|
15914
15979
|
Blockly.Blocks['operators_compare_lt'] = {
|
15915
15980
|
init: function() {
|
15916
15981
|
this.setHelpUrl('');
|
15917
|
-
this.setColour(
|
15982
|
+
this.setColour(100);
|
15918
15983
|
this.interpolateMsg('%1<%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15919
15984
|
this.setInputsInline(true);
|
15920
15985
|
this.setOutput(true, 'Boolean');
|
@@ -15933,7 +15998,7 @@ case end next return until\
|
|
15933
15998
|
Blockly.Blocks['operators_compare_lte'] = {
|
15934
15999
|
init: function() {
|
15935
16000
|
this.setHelpUrl('');
|
15936
|
-
this.setColour(
|
16001
|
+
this.setColour(100);
|
15937
16002
|
this.interpolateMsg('%1≦%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15938
16003
|
this.setInputsInline(true);
|
15939
16004
|
this.setOutput(true, 'Boolean');
|
@@ -15952,7 +16017,7 @@ case end next return until\
|
|
15952
16017
|
Blockly.Blocks['operators_compare_eq'] = {
|
15953
16018
|
init: function() {
|
15954
16019
|
this.setHelpUrl('');
|
15955
|
-
this.setColour(
|
16020
|
+
this.setColour(100);
|
15956
16021
|
this.interpolateMsg('%1=%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15957
16022
|
this.setInputsInline(true);
|
15958
16023
|
this.setOutput(true, 'Boolean');
|
@@ -15971,7 +16036,7 @@ case end next return until\
|
|
15971
16036
|
Blockly.Blocks['operators_compare_gte'] = {
|
15972
16037
|
init: function() {
|
15973
16038
|
this.setHelpUrl('');
|
15974
|
-
this.setColour(
|
16039
|
+
this.setColour(100);
|
15975
16040
|
this.interpolateMsg('%1≧%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15976
16041
|
this.setInputsInline(true);
|
15977
16042
|
this.setOutput(true, 'Boolean');
|
@@ -15990,7 +16055,7 @@ case end next return until\
|
|
15990
16055
|
Blockly.Blocks['operators_compare_gt'] = {
|
15991
16056
|
init: function() {
|
15992
16057
|
this.setHelpUrl('');
|
15993
|
-
this.setColour(
|
16058
|
+
this.setColour(100);
|
15994
16059
|
this.interpolateMsg('%1>%2', ['A', null, Blockly.ALIGN_RIGHT], ['B', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
15995
16060
|
this.setInputsInline(true);
|
15996
16061
|
this.setOutput(true, 'Boolean');
|
@@ -16009,7 +16074,7 @@ case end next return until\
|
|
16009
16074
|
Blockly.Blocks['operators_rand'] = {
|
16010
16075
|
init: function() {
|
16011
16076
|
this.setHelpUrl('');
|
16012
|
-
this.setColour(
|
16077
|
+
this.setColour(100);
|
16013
16078
|
this.interpolateMsg('%1から%2までの乱数', ['A', ['Number'], Blockly.ALIGN_RIGHT], ['B', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16014
16079
|
this.setInputsInline(true);
|
16015
16080
|
this.setOutput(true, 'Number');
|
@@ -16027,7 +16092,7 @@ case end next return until\
|
|
16027
16092
|
Blockly.Blocks['operators_and'] = {
|
16028
16093
|
init: function() {
|
16029
16094
|
this.setHelpUrl('');
|
16030
|
-
this.setColour(
|
16095
|
+
this.setColour(100);
|
16031
16096
|
this.interpolateMsg('%1かつ%2', ['A', ['Boolean'], Blockly.ALIGN_RIGHT], ['B', ['Boolean'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16032
16097
|
this.setInputsInline(true);
|
16033
16098
|
this.setOutput(true, 'Boolean');
|
@@ -16046,7 +16111,7 @@ case end next return until\
|
|
16046
16111
|
Blockly.Blocks['operators_or'] = {
|
16047
16112
|
init: function() {
|
16048
16113
|
this.setHelpUrl('');
|
16049
|
-
this.setColour(
|
16114
|
+
this.setColour(100);
|
16050
16115
|
this.interpolateMsg('%1または%2', ['A', ['Boolean'], Blockly.ALIGN_RIGHT], ['B', ['Boolean'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16051
16116
|
this.setInputsInline(true);
|
16052
16117
|
this.setOutput(true, 'Boolean');
|
@@ -16065,7 +16130,7 @@ case end next return until\
|
|
16065
16130
|
Blockly.Blocks['operators_negate'] = {
|
16066
16131
|
init: function() {
|
16067
16132
|
this.setHelpUrl('');
|
16068
|
-
this.setColour(
|
16133
|
+
this.setColour(100);
|
16069
16134
|
this.interpolateMsg('%1ではない', ['A', ['Boolean'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16070
16135
|
this.setInputsInline(true);
|
16071
16136
|
this.setOutput(true, 'Boolean');
|
@@ -16083,7 +16148,7 @@ case end next return until\
|
|
16083
16148
|
Blockly.Blocks['operators_index_of'] = {
|
16084
16149
|
init: function() {
|
16085
16150
|
this.setHelpUrl('');
|
16086
|
-
this.setColour(
|
16151
|
+
this.setColour(100);
|
16087
16152
|
this.interpolateMsg('%1の%2番目', ['A', null, Blockly.ALIGN_RIGHT], ['INDEX', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16088
16153
|
this.setInputsInline(true);
|
16089
16154
|
this.setOutput(true, null);
|
@@ -16101,7 +16166,7 @@ case end next return until\
|
|
16101
16166
|
Blockly.Blocks['operators_length'] = {
|
16102
16167
|
init: function() {
|
16103
16168
|
this.setHelpUrl('');
|
16104
|
-
this.setColour(
|
16169
|
+
this.setColour(100);
|
16105
16170
|
this.interpolateMsg('%1の長さ', ['A', null, Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16106
16171
|
this.setInputsInline(true);
|
16107
16172
|
this.setOutput(true, null);
|
@@ -16119,7 +16184,7 @@ case end next return until\
|
|
16119
16184
|
Blockly.Blocks['operators_modulo'] = {
|
16120
16185
|
init: function() {
|
16121
16186
|
this.setHelpUrl('');
|
16122
|
-
this.setColour(
|
16187
|
+
this.setColour(100);
|
16123
16188
|
this.interpolateMsg('%1を%2で割った余り', ['A', ['Number'], Blockly.ALIGN_RIGHT], ['B', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16124
16189
|
this.setInputsInline(true);
|
16125
16190
|
this.setOutput(true, 'Number');
|
@@ -16138,7 +16203,7 @@ case end next return until\
|
|
16138
16203
|
Blockly.Blocks['operators_round'] = {
|
16139
16204
|
init: function() {
|
16140
16205
|
this.setHelpUrl('');
|
16141
|
-
this.setColour(
|
16206
|
+
this.setColour(100);
|
16142
16207
|
this.interpolateMsg('%1を丸める', ['A', ['Number'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16143
16208
|
this.setInputsInline(true);
|
16144
16209
|
this.setOutput(true, 'Number');
|
@@ -16158,7 +16223,7 @@ case end next return until\
|
|
16158
16223
|
var dropdown;
|
16159
16224
|
dropdown = [['絶対値', '%num%.abs'], ['切り上げ', '%num%.floor'], ['切り下げ', '%num%.ceil'], ['平方根', 'Math.sqrt(%num%)'], ['sin', 'Math.sin(%num%)'], ['cos', 'Math.cos(%num%)'], ['tan', 'Math.tan(%num%)'], ['asin', 'Math.asin(%num%)'], ['acos', 'Math.acos(%num%)'], ['atan', 'Math.atan(%num%)'], ['log', 'Math.log(%num%)'], ['log10', 'Math.log10(%num%)'], ['e^', 'Math::E ** %num%'], ['10^', '10 ** %num%']];
|
16160
16225
|
this.setHelpUrl('');
|
16161
|
-
this.setColour(
|
16226
|
+
this.setColour(100);
|
16162
16227
|
this.appendValueInput('NUM').setCheck('Number');
|
16163
16228
|
this.appendDummyInput().appendField('の').appendField(new Blockly.FieldDropdown(dropdown), 'METHOD');
|
16164
16229
|
this.setInputsInline(true);
|
@@ -16178,7 +16243,7 @@ case end next return until\
|
|
16178
16243
|
Blockly.Blocks['operators_true'] = {
|
16179
16244
|
init: function() {
|
16180
16245
|
this.setHelpUrl('');
|
16181
|
-
this.setColour(
|
16246
|
+
this.setColour(100);
|
16182
16247
|
this.appendDummyInput().appendField('真');
|
16183
16248
|
this.setInputsInline(true);
|
16184
16249
|
this.setOutput(true, 'Boolean');
|
@@ -16193,7 +16258,7 @@ case end next return until\
|
|
16193
16258
|
Blockly.Blocks['operators_false'] = {
|
16194
16259
|
init: function() {
|
16195
16260
|
this.setHelpUrl('');
|
16196
|
-
this.setColour(
|
16261
|
+
this.setColour(100);
|
16197
16262
|
this.appendDummyInput().appendField('偽');
|
16198
16263
|
this.setInputsInline(true);
|
16199
16264
|
this.setOutput(true, 'Boolean');
|
@@ -16341,7 +16406,7 @@ case end next return until\
|
|
16341
16406
|
keyDropdown = window.SmalrubyEditor.Sensing.KeyDropdown;
|
16342
16407
|
podDropdown = window.SmalrubyEditor.Sensing.PushOrDownDropdown;
|
16343
16408
|
this.setHelpUrl('');
|
16344
|
-
this.setColour(
|
16409
|
+
this.setColour(190);
|
16345
16410
|
this.appendDummyInput().appendField('キーボードの').appendField(new Blockly.FieldDropdown(keyDropdown), 'KEY').appendField('が').appendField(new Blockly.FieldDropdown(podDropdown), 'POD');
|
16346
16411
|
this.setOutput(true, 'Boolean');
|
16347
16412
|
return this.setTooltip('');
|
@@ -16361,7 +16426,7 @@ case end next return until\
|
|
16361
16426
|
mbDropdown = window.SmalrubyEditor.Sensing.MouseButtonDropdown;
|
16362
16427
|
podDropdown = window.SmalrubyEditor.Sensing.PushOrDownDropdown;
|
16363
16428
|
this.setHelpUrl('');
|
16364
|
-
this.setColour(
|
16429
|
+
this.setColour(190);
|
16365
16430
|
this.appendDummyInput().appendField('マウスの').appendField(new Blockly.FieldDropdown(mbDropdown), 'MOUSE_BUTTON').appendField('が').appendField(new Blockly.FieldDropdown(podDropdown), 'POD');
|
16366
16431
|
this.setOutput(true, 'Boolean');
|
16367
16432
|
return this.setTooltip('');
|
@@ -16378,7 +16443,7 @@ case end next return until\
|
|
16378
16443
|
Blockly.Blocks['sensing_input_mouse_pos_x'] = {
|
16379
16444
|
init: function() {
|
16380
16445
|
this.setHelpUrl('');
|
16381
|
-
this.setColour(
|
16446
|
+
this.setColour(190);
|
16382
16447
|
this.appendDummyInput().appendField('マウスのx座標');
|
16383
16448
|
this.setOutput(true, 'Number');
|
16384
16449
|
return this.setTooltip('');
|
@@ -16392,7 +16457,7 @@ case end next return until\
|
|
16392
16457
|
Blockly.Blocks['sensing_input_mouse_pos_y'] = {
|
16393
16458
|
init: function() {
|
16394
16459
|
this.setHelpUrl('');
|
16395
|
-
this.setColour(
|
16460
|
+
this.setColour(190);
|
16396
16461
|
this.appendDummyInput().appendField('マウスのy座標');
|
16397
16462
|
this.setOutput(true, 'Number');
|
16398
16463
|
return this.setTooltip('');
|
@@ -16406,7 +16471,7 @@ case end next return until\
|
|
16406
16471
|
Blockly.Blocks['sensing_hit'] = {
|
16407
16472
|
init: function() {
|
16408
16473
|
this.setHelpUrl('');
|
16409
|
-
this.setColour(
|
16474
|
+
this.setColour(190);
|
16410
16475
|
this.appendDummyInput().appendField(new Smalruby.FieldCharacter(), 'CHAR').appendField('に触れた');
|
16411
16476
|
this.setOutput(true, 'Boolean');
|
16412
16477
|
return this.setTooltip('');
|
@@ -16422,7 +16487,7 @@ case end next return until\
|
|
16422
16487
|
Blockly.Blocks['sensing_ask'] = {
|
16423
16488
|
init: function() {
|
16424
16489
|
this.setHelpUrl('');
|
16425
|
-
this.setColour(
|
16490
|
+
this.setColour(190);
|
16426
16491
|
this.interpolateMsg('%1と聞いて待つ', ['TEXT', ['String'], Blockly.ALIGN_RIGHT], Blockly.ALIGN_RIGHT);
|
16427
16492
|
this.setInputsInline(true);
|
16428
16493
|
this.setPreviousStatement(true);
|
@@ -16440,7 +16505,7 @@ case end next return until\
|
|
16440
16505
|
Blockly.Blocks['sensing_answer'] = {
|
16441
16506
|
init: function() {
|
16442
16507
|
this.setHelpUrl('');
|
16443
|
-
this.setColour(
|
16508
|
+
this.setColour(190);
|
16444
16509
|
this.appendDummyInput().appendField('答え');
|
16445
16510
|
this.setOutput(true, 'String');
|
16446
16511
|
return this.setTooltip('');
|
@@ -16454,7 +16519,7 @@ case end next return until\
|
|
16454
16519
|
Blockly.Blocks['sensing_timer_count'] = {
|
16455
16520
|
init: function() {
|
16456
16521
|
this.setHelpUrl('');
|
16457
|
-
this.setColour(
|
16522
|
+
this.setColour(190);
|
16458
16523
|
this.appendDummyInput().appendField('タイマー');
|
16459
16524
|
this.setOutput(true, 'Number');
|
16460
16525
|
return this.setTooltip('');
|
@@ -16468,7 +16533,7 @@ case end next return until\
|
|
16468
16533
|
Blockly.Blocks['sensing_timer_reset'] = {
|
16469
16534
|
init: function() {
|
16470
16535
|
this.setHelpUrl('');
|
16471
|
-
this.setColour(
|
16536
|
+
this.setColour(190);
|
16472
16537
|
this.appendDummyInput().appendField('タイマーをリセット');
|
16473
16538
|
this.setPreviousStatement(true);
|
16474
16539
|
this.setNextStatement(true);
|
@@ -16485,7 +16550,7 @@ case end next return until\
|
|
16485
16550
|
var dropdown;
|
16486
16551
|
dropdown = [['x座標', 'x'], ['y座標', 'y'], ['向き', 'angle'], ['コスチューム番号', 'costume_index'], ['コスチューム名', 'costume'], ['大きさ', 'scale'], ['ボリューム', 'volume']];
|
16487
16552
|
this.setHelpUrl('');
|
16488
|
-
this.setColour(
|
16553
|
+
this.setColour(190);
|
16489
16554
|
this.appendDummyInput().appendField(new Smalruby.FieldCharacter(), 'CHAR').appendField('の').appendField(new Blockly.FieldDropdown(dropdown), 'PROPERTY');
|
16490
16555
|
this.setOutput(true, ['Number', 'String']);
|
16491
16556
|
return this.setTooltip('');
|
@@ -16509,7 +16574,7 @@ case end next return until\
|
|
16509
16574
|
var dropdown;
|
16510
16575
|
dropdown = [['年', 'year'], ['月', 'month'], ['日付', 'day'], ['曜日', 'wday'], ['時', 'hour'], ['分', 'min'], ['秒', 'sec']];
|
16511
16576
|
this.setHelpUrl('');
|
16512
|
-
this.setColour(
|
16577
|
+
this.setColour(190);
|
16513
16578
|
this.appendDummyInput().appendField('現在の').appendField(new Blockly.FieldDropdown(dropdown), 'METHOD');
|
16514
16579
|
this.setOutput(true, 'Number');
|
16515
16580
|
return this.setTooltip('');
|
@@ -16525,7 +16590,7 @@ case end next return until\
|
|
16525
16590
|
Blockly.Blocks['sensing_days_since_2000'] = {
|
16526
16591
|
init: function() {
|
16527
16592
|
this.setHelpUrl('');
|
16528
|
-
this.setColour(
|
16593
|
+
this.setColour(190);
|
16529
16594
|
this.appendDummyInput().appendField('2000年からの日数');
|
16530
16595
|
this.setOutput(true, 'Number');
|
16531
16596
|
return this.setTooltip('');
|
@@ -16543,7 +16608,7 @@ case end next return until\
|
|
16543
16608
|
var sounds;
|
16544
16609
|
sounds = [['ピアノのド', 'piano_do.wav'], ['ピアノのレ', 'piano_re.wav'], ['ピアノのミ', 'piano_mi.wav'], ['ピアノのファ', 'piano_fa.wav'], ['ピアノのソ', 'piano_so.wav'], ['ピアノのラ', 'piano_ra.wav'], ['ピアノのシ', 'piano_si.wav'], ['ピアノの高いド', 'piano_do_2.wav']];
|
16545
16610
|
this.setHelpUrl('');
|
16546
|
-
this.setColour(
|
16611
|
+
this.setColour(300);
|
16547
16612
|
this.appendDummyInput().appendField(new Blockly.FieldDropdown(sounds), 'NAME');
|
16548
16613
|
this.setOutput(true, 'String');
|
16549
16614
|
return this.setTooltip('');
|
@@ -16559,7 +16624,7 @@ case end next return until\
|
|
16559
16624
|
Blockly.Blocks['sound_play'] = {
|
16560
16625
|
init: function() {
|
16561
16626
|
this.setHelpUrl('');
|
16562
|
-
this.setColour(
|
16627
|
+
this.setColour(300);
|
16563
16628
|
this.appendValueInput('NAME').setCheck('String');
|
16564
16629
|
this.appendDummyInput().appendField('の音を鳴らす');
|
16565
16630
|
this.setInputsInline(true);
|
@@ -16578,7 +16643,7 @@ case end next return until\
|
|
16578
16643
|
Blockly.Blocks['sound_stop'] = {
|
16579
16644
|
init: function() {
|
16580
16645
|
this.setHelpUrl('');
|
16581
|
-
this.setColour(
|
16646
|
+
this.setColour(300);
|
16582
16647
|
this.appendDummyInput().appendField('すべての音を止める');
|
16583
16648
|
this.setPreviousStatement(true);
|
16584
16649
|
this.setNextStatement(true);
|
@@ -16593,7 +16658,7 @@ case end next return until\
|
|
16593
16658
|
Blockly.Blocks['sound_volume'] = {
|
16594
16659
|
init: function() {
|
16595
16660
|
this.setHelpUrl('');
|
16596
|
-
this.setColour(
|
16661
|
+
this.setColour(300);
|
16597
16662
|
this.appendDummyInput().appendField('ボリューム');
|
16598
16663
|
this.setOutput(true, 'Number');
|
16599
16664
|
return this.setTooltip('');
|