Skip to content

Commit 7746da5

Browse files
authored
Merge pull request #21 from Nitro-Bolt/oh-no-our-table
Tables Variable Type!
2 parents cba6ed9 + 19b8eab commit 7746da5

File tree

10 files changed

+968
-42
lines changed

10 files changed

+968
-42
lines changed

blocks_vertical/data.js

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

blocks_vertical/vertical_extensions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION = function() {
263263
*/
264264
Blockly.ScratchBlocks.VerticalExtensions.registerAll = function() {
265265
var categoryNames =
266-
['control', 'data', 'data_lists', 'json', 'sounds', 'motion', 'looks', 'event',
266+
['control', 'data', 'data_lists', 'data_tables', 'json', 'sounds', 'motion', 'looks', 'event',
267267
'sensing', 'pen', 'operators', 'more', 'comments'];
268268
// Register functions for all category colours.
269269
for (var i = 0; i < categoryNames.length; i++) {

core/colours.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ Blockly.Colours = {
8787
"tertiary": "#E64D00",
8888
"quaternary": "#E64D00"
8989
},
90+
// Same reasoning as data_lists, but this is to differentiate tables
91+
"data_tables": {
92+
"primary": "#66BD5C",
93+
"secondary": "#5CAA53",
94+
"tertiary": "#52974A",
95+
"quaternary": "#52974A"
96+
},
9097
"json": {
9198
"primary": "#5755D4",
9299
"secondary": "#4644AA",

core/constants.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ Blockly.Categories = {
271271
"pen": "pen",
272272
"data": "data",
273273
"dataLists": "data-lists",
274+
"dataTables": "data-tables",
274275
"json": "json",
275276
"event": "events",
276277
"control": "control",
@@ -349,6 +350,14 @@ Blockly.NEW_BROADCAST_MESSAGE_ID = 'NEW_BROADCAST_MESSAGE_ID';
349350
*/
350351
Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE = 'broadcast_msg';
351352

353+
/**
354+
* String representing the variable type of table blocks.
355+
* This string, for use in differentiating between types of variables,
356+
* indicates that the current variable is a table.
357+
* @const {string}
358+
*/
359+
Blockly.TABLE_VARIABLE_TYPE = 'table';
360+
352361
/**
353362
* String representing the variable type of list blocks.
354363
* This string, for use in differentiating between types of variables,

0 commit comments

Comments
 (0)