Permalink
Browse files

Refine field matrix menu

  - Change input type from 25 bit integer to 25 char string.
  - Fix pointer flickering while hovering over field.
  - Include node pad in the matrix editor hit zone.
  - Change color scheme to "pen" to match new extension colors.
  - Define all properties in the constructor.
  - Rename a few functions for clarity.
  - Add additional comments
  • Loading branch information...
khanning committed Jul 6, 2018
1 parent 5f5af7e commit 36f3f01975d3ec62600a7931760dcb70733c6aad
Showing with 239 additions and 80 deletions.
  1. +1 −1 blocks_common/matrix.js
  2. +1 −2 blocks_vertical/default_toolbox.js
  3. +28 −0 blocks_vertical/extensions.js
  4. +209 −77 core/field_matrix.js
View
@@ -48,7 +48,7 @@ Blockly.Blocks['matrix'] = {
],
"outputShape": Blockly.OUTPUT_SHAPE_ROUND,
"output": "Number",
"extensions": ["colours_more"]
"extensions": ["colours_pen"]
});
}
};
@@ -541,11 +541,10 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</value>' +
'</block>' +
'<block type="extension_music_reporter" id="extension_music_reporter"></block>' +
'<block type="extension_music_reporter" id="extension_music_reporter"></block>' +
'<block type="extension_microbit_display" id="extension_microbit_display">' +
'<value name="MATRIX">' +
'<shadow type="matrix">' +
'<field name="MATRIX">4540074</field>' +
'<field name="MATRIX">0101010101100010101000100</field>' +
'</shadow>' +
'</value>' +
'</block>' +
@@ -260,3 +260,31 @@ Blockly.Blocks['extension_microbit_display'] = {
});
}
};
Blockly.Blocks['extension_microbit_display'] = {
/**
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "%1 %2 display %3",
"args0": [
{
"type": "field_image",
"src": Blockly.mainWorkspace.options.pathToMedia + "extensions/microbit-block-icon.svg",
"width": 40,
"height": 40
},
{
"type": "field_vertical_separator"
},
{
"type": "input_value",
"name": "MATRIX"
},
],
"category": Blockly.Categories.pen,
"extensions": ["colours_pen", "shape_statement", "scratch_extension"]
});
}
};
Oops, something went wrong.

0 comments on commit 36f3f01

Please sign in to comment.