Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (menu.length === 0) {
return [['', '']]; // Empty menu matches Scratch 2 behavior
}
return menu;
}
const myself = ScratchBlocks.ScratchMsgs.translate('CONTROL_CREATECLONEOF_MYSELF', 'myself');
return [[myself, '_myself_']].concat(spriteMenu());
};
const soundColors = ScratchBlocks.Colours.sounds;
const looksColors = ScratchBlocks.Colours.looks;
const motionColors = ScratchBlocks.Colours.motion;
const sensingColors = ScratchBlocks.Colours.sensing;
const controlColors = ScratchBlocks.Colours.control;
const eventColors = ScratchBlocks.Colours.event;
ScratchBlocks.Blocks.sound_sounds_menu.init = function () {
const json = jsonForMenuBlock('SOUND_MENU', soundsMenu, soundColors, []);
this.jsonInit(json);
};
ScratchBlocks.Blocks.looks_costume.init = function () {
const json = jsonForMenuBlock('COSTUME', costumesMenu, looksColors, []);
this.jsonInit(json);
};
ScratchBlocks.Blocks.looks_backdrops.init = function () {
args0: [
{
type: 'field_dropdown',
name: 'PROPERTY',
options: function () {
return menuOptionsFn();
}
},
{
type: 'input_value',
name: 'OBJECT'
}
],
output: true,
colour: ScratchBlocks.Colours.sensing.primary,
colourSecondary: ScratchBlocks.Colours.sensing.secondary,
colourTertiary: ScratchBlocks.Colours.sensing.tertiary,
outputShape: ScratchBlocks.OUTPUT_SHAPE_ROUND
};
};
{
type: 'field_dropdown',
name: 'PROPERTY',
options: function () {
return menuOptionsFn();
}
},
{
type: 'input_value',
name: 'OBJECT'
}
],
output: true,
colour: ScratchBlocks.Colours.sensing.primary,
colourSecondary: ScratchBlocks.Colours.sensing.secondary,
colourTertiary: ScratchBlocks.Colours.sensing.tertiary,
outputShape: ScratchBlocks.OUTPUT_SHAPE_ROUND
};
};