Layer blocks change "go to front/back" and "go forward/backward N layer"

This commit is contained in:
Paul Kaplan 2017-12-28 13:04:49 -05:00
parent 32a689e38a
commit ee13c2d5be
2 changed files with 26 additions and 8 deletions

View file

@ -193,8 +193,8 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</shadow>'+
'</value>'+
'</block>'+
'<block type="looks_gotofront" id="looks_gotofront"></block>'+
'<block type="looks_gobacklayers" id="looks_gobacklayers">'+
'<block type="looks_gotofrontback" id="looks_gotofrontback"></block>'+
'<block type="looks_goforwardbackwardlayers" id="looks_goforwardbackwardlayers">'+
'<value name="NUM">'+
'<shadow type="math_integer">'+
'<field name="NUM">1</field>'+

View file

@ -383,30 +383,48 @@ Blockly.Blocks['looks_backdrops'] = {
}
};
Blockly.Blocks['looks_gotofront'] = {
Blockly.Blocks['looks_gotofrontback'] = {
/**
* "Go to front" Block.
* "Go to front/back" Block.
* @this Blockly.Block
*/
init: function() {
this.jsonInit(
{
"message0": "go to front",
"message0": "go to %1",
"args0": [
{
"type": "field_dropdown",
"name": "FRONT_BACK",
"options": [
['front', 'front'],
['back', 'back']
]
}
],
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
}
};
Blockly.Blocks['looks_gobacklayers'] = {
Blockly.Blocks['looks_goforwardbackwardlayers'] = {
/**
* "Go back [Number] Layers" Block.
* "Go forward/backward [Number] Layers" Block.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "go back %1 layers",
"message0": "go %1 %2 layers",
"args0": [
{
"type": "field_dropdown",
"name": "FORWARD_BACKWARD",
"options": [
['forward', 'forward'],
['backward', 'backward']
]
},
{
"type": "input_value",
"name": "NUM"