mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-12 22:42:03 -04:00
Merge pull request #1154 from vincentbriglia/issue1552
Allow override of icons per block
This commit is contained in:
commit
b3db00fab7
1 changed files with 6 additions and 2 deletions
|
@ -649,11 +649,15 @@ class Runtime extends EventEmitter {
|
|||
};
|
||||
|
||||
// If an icon for the extension exists, prepend it to each block, with a vertical separator.
|
||||
if (categoryInfo.blockIconURI) {
|
||||
// We can overspecify an icon for each block, but if no icon exists on a block, fall back to
|
||||
// the category block icon.
|
||||
const iconURI = blockInfo.blockIconURI || categoryInfo.blockIconURI;
|
||||
|
||||
if (iconURI) {
|
||||
blockJSON.message0 = '%1 %2';
|
||||
const iconJSON = {
|
||||
type: 'field_image',
|
||||
src: categoryInfo.blockIconURI,
|
||||
src: iconURI,
|
||||
width: 40,
|
||||
height: 40
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue