Skip to content

Commit 2ee8d6c

Browse files
authored
Merge pull request #299 from TurboWarp/face-sensing
Add face sensing to default extension URLs
2 parents 51aacba + 4ab2467 commit 2ee8d6c

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// If a project uses an extension but does not specify a URL, it will default to
22
// the URLs given here, if it exists. This is useful for compatibility with other mods.
33

4-
const defaults = new Map();
4+
const defaults = {
5+
// Box2D (`griffpatch`) is not listed here because our extension is not actually
6+
// compatible with the original version due to fields vs inputs.
57

6-
// Box2D (`griffpatch`) is not listed here because our extension is not actually
7-
// compatible with the original version due to fields vs inputs.
8+
// Scratch Lab Animated Text - https://lab.scratch.mit.edu/text/
9+
text: 'https://extensions.turbowarp.org/lab/text.js',
810

9-
// Scratch Lab Animated Text - https://lab.scratch.mit.edu/text/
10-
defaults.set('text', 'https://extensions.turbowarp.org/lab/text.js');
11+
// Turboloader's AudioStream
12+
audiostr: 'https://extensions.turbowarp.org/turboloader/audiostream.js',
1113

12-
// Turboloader's AudioStream
13-
defaults.set('audiostr', 'https://extensions.turbowarp.org/turboloader/audiostream.js');
14+
// https://scratch.mit.edu/discuss/topic/842592/
15+
faceSensing: 'https://extensions.turbowarp.org/lab/face-sensing.js'
16+
};
1417

1518
module.exports = defaults;

src/virtual-machine.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,10 @@ class VirtualMachine extends EventEmitter {
779779
this.extensionManager.loadExtensionIdSync(extensionID);
780780
} else {
781781
// Custom extension
782-
const url = extensionURLs.get(extensionID) || defaultExtensionURLs.get(extensionID);
782+
let url = extensionURLs.get(extensionID);
783+
if (!url && Object.prototype.hasOwnProperty.call(defaultExtensionURLs, extensionID)) {
784+
url = defaultExtensionURLs[extensionID];
785+
}
783786
if (!url) {
784787
throw new Error(`Unknown extension: ${extensionID}`);
785788
}

0 commit comments

Comments
 (0)