mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Merge pull request #1233 from ericrosenbaum/feature/extension-status-button
Add extension status button
This commit is contained in:
commit
8c748cebb4
2 changed files with 11 additions and 0 deletions
|
@ -546,6 +546,16 @@ class Runtime extends EventEmitter {
|
||||||
categoryInfo.menus.push(convertedMenu);
|
categoryInfo.menus.push(convertedMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add extension status button
|
||||||
|
if (extensionInfo.showStatusButton) {
|
||||||
|
categoryInfo.blocks.push({
|
||||||
|
info: {},
|
||||||
|
json: null,
|
||||||
|
xml: `<button type="status" extensionId="${categoryInfo.id}"></button>`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
for (const blockInfo of extensionInfo.blocks) {
|
for (const blockInfo of extensionInfo.blocks) {
|
||||||
if (blockInfo === '---') {
|
if (blockInfo === '---') {
|
||||||
categoryInfo.blocks.push(ConvertedSeparator);
|
categoryInfo.blocks.push(ConvertedSeparator);
|
||||||
|
|
|
@ -318,6 +318,7 @@ class Scratch3MicroBitBlocks {
|
||||||
name: Scratch3MicroBitBlocks.EXTENSION_NAME,
|
name: Scratch3MicroBitBlocks.EXTENSION_NAME,
|
||||||
menuIconURI: menuIconURI,
|
menuIconURI: menuIconURI,
|
||||||
blockIconURI: blockIconURI,
|
blockIconURI: blockIconURI,
|
||||||
|
showStatusButton: true,
|
||||||
blocks: [
|
blocks: [
|
||||||
{
|
{
|
||||||
opcode: 'whenButtonPressed',
|
opcode: 'whenButtonPressed',
|
||||||
|
|
Loading…
Reference in a new issue