diff --git a/fieldeditors/field_music.ts b/fieldeditors/field_music.ts
index 96028db4..ac3759e1 100644
--- a/fieldeditors/field_music.ts
+++ b/fieldeditors/field_music.ts
@@ -10,6 +10,7 @@ export interface FieldMusicOptions extends pxtblockly.FieldImagesOptions {
declare const pxtTargetBundle: any;
let soundCache: any;
+let soundIconCache: any;
export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldCustom {
public isFieldCustom_ = true;
@@ -18,8 +19,6 @@ export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldC
private categoriesCache_: string[];
- private static MUSIC_DATA_URI = `data:image/svg+xml;base64,PHN2ZyBpZD0ic3ZnNDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDIzIDIzIj48cGF0aCBpZD0ibWVudV9pY25fbXVzaWMiIGQ9Ik0xMy45IDEyLjhjMS43LjMgMy4zIDEuMiA0LjMgMi42aDFzMS41LTQuNC0xLjgtNy41LTkuNy0zLjEtMTIuMSAwYy0xLjcgMi4xLTIuMyA1LTEuNCA3LjVoLjhzMS43LTIuNSA0LjQtMi42QzkgMTcuMiA5IDIxIDkgMjFjLTEuOS0uNC0zLjUtMS42LTQuNC0zLjQtMi0uNC0zLjYtMi4yLTMuNi00LjRDMSA2LjcgNS45IDMgMTEuNSAzczEwLjggNC4zIDEwLjQgMTAuMmMtLjIgNC4xLTMuNiA0LjQtMy42IDQuNC0uOCAxLjgtMi40IDMuMS00LjMgMy40LS4xLTQuNS0uMS04LjItLjEtOC4yeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==`;
-
constructor(text: string, options: FieldMusicOptions, validator?: Function) {
super(text, { sort: true, data: options.data }, validator);
@@ -33,6 +32,9 @@ export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldC
if (!pxt.BrowserUtils.isIE() && !soundCache) {
soundCache = JSON.parse(pxtTargetBundle.bundledpkgs['music']['sounds.jres']);
}
+ if (!soundIconCache) {
+ soundIconCache = JSON.parse(pxtTargetBundle.bundledpkgs['music']['icons.jres']);
+ }
}
/**
@@ -214,7 +216,7 @@ export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldC
contentDiv.removeAttribute('aria-activedescendant');
});
let buttonImg = document.createElement('img');
- buttonImg.src = FieldMusic.MUSIC_DATA_URI;
+ buttonImg.src = this.getSoundIcon(category);
//buttonImg.alt = icon.alt;
// Upon click/touch, we will be able to get the clicked element as e.target
// Store a data attribute on all possible click targets so we can match it to the icon.
@@ -308,4 +310,11 @@ export class FieldMusic extends pxtblockly.FieldImages implements Blockly.FieldC
private stopSounds() {
pxsim.AudioContextManager.stop();
}
+
+ private getSoundIcon(category: string) {
+ if (soundIconCache && soundIconCache[category]) {
+ return soundIconCache[category].icon;
+ }
+ return undefined;
+ }
}
diff --git a/legoresources/musicicons/animals.svg b/legoresources/musicicons/animals.svg
new file mode 100644
index 00000000..8cadd615
--- /dev/null
+++ b/legoresources/musicicons/animals.svg
@@ -0,0 +1,107 @@
+
+
+
+
diff --git a/legoresources/musicicons/colors.svg b/legoresources/musicicons/colors.svg
new file mode 100644
index 00000000..e97f7662
--- /dev/null
+++ b/legoresources/musicicons/colors.svg
@@ -0,0 +1,117 @@
+
+
+
+
diff --git a/legoresources/musicicons/communication.svg b/legoresources/musicicons/communication.svg
new file mode 100644
index 00000000..8649ed75
--- /dev/null
+++ b/legoresources/musicicons/communication.svg
@@ -0,0 +1,107 @@
+
+
+
+
diff --git a/legoresources/musicicons/expressions.svg b/legoresources/musicicons/expressions.svg
new file mode 100644
index 00000000..7c5f84e1
--- /dev/null
+++ b/legoresources/musicicons/expressions.svg
@@ -0,0 +1,116 @@
+
+
+
+
diff --git a/legoresources/musicicons/information.svg b/legoresources/musicicons/information.svg
new file mode 100644
index 00000000..f9412f98
--- /dev/null
+++ b/legoresources/musicicons/information.svg
@@ -0,0 +1,128 @@
+
+
+
+
diff --git a/legoresources/musicicons/mechanical.svg b/legoresources/musicicons/mechanical.svg
new file mode 100644
index 00000000..5842ad9d
--- /dev/null
+++ b/legoresources/musicicons/mechanical.svg
@@ -0,0 +1,125 @@
+
+
+
+
diff --git a/legoresources/musicicons/movements.svg b/legoresources/musicicons/movements.svg
new file mode 100644
index 00000000..c602c748
--- /dev/null
+++ b/legoresources/musicicons/movements.svg
@@ -0,0 +1,124 @@
+
+
+
+
diff --git a/legoresources/musicicons/numbers.svg b/legoresources/musicicons/numbers.svg
new file mode 100644
index 00000000..e9e1e6f6
--- /dev/null
+++ b/legoresources/musicicons/numbers.svg
@@ -0,0 +1,139 @@
+
+
+
+
diff --git a/legoresources/musicicons/sounds_icons_2.ai b/legoresources/musicicons/sounds_icons_2.ai
new file mode 100644
index 00000000..a89f1122
--- /dev/null
+++ b/legoresources/musicicons/sounds_icons_2.ai
@@ -0,0 +1,633 @@
+%PDF-1.5
%
+1 0 obj
<>/OCGs[5 0 R 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R 29 0 R 30 0 R 31 0 R 32 0 R 110 0 R 111 0 R 112 0 R 113 0 R 114 0 R 115 0 R 116 0 R 117 0 R 118 0 R 119 0 R 120 0 R 121 0 R 122 0 R 123 0 R 124 0 R 125 0 R 126 0 R 127 0 R 128 0 R]>>/Pages 3 0 R/Type/Catalog>>
endobj
2 0 obj
<>stream
+
+
+
+
+ xmp.did:568309c5-b0de-42e8-9d0c-5f69b0a05445
+ uuid:2169725c-7891-144e-a80c-d1087aadd4cb
+ xmp.did:af2d7283-7fe2-4841-b029-0ac5306ad7a8
+ proof:pdf
+
+ xmp.iid:af2d7283-7fe2-4841-b029-0ac5306ad7a8
+ xmp.did:af2d7283-7fe2-4841-b029-0ac5306ad7a8
+ xmp.did:af2d7283-7fe2-4841-b029-0ac5306ad7a8
+ proof:pdf
+
+
+
+
+ saved
+ xmp.iid:af2d7283-7fe2-4841-b029-0ac5306ad7a8
+ 2018-04-19T12:10:09+02:00
+ Adobe Illustrator CC 22.1 (Macintosh)
+ /
+
+
+ saved
+ xmp.iid:568309c5-b0de-42e8-9d0c-5f69b0a05445
+ 2018-04-24T20:00:40+02:00
+ Adobe Illustrator CC 22.1 (Macintosh)
+ /
+
+
+
+ application/pdf
+ Adobe Illustrator CC 22.1 (Macintosh)
+ 2018-04-24T20:00:40+02:00
+ 2018-04-24T20:02:01+02:00
+ 2018-04-24T20:02:01+02:00
+
+
+
+ 256
+ 80
+ JPEG
+ /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAUAEAAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUk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