Skip to content
Snippets Groups Projects
Commit ed0c4668 authored by picklesrus's avatar picklesrus
Browse files

Address code review comments.

parent 10ec82f3
No related branches found
No related tags found
No related merge requests found
...@@ -48,13 +48,13 @@ export default function (vm) { ...@@ -48,13 +48,13 @@ export default function (vm) {
}; };
const jsonForSensingMenus = function (blockMsg, name, menuOptionsFn, colors) { const jsonForSensingMenus = function (menuOptionsFn) {
return { return {
message0: blockMsg, message0: ScratchBlocks.Msg.SENSING_OF,
args0: [ args0: [
{ {
type: 'field_dropdown', type: 'field_dropdown',
name: name, name: 'PROPERTY',
options: function () { options: function () {
return menuOptionsFn(); return menuOptionsFn();
} }
...@@ -66,9 +66,9 @@ export default function (vm) { ...@@ -66,9 +66,9 @@ export default function (vm) {
} }
], ],
output: true, output: true,
colour: colors.primary, colour: ScratchBlocks.Colours.sensing.primary,
colourSecondary: colors.secondary, colourSecondary: ScratchBlocks.Colours.sensing.secondary,
colourTertiary: colors.tertiary, colourTertiary: ScratchBlocks.Colours.sensing.tertiary,
outputShape: ScratchBlocks.OUTPUT_SHAPE_ROUND outputShape: ScratchBlocks.OUTPUT_SHAPE_ROUND
}; };
}; };
...@@ -245,10 +245,10 @@ export default function (vm) { ...@@ -245,10 +245,10 @@ export default function (vm) {
// The block was in the flyout so look up future block info there. // The block was in the flyout so look up future block info there.
lookupBlocks = vm.runtime.flyoutBlocks; lookupBlocks = vm.runtime.flyoutBlocks;
} }
// There's a block dropped on top of the menu. It'd be nice to evaluate it and
// return the correct list, but that is tricky. Scratch2 just returns stage options
// so just do that here too.
if (sensingOfBlock.inputs.OBJECT.shadow !== sensingOfBlock.inputs.OBJECT.block) { if (sensingOfBlock.inputs.OBJECT.shadow !== sensingOfBlock.inputs.OBJECT.block) {
// There's a block dropped on top of the menu. It'd be nice to evaluate it and
// return the correct list, but that is tricky. Scratch2 just returns stage options
// so just do that here too.
return stageOptions; return stageOptions;
} }
const menuBlock = lookupBlocks.getBlock(sensingOfBlock.inputs.OBJECT.shadow); const menuBlock = lookupBlocks.getBlock(sensingOfBlock.inputs.OBJECT.shadow);
...@@ -261,8 +261,7 @@ export default function (vm) { ...@@ -261,8 +261,7 @@ export default function (vm) {
return [['', '']]; return [['', '']];
}; };
const json = jsonForSensingMenus(ScratchBlocks.Msg.SENSING_OF, const json = jsonForSensingMenus(menuFn);
'PROPERTY', menuFn, sensingColors);
this.jsonInit(json); this.jsonInit(json);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment