mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-10 21:39:57 -04:00
Add Thread.blockContainer
Store the thread's blocks at blockContainer letting execute quickly determine the block source. Monitor threads are a monitor thread. They do not become a target thread suddenly.
This commit is contained in:
parent
ab8d8e5f34
commit
4286e3e982
4 changed files with 13 additions and 7 deletions
src/engine
|
@ -861,6 +861,9 @@ class Runtime extends EventEmitter {
|
|||
thread.target = target;
|
||||
thread.stackClick = opts.stackClick;
|
||||
thread.updateMonitor = opts.updateMonitor;
|
||||
thread.blockContainer = opts.updateMonitor ?
|
||||
this.monitorBlocks :
|
||||
target.blocks;
|
||||
|
||||
thread.pushStack(id);
|
||||
this.threads.push(thread);
|
||||
|
@ -890,6 +893,7 @@ class Runtime extends EventEmitter {
|
|||
newThread.target = thread.target;
|
||||
newThread.stackClick = thread.stackClick;
|
||||
newThread.updateMonitor = thread.updateMonitor;
|
||||
newThread.blockContainer = thread.blockContainer;
|
||||
newThread.pushStack(thread.topBlock);
|
||||
const i = this.threads.indexOf(thread);
|
||||
if (i > -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue