mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Allow override of icons per block
This commit is contained in:
parent
82fd6f0d2f
commit
0c8662bc23
2 changed files with 8 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -10,8 +10,9 @@ npm-*
|
|||
/.nyc_output
|
||||
/coverage
|
||||
|
||||
# IDEA
|
||||
# Editor
|
||||
/.idea
|
||||
/.vscode
|
||||
|
||||
# Build
|
||||
/dist
|
||||
|
|
|
@ -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…
Reference in a new issue