mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-30 08:01:18 -04:00
Merge branch 'develop' into feature/extension-category-icons
This commit is contained in:
commit
2d6e91fa59
2 changed files with 7 additions and 3 deletions
src/engine
|
@ -618,16 +618,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.blockIconURI) {
|
||||
blockJSON.message0 = '%1';
|
||||
blockJSON.message0 = '%1 %2';
|
||||
const iconJSON = {
|
||||
type: 'field_image',
|
||||
src: categoryInfo.blockIconURI,
|
||||
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…
Add table
Add a link
Reference in a new issue