mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #869 from ericrosenbaum/feature/add-extension-separator
Add separator to extension block definition
This commit is contained in:
commit
7c853ab7f3
1 changed files with 6 additions and 2 deletions
|
@ -617,16 +617,20 @@ class Runtime extends EventEmitter {
|
|||
|
||||
blockJSON.message0 = '';
|
||||
|
||||
// If an icon for the extension exists, prepend it to each block
|
||||
// If an icon for the extension exists, prepend it to each block, with a vertical separator.
|
||||
if (categoryInfo.iconURI) {
|
||||
blockJSON.message0 = '%1';
|
||||
blockJSON.message0 = '%1 %2';
|
||||
const iconJSON = {
|
||||
type: 'field_image',
|
||||
src: categoryInfo.iconURI,
|
||||
width: 40,
|
||||
height: 40
|
||||
};
|
||||
const separatorJSON = {
|
||||
type: 'field_vertical_separator'
|
||||
};
|
||||
blockJSON.args0.push(iconJSON);
|
||||
blockJSON.args0.push(separatorJSON);
|
||||
}
|
||||
|
||||
blockJSON.message0 += blockInfo.text.replace(/\[(.+?)]/g, (match, placeholder) => {
|
||||
|
|
Loading…
Reference in a new issue