I give up!
How do you make this block typing work?
I want only case and default blocks to be able to connect inside the switch block.
What are the types in
setCheck(["case", "default"]) referring to exactly?
How do my case and default blocks actually get the type 'case' and default'.
There is not enough information in the mouse, rat, rodent example:
Blockly.Blocks.controls_switch =
{
init: function()
{
this.appendDummyInput().appendField("switch");
this.appendValueInput("Expression").setCheck(null);
this.appendStatementInput("Statements").setCheck(["case", "default"]);
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(Blockly.Blocks.logic.HUE);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.Blocks.controls_case =
{
init: function()
{
this.appendDummyInput().appendField("case");
this.appendValueInput("Expression").setCheck(null);
this.appendStatementInput("Statements").setCheck(null);
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(Blockly.Blocks.logic.HUE);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.Blocks.controls_default =
{
init: function()
{
this.appendDummyInput().appendField("default");
this.appendStatementInput("Statements").setCheck(null);
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setColour(Blockly.Blocks.logic.HUE);
this.setTooltip("");
this.setHelpUrl("");
}
};