Skip to content

Commit 7ebc0e1

Browse files
committed
add 2 middle click opts, rename & fix other addons
1 parent ade55c1 commit 7ebc0e1

File tree

6 files changed

+45
-14
lines changed

6 files changed

+45
-14
lines changed

src/addons/addons.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ const addons = [
6767
'tw-straighten-comments',
6868
'tw-remove-backpack',
6969
'tw-remove-feedback',
70-
'tw-disable-cloud-variables',
71-
'editor-stepping'
70+
'tw-disable-cloud-variables'
7271
];
7372

7473
const newAddons = [

src/addons/addons/middle-click-popup/_manifest_entry.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const manifest = {
1010
{
1111
"name": "TheColaber",
1212
"link": "https://scratch.mit.edu/users/TheColaber/"
13-
}
13+
},
14+
{
15+
"name": "JeremyGamer13"
16+
},
1417
],
1518
"tags": [
1619
"recommended"
@@ -50,12 +53,32 @@ const manifest = {
5053
"min": 1,
5154
"max": 100,
5255
"default": 40
56+
},
57+
{
58+
"name": "Max Search Results",
59+
"id": "popup_max_search",
60+
"type": "integer",
61+
"min": 1,
62+
"max": 1000,
63+
"default": 100
64+
},
65+
{
66+
"name": "Max Object Variants",
67+
"id": "popup_max_variants",
68+
"type": "integer",
69+
"min": 1,
70+
"max": 1000,
71+
"default": 7
5372
}
5473
],
5574
"info": [
5675
{
5776
"text": "This addon was previously part of the \"developer tools\" addon but has moved here.",
5877
"id": "developer-tools"
78+
},
79+
{
80+
"text": "Changing the \"Max Object Variants\" will limit the amount of results that just use a different costume, sprite, sound or menu option selected in the block.",
81+
"id": "maxObjectVariants"
5982
}
6083
]
6184
};

src/addons/addons/middle-click-popup/userscript.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,20 @@ export default async function ({ addon, msg, console }) {
180180
// Create the new previews
181181
queryPreviews.length = 0;
182182
let y = 0;
183+
let addedResults = 0;
184+
const addedIds = [];
185+
186+
const maxSearchResults = addon.settings.get('popup_max_search');
187+
const maxVariants = addon.settings.get("popup_max_variants");
183188
for (let resultIdx = 0; resultIdx < blockList.length; resultIdx++) {
189+
if (addedResults >= maxSearchResults) break;
190+
184191
const result = blockList[resultIdx];
192+
if (maxVariants <= 1) {
193+
if (addedIds.includes(result.block.typeInfo.id)) continue;
194+
} else {
195+
if (addedIds.filter(id => id === result.block.typeInfo.id).length >= maxVariants) continue;
196+
}
185197

186198
const mouseMoveListener = () => {
187199
updateSelection(resultIdx);
@@ -225,6 +237,8 @@ export default async function ({ addon, msg, console }) {
225237
});
226238

227239
y += height;
240+
addedResults++;
241+
addedIds.push(result.block.typeInfo.id);
228242
}
229243

230244
const height = (y + 8) * previewScale;

src/addons/addons/tw-remove-feedback/_manifest_entry.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
/* generated by pull.js */
22
const manifest = {
33
"noTranslations": true,
4-
"name": "Remove feedback button",
5-
"description": "Removes the feedback button from the menu bar.",
4+
"name": "Remove Back to Home button",
5+
"description": "Removes the Back to Home button from the menu bar.",
66
"userstyles": [
77
{
88
"url": "remove-feedback.css"
99
}
1010
],
11-
"tags": [
12-
"danger"
13-
],
11+
"tags": [],
1412
"dynamicDisable": true,
1513
"enabledByDefault": false
1614
};

src/addons/generated/addon-entries.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/addons/generated/addon-manifests.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ import _script_snap from "../addons/script-snap/_manifest_entry.js";
6363
import _fullscreen from "../addons/fullscreen/_manifest_entry.js";
6464
import _hide_stage from "../addons/hide-stage/_manifest_entry.js";
6565
import _tw_straighten_comments from "../addons/tw-straighten-comments/_manifest_entry.js";
66-
import _tw_remove_backpack from "../addons/tw-remove-backpack/_manifest_entry.js";
6766
import _tw_remove_feedback from "../addons/tw-remove-feedback/_manifest_entry.js";
67+
import _tw_remove_backpack from "../addons/tw-remove-backpack/_manifest_entry.js";
6868
import _tw_disable_cloud_variables from "../addons/tw-disable-cloud-variables/_manifest_entry.js";
69-
import _editor_stepping from "../addons/editor-stepping/_manifest_entry.js";
7069

7170
export default {
7271
"cat-blocks": _cat_blocks,
@@ -133,9 +132,8 @@ export default {
133132
"fullscreen": _fullscreen,
134133
"hide-stage": _hide_stage,
135134
"tw-straighten-comments": _tw_straighten_comments,
136-
"tw-remove-backpack": _tw_remove_backpack,
137135
"tw-remove-feedback": _tw_remove_feedback,
136+
"tw-remove-backpack": _tw_remove_backpack,
138137
"tw-disable-cloud-variables": _tw_disable_cloud_variables,
139-
"editor-stepping": _editor_stepping,
140138
"vol-slider": _vol_slider,
141139
};

0 commit comments

Comments
 (0)