mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-10 21:39:57 -04:00
Make the wait block's logic and behavior more consistent with Scratch 2 (#1759)
This commit is contained in:
parent
536305af1b
commit
967cab8f20
6 changed files with 126 additions and 12 deletions
src/engine
|
@ -304,6 +304,9 @@ class Runtime extends EventEmitter {
|
|||
*/
|
||||
this.currentStepTime = null;
|
||||
|
||||
// Set an intial value for this.currentMSecs
|
||||
this.updateCurrentMSecs();
|
||||
|
||||
/**
|
||||
* Whether any primitive has requested a redraw.
|
||||
* Affects whether `Sequencer.stepThreads` will yield
|
||||
|
@ -2262,6 +2265,15 @@ class Runtime extends EventEmitter {
|
|||
disableProfiling () {
|
||||
this.profiler = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a millisecond timestamp value that is saved on the Runtime.
|
||||
* This value is helpful in certain instances for compatibility with Scratch 2,
|
||||
* which sometimes uses a `currentMSecs` timestamp value in Interpreter.as
|
||||
*/
|
||||
updateCurrentMSecs () {
|
||||
this.currentMSecs = Date.now();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue