blocks_vertical/control.js
function() {
    var ALL_SCRIPTS = 'all';
    var THIS_SCRIPT = 'this script';
    var OTHER_SCRIPTS = 'other scripts in sprite';
    var stopDropdown = new Blockly.FieldDropdown(function() {
      if (this.sourceBlock_ &&
          this.sourceBlock_.nextConnection &&
          this.sourceBlock_.nextConnection.isConnected()) {
        return [
          [Blockly.Msg.CONTROL_STOP_OTHER, OTHER_SCRIPTS]
        ];
      }
      return [[Blockly.Msg.CONTROL_STOP_ALL, ALL_SCRIPTS],
        [Blockly.Msg.CONTROL_STOP_THIS, THIS_SCRIPT],
        [Blockly.Msg.CONTROL_STOP_OTHER, OTHER_SCRIPTS]
      ];
    }, function(option) {
      // Create an event group to keep field value and mutator in sync
      // Return null at the end because setValue is called here already.
      Blockly.Events.setGroup(true);
      var oldMutation = Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());
      this.sourceBlock_.setNextStatement(option == OTHER_SCRIPTS);
      var newMutation = Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());
      Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,
          'mutation', null, oldMutation, newMutation));
      this.setValue(option);
      Blockly.Events.setGroup(false);
      return null;
    });
    this.appendDummyInput()
        .appendField(Blockly.Msg.CONTROL_STOP)
        .appendField(stopDropdown, 'STOP_OPTION');
    this.setCategory(Blockly.Categories.control);
    this.setColour(Blockly.Colours.control.primary,
        Blockly.Colours.control.secondary,
        Blockly.Colours.control.tertiary
    );
    this.setPreviousStatement(true);
  }
function() {
    var ALL_SCRIPTS = 'all';
    var THIS_SCRIPT = 'this script';
    var OTHER_SCRIPTS = 'other scripts in sprite';
    var stopDropdown = new Blockly.FieldDropdown(function() {
      if (this.sourceBlock_ &&
          this.sourceBlock_.nextConnection &&
          this.sourceBlock_.nextConnection.isConnected()) {
        return [
          [Blockly.Msg.CONTROL_STOP_OTHER, OTHER_SCRIPTS]
        ];
      }
      return [[Blockly.Msg.CONTROL_STOP_ALL, ALL_SCRIPTS],
        [Blockly.Msg.CONTROL_STOP_THIS, THIS_SCRIPT],
        [Blockly.Msg.CONTROL_STOP_OTHER, OTHER_SCRIPTS]
      ];
    }, function(option) {
      // Create an event group to keep field value and mutator in sync
      // Return null at the end because setValue is called here already.
      Blockly.Events.setGroup(true);
      var oldMutation = Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());
      this.sourceBlock_.setNextStatement(option == OTHER_SCRIPTS);
      var newMutation = Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());
      Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,
          'mutation', null, oldMutation, newMutation));
      this.setValue(option);
      Blockly.Events.setGroup(false);
      return null;
    });
    this.appendDummyInput()
        .appendField(Blockly.Msg.CONTROL_STOP)
        .appendField(stopDropdown, 'STOP_OPTION');
    this.setCategory(Blockly.Categories.control);
    this.setColour(Blockly.Colours.control.primary,
        Blockly.Colours.control.secondary,
        Blockly.Colours.control.tertiary
    );
    this.setPreviousStatement(true);
  }
function ( ) { var ALL_SCRIPTS = 'all' ; var THIS_SCRIPT = 'this script' ; var OTHER_SCRIPTS = 'other scripts in sprite' ; var stopDropdown = new Blockly . FieldDropdown ( function ( ) { if ( this . sourceBlock_ && this . sourceBlock_ . nextConnection && this . sourceBlock_ . nextConnection . isConnected ( ) ) { return [ [ Blockly . Msg . CONTROL_STOP_OTHER , OTHER_SCRIPTS ] ] ; } return [ [ Blockly . Msg . CONTROL_STOP_ALL , ALL_SCRIPTS ] , [ Blockly . Msg . CONTROL_STOP_THIS , THIS_SCRIPT ] , [ Blockly . Msg . CONTROL_STOP_OTHER , OTHER_SCRIPTS ] ] ; } , function ( option ) { // Create an event group to keep field value and mutator in sync // Return null at the end because setValue is called here already. Blockly . Events . setGroup ( true ) ; var oldMutation = Blockly . Xml . domToText ( this . sourceBlock_ . mutationToDom ( ) ) ; this . sourceBlock_ . setNextStatement ( option == OTHER_SCRIPTS ) ; var newMutation = Blockly . Xml . domToText ( this . sourceBlock_ . mutationToDom ( ) ) ; Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock_ , 'mutation' , null , oldMutation , newMutation ) ) ; this . setValue ( option ) ; Blockly . Events . setGroup ( false ) ; return null ; } ) ; this . appendDummyInput ( ) . appendField ( Blockly . Msg . CONTROL_STOP ) . appendField ( stopDropdown , 'STOP_OPTION' ) ; this . setCategory ( Blockly . Categories . control ) ; this . setColour ( Blockly . Colours . control . primary , Blockly . Colours . control . secondary , Blockly . Colours . control . tertiary ) ; this . setPreviousStatement ( true ) ; }
Block for stop all scripts.
@this Blockly.Block
Block for stop all scripts .