Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"all at once" reimplementation (ScratchBlocks Part) #195

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/blocks/scratch3_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@
}

allAtOnce (args, util) {
// Since the "all at once" block is implemented for compatiblity with
// Scratch 2.0 projects, it behaves the same way it did in 2.0, which
// is to simply run the contained script (like "if 1 = 1").
// (In early versions of Scratch 2.0, it would work the same way as
// "run without screen refresh" custom blocks do now, but this was
// removed before the release of 2.0.)
// In Scratch 3.0 and TurboWarp, this would simply
// run the contained substack. In Unsandboxed,

Check failure on line 197 in src/blocks/scratch3_control.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
// we've reimplemented the intended functionality

Check failure on line 198 in src/blocks/scratch3_control.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
// of running the stack all in one frame.
util.thread.peekStackFrame().warpMode = false;
util.startBranch(1, false);
util.thread.peekStackFrame().warpMode = true;
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/compiler/jsgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,13 @@
this.source += `}\n`;
break;

case 'control.allAtOnce':
const previousWarp = this.isWarp;

Check failure on line 880 in src/compiler/jsgen.js

View workflow job for this annotation

GitHub Actions / build

Unexpected lexical declaration in case block
this.isWarp = true;
this.descendStack(node.code, new Frame(false, 'control.allAtOnce'));
this.isWarp = previousWarp;
break;

case 'counter.clear':
this.source += 'runtime.ext_scratch3_control._counter = 0;\n';
break;
Expand Down
Loading