Skip to content

Commit 9ed4c85

Browse files
authored
Merge pull request #671 from rgantzos/main
2 parents 2706824 + d41a0f2 commit 9ed4c85

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"title": "Default to Local",
3+
"description": "When creating a variable, sets the default to For This Sprite Only, rather than For All Sprites.",
4+
"credits": [
5+
{ "username": "rgantzos", "url": "https://scratch.mit.edu/users/rgantzos/" }
6+
],
7+
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
8+
"type": ["Editor"],
9+
"tags": ["New", "Featured"],
10+
"dynamic": true
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default function ({ feature, console }) {
2+
ScratchTools.waitForElements(".ReactModalPortal", function (modal) {
3+
console.log(modal)
4+
window.feature = feature
5+
if (!feature.self.enabled) return;
6+
console.log("passed enabled")
7+
if (modal.querySelector(".sa-swap-local-global-hint")) return;
8+
console.log("passed no sa")
9+
if (modal.querySelector('[class^="prompt_variable-name-text-input_"]')) {
10+
document.querySelectorAll('[name="variableScopeOption"]')[1].click();
11+
}
12+
});
13+
}

features/features.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"version": 2,
4+
"id": "default-to-local",
5+
"versionUpdated": "v3.2.0"
6+
},
27
{
38
"version": 2,
49
"id": "start-stop-hotkeys",
@@ -515,16 +520,6 @@
515520
"type": ["Website"],
516521
"dynamic": true
517522
},
518-
{
519-
"title": "Default to Local",
520-
"description": "When creating a variable, sets the default to For This Sprite Only, rather than For All Sprites.",
521-
"credits": ["rgantzos"],
522-
"urls": ["https://scratch.mit.edu/users/rgantzos/"],
523-
"file": "default-to-local",
524-
"tags": [],
525-
"type": ["Editor"],
526-
"dynamic": true
527-
},
528523
{
529524
"title": "More Editor Fonts",
530525
"description": "Adds more fonts to choose from in the paint editor. They look nicer and are more modern.",

0 commit comments

Comments
 (0)