New extension: Cross-Project#2518
Conversation
…into mesh * 'mesh' of ssh://github.com/ampelectrecuted/twextensions: [Automated] Update translations 2026-01-03 (TurboWarp#2378) SharkPool/Camera: Fix critical regression from previous commit (TurboWarp#2376) SharkPool/Camera V2 -- Fix hidden sprites not receiving camera updates (TurboWarp#2372) [Automated] Update translations 2025-12-31 (TurboWarp#2374) text.js -- Add array of regex matches block (TurboWarp#2306) Revert "SharkPool/CameraV2 -- Fix hidden sprites not receiving camera updates" (TurboWarp#2371) cursor: translate cursor menu (TurboWarp#2076) SharkPool/CameraV2: Fix hidden sprites not receiving camera updates (TurboWarp#2359) local-storage: fix it generally not working (TurboWarp#2368) [Automated] Update translations 2025-12-20 (TurboWarp#2362) [Automated] Update translations 2025-12-17 (TurboWarp#2360) [Automated] Update translations 2025-12-13 (TurboWarp#2358) build(deps): bump @turbowarp/types from `c54f2cc` to `938c3ab` (TurboWarp#2355)
…into mesh * 'mesh' of ssh://github.com/ampelectrecuted/twextensions: 8to16/mesh: remove old debugging log
|
I dont think 'Mesh' is the greatest name for this |
|
Is this meaningfully compatible or equivalent with the Scratch 1.4 feature enough to justify giving it the same name? |
actually not really since mesh might be confusing to some anyways i've renamed this to cross-project |
|
!format |
SharkPool-SP
left a comment
There was a problem hiding this comment.
I really like this extension, but do these first. I can also make a better banner for you if you want
| vm.runtime.extensionStorage["8to16mesh"] = { messages: [], variables: {} }; | ||
| }); | ||
| vm.runtime.on("PROJECT_LOADED", () => { | ||
| vm.runtime.extensionManager.refreshBlocks(); |
There was a problem hiding this comment.
vm.extensionManager.refreshBlocks() takes in arguments to refresh a specific extension palette. For optimization, use your extension id as the first argument
| ...getMeshages(), | ||
| name, | ||
| ]; | ||
| vm.extensionManager.refreshBlocks(); |
| vm.runtime.extensionStorage["8to16mesh"].messages = getMeshages().filter( | ||
| (n) => n !== name | ||
| ); | ||
| vm.extensionManager.refreshBlocks(); |
| ...getMeshVars(), | ||
| [name]: "", | ||
| }; | ||
| vm.extensionManager.refreshBlocks(); |
| vm.runtime.extensionStorage["8to16mesh"].variables = Object.fromEntries( | ||
| Object.entries(getMeshVars()).filter((v) => v[0] !== name) | ||
| ); | ||
| vm.extensionManager.refreshBlocks(); |
| id: "eightxtwoMesh", | ||
| name: Scratch.translate("Cross-Project"), | ||
| docsURI: "https://extensions.turbowarp.org/8to16/mesh", | ||
| color1: "#4cdab2", |
There was a problem hiding this comment.
I would make the block color a bit darker so you can see the block text better
| await new Promise((resolve) => { | ||
| const poll = () => { | ||
| if (finishedWaits[BROADCAST] >= connectedUsers) resolve(); | ||
| else setTimeout(poll, 25); |
There was a problem hiding this comment.
same thing with runtime.on("AFTER_EXECUTE"), alternatively use util.yield(), which I can give examples for.
| // Init the broadcastchannel | ||
| const bc = new BroadcastChannel("extensions.turbowarp.org/8to16/mesh"); | ||
| let connectedUsers = 0; | ||
| let finishedWaits = {}; |
There was a problem hiding this comment.
change {} to Object.create(null) since keys are set by users, which means they can set dangerous keys like toString or prototype
| let finishedWaits = {}; | ||
|
|
||
| if (!vm.runtime.extensionStorage["8to16mesh"]) | ||
| vm.runtime.extensionStorage["8to16mesh"] = { messages: [], variables: {} }; |
There was a problem hiding this comment.
change {} to Object.create(null) since keys are set by users, which means they can set dangerous keys like toString or prototype
| if (!vm.runtime.extensionStorage["8to16mesh"]) | ||
| vm.runtime.extensionStorage["8to16mesh"] = { messages: [], variables: {} }; | ||
| vm.runtime.on("RUNTIME_DISPOSED", () => { | ||
| vm.runtime.extensionStorage["8to16mesh"] = { messages: [], variables: {} }; |
There was a problem hiding this comment.
change {} to Object.create(null) since keys are set by users, which means they can set dangerous keys like toString or prototype
Per the docs:
This was actually a real feature in Scratch 1.4.
TODO: ws integration (though that can be added at a later time).
This is a copy of #2382 which is from an account I am now locked out of.