From 86186a4137ec71ecfa001144e417f949e86f7099 Mon Sep 17 00:00:00 2001 From: Muffin Date: Thu, 11 Jan 2024 02:39:19 -0600 Subject: [PATCH] Add some more extensions for extensions --- blocks_vertical/vertical_extensions.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/blocks_vertical/vertical_extensions.js b/blocks_vertical/vertical_extensions.js index 3200b4fe5e..96e2684534 100644 --- a/blocks_vertical/vertical_extensions.js +++ b/blocks_vertical/vertical_extensions.js @@ -220,10 +220,18 @@ Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU = { } }; +Blockly.ScratchBlocks.VerticalExtensions.FROM_EXTENSION = function() { + this.isFromExtension = true; +}; + +Blockly.ScratchBlocks.VerticalExtensions.DEFAULT_EXTENSION_COLORS = function() { + this.usesDefaultExtensionColors = true; +}; Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION = function() { this.isScratchExtension = true; }; + /** * Register all extensions for scratch-blocks. * @package @@ -265,7 +273,15 @@ Blockly.ScratchBlocks.VerticalExtensions.registerAll = function() { Blockly.Extensions.registerMixin('procedure_call_contextmenu', Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU); - // Extension blocks have slightly different block rendering. + // Given to all blocks from an extension. + Blockly.Extensions.register('from_extension', + Blockly.ScratchBlocks.VerticalExtensions.FROM_EXTENSION); + + // Given to blocks that use the default extension colors ("pen") + Blockly.Extensions.register('default_extension_colors', + Blockly.ScratchBlocks.VerticalExtensions.DEFAULT_EXTENSION_COLORS); + + // Misleading name. Given to blocks that have an extension icon. Blockly.Extensions.register('scratch_extension', Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION); };