diff --git a/blocks_vertical/default_toolbox.js b/blocks_vertical/default_toolbox.js index cf05c8652b..c3255c1505 100644 --- a/blocks_vertical/default_toolbox.js +++ b/blocks_vertical/default_toolbox.js @@ -128,11 +128,7 @@ Blockly.Blocks.defaultToolbox = ''+ - ''+ - ''+ - ''+ - ''+ - ''+ + ''+ ''+ ''+ ''+ @@ -196,9 +192,6 @@ Blockly.Blocks.defaultToolbox = ''+ - ''+ - ''+ - ''+ ''+ ''+ '10'+ @@ -206,9 +199,6 @@ Blockly.Blocks.defaultToolbox = ''+ - ''+ - ''+ - ''+ ''+ ''+ '10'+ @@ -289,23 +279,17 @@ Blockly.Blocks.defaultToolbox = '' + '' + ''+ - '' + - '' + - '' + - '' + + '' + '' + ''+ - '100'+ + '10'+ ''+ '' + '' + - '' + - '' + - '' + - '' + + '' + '' + ''+ - '10'+ + '100'+ ''+ '' + '' + @@ -741,9 +725,6 @@ Blockly.Blocks.defaultToolbox = ''+ - ''+ - ''+ - ''+ ''+ ''+ ''+ diff --git a/blocks_vertical/looks.js b/blocks_vertical/looks.js index 81259d4ff5..aa0196c7fe 100644 --- a/blocks_vertical/looks.js +++ b/blocks_vertical/looks.js @@ -169,39 +169,15 @@ Blockly.Blocks['looks_hide'] = { } }; -Blockly.Blocks['looks_effectmenu'] = { - /** - * Graphic effects drop-down menu. - * @this Blockly.Block - */ - init: function() { - this.jsonInit( - { - "message0": "%1", - "args0": [ - { - "type": "field_dropdown", - "name": "EFFECT", - "options": [ - ['color', 'COLOR'], - ['fisheye', 'FISHEYE'], - ['whirl', 'WHIRL'], - ['pixelate', 'PIXELATE'], - ['mosaic', 'MOSAIC'], - ['brightness', 'BRIGHTNESS'], - ['ghost', 'GHOST'] - ] - } - ], - "inputsInline": true, - "output": "String", - "colour": Blockly.Colours.looks.secondary, - "colourSecondary": Blockly.Colours.looks.secondary, - "colourTertiary": Blockly.Colours.looks.tertiary, - "outputShape": Blockly.OUTPUT_SHAPE_ROUND - }); - } -}; +Blockly.Blocks['looks_effect_menu_options'] = [ + ['color', 'COLOR'], + ['fisheye', 'FISHEYE'], + ['whirl', 'WHIRL'], + ['pixelate', 'PIXELATE'], + ['mosaic', 'MOSAIC'], + ['brightness', 'BRIGHTNESS'], + ['ghost', 'GHOST'] +]; Blockly.Blocks['looks_changeeffectby'] = { /** @@ -213,8 +189,9 @@ Blockly.Blocks['looks_changeeffectby'] = { "message0": "change effect %1 by %2", "args0": [ { - "type": "input_value", - "name": "EFFECT" + "type": "field_dropdown", + "name": "EFFECT", + "options": Blockly.Blocks['looks_effect_menu_options'] }, { "type": "input_value", @@ -242,8 +219,9 @@ Blockly.Blocks['looks_seteffectto'] = { "message0": "set effect %1 to %2", "args0": [ { - "type": "input_value", - "name": "EFFECT" + "type": "field_dropdown", + "name": "EFFECT", + "options": Blockly.Blocks['looks_effect_menu_options'] }, { "type": "input_value", diff --git a/blocks_vertical/motion.js b/blocks_vertical/motion.js index 9fcffc5a65..e85c47bfd0 100644 --- a/blocks_vertical/motion.js +++ b/blocks_vertical/motion.js @@ -426,36 +426,6 @@ Blockly.Blocks['motion_ifonedgebounce'] = { } }; -Blockly.Blocks['motion_setrotationstyle_menu'] = { - /** - * Rotation style drop-down menu. - * @this Blockly.Block - */ - init: function() { - this.jsonInit( - { - "message0": "%1", - "args0": [ - { - "type": "field_dropdown", - "name": "STYLE", - "options": [ - ['left-right', 'left-right'], - ['don\'t rotate', 'don\'t rotate'], - ['all around', 'all around'] - ] - } - ], - "inputsInline": true, - "output": "String", - "colour": Blockly.Colours.motion.secondary, - "colourSecondary": Blockly.Colours.motion.secondary, - "colourTertiary": Blockly.Colours.motion.tertiary, - "outputShape": Blockly.OUTPUT_SHAPE_ROUND - }); - } -}; - Blockly.Blocks['motion_setrotationstyle'] = { /** * Block to set rotation style. @@ -466,8 +436,13 @@ Blockly.Blocks['motion_setrotationstyle'] = { "message0": "set rotation style %1", "args0": [ { - "type": "input_value", - "name": "STYLE" + "type": "field_dropdown", + "name": "STYLE", + "options": [ + ['left-right', 'left-right'], + ['don\'t rotate', 'don\'t rotate'], + ['all around', 'all around'] + ] } ], "previousStatement": null, diff --git a/blocks_vertical/operators.js b/blocks_vertical/operators.js index d518fa86a8..f2f52a3ca1 100644 --- a/blocks_vertical/operators.js +++ b/blocks_vertical/operators.js @@ -491,15 +491,15 @@ Blockly.Blocks['operator_round'] = { } }; -Blockly.Blocks['operator_mathop_menu'] = { +Blockly.Blocks['operator_mathop'] = { /** - * Math ops drop-down menu. + * Block for "advanced" math ops on a number. * @this Blockly.Block */ init: function() { this.jsonInit( { - "message0": "%1", + "message0": "%1 of %2", "args0": [ { "type": "field_dropdown", @@ -520,31 +520,6 @@ Blockly.Blocks['operator_mathop_menu'] = { ['e ^', 'e ^'], ['10 ^', '10 ^'] ] - } - ], - "inputsInline": true, - "output": "String", - "colour": Blockly.Colours.operators.secondary, - "colourSecondary": Blockly.Colours.operators.secondary, - "colourTertiary": Blockly.Colours.operators.tertiary, - "outputShape": Blockly.OUTPUT_SHAPE_ROUND - }); - } -}; - -Blockly.Blocks['operator_mathop'] = { - /** - * Block for "advanced" math ops on a number. - * @this Blockly.Block - */ - init: function() { - this.jsonInit( - { - "message0": "%1 of %2", - "args0": [ - { - "type": "input_value", - "name": "OPERATOR" }, { "type": "input_value", diff --git a/blocks_vertical/sound.js b/blocks_vertical/sound.js index b38c41087d..f2b64428a4 100644 --- a/blocks_vertical/sound.js +++ b/blocks_vertical/sound.js @@ -26,7 +26,6 @@ goog.require('Blockly.Blocks'); goog.require('Blockly.Colours'); goog.require('Blockly.constants'); - Blockly.Blocks['sound_sounds_menu'] = { /** * Sound effects drop-down menu. @@ -256,38 +255,14 @@ Blockly.Blocks['sound_playnoteforbeats'] = { } }; -Blockly.Blocks['sound_effects_menu'] = { - /** - * Sound effects drop-down menu. - * @this Blockly.Block - */ - init: function() { - this.jsonInit( - { - "message0": "%1", - "args0": [ - { - "type": "field_dropdown", - "name": "EFFECT", - "options": [ - ['pitch', 'PITCH'], - ['pan left/right', 'PAN'], - ['echo', 'ECHO'], - ['reverb', 'REVERB'], - ['fuzz', 'FUZZ'], - ['robot', 'ROBOT'] - ] - } - ], - "inputsInline": true, - "output": "String", - "colour": Blockly.Colours.sounds.secondary, - "colourSecondary": Blockly.Colours.sounds.secondary, - "colourTertiary": Blockly.Colours.sounds.tertiary, - "outputShape": Blockly.OUTPUT_SHAPE_ROUND - }); - } -}; +Blockly.Blocks['sound_effects_menu_options'] = [ + ['pitch', 'PITCH'], + ['pan left/right', 'PAN'], + ['echo', 'ECHO'], + ['reverb', 'REVERB'], + ['fuzz', 'FUZZ'], + ['robot', 'ROBOT'] +]; Blockly.Blocks['sound_seteffectto'] = { /** @@ -299,8 +274,9 @@ Blockly.Blocks['sound_seteffectto'] = { "message0": "set effect %1 to %2", "args0": [ { - "type": "input_value", - "name": "EFFECT" + "type": "field_dropdown", + "name": "EFFECT", + "options": Blockly.Blocks['sound_effects_menu_options'] }, { "type": "input_value", @@ -327,8 +303,9 @@ Blockly.Blocks['sound_changeeffectby'] = { "message0": "change effect %1 by %2", "args0": [ { - "type": "input_value", - "name": "EFFECT" + "type": "field_dropdown", + "name": "EFFECT", + "options": Blockly.Blocks['sound_effects_menu_options'] }, { "type": "input_value", @@ -351,7 +328,7 @@ Blockly.Blocks['sound_cleareffects'] = { */ init: function() { this.jsonInit({ - "message0": "clear audio effects", + "message0": "clear sound effects", "previousStatement": null, "nextStatement": null, "colour": Blockly.Colours.sounds.primary,