Merge pull request #733 from ericrosenbaum/bugfix/sync-toolbox

Sync toolbox
This commit is contained in:
Paul Kaplan authored and GitHub committed 2017-10-04 14:02:16 -04:00
commit 0d37fdb391
2 files changed
+31 -3

No files matched your search

+3
View File
@@ -56,6 +56,9 @@ class Blocks extends React.Component {
const workspaceConfig = defaultsDeep({}, Blocks.defaultOptions, this.props.options);
this.workspace = this.ScratchBlocks.inject(this.blocks, workspaceConfig);
// Load the toolbox from the GUI (otherwise we get the scratch-blocks default toolbox)
this.workspace.updateToolbox(this.props.toolboxXML);
// @todo change this when blockly supports UI events
addFunctionListener(this.workspace, 'translate', this.onWorkspaceMetricsChange);
addFunctionListener(this.workspace, 'zoom', this.onWorkspaceMetricsChange);
+28 -3
View File
@@ -71,6 +71,17 @@ const motion = `
</shadow>
</value>
</block>
<block type="motion_glideto" id="motion_glideto">
<value name="SECS">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="TO">
<shadow type="motion_glideto_menu">
</shadow>
</value>
</block>
<block type="motion_changexby">
<value name="DX">
<shadow type="math_number">
@@ -321,6 +332,20 @@ const pen = `
</shadow>
</value>
</block>
<block type="pen_changepentransparencyby" id="pen_changepentransparencyby">
<value name="TRANSPARENCY">
<shadow type="math_number">
<field name="NUM">10</field>
</shadow>
</value>
</block>
<block type="pen_setpentransparencyto" id="pen_setpentransparencyto">
<value name="TRANSPARENCY">
<shadow type="math_number">
<field name="NUM">50</field>
</shadow>
</value>
</block>
</category>
`;
@@ -620,12 +645,12 @@ const makeToolboxXML = function (categoriesXML) {
motion, gap,
looks, gap,
sound, gap,
pen, gap,
data, gap,
events, gap,
control, gap,
sensing, gap,
operators
pen, gap,
operators, gap,
data
];
if (categoriesXML) {