Skip to content

Commit ba59e66

Browse files
authored
add control_while to block switching
1 parent 6946374 commit ba59e66

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/addons/addons/block-switching/userscript.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ export default async function ({ addon, console, msg }) {
384384
];
385385
blockSwitches["control_repeat_until"] = [
386386
noopSwitch,
387+
{
388+
opcode: "control_while",
389+
},
387390
{
388391
opcode: "control_wait_until",
389392
splitInputs: ["SUBSTACK"],
@@ -397,6 +400,9 @@ export default async function ({ addon, console, msg }) {
397400
{
398401
opcode: "control_repeat_until",
399402
},
403+
{
404+
opcode: "control_while",
405+
},
400406
noopSwitch,
401407
];
402408
blockSwitches["control_wait_until"] = [
@@ -405,6 +411,21 @@ export default async function ({ addon, console, msg }) {
405411
},
406412
noopSwitch,
407413
];
414+
415+
blockSwitches["control_while"] = [
416+
{
417+
opcode: "control_repeat_until",
418+
},
419+
noopSwitch,
420+
{
421+
opcode: "control_wait_until",
422+
splitInputs: ["SUBSTACK"],
423+
},
424+
{
425+
opcode: "control_forever",
426+
splitInputs: ["CONDITION"],
427+
},
428+
];
408429
}
409430

410431
if (addon.settings.get("operator")) {

0 commit comments

Comments
 (0)